Skip to content

@shopify/hydrogen@1.3.2

Compare
Choose a tag to compare
@github-actions github-actions released this 06 Sep 15:36
· 190 commits to v1.x-2022-07 since this release
8afab61

Patch Changes

  • Whenever using fetchSync, make sure to handle the error state. Though we've made changes to the error thrown by the JSON parser to also tell you that the request was unsuccessful: (#2070) by @blittle

    function MyComponent() {
      const response = fetchSync('/api');
    
      // Make sure the error state is handled!
      if (!response.ok) {
        console.error(
          `Unable to load ${response.url} returned ${response.status}`,
        );
        return <div>Error. Please try again</div>;
      }
    
      // Check `response.ok` before parsing the response
      const json = response.json();
    
      return ...
  • Update undici to the latest (#2015) by @dependabot

  • Added experimental support for Vite 3. By default, Hydrogen will still use Vite 2. However, it is possible to upgrade apps to Vite 3 by changing devDependencies in the app package.json. Beware that this is experimental and it might break. (#1992) by @frandiox

  • Hydrogen responses now contain a Link header to preload stylesheets. (#2075) by @frandiox

  • Improvements and fixes to hydrogen logging: (#2084) by @blittle

    1. API Routes are now passed a reference to the logger bound to the current request:
    export async function api(request, {log}) {
      log.warn("Here's a warning!");
      return new Request('Hello World');
    }
    1. If you define a custom logging implementation within your Hydrogen config, we'll now warn you when your logging implementation itself errors.
  • When a route is rendering, if Hydrogen has already started streaming, it is invalid to call response.doNotStream(). Disabling streaming should always happen before any async operation in your route server component. This change fixes Hydrogen to warn if you try to disable streaming after the stream has already begun. (#2081) by @frandiox