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

checkout updates for ui-extensions #1034

Merged
merged 9 commits into from
Jul 11, 2023
Merged

Conversation

jamesvidler
Copy link
Contributor

@jamesvidler jamesvidler commented Jun 26, 2023

Background

Closes https://github.com/Shopify/checkout-web/issues/22623.

TLDR; this brings over the latest changes from the checkout-web/packages/ui-extensions(-react) packages. This is identical in features and functionality as version 0.27.0 of the legacy checkout-ui-extensions packages which are being published in this PR.

Note: We do not need to wait for the legacy package to publish. The changes in this PR will go to the unstable branch where we can continue to make any other small updates before branching and shipping 2023-04 (according to these instructions).

Docs will not be published for this version.

Solution

🎩

  1. Run spin up ui-extensions.
  2. Checkout this branch.
  3. Run yarn build to build the packages.
  4. Scaffold a standalone extension (outside of spin) on your machine and adjust the packages to use "@shopify/ui-extensions-react": "2022.10.6" and import from @shopify/ui-extensions-react/checkout.

Then, run the following command to copy the packages to your local extension to use. This will ask you to choose the spin instance:

VM=direct.$(spin show -o fqdn)
rsync -av --delete $VM:~/src/github.com/Shopify/ui-extensions/packages/ui-extensions node_modules/@shopify/ && \
   rsync -av --delete $VM:~/src/github.com/Shopify/ui-extensions/packages/ui-extensions-react node_modules/@shopify/

Finally, run yarn dev to run your extension in production using this package.

You should not have any type errors relating to the package and your dev extension should render without error.

Checklist

  • I have 🎩'd these changes
  • I have updated relevant documentation

@jamesvidler jamesvidler changed the title Ran prepare-package-release:ui-extensions checkout updates for ui-extensions Jun 26, 2023
@jamesvidler jamesvidler marked this pull request as ready for review June 27, 2023 16:38
@github-actions

This comment has been minimized.

@jamesvidler
Copy link
Contributor Author

There are some additional commits we can add to this, same ones made in the legacy PR.

Copy link
Contributor

@kumar303 kumar303 left a comment

Choose a reason for hiding this comment

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

I tophatted in production with a linked library and could use some newly added APIs 🚀 I wasn't able to review all changes.

Copy link
Contributor

@kumar303 kumar303 Jun 28, 2023

Choose a reason for hiding this comment

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

😂 🏄

Copy link
Contributor

@oliverigor oliverigor left a comment

Choose a reason for hiding this comment

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

Mainly checked the code and did some basic tophatting.

Copy link
Member

@lemonmade lemonmade left a comment

Choose a reason for hiding this comment

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

Obviously did not review every file (Github can barely handle this PR on my Mac :P), but spot check LGTM 👍

@@ -26,9 +31,13 @@ export function useApi<
}

/**
* Returns the full API object that was passed in to your
* extension when it was created.
* @deprecated you shoud be importing useApi instead
Copy link
Member

Choose a reason for hiding this comment

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

Was this removed on purpose?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, plan is to not mark these as deprecated yet for 2023-04. 2023-07 will introduce deprecations.


render('Checkout::Dynamic::Render', () => <App />);
reactExtension('Checkout::Dynamic::Render', () => <Extension />);
Copy link
Member

Choose a reason for hiding this comment

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

For the future: we still need to update these to use export default for the new package

@jamesvidler jamesvidler merged commit 98e4605 into unstable Jul 11, 2023
5 checks passed
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.

None yet

4 participants