Skip to content

feat: throw error for outdated compilation#8315

Merged
SyMind merged 9 commits intomainfrom
throw-error-for-last-compilation
Nov 5, 2024
Merged

feat: throw error for outdated compilation#8315
SyMind merged 9 commits intomainfrom
throw-error-for-last-compilation

Conversation

@SyMind
Copy link
Copy Markdown
Member

@SyMind SyMind commented Nov 2, 2024

Summary

The Rspack compilation instance will be dropped on the Rust side after the compilation stage.

Before this PR, since the memory address of the compilation instance on the Rust side didn't change across multiple compilation cycles, when properties and methods on an outdated compilation instance on the JavaScript side were called, the data from the current Rust instance was retrieved, which was not as expected.

Now, Rspack will throw an error when an outdated JavaScript side compilation instance is accessed.

The compilation instance of Rspack will be dropped on the Rust side after compilation.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@github-actions github-actions bot added team The issue/pr is created by the member of Rspack. release: feature release: feature related release(mr only) labels Nov 2, 2024
@netlify
Copy link
Copy Markdown

netlify bot commented Nov 2, 2024

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit d603430
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/6728b53201cf660008d24458

@SyMind SyMind marked this pull request as ready for review November 2, 2024 08:25
@SyMind
Copy link
Copy Markdown
Member Author

SyMind commented Nov 2, 2024

!eco-ci

@rspack-bot
Copy link
Copy Markdown

rspack-bot commented Nov 2, 2024

📝 Ran ecosystem CI: Open

suite result
modernjs ✅ success
rspress ✅ success
rslib ✅ success
rsbuild ✅ success
examples ✅ success
devserver ✅ success

@ahabhgk ahabhgk requested a review from h-a-n-a November 4, 2024 06:27
ahabhgk
ahabhgk previously approved these changes Nov 4, 2024
@h-a-n-a
Copy link
Copy Markdown
Contributor

h-a-n-a commented Nov 4, 2024

Looks good. Would you please add a test case for the error message to avoid future regression?

@SyMind SyMind force-pushed the throw-error-for-last-compilation branch from 4287f65 to d603430 Compare November 4, 2024 11:51
@h-a-n-a h-a-n-a changed the title feat: throw error for out life compilation feat: throw error for outdated compilation Nov 5, 2024
@SyMind SyMind merged commit 0763068 into main Nov 5, 2024
@SyMind SyMind deleted the throw-error-for-last-compilation branch November 5, 2024 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: feature release: feature related release(mr only) team The issue/pr is created by the member of Rspack.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants