hydrogen icon indicating copy to clipboard operation
hydrogen copied to clipboard

[ci] release v1.x-2022-07

Open github-actions[bot] opened this issue 3 years ago • 0 comments

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 v1.x-2022-07, this PR will be updated.

Releases

@shopify/[email protected]

Minor Changes

  • Remove automatic origin support from fetchSync on the server. (#2276) by @jplhomer

    Developers should never be making fetch requests on the server against their own Hydrogen app. This is because some production runtimes prohibit invoking fetch requests to servers in the same region. Other runtimes will fail to resolve DNS when invoked from within the same process.

    This change makes it required to pass a fully-qualified URL (including origin) to fetchSync when it's being used on the server:

    // MyComponent.server.jsx
    
    // ❌ You should not use this pattern, and it will now fail:
    fetchSync('/api/path').json();
    

    Instead, you should query the data directly, or extract the data query to a function and call it inside your server component:

    // MyComponent.server.jsx
    import {sharedQuery} from './shared-location.server';
    
    // ✅ Do this instead:
    useQuery('shared-query', sharedQuery);
    

    This is not considered a breaking change because the intention of the server-side fetchSync API was never to enable calling a Hydrogen app from itself, but rather to call third-party APIs from the server.

[email protected]

github-actions[bot] avatar Oct 28 '22 13:10 github-actions[bot]