Skip to content

Commit

Permalink
Update to latest hydrogen-react and fix template imports (#523)
Browse files Browse the repository at this point in the history
  • Loading branch information
blittle committed Feb 15, 2023
1 parent 257ce6d commit d94488b
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 20 deletions.
6 changes: 6 additions & 0 deletions .changeset/funny-pants-kick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@shopify/hydrogen': patch
'@shopify/cli-hydrogen': patch
---

Fix template imports to only reference `@shopify/hydrogen`, not `@shopify/hydrogen-react`
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"peerDependencies": {
"@remix-run/react": "^1.12.0",
"@shopify/hydrogen-react": "^2023.1.4",
"@shopify/hydrogen-react": "^2023.1.5",
"@shopify/remix-oxygen": "^1.0.2"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/hydrogen/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"dist"
],
"dependencies": {
"@shopify/hydrogen-react": "2023.1.4"
"@shopify/hydrogen-react": "2023.1.5"
},
"peerDependencies": {
"@remix-run/react": "1.12.0",
Expand Down
4 changes: 2 additions & 2 deletions templates/skeleton/app/routes/[sitemap.xml].tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {flattenConnection} from '@shopify/hydrogen-react';
import {flattenConnection} from '@shopify/hydrogen';
import type {LoaderArgs} from '@shopify/remix-oxygen';
import {
CollectionConnection,
PageConnection,
ProductConnection,
} from '@shopify/hydrogen-react/storefront-api-types';
} from '@shopify/hydrogen/storefront-api-types';

const MAX_URLS = 250; // the google limit is 50K, however, SF API only allow querying for 250 resources each time

Expand Down
4 changes: 2 additions & 2 deletions templates/skeleton/app/routes/cart.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {Await, useMatches} from '@remix-run/react';
import {Suspense} from 'react';
import {flattenConnection} from '@shopify/hydrogen-react';
import type {Cart as CartType} from '@shopify/hydrogen-react/storefront-api-types';
import {flattenConnection} from '@shopify/hydrogen';
import type {Cart as CartType} from '@shopify/hydrogen/storefront-api-types';

export async function action() {
// @TODO implement cart action
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {json, type LoaderArgs} from '@shopify/remix-oxygen';
import {useLoaderData} from '@remix-run/react';
import type {Collection as CollectionType} from '@shopify/hydrogen-react/storefront-api-types';
import type {Collection as CollectionType} from '@shopify/hydrogen/storefront-api-types';
import {Link} from '@remix-run/react';

export async function loader({params, request, context}: LoaderArgs) {
Expand Down
2 changes: 1 addition & 1 deletion templates/skeleton/app/routes/pages/$pageHandle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
} from '@shopify/remix-oxygen';
import {useLoaderData} from '@remix-run/react';
import invariant from 'tiny-invariant';
import type {Page as PageType} from '@shopify/hydrogen-react/storefront-api-types';
import type {Page as PageType} from '@shopify/hydrogen/storefront-api-types';
import type {SeoHandleFunction} from '@shopify/hydrogen';

export async function loader({params, context}: LoaderArgs) {
Expand Down
2 changes: 1 addition & 1 deletion templates/skeleton/app/routes/policies/$policyHandle.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {json, type MetaFunction, type LoaderArgs} from '@shopify/remix-oxygen';
import {useLoaderData} from '@remix-run/react';

import {ShopPolicy} from '@shopify/hydrogen-react/storefront-api-types';
import {ShopPolicy} from '@shopify/hydrogen/storefront-api-types';

export async function loader({request, params, context}: LoaderArgs) {
const handle = params.policyHandle;
Expand Down
2 changes: 1 addition & 1 deletion templates/skeleton/app/routes/policies/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {json, type LoaderArgs} from '@shopify/remix-oxygen';
import {useLoaderData, Link} from '@remix-run/react';
import type {ShopPolicy} from '@shopify/hydrogen-react/storefront-api-types';
import type {ShopPolicy} from '@shopify/hydrogen/storefront-api-types';

export async function loader({context: {storefront}}: LoaderArgs) {
const data = await storefront.query<{
Expand Down
2 changes: 1 addition & 1 deletion templates/skeleton/app/routes/products/$productHandle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {useLoaderData} from '@remix-run/react';
import type {
ProductVariant,
Product as ProductType,
} from '@shopify/hydrogen-react/storefront-api-types';
} from '@shopify/hydrogen/storefront-api-types';

export async function loader({params, context}: LoaderArgs) {
const {productHandle} = params;
Expand Down

0 comments on commit d94488b

Please sign in to comment.