-
Notifications
You must be signed in to change notification settings - Fork 284
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
Remix v2 #1289
Merged
Merged
Remix v2 #1289
Changes from all commits
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
68704d2
Update Remix versions to 2.0.0-pre.3
frandiox c782798
Fix types in Hydrogen
frandiox 43807e1
Fix type exports in Oxygen adapter
frandiox cfce813
Mock v2 flags in CLI
frandiox 152c188
Rename V2_MetaFunction type in skeleton
frandiox 58d6cbb
Remove CSS nesting to avoid ESBuild warnings
frandiox c18b194
Remove old error and catch boundaries
frandiox 72ea274
Add small wrapper for root data to fix type unknown
frandiox c3ee877
ts-ignore jsonify errors
frandiox 10ee142
Remove vs flags from template
frandiox 676106e
Update to Remix 2.0.0
frandiox 751ec88
Update skeleton types to v2
frandiox 1f3e663
Update hello-world types to v2
frandiox 628b155
Update demo-store types to v2
frandiox 86e13b1
Update examples types to v2
frandiox 64ddaf9
Remove future v2 flags
frandiox 8764330
Minor type update
frandiox 8fb86a6
Merge branch 'main' into fd-remix-2
frandiox c6760a7
Remove v2 flags from CLI
frandiox 4281f30
Remix deprecated tsconfig in config
frandiox b581650
Fix typecheck
frandiox 50ea564
Stop injecting booleans in remix config. Fix tests
frandiox aeda704
Package lock
frandiox 12a88cc
Fix types
frandiox 049e8aa
Remove unused tests
frandiox 7452f71
Cleanup
frandiox 32d9177
Merge branch 'main' into fd-remix-2
frandiox 562ccbf
Update package-lock
frandiox 7aae225
Update Remix versions to latest nightly
frandiox 90a61ef
Fix optimistic-ui for Remix v2
frandiox 17587a0
Update package-lock
frandiox 66d963b
Remove ts-ignore comments related to JsonifyObject error
frandiox 182256e
Add missing reference to eslint package in skeleton
frandiox 55fe601
Update to Remix 2.1.0
frandiox a9cac55
Merge branch 'main' into fd-remix-2
frandiox 0909500
Fix SerializeFrom in JSDoc
frandiox 119e5b1
Fix typedefs in JSDoc
frandiox 83334e5
Use SerializeFrom in demo-store
frandiox 26e3343
Changesets
frandiox af30e5e
Support generics in JSDoc
frandiox d72bb64
Set Remix as a non-pinned peer dependency
frandiox cb0d4b9
Changesets
frandiox b33e7af
Update .changeset/smart-ways-destroy.md
frandiox edd1bbf
Merge branch 'main' into fd-remix-2
frandiox 7764b0a
Merge branch 'main' into fd-remix-2
frandiox 182f435
Remove react dep again
frandiox 7d5a636
Remove template guidelines for Remix v1
frandiox ac7216e
Minor fix
frandiox 7218f23
Update changeset
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 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,6 @@ | ||
--- | ||
'demo-store': major | ||
--- | ||
|
||
Update to Remix v2. Please check the [Remix v2 release notes](https://github.com/remix-run/remix/releases/tag/remix%402.0.0) to see what needs to be changed in your app code. | ||
If you were not already using v2 flags, follow the official [Remix migration guide](https://remix.run/docs/en/main/start/v2) before upgrading to v2. |
This file contains 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,17 @@ | ||
--- | ||
'@shopify/hydrogen': patch | ||
'@shopify/cli-hydrogen': major | ||
'@shopify/create-hydrogen': major | ||
'@shopify/remix-oxygen': major | ||
--- | ||
|
||
Update to Remix v2. Remix is now a peer dependency and its version is no longer pinned. This means that you can upgrade to newer Remix 2.x versions without upgrading Hydrogen. | ||
|
||
### Breaking changes | ||
|
||
Please check the [Remix v2 release notes](https://github.com/remix-run/remix/releases/tag/remix%402.0.0) to see what needs to be changed in your app code. Common changes include: | ||
|
||
- Renaming types prefixed with `V2_`. For example, `V2_MetaFunction` is now `MetaFunction`. | ||
- Renaming other types like `LoaderArgs` and `ActionArgs`, which are now `LoaderFunctionArgs` and `ActionFunctionArgs` respectively. | ||
|
||
If you were not already using v2 flags, follow the official [Remix migration guide](https://remix.run/docs/en/main/start/v2) before upgrading to v2. |
This file contains 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,23 @@ | ||
--- | ||
'demo-store': patch | ||
--- | ||
|
||
If you are calling `useMatches()` in different places of your app to access the data returned by the root loader, you may want to update it to the following pattern to enhance types: | ||
|
||
```ts | ||
// root.tsx | ||
|
||
import {useMatches} from '@remix-run/react'; | ||
import {type SerializeFrom} from '@shopify/remix-oxygen'; | ||
|
||
export const useRootLoaderData = () => { | ||
const [root] = useMatches(); | ||
return root?.data as SerializeFrom<typeof loader>; | ||
}; | ||
|
||
export function loader(context) { | ||
// ... | ||
} | ||
``` | ||
|
||
This way, you can import `useRootLoaderData()` anywhere in your app and get the correct type for the data returned by the root loader. | ||
This file contains 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 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 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,9 +1,9 @@ | ||
import {ActionArgs, LoaderArgs} from '@shopify/remix-oxygen'; | ||
import {ActionFunctionArgs, LoaderFunctionArgs} from '@shopify/remix-oxygen'; | ||
|
||
export async function action({context}: ActionArgs) { | ||
export async function action({context}: ActionFunctionArgs) { | ||
return context.customer.login(); | ||
} | ||
|
||
export async function loader({context}: LoaderArgs) { | ||
export async function loader({context}: LoaderFunctionArgs) { | ||
return context.customer.authorize('/'); | ||
} |
This file contains 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 {ActionArgs} from '@shopify/remix-oxygen'; | ||
import {ActionFunctionArgs} from '@shopify/remix-oxygen'; | ||
|
||
export async function action({context}: ActionArgs) { | ||
export async function action({context}: ActionFunctionArgs) { | ||
return context.customer.logout(); | ||
} |
This file contains 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 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 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 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 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 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 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.
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.
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.
This is cool, I didn't know about it.