Skip to content
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

[ci] release 2023-10 #1453

Merged
merged 5 commits into from
Oct 31, 2023
Merged

[ci] release 2023-10 #1453

merged 5 commits into from
Oct 31, 2023

Conversation

shopify-github-actions-access[bot]
Copy link
Contributor

@shopify-github-actions-access shopify-github-actions-access bot commented Oct 25, 2023

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

@shopify/[email protected]

Major Changes

  • The default caching strategy has been updated. The new default caching strategy provides a max-age value of 1 second, and a stale-while-revalidate value of 1 day. If you would keep the old caching values, update your queries to use CacheShort: (#1336) by @benjaminsehl

     const {product} = await storefront.query(
       `#graphql
         query Product($handle: String!) {
           product(handle: $handle) { id title }
         }
       `,
       {
         variables: {handle: params.productHandle},
    +    /**
    +     * Override the default caching strategy with the old caching values
    +     */
    +    cache: storefront.CacheShort(),
       },
     );
  • Remix v2 (#1289) by @frandiox

    Hydrogen 2023-10 has upgraded to Remix v2 and is now a peer dependency.

    • Please check the Remix v2 release notes 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 before upgrading to v2.

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

  • The Storefront API types included are now generated using @graphql-codegen/typescript@4 (changelog). This results in a breaking change if you were importing Scalars directly from @shopify/hydrogen-react or @shopify/hydrogen: (#1108) by @frandiox

     import type {Scalars} from '@shopify/hydrogen/storefront-api-types';
    
     type Props = {
    -  id: Scalars['ID']; // This was a string
    +  id: Scalars['ID']['input']; // Need to access 'input' or 'output' to get the string
     };

Patch Changes

@shopify/[email protected]

Major Changes

  • The Storefront API types included are now generated using @graphql-codegen/typescript@4 (changelog). This results in a breaking change if you were importing Scalars directly from @shopify/hydrogen-react or @shopify/hydrogen: (#1108) by @frandiox

     import type {Scalars} from '@shopify/hydrogen/storefront-api-types';
    
     type Props = {
    -  id: Scalars['ID']; // This was a string
    +  id: Scalars['ID']['input']; // Need to access 'input' or 'output' to get the string
     };

Patch Changes

@shopify/[email protected]

Major Changes

  • Remove the function export getBuyerIp, which was deprecated in 2023-07. (#1455) by @frandiox

@shopify/[email protected]

Minor Changes

  • The Codegen feature is now considered stable and related dependencies have been updated. Use --codegen flag instead of --codegen-unstable to generate code from your GraphQL queries. (#1108) by @frandiox

Patch Changes

@shopify/[email protected]

Minor Changes

  • Removed the patchGqlPluck named export from the main entrypoint. (#1108) by @frandiox

    Added @shopify/hydrogen-codegen/patch entrypoint that automatically patches the necessary files. This is applied automatically by Hydrogen CLI.
    If you're using the graphql-codegen CLI directly, you can either run it as a Node loader with node -r @shopify/hydrogen-codegen/patch node_modules/.bin/graphql-codegen or import it in your codegen.ts file before anything else:

    import '@shopify/hydrogen-codegen/patch';
    import {preset, schema, pluckConfig} from '@shopify/hydrogen-codegen';
    
    export default {
      overwrite: true,
      pluckConfig,
      generates: {
        'storefrontapi.generated.d.ts': {
          preset,
          schema,
          documents: ['...'],
        },
      },
    };

Patch Changes

@shopify/[email protected]

Patch Changes

[email protected]

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]:

[email protected]

Patch Changes

@github-actions github-actions bot force-pushed the changeset-release/main branch 11 times, most recently from a20ce12 to e9a2e7a Compare October 30, 2023 18:59
@github-actions github-actions bot had a problem deploying to preview October 30, 2023 19:22 Failure
@github-actions github-actions bot force-pushed the changeset-release/main branch 4 times, most recently from 7f8490c to ff50cc7 Compare October 31, 2023 15:59
@github-actions github-actions bot force-pushed the changeset-release/main branch from ff50cc7 to 2e4afc2 Compare October 31, 2023 17:25
@blittle blittle merged commit 300fe1b into main Oct 31, 2023
7 of 9 checks passed
@blittle blittle deleted the changeset-release/main branch October 31, 2023 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant