-
Notifications
You must be signed in to change notification settings - Fork 325
Simplify routes property in Hydrogen config
#1313
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
Merged
+304
−219
Merged
Changes from 24 commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
beb0624
Drop import.meta.globEager in dev
frandiox 886360a
Refactor variables and virtual modules
frandiox af3b972
Fix code after cherry-pick
frandiox f3c3bca
Extract Vitception
frandiox 441e604
Use Vitception to load routes during build
frandiox 5f0bc0e
Use static imports to fix build
frandiox f48ca85
Add default routes path
frandiox bf409b4
Fix types and paths
frandiox 9558d46
Fix dirPrefix issues
frandiox 9729ef5
Merge branch 'v1.x-2022-07' into fd-drop-import-globs
frandiox 43384a4
Fix HMR in route files
frandiox 24a9c15
Use default value for config.routes
frandiox 112f334
Fix issue in Node 16.15
frandiox 24710b1
Extract virtual-files plugin for clarity
frandiox 34699e4
Merge branch 'v1.x-2022-07' into fd-drop-import-globs
frandiox 259db55
Cleanup
frandiox 20119a1
Fix unit tests
frandiox 1c95e85
Merge branch 'v1.x-2022-07' into fd-drop-import-globs
frandiox 5a23ae8
Update docs
frandiox 24a4943
Changeset
frandiox 79d95fd
Cleanup
frandiox 83b9138
Regenerate broken graphql.schema.json
frandiox e0ffbf6
Disable rules-of-hooks in server components
frandiox d130f1c
Disable prefer-gql in test
frandiox 720d786
Apply suggestions from code review
frandiox a14c2b5
Merge branch 'v1.x-2022-07' into fd-drop-import-globs
frandiox e9b51a5
Revert "Disable prefer-gql in test"
frandiox 689c3df
Revert "Disable rules-of-hooks in server components"
frandiox File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| --- | ||
| '@shopify/hydrogen': minor | ||
| 'create-hydrogen-app': minor | ||
| --- | ||
|
|
||
| The `routes` property in `hydrogen.config.js` file has been simplified. It is now a string that represents the path to the routes from the project root: | ||
|
|
||
| ```diff | ||
| // hydrogen.config.js | ||
|
|
||
| export default defineConfig({ | ||
| - routes: import('./src/routes/**/*.server.[jt](s|sx)'), | ||
| + routes: '/src/routes', | ||
| }); | ||
| ``` | ||
|
|
||
| Its default value is `/src/routes` so this property can be removed when using this directory. | ||
|
|
||
| In the object syntax version, `dirPrefix` is removed and `files` becomes a string: | ||
|
|
||
| ```diff | ||
| // hydrogen.config.js | ||
|
|
||
| export default defineConfig({ | ||
| routes: { | ||
| - files: import('./src/routes/**/*.server.[jt](s|sx)'), | ||
| - dirPrefix: './src/routes', | ||
| + files: '/src/routes', | ||
| basePath: '/', | ||
| }, | ||
| }); | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| import type {HydrogenConfig} from './types'; | ||
| import type {InlineHydrogenConfig} from './types'; | ||
|
|
||
| export const defineConfig = (params: HydrogenConfig) => params; | ||
| export const defineConfig = (params: InlineHydrogenConfig) => params; | ||
|
|
||
| export type {HydrogenConfig}; | ||
| export type {InlineHydrogenConfig as HydrogenConfig}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.