Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: react refresh in async entrypoint #3731

Merged
merged 7 commits into from
Jul 10, 2023
Merged

Conversation

ahabhgk
Copy link
Contributor

@ahabhgk ahabhgk commented Jul 7, 2023

Summary

fix react refresh error when importing a react component in worker module

before the react refresh runtime is added by prepending additional entry, but worker chunk is a async entrypoint, so in async entrypoint will loose the react refresh runtime because you can't prepend entry for async entrypoint

now we inject the react refresh runtime by builtins.provide to make sure every module using react will have the react refresh runtime

Test Plan

  • packages/playground/cases/react/worker

@ahabhgk ahabhgk requested review from a team July 7, 2023 13:43
@ahabhgk ahabhgk requested a review from Boshen as a code owner July 7, 2023 13:43
@ahabhgk ahabhgk requested review from LingyuCoder and underfin July 7, 2023 13:43
@github-actions github-actions bot added release: bug fix team The issue/pr is created by the member of Rspack. labels Jul 7, 2023
@ahabhgk ahabhgk added this pull request to the merge queue Jul 10, 2023
@ahabhgk
Copy link
Contributor Author

ahabhgk commented Jul 10, 2023

!canary

Merged via the queue into main with commit 0252f13 Jul 10, 2023
@ahabhgk ahabhgk deleted the react-refresh-async-entrypoint branch July 10, 2023 08:35
@github-actions
Copy link
Contributor

0.2.5-canary-32a0280-20230710091317

This was referenced Jul 10, 2023
@hardfist
Copy link
Contributor

hardfist commented Jul 12, 2023

@ahabhgk we should add the breaking change notice in description, so other should know about it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team The issue/pr is created by the member of Rspack.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants