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(hmr): improve detecting of ReactRefreshBoundary and Return value of React.createContext is not considered as React component #2587

Merged
merged 4 commits into from
Apr 4, 2023

Conversation

underfin
Copy link
Collaborator

@underfin underfin commented Apr 3, 2023

Summary

Thanks for @hyf0 to resolve the issue with me.

  • fix implement of react referesh, port from react-refresh-webpack-plugin,it should detect component at runtime, it can fix react context hmr issue
  • implement __webpack_module__.id

Related issue (if exists)

close #2266

Types of changes

  • Docs change / Dependency upgrade
  • Bug fix
  • New feature / Improvement
  • Refactoring
  • Breaking change

Checklist

  • I have added changeset via pnpm run changeset.
  • I have added tests to cover my changes.

@changeset-bot
Copy link

changeset-bot bot commented Apr 3, 2023

🦋 Changeset detected

Latest commit: c718f0f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 18 packages
Name Type
@rspack/dev-client Patch
@rspack/binding Patch
@rspack/dev-server Patch
@rspack/core Patch
webpack-test Patch
@rspack/postcss-loader Patch
@rspack/playground Patch
@rspack/cli Patch
@rspack/dev-middleware Patch
@rspack/plugin-html Patch
benchmarkcase-rspack-react-refresh Patch
@rspack/plugin-minify Patch
@rspack/plugin-node-polyfill Patch
@rspack/binding-darwin-arm64 Patch
@rspack/binding-darwin-x64 Patch
@rspack/binding-linux-x64-gnu Patch
@rspack/binding-win32-x64-msvc Patch
@rspack/fs Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the team The issue/pr is created by the member of Rspack. label Apr 3, 2023
ahabhgk
ahabhgk previously approved these changes Apr 3, 2023
@hyf0
Copy link
Collaborator

hyf0 commented Apr 3, 2023

Could you link the issues this PR fixed?

@hyf0 hyf0 disabled auto-merge April 3, 2023 08:40
@hyf0 hyf0 changed the title fix: react refresh with context fix(hmr): improve detecting of ReactRefreshBoundary and Return value of React.createContext is not considered as React component Apr 3, 2023
hyf0
hyf0 previously approved these changes Apr 3, 2023
@underfin underfin enabled auto-merge April 3, 2023 08:47
@underfin underfin disabled auto-merge April 3, 2023 08:55
@underfin underfin dismissed stale reviews from hyf0 and ahabhgk via 45a4726 April 3, 2023 09:02
hyf0
hyf0 previously approved these changes Apr 3, 2023
hyf0
hyf0 previously approved these changes Apr 3, 2023
hardfist
hardfist previously approved these changes Apr 3, 2023
bvanjoi
bvanjoi previously approved these changes Apr 3, 2023
@underfin underfin enabled auto-merge April 3, 2023 09:14
@underfin underfin added this pull request to the merge queue Apr 4, 2023
Merged via the queue into main with commit fff64ea Apr 4, 2023
4 checks passed
@underfin underfin deleted the fix-react-refresh branch April 4, 2023 06:42
hardfist pushed a commit that referenced this pull request Apr 4, 2023
* feat(html): support templateContent in `builtins.html` (#2589)

* feat(html): support templateContent in `builtins.html`

* fix: ci

* fix(hmr): improve detecting of ReactRefreshBoundary and Return value of `React.createContext` is not considered as React component (#2587)

* fix: react refresh with context

* chore: use @pmmmwh/react-refresh-webpack-plugin runtime

* chore: add comment

* chore: fix promise

* ci: release pre check (#2606)

* chore: 🤖 release pre check

* chore: 🤖 cacnel release workflow

* fix: draw progress bar to stdout instead of stderr, close #1434 (#2599)

* fix: bump nodejs-resolver to fix path issue with chinese characaters (#2506)

* refactor: upgrade nodejs_resolver

* feat(resolve): support fullySpecified

* Release v0.1.6

---------

Co-authored-by: jinrui <jerrykingxyz@gmail.com>
Co-authored-by: underfin <likui6666666@gmail.com>
Co-authored-by: IWANABETHATGUY <iwanabethatguy@qq.com>
Co-authored-by: zjk <jingkai.zhao@foxmail.com>
Co-authored-by: bohan <bohan-zhang@foxmail.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot mentioned this pull request Apr 11, 2023
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.

[Bug Report]: HMR breaks when modifying React context provider
6 participants