remix
remix copied to clipboard
feat(remix-dev): deprecate `serverBuildTarget`
As discussed in the second roadmap livestream
Closes #3556
⚠️ No Changeset found
Latest commit: bdc6ff1062b53b439f252308dab3674bece74966
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
Between this and #4842 are we missing anything? I see there are some places where we key off of this in the compiler (e.g. here), do we need additional config to support this behavior?
@jenseng Good call! That's indeed something we need to figure out in some other way 🤔
Listing all the usages:
- https://github.com/remix-run/remix/blob/6a6fa5911e09667c1788451512956ba636aca043/packages/remix-dev/compiler/compilerServer.ts#L45-L48
- https://github.com/remix-run/remix/blob/6a6fa5911e09667c1788451512956ba636aca043/packages/remix-dev/compiler/plugins/serverBareModulesPlugin.ts#L24
- https://github.com/remix-run/remix/blob/6a6fa5911e09667c1788451512956ba636aca043/packages/remix-dev/compiler/plugins/serverBareModulesPlugin.ts#L95-L101
- https://github.com/remix-run/remix/blob/6a6fa5911e09667c1788451512956ba636aca043/packages/remix-dev/compiler/plugins/serverBareModulesPlugin.ts#L116-L117
@Harmony7 mentioned the same problem in #4860 regarding not being able to fully deprecate serverBuildtarget
This PR is necessary because, except for the first two subitems in the list above, these behaviors cannot be set through
remix.config.js.
Looks like this is going to be solving https://github.com/remix-run/remix/discussions/4615 that was one of my concerns, too. Thanks.
bundling everything should be achievable using serverDependenciesToBundle: /.*/, but still need a way to set conditions, minify, and mainfield for esbuild
@mcansh So how do you think that would that look like?
Creating new serverConditions, serverMinify & serverMainFields config options?
If so, I would suggest to go with a server object instead, to not pollute the global config namespace.
CC/ @mjackson @ryanflorence
new serverConditions, serverMinify & serverMainFields config options
Yeah, @MichaelDeBoey. I think we will need these.
If so, I would suggest to go with a server object instead, to not pollute the global config namespace.
No, let's keep the config object as flat as possible.
@mjackson I introduced the serverConditions, serverMinify & serverMainFields config options and updated serverDependenciesToBundle so that it can also receive "all" as value.
The only places where we're now still using serverBuildTarget is in serverBareModulesPlugin:
- https://github.com/remix-run/remix/blob/6a6fa5911e09667c1788451512956ba636aca043/packages/remix-dev/compiler/plugins/serverBareModulesPlugin.ts#L24-L37
- https://github.com/remix-run/remix/blob/6a6fa5911e09667c1788451512956ba636aca043/packages/remix-dev/compiler/plugins/serverBareModulesPlugin.ts#L116-L117
Can't think of a good way to remove usage here though 🤔
CC/ @jacob-ebey @mcansh @pcattori as you have been working in this file on the parts that still need a solution.
awesome stuff! =)
🤖 Hello there,
We just published version v0.0.0-nightly-79859c9-20230203 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!
Client conditions would be useful too https://github.com/remix-run/remix/discussions/6003