Skip to content

fix(remix-dev): require.resolve isolateChunks for pnpm - #5637

Merged
mcansh merged 4 commits into
devfrom
logan/react-refresh-pnpm
Mar 15, 2023
Merged

mcansh merged 4 commits into
devfrom
logan/react-refresh-pnpm

Conversation

@mcansh

@mcansh mcansh commented Mar 2, 2023 •

Copy link
Copy Markdown
Contributor

react-refresh is a dependency of @remix-run/dev, not of your app so it's not "hoisted" to node_modules.

so we can use require.resolve to find it. This fixes an issue where remix-dev would not work with pnpm.

see pnpm/pnpm#2957 (comment) for a similar issue in CRAv4 and how they fixed it there https://github.com/pmmmwh/react-refresh-webpack-plugin/pull/230/files

confirmed working: https://twitter.com/jplhomer/status/1631375544263516180

closes #5811

Closes: #

  • Docs
  • Tests

Testing Strategy:

react-refresh is a dependency of remix-dev, not of your app.

so we can use require.resolve to find it. This fixes an issue where remix-dev would not work with pnpm.

see pnpm/pnpm#2957 (comment) for a similar issue in CRAv4 and how they fixed it there https://github.com/pmmmwh/react-refresh-webpack-plugin/pull/230/files

Signed-off-by: Logan McAnsh <logan@mcan.sh>
@changeset-bot

changeset-bot Bot commented Mar 2, 2023 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: db5f644

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

This PR includes changesets to release 18 packages
Name Type
remix Patch
@remix-run/dev Patch
create-remix Patch
@remix-run/css-bundle Patch
@remix-run/architect Patch
@remix-run/cloudflare Patch
@remix-run/cloudflare-pages Patch
@remix-run/cloudflare-workers Patch
@remix-run/deno Patch
@remix-run/eslint-config Patch
@remix-run/express Patch
@remix-run/netlify Patch
@remix-run/node Patch
@remix-run/react Patch
@remix-run/serve Patch
@remix-run/server-runtime Patch
@remix-run/testing Patch
@remix-run/vercel 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

"react-dom",
"react-dom/client",
"react-refresh/runtime",
require.resolve("react-refresh/runtime"),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

other packages listed are installed in the user's app already, so we shouldn't need to resolve them

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

did it anyway to be consistent and safe

@mcansh mcansh changed the title fix(remix-dev): require.resolve react-refresh fix(remix-dev): require.resolve react-refresh for pnpm Mar 2, 2023
Signed-off-by: Logan McAnsh <logan@mcan.sh>
@mcansh mcansh changed the title fix(remix-dev): require.resolve react-refresh for pnpm fix(remix-dev): require.resolve isolateChunks for pnpm Mar 8, 2023
@mcansh mcansh self-assigned this Mar 14, 2023
@mcansh
mcansh force-pushed the logan/react-refresh-pnpm branch from afd65be to db5f644 Compare March 15, 2023 14:48
@mcansh mcansh linked an issue Mar 15, 2023 that may be closed by this pull request
@mcansh
mcansh merged commit bf44020 into dev Mar 15, 2023
@mcansh
mcansh deleted the logan/react-refresh-pnpm branch March 15, 2023 16:56
@github-actions

Copy link
Copy Markdown
Contributor

🤖 Hello there,

We just published version v0.0.0-nightly-4b70f9f-20230316 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pnpm doesn't work with HMR/HDR

3 participants