-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
835 additions
and
884 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@remix-run/dev": patch | ||
--- | ||
|
||
Upgrade Vite peer dependency range to v5 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
"@remix-run/dev": minor | ||
--- | ||
|
||
Vite: Strict route exports | ||
|
||
With Vite, Remix gets stricter about which exports are allowed from your route modules. | ||
Previously, the Remix compiler would allow any export from routes. | ||
While this was convenient, it was also a common source of bugs that were hard to track down because they only surfaced at runtime. | ||
|
||
For more, see https://remix.run/docs/en/main/future/vite#strict-route-exports |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
"@remix-run/dev": patch | ||
--- | ||
|
||
Vite: Preserve names for exports from .client imports | ||
|
||
Unlike `.server` modules, the main idea is not to prevent code from leaking into the server build | ||
since the client build is already public. Rather, the goal is to isolate the SSR render from client-only code. | ||
Routes need to import code from `.client` modules without compilation failing and then rely on runtime checks | ||
to determine if the code is running on the server or client. | ||
|
||
Replacing `.client` modules with empty modules would cause the build to fail as ESM named imports are statically analyzed. | ||
So instead, we preserve the named export but replace each exported value with an empty object. | ||
That way, the import is valid at build time and the standard runtime checks can be used to determine if then | ||
code is running on the server or client. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@remix-run/dev": patch | ||
--- | ||
|
||
Add `@remix-run/node` to Vite's `optimizeDeps.include` array |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
"@remix-run/dev": patch | ||
--- | ||
|
||
Vite: Errors at build-time when client imports .server default export | ||
|
||
Remix already stripped .server file code before ensuring that server code never makes it into the client. | ||
That results in errors when client code tries to import server code, which is exactly what we want! | ||
But those errors were happening at runtime for default imports. | ||
A better experience is to have those errors happen at build-time so that you guarantee that your users won't hit them. |
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
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
Oops, something went wrong.