-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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): use global Request
class in Vite dev server handler
#8062
Merged
markdalgleish
merged 10 commits into
remix-run:dev
from
hi-ogawa:fix-vite-consistent-Request-class
Nov 23, 2023
Merged
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
575c0a0
fix(remix-dev/vite): use consistent `Request` class
hi-ogawa 6209d37
chore: remove unused
hi-ogawa 4739128
Merge branch 'dev' into fix-vite-consistent-Request-class
hi-ogawa 8601fdb
test: add vite-dev-custom-entry-test
hi-ogawa ca75cf3
chore: changeset
hi-ogawa c30ec67
Merge branch 'dev' into fix-vite-consistent-Request-class
markdalgleish 1dd58a7
fix createRequest call, refactor
markdalgleish 7f6fc79
tweak test
markdalgleish 1dc11e8
tweak changeset
markdalgleish f4b3f34
remove unused dependencies
markdalgleish File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix createRequest call, refactor
- Loading branch information
commit 1dd58a77780ad22a2cb2703ae6bfde9d7bb9381a
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for proceeding with this PR!
I was wondering about what's the future plan of this forced
installGlobals
duringvite dev
.Node 18 ships
fetch
,Request
, etc... globals, so I thought forcing polyfills here might not be appropriate and better to be opt-in choice by individual users.Looking at what happened in other adapters #7009 (and also
unstable-vite-express
currently has explicitinstallGlobals
inserver.mjs
), the general direction seems to remove automatic/forcedinstallGlobals
.Currently this polyfills kicks in whenever remix vite plugin is loaded, so I think it's not even possible for custom server (during dev) to opt-out from
installGlobals
currently.Here is a quick repro:
https://stackblitz.com/edit/remix-run-remix-ws1uig?file=vite.config.ts
EDIT: Current behavior would be essentially same as
installGlobals
invite.config.ts
, so in order to allow users to opt-out, I think I would prefer doing it in the template'svite.config.ts
#8119There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I was wanting to follow this up separately. Thanks for looking into this!