feat(remix-dev): add support for `fastly-compute-js` as `serverBuildTarget` value
At Fastly we have created a runtime, a server adapter, and a template for running Remix on Fastly Compute@Edge. This PR adds support for settings serverBuildTarget to fastly-compute-js, which configures compiler settings to enable their use.
Our runtime, server adapter, and template are available at: https://github.com/fastly/remix-compute-js
These will work once this PR is accepted.
This PR adds:
- Support for
fastly-compute-jsas an accepted value forserverBuildTargetinremix.config.js. This value:- Sets
serverModuleFormatto"esm" - Sets
serverPlatformto"neutral" - Causes
esbuildconfig to:- use
conditionvalue of["worker"] - use
minifyvalue oftrue - use
mainFieldsvalue of["browser", "module", "main"]
- use
- Causes
serverBareModulesPluginto always bundle everything
- Sets
This PR is necessary because, except for the first two subitems in the list above, these behaviors cannot be set through remix.config.js.
This PR also adds the new value to the documentation page for the config file.
Relates to https://github.com/remix-run/remix/discussions/4613 as well as https://github.com/remix-run/remix/discussions/2888
🦋 Changeset detected
Latest commit: dcb6c79ade350c7ddbfb421b416aef8bca874332
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 17 packages
| Name | Type |
|---|---|
| @remix-run/dev | Minor |
| create-remix | Minor |
| remix | Minor |
| @remix-run/architect | Minor |
| @remix-run/cloudflare | Minor |
| @remix-run/cloudflare-pages | Minor |
| @remix-run/cloudflare-workers | Minor |
| @remix-run/deno | Minor |
| @remix-run/eslint-config | Minor |
| @remix-run/express | Minor |
| @remix-run/netlify | Minor |
| @remix-run/node | Minor |
| @remix-run/react | Minor |
| @remix-run/serve | Minor |
| @remix-run/server-runtime | Minor |
| @remix-run/testing | Minor |
| @remix-run/vercel | Minor |
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
Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳
I've also added a changeset, please let me know if this is sufficient or if it needs changing.
Nice, thanks.
Thanks for your update. I have been following #4841 as well, and your comments make sense. As soon as that one lands the code-based changes in this PR will not be necessary (However I'd still like to submit updates to the docs to make Fastly discoverable).
Closing this as #4841 is now merged
Once that's released, the fastly template can use these new config options.
@harmony7 If you want to add the template and/or adapter to our docs like @penx did in #5254, feel free to open a new PR for that 🙏
awesome, thanks!
@harmony7 If you want to add the template and/or adapter to our docs like @penx did in https://github.com/remix-run/remix/pull/5254, feel free to open a new PR for that
I certainly will do that =) thanks
@MichaelDeBoey have filed PR #5370 . Please take a look.