-
Notifications
You must be signed in to change notification settings - Fork 281
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
Reload environment variables in development #997
Changes from all commits
c25342f
9eafba8
2a03c45
5753dbf
e8e2c00
eebb29f
812368e
7816a4a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
'demo-store': patch | ||
--- | ||
|
||
Add `.env` file to Remix watcher to allow reloading environment variables on file save. In `remix.config.js`: | ||
|
||
```diff | ||
-watchPaths: ['./public'], | ||
+watchPaths: ['./public', './.env'], | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@shopify/cli-hydrogen': minor | ||
--- | ||
|
||
Reload environment variables in the development server when `.env` file is updated. Show injected variables when project is not linked to any storefront. |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I actually kind of love that it fetches them again but I wonder if that would be considered unexpected... |
This file was deleted.
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.
I've bee going back and forth on where logs should go. Maybe it'd be easier if certain components were broken down even further into functions so that things could be more reuseable?
On save I think it'd be better to have something like "Change detected; reloading environment variables". I like the idea of a diff to shorten the output but might be more work than it's worth.
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.
How often will someone realistically be changing the
.env
file? If I change it, I think it's nice to know that the server is getting those changes. So I think the feedback is good and I don't imagine it changing all that often.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.
Alright, keeping the same logs for now 👍