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(remix-dev/vite): make installGlobals opt-in for Vite dev #8119

Merged
merged 7 commits into from
Nov 28, 2023

Conversation

hi-ogawa
Copy link
Contributor

@hi-ogawa hi-ogawa commented Nov 24, 2023

I wrote this PR's rational in #8062 (comment)

I moved installGlobals to templates/unstable-vite/vite.config.ts, which looks a little ugly but the intention is to align with templates/unstable-vite-express (and also other non-vite templates). If the time has come to remove installGlobals, then that can be done by just by updating templates.

It might be worth mentioning that currently remix-serve has automatic installGlobals, so if users rely on default npm run start script, then they cannot avoid polyfills but I think it's same as other templates as well.

Testing Strategy

CI runs only Node 18 and 20 (or maybe only on 20?), so I didn't update vite.config.ts of integration tests.
But if it's still desired to test against installGlobals polyfills, then I think it might make sense to extra test case for that. Please let me know if that's preferred.

Copy link

changeset-bot bot commented Nov 24, 2023

🦋 Changeset detected

Latest commit: 6c783b7

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

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

@hi-ogawa hi-ogawa marked this pull request as ready for review November 24, 2023 00:33
@hi-ogawa hi-ogawa changed the title feat(remix-dev/vite): make installGlobals opt-in for Vite dev fix(remix-dev/vite): make it possible to out-out from installGlobals for Vite dev Nov 24, 2023
@hi-ogawa hi-ogawa changed the title fix(remix-dev/vite): make it possible to out-out from installGlobals for Vite dev fix(remix-dev/vite): ability to out-out from installGlobals for Vite dev Nov 24, 2023
@hi-ogawa hi-ogawa changed the title fix(remix-dev/vite): ability to out-out from installGlobals for Vite dev fix(remix-dev/vite): ability to opt-out from installGlobals for Vite dev Nov 24, 2023
@markdalgleish markdalgleish changed the title fix(remix-dev/vite): ability to opt-out from installGlobals for Vite dev fix(remix-dev/vite): make installGlobals opt-in for Vite dev Nov 28, 2023
Copy link
Member

@markdalgleish markdalgleish left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! This approach seemed odd to me at first, but the more I thought about it, the more it made sense to me. When using Vite dev directly, the Vite config is the closest thing you have to an entry point, so calling it anywhere else (e.g. by passing a callback to the Remix plugin) feels like indirection.

@markdalgleish markdalgleish merged commit a95e5fb into remix-run:dev Nov 28, 2023
9 checks passed
@hi-ogawa hi-ogawa deleted the fix-vite-opt-in-installGlobals branch November 29, 2023 00:15
Copy link
Contributor

github-actions bot commented Dec 5, 2023

🤖 Hello there,

We just published version 2.4.0-pre.0 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!

Copy link
Contributor

🤖 Hello there,

We just published version 2.4.0 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.

3 participants