You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the most recent roadmap call there was some discussion about deprecating serverBuildTarget. This is a good idea for the reasons discussed: adding platform-specific code to the compiler is fragile and becoming less sustainable as the number of runtimes increases. It also makes it hard to delegate adapter maintenance to third-parties if they need to also make changes to the compiler. However the suggested replacement (putting the config into templates) would be fragile and hard to maintain. There would be no way to update the settings without requiring users to update their configs manually, and they could get out of sync with the Remix version.
Proposal
Allow adapters to export a config object that is imported into the site's remix.config.js, and either directly re-exported if no changes are needed, or spread into a user-defined config object if changes are needed.
This is an example for how this could be implemented for CloudFlare Pages.
This is not a breaking change, and could be incrementally adopted. Adapters could add the exports, and templates updated to use them, but existing config would still work.
Other options
There could be logic for merging configs, but right now that's not needed, as the requirements are quite limited.
Future developments
Adapters could export lifecycle hooks that are run by the compiler, such as onBuild.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Background
In the most recent roadmap call there was some discussion about deprecating
serverBuildTarget
. This is a good idea for the reasons discussed: adding platform-specific code to the compiler is fragile and becoming less sustainable as the number of runtimes increases. It also makes it hard to delegate adapter maintenance to third-parties if they need to also make changes to the compiler. However the suggested replacement (putting the config into templates) would be fragile and hard to maintain. There would be no way to update the settings without requiring users to update their configs manually, and they could get out of sync with the Remix version.Proposal
Allow adapters to export a config object that is imported into the site's
remix.config.js
, and either directly re-exported if no changes are needed, or spread into a user-defined config object if changes are needed.This is an example for how this could be implemented for CloudFlare Pages.
The site's
remix.config.js
could then either directly re-export the config:...or it could be customized by spreading the imported config into the user-defined config:
This is not a breaking change, and could be incrementally adopted. Adapters could add the exports, and templates updated to use them, but existing config would still work.
Other options
There could be logic for merging configs, but right now that's not needed, as the requirements are quite limited.
Future developments
Adapters could export lifecycle hooks that are run by the compiler, such as
onBuild
.Beta Was this translation helpful? Give feedback.
All reactions