-
Notifications
You must be signed in to change notification settings - Fork 284
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update Remix versions to 2.0.0-pre.3 * Fix types in Hydrogen * Fix type exports in Oxygen adapter * Mock v2 flags in CLI * Rename V2_MetaFunction type in skeleton * Remove CSS nesting to avoid ESBuild warnings * Remove old error and catch boundaries * Add small wrapper for root data to fix type unknown * ts-ignore jsonify errors remix-run/remix#7246 * Remove vs flags from template * Update to Remix 2.0.0 * Update skeleton types to v2 * Update hello-world types to v2 * Update demo-store types to v2 * Update examples types to v2 * Remove future v2 flags * Minor type update * Remove v2 flags from CLI * Remix deprecated tsconfig in config * Fix typecheck * Stop injecting booleans in remix config. Fix tests * Package lock * Fix types * Remove unused tests * Cleanup * Update package-lock * Update Remix versions to latest nightly * Fix optimistic-ui for Remix v2 * Update package-lock * Remove ts-ignore comments related to JsonifyObject error * Add missing reference to eslint package in skeleton * Update to Remix 2.1.0 * Fix SerializeFrom in JSDoc * Fix typedefs in JSDoc * Use SerializeFrom in demo-store * Changesets * Support generics in JSDoc * Set Remix as a non-pinned peer dependency * Changesets * Update .changeset/smart-ways-destroy.md Co-authored-by: Bret Little <bret.little@shopify.com> * Remove react dep again * Remove template guidelines for Remix v1 * Minor fix * Update changeset --------- Co-authored-by: Bret Little <bret.little@shopify.com>
- Loading branch information
Showing
127 changed files
with
6,355 additions
and
4,943 deletions.
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.