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

Packages for release #1940

Merged
merged 2 commits into from
Jan 23, 2025
Merged

Packages for release #1940

merged 2 commits into from
Jan 23, 2025

Conversation

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

@shopify-github-actions-access shopify-github-actions-access bot commented Jan 7, 2025

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]

Minor Changes

  • 89d803e: # Adds signal as request option

    This adds the signal option to the request method of the GraphQL client, for the shopify-api and shopify-app-remix packages to pass in an AbortSignal to abort requests, and set a timeout.

    If a request is aborted, an HttpRequestError will be thrown.

    This will allow you to set your own custom timeout, and abort requests.

    // Abort the request after 3 seconds
    await admin.graphql('{ shop { name } }', {
      signal: AbortSignal.timeout(3000),
    });
    // Abort the request after 3 seconds, and retry the request up to 2 times
    await admin.graphql('{ shop { name } }', {
      signal: AbortSignal.timeout(3000),
      tries: 2,
    });

Patch Changes

@shopify/[email protected]

Minor Changes

  • 89d803e: # Adds signal as request option

    This adds the signal option to the request method of the GraphQL client, for the shopify-api and shopify-app-remix packages to pass in an AbortSignal to abort requests, and set a timeout.

    If a request is aborted, an HttpRequestError will be thrown.

    This will allow you to set your own custom timeout, and abort requests.

    // Abort the request after 3 seconds
    await admin.graphql('{ shop { name } }', {
      signal: AbortSignal.timeout(3000),
    });
    // Abort the request after 3 seconds, and retry the request up to 2 times
    await admin.graphql('{ shop { name } }', {
      signal: AbortSignal.timeout(3000),
      tries: 2,
    });
  • 724f3d9: # Function to authenticate POS UI extension requests

    A new API had been added to the authenticate module to authenticate POS UI extension requests.

    The authenticate.public.pos function is now available to authenticate POS UI extension requests.

    It returns the session token that was sent with the request and a cors function to ensure your app can respond to POS UI extension requests.

    //app/routes/pos.jsx
    import { authenticate } from "../shopify.server";
    export const action = async ({ request }) => {
    
            const {sessionToken } = await authenticate.public.pos(request);
            console.log(sessionToken, "sessionToken");
    
        return "hello world"
    }
    
    // extensions/pos-ui/src/Modal.jsx
    import React, { useEffect, useState } from 'react'
    
    import { Text, Screen, ScrollView, Navigator, reactExtension, useApi } from '@shopify/ui-extensions-react/point-of-sale'
    
    const Modal = () => {
      const api = useApi()
      const {getSessionToken} = api.session;
      const [token, setToken] = useState('');
      const [result, setResult] = useState('');
    
      useEffect(() => {
        const fetchToken = async () => {
          const newToken = await getSessionToken();
          setToken(newToken);
          await fetchWithToken(newToken);
        };
    
        async function fetchWithToken(token) {
          const result = await fetch(
            'https://decor-plasma-showtimes-beverages.trycloudflare.com/pos',
            {
              method: 'POST',
              headers: {
                'Authorization': `Bearer ${token}`,
                'Content-Type': 'application/json'
              },
              body: JSON.stringify({}) // Add your POST data here
            },
          );
          const resultJson = await result.json();
          setResult(resultJson);
        }
    
       fetchToken();
      }, []); // Empty dependency array means this runs once on mount
    
      return (
        <Navigator>
          <Screen name="HelloWorld" title="Hello World!">
            <ScrollView>
              <Text>Welcome to the extension</Text>
              <Text> The result is: {JSON.stringify(result)}</Text>
            </ScrollView>
          </Screen>
        </Navigator>
      )
    }
    
    export default reactExtension('pos.home.modal.render', () => <Modal />);

Patch Changes

@shopify/[email protected]

Patch Changes

@shopify/[email protected]

Patch Changes

  • d3531c5: Better error handling for missing Response.body in multipart requests. Instead of being "Cannot read properties of undefined (reading 'Symbol(Symbol.asyncIterator)')", it will now be the more useful and accurate message "API multipart response did not return an iterable body".

@shopify/[email protected]

Patch Changes

@shopify/[email protected]

Patch Changes

  • e7d9103: Updated mysql2 dependencies

@shopify/[email protected]

Patch Changes

  • 1475edf: Updated @aws-sdk/util-dynamodb dependencies
  • 2021f34: Updated @aws-sdk/client-dynamodb dependencies
  • 6fd94f1: Updated @aws-sdk/client-dynamodb, @aws-sdk/util-dynamodb dependencies

@shopify/[email protected]

Patch Changes

  • e7d9103: Updated mysql2 dependencies

@shopify/[email protected]

Patch Changes

@shopify/[email protected]

@shopify/[email protected]

@shopify/[email protected]

@shopify/[email protected]

@shopify/[email protected]

@shopify/[email protected]

@shopify/[email protected]

@shopify/[email protected]

@shopify/[email protected]

@shopify-github-actions-access shopify-github-actions-access bot requested a review from a team as a code owner January 7, 2025 23:21
@github-actions github-actions bot force-pushed the changeset-release/main branch 17 times, most recently from 0b604f5 to f57b9c5 Compare January 9, 2025 01:18
@github-actions github-actions bot force-pushed the changeset-release/main branch 12 times, most recently from 1cbc50e to 46b9670 Compare January 17, 2025 13:02
@github-actions github-actions bot force-pushed the changeset-release/main branch 21 times, most recently from 64fc7bf to 1ca85a1 Compare January 23, 2025 08:28
@github-actions github-actions bot force-pushed the changeset-release/main branch from 1ca85a1 to f709f75 Compare January 23, 2025 17:52
Copy link
Contributor

@sle-c sle-c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great to have the Abort signal release! 🎉

@lizkenyon lizkenyon merged commit efb9a35 into main Jan 23, 2025
6 checks passed
@lizkenyon lizkenyon deleted the changeset-release/main branch January 23, 2025 19:16
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.

2 participants