Skip to content

Latest commit

 

History

History
314 lines (235 loc) · 16.5 KB

CHANGELOG.md

File metadata and controls

314 lines (235 loc) · 16.5 KB

skeleton

1.0.4

Patch Changes

  • This is an important fix to a bug with 404 routes and path-based i18n projects where some unknown routes would not properly render a 404. This fixes all new projects, but to fix existing projects, add a ($locale).tsx route with the following contents: (#1732) by @blittle

    import {type LoaderFunctionArgs} from '@remix-run/server-runtime';
    
    export async function loader({params, context}: LoaderFunctionArgs) {
      const {language, country} = context.storefront.i18n;
    
      if (
        params.locale &&
        params.locale.toLowerCase() !== `${language}-${country}`.toLowerCase()
      ) {
        // If the locale URL param is defined, yet we still are still at the default locale
        // then the the locale param must be invalid, send to the 404 page
        throw new Response(null, {status: 404});
      }
    
      return null;
    }
  • Add defensive null checks to the default cart implementation in the starter template (#1746) by @blittle

  • 🐛 Fix issue where customer login does not persist to checkout (#1719) by @michenly

    ✨ Add customerAccount option to createCartHandler. Where a ?logged_in=true will be added to the checkoutUrl for cart query if a customer is logged in.

  • Updated dependencies [faeba9f8, 6d585026, fcecfb23, 28864d6f, c0ec7714, 226cf478, 06d9fd91]:

1.0.3

Patch Changes

1.0.2

Patch Changes

  • Use new parameters introduced in Storefront API v2024-01 to fix redirection to the product's default variant when there are unknown query params in the URL. (#1642) by @wizardlyhel

    -   selectedVariant: variantBySelectedOptions(selectedOptions: $selectedOptions) {
    +   selectedVariant: variantBySelectedOptions(selectedOptions: $selectedOptions, ignoreUnknownOptions: true, caseInsensitiveMatch: true) {
          ...ProductVariant
        }
  • Update the GraphQL config in .graphqlrc.yml to use the more modern projects structure: (#1577) by @frandiox

    -schema: node_modules/@shopify/hydrogen/storefront.schema.json
    +projects:
    + default:
    +    schema: 'node_modules/@shopify/hydrogen/storefront.schema.json'

    This allows you to add additional projects to the GraphQL config, such as third party CMS schemas.

    Also, you can modify the document paths used for the Storefront API queries. This is useful if you have a large codebase and want to exclude certain files from being used for codegen or other GraphQL utilities:

    projects:
      default:
        schema: 'node_modules/@shopify/hydrogen/storefront.schema.json'
        documents:
          - '!*.d.ts'
          - '*.{ts,tsx,js,jsx}'
          - 'app/**/*.{ts,tsx,js,jsx}'
  • Improve resiliency of HydrogenSession (#1583) by @blittle

  • Update @shopify/cli dependency in package.json: (#1579) by @frandiox

    -   "@shopify/cli": "3.51.0",
    +   "@shopify/cli": "3.52.0",
  • Updated dependencies [810f48cf, 8c477cb5, 42ac4138, 0241b7d2, 6a897586, 0ff63bed, 6bc1d61c, eb0f4bcc, 400bfee6, a69c21ca, 970073e7, 772118ca, 335375a6, 335371ce, 94509b75, 36d6fa2c, 3e7b6e8a, cce65795, 9e3d88d4, ca1161b2, 92840e51, 952fedf2, 1bc053c9]:

1.0.1

Patch Changes

  • Sync up environment variable names across all example & type files. (#1542) by @michenly

  • Remove error boundary from robots.txt file in the Skeleton template (#1492) by @andrewcohen

  • Use the worker runtime by default when running the dev or preview commands. (#1525) by @frandiox

    Enable it in your project by adding the --worker flag to your package.json scripts:

    "scripts": {
      "build": "shopify hydrogen build",
    - "dev": "shopify hydrogen dev --codegen",
    + "dev": "shopify hydrogen dev --worker --codegen",
    - "preview": "npm run build && shopify hydrogen preview",
    + "preview": "npm run build && shopify hydrogen preview --worker",
      ...
    }
  • Update to the latest version of @shopify/oxygen-workers-types. (#1494) by @frandiox

    In TypeScript projects, when updating to the latest @shopify/remix-oxygen adapter release, you should also update to the latest version of @shopify/oxygen-workers-types:

    "devDependencies": {
      "@remix-run/dev": "2.1.0",
      "@remix-run/eslint-config": "2.1.0",
    - "@shopify/oxygen-workers-types": "^3.17.3",
    + "@shopify/oxygen-workers-types": "^4.0.0",
      "@shopify/prettier-config": "^1.1.2",
      ...
    },
  • Update internal dependencies for bug resolution. (#1496) by @vincentezw

    Update your @shopify/cli dependency to avoid duplicated sub-dependencies:

      "dependencies": {
    -   "@shopify/cli": "3.50.2",
    +   "@shopify/cli": "3.51.0",
      }
  • Update all Node.js dependencies to version 18. (Not a breaking change, since Node.js 18 is already required by Remix v2.) (#1543) by @michenly

  • 🐛 fix undefined menu error (#1533) by @michenly

  • Add @remix-run/server-runtime dependency. (#1489) by @frandiox

    Since Remix is now a peer dependency of @shopify/remix-oxygen, you need to add @remix-run/server-runtime to your dependencies, with the same version as the rest of your Remix dependencies.

    "dependencies": {
      "@remix-run/react": "2.1.0"
    + "@remix-run/server-runtime": "2.1.0"
      ...
    }
  • Updated dependencies [b2a350a7, 9b4f4534, 74ea1dba, 2be9ce82, a9b8bcde, bca112ed, 848c6260, d53b4ed7, 961fd8c6, 2bff9fc7, c8e8f6fd, 8fce70de, f90e4d47, e8cc49fe]:

1.0.0

Major Changes

  • The Storefront API 2023-10 now returns menu item URLs that include the primaryDomainUrl, instead of defaulting to the Shopify store ID URL (example.myshopify.com). The skeleton template requires changes to check for the primaryDomainUrl: by @blittle

    1. Update the HeaderMenu component to accept a primaryDomainUrl and include it in the internal url check
    // app/components/Header.tsx
    
    + import type {HeaderQuery} from 'storefrontapi.generated';
    
    export function HeaderMenu({
      menu,
    +  primaryDomainUrl,
      viewport,
    }: {
      menu: HeaderProps['header']['menu'];
    +  primaryDomainUrl: HeaderQuery['shop']['primaryDomain']['url'];
      viewport: Viewport;
    }) {
    
      // ...code
    
      // if the url is internal, we strip the domain
      const url =
        item.url.includes('myshopify.com') ||
        item.url.includes(publicStoreDomain) ||
    +   item.url.includes(primaryDomainUrl)
          ? new URL(item.url).pathname
          : item.url;
    
       // ...code
    
    }
    1. Update the FooterMenu component to accept a primaryDomainUrl prop and include it in the internal url check
    // app/components/Footer.tsx
    
    - import type {FooterQuery} from 'storefrontapi.generated';
    + import type {FooterQuery, HeaderQuery} from 'storefrontapi.generated';
    
    function FooterMenu({
      menu,
    +  primaryDomainUrl,
    }: {
      menu: FooterQuery['menu'];
    +  primaryDomainUrl: HeaderQuery['shop']['primaryDomain']['url'];
    }) {
      // code...
    
      // if the url is internal, we strip the domain
      const url =
        item.url.includes('myshopify.com') ||
        item.url.includes(publicStoreDomain) ||
    +   item.url.includes(primaryDomainUrl)
          ? new URL(item.url).pathname
          : item.url;
    
       // ...code
    
      );
    }
    1. Update the Footer component to accept a shop prop
    export function Footer({
      menu,
    + shop,
    }: FooterQuery & {shop: HeaderQuery['shop']}) {
      return (
        <footer className="footer">
    -      <FooterMenu menu={menu} />
    +      <FooterMenu menu={menu} primaryDomainUrl={shop.primaryDomain.url} />
        </footer>
      );
    }
    1. Update Layout.tsx to pass the shop prop
    export function Layout({
      cart,
      children = null,
      footer,
      header,
      isLoggedIn,
    }: LayoutProps) {
      return (
        <>
          <CartAside cart={cart} />
          <SearchAside />
          <MobileMenuAside menu={header.menu} shop={header.shop} />
          <Header header={header} cart={cart} isLoggedIn={isLoggedIn} />
          <main>{children}</main>
          <Suspense>
            <Await resolve={footer}>
    -          {(footer) => <Footer menu={footer.menu}  />}
    +          {(footer) => <Footer menu={footer.menu} shop={header.shop} />}
            </Await>
          </Suspense>
        </>
      );
    }

Patch Changes

  • 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: (#1289) by @frandiox

    // 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.

  • Updated dependencies [81400439, a6f397b6, 3464ec04, 7fc088e2, 867e0b03, ad45656c, f24e3424, 66a48573, 0ae7cbe2, 8198c1be, ad45656c]: