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

chore(gatsby): upgrade @pmmmwh/react-refresh-webpack-plugin #36360

Merged
merged 1 commit into from
Aug 15, 2022

Conversation

pieh
Copy link
Contributor

@pieh pieh commented Aug 10, 2022

Description

Optimistic bump - but might need more changes to work ( https://github.com/pmmmwh/react-refresh-webpack-plugin/releases/tag/v0.5.0 mentions some breaking changes)

Related Issues

[ch54232]

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Aug 10, 2022
@pieh pieh added type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Aug 10, 2022
@LekoArts
Copy link
Contributor

We also use this for Preact (see #33374)

@pieh pieh force-pushed the chore/upgrade/fast-refresh branch from f4d66cb to bac1520 Compare August 14, 2022 08:08
Comment on lines +1 to +2
// needed for fast refresh
import "@gatsbyjs/webpack-hot-middleware/client"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously refresh plugin would automatically fallback to importing client and using it. After https://github.com/pmmmwh/react-refresh-webpack-plugin/pull/337/files#diff-5425e895a25e9446e7307d31bc2cf26e1a77778571d76656d3b10876e9e48871 hot middleware client needs to be initialized elsewhere in the app and react-refresh will hook up to it (if available)

We can do it here as first import, or follow example and have it in our webpack entry ( https://github.com/pmmmwh/react-refresh-webpack-plugin/blob/5b0ef9b2ee2fb2f4323df3ec628c26b9c72bf0c7/examples/webpack-hot-middleware/webpack.config.js#L10-L12 )

@pieh pieh marked this pull request as ready for review August 14, 2022 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: maintenance An issue or pull request describing a change that isn't a bug, feature or documentation change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants