-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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(remix-dev): allow serverBuildPath
to end with .cjs
#7180
Conversation
🦋 Changeset detectedLatest commit: 3bf8e52 The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 packages
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 |
34e5176
to
5b9eb29
Compare
5b9eb29
to
04252d8
Compare
Rebased. |
serverBuildPath
to end with .cjs
Fix a bug that caused the server build file to be emitted into the assets directory if the value of `serverBuildPath` ended in `.cjs`. The bug was due to the server-side portion of the Remix compiler only iterating over files ending in `.js` and `.mjs`, but not `.cjs`. Note that this diff is smaller than it appears: the largest number of lines affected are in integration/compiler-mjs-cjs-output-test.ts, in which I increased the indentation of the test fixture code in order to parametrize it over file extension.
04252d8
to
5a8c372
Compare
Co-authored-by: Michaël De Boey <[email protected]>
Co-authored-by: Michaël De Boey <[email protected]>
Co-authored-by: Michaël De Boey <[email protected]>
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
Were you going to backport this to 1.x? |
I wasn't planning on it - there are a lot of bug fixes included in v2 and we can't backport them all to v1. If there's a compelling reason to we could consider it but otherwise I think this just qualifies as a bug fixed in v2? It's also worth noting that this didn't make the |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
🤖 Hello there, We just published version Thanks! |
The server builds are still CJS for now. This is made possible by remix-run/remix#7180, which was included in the recent release of Remix 2.0.1.
The server builds are still CJS for now. This is made possible by remix-run/remix#7180, which was included in the recent release of Remix 2.0.1.
Fix a bug that caused the server build file to be emitted into the assets directory if the value of
serverBuildPath
ended in.cjs
.The bug was due to the server-side portion of the Remix compiler only iterating over files ending in
.js
and.mjs
, but not.cjs
.Note that this diff is smaller than it appears: the largest number of lines affected are in integration/compiler-mjs-cjs-output-test.ts, in which I increased the indentation of the test fixture code in order to parametrize it over file extension.
Testing Strategy:
I found that the existing integration test
compiler-mjs-output-test.ts
was nearly what I needed. I renamed it tocompiler-mjs-cjs-output-test.ts
and parametrized it over server build file extension.Note that this PR both introduces the new test and fixes the bug. To reproduce the test, just revert the part of the diff that affects
packages/remix-dev/compiler/server/write.ts
and run the integration test.