-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement asset-preloading for all scenarios
This moves from the marker function to a very specific object property name. This follows what was done in: - zth/rescript-relay#369 - #47 - #48 This reimplements the changes of those last two R3 PRs on top of the work done to turn server.mjs into ReScript code. A few changes are made with respect to the original PRs. *Vite Plugin* - I did not alter the user’s config. The rollup option not working with the `SSR` option is not caused by our plugin, so it shouldn’t be fixed in our plugin. It’s a user configuration error. Altering the config without the user knowing may confuse them. - Removed `production` check in `transform` this allows using the Vite generated `ssr-manifest.json` - Removed the `Rescript` check in `transform`, our regex should be fast enough that this doesn’t matter and it ensures our plugin works in codebases or pipelines that strip this header. - Removed tracking of `didReplace` since `magic-string` does this for us. *EntryServer.res* - Omitted asset emitting change for RelayRouter since the function has a different shape than RelaySSRUtils.AssetRegisterer. This was because `eagerPreloadFn` was not available in the function the router got. Ideally when we bring this back we only require the consuming developer to create a single preload handler on top of our transformation stream. *package.json* - It looks like the introduction of SSR in production mode has also exposed the bug in Relay’s faulty exports (or ReScript/Vite’s handling of them) here. - Upgrade `history` to 5.3.0 which is required for ESM support.
- Loading branch information
Showing
7 changed files
with
156 additions
and
29 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
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
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
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