-
Notifications
You must be signed in to change notification settings - Fork 288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add remix.config.js back to templates #441
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me. I found in writing the proj structure that it would be nice to refer to this file (like for the public directory), but it wasn't there.
templates/demo-store/remix.config.js
Outdated
module.exports = { | ||
appDirectory: 'app', | ||
ignoredRouteFiles: ['**/.*'], | ||
publicPath: (process.env.HYDROGEN_ASSET_BASE_URL ?? '/') + 'build/', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this going to confuse people?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we can rename it to something else in our CLI? OXYGEN_CDN
, SHOPIFY_CDN
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would need to coordinate with the CS Admin team as they hardcode this in the Deployment GH Workflow for Oxygen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jplhomer I mean we can add an alias in our CLI until all the other parts are aligned. But I guess we can just stick to HYDROGEN_ASSET_BASE_URL
for the time being.
Since these are not really "options", should we add comments explaining not to change anything? Because it won't work if they change any of these values. I can add a value validator to our CLI in another PR. |
Also, let's add the same file for the |
We've been using the
shopify hydrogen
CLI to read and modify in-memory an app'sremix.config.js
values to support Oxygen deployments. We do this to:However, we've started thinking this type of "blackbox magic" is aligned with our standards for Hydrogen moving forward. Instead, it's better to be explicit about these settings and lean into existing Remix patterns.
Therefore, we should move these settings back to
remix.config.js
files in each of the templates.Note: Some of these settings are not yet available in stable Remix remix-run/remix#4841, and thus won't quite work on their own. We're keeping out "magic" inside the Hydrogen CLI until they are stable, at which point we can remove them from the CLI.
It's most important to get these config files into the starter templates so that we don't have to issue a breaking change when we remove the functionality from the CLI at a later date.
@frandiox has started a PR demonstrating the changes using a nightly release of Remix: #437