-
Notifications
You must be signed in to change notification settings - Fork 42
Pre-publish checkout-ui-extensions: brought over public packages, re-generated docs #322
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
Pre-publish checkout-ui-extensions: brought over public packages, re-generated docs #322
Conversation
Turns out this was an issue related to using |
/** | ||
* Set the semantic of the component’s content | ||
*/ | ||
accessibilityRole?: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jffortier do you know what the tuple version of this type means?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes!
- when one value is set, we render the correct HTML element if one exist for that specific role. ex:
<View accessibilityRole="header">
will render<header>
- when a second value is set, we then set the
role
property on the element. ex:<View accessibilityRole={['header', 'banner']}>
will render<header role="banner">
It can be useful for many use cases. In Self Serve, they need the list/listItem semantic and the stylistic flexibility of View for their UI. They also needed a list item that had the role of "separator".
<View accessibilityRole="list" {...styleOnlyPossibleWithView}>
<View accessibilityRole="listItem">...</View>
<View accessibilityRole={{'listItem', 'separator']} border="base" />
<View accessibilityRole="listItem">...</View>
</View>
Which renders
<ul>
<li>...</li>
<li role="separator" class="css-class-for-border" />
<li>...</li>
</ul>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, interesting. I think we should probably add some of this content as documentation for the prop, unless a deeper explainer is somewhere else. It wasn't clear to me what they meant, and I still find it a bit hard to understand from this type what values are actually useful to use in the two-value format (e.g., ['listItem', 'listItem']
is valid here but presumably not a thing you'd ever want in practice?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should probably add some of this content as documentation for the prop, unless a deeper explainer is somewhere else.
Yeah, I remember providing that feedback in the PR, but now can't find the detailed explanation in the code. Not sure what happened. I'll add one.
I still find it a bit hard to understand from this type what values are actually useful to use in the two-value format (e.g., ['listItem', 'listItem'] is valid here but presumably not a thing you'd ever want in practice?)
We can provide examples in that description. Yes, ['listItem', 'listItem']
is valid with this API. We currently allow it (eg: this will render <li role="listItem">
, but could decide to not do anything with the second value when its identical to the first.
yarn.lock
Outdated
@@ -10116,6 +10148,15 @@ react-is@^17.0.1: | |||
resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.1.tgz#5b3531bd76a645a4c9fb6e693ed36419e3301339" | |||
integrity sha512-NAnt2iGDXohE5LI7uBnLnqvLQMtzhkiAOLXTmv+qnF9Ky7xAPcX8Up/xWIhxvLVGJvuLiNc4xQLtuqDRzb4fSA== | |||
|
|||
"react-reconciler@>=0.26.0 <0.27.0", react-reconciler@^0.26.0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bunch of these can technically be deduplicated, I'd probably runnpx yarn-deduplicate
with the --packages
flag to avoid these new duplicates.
@marvinhagemeister filed an issue for showing the actual error: https://github.com/Shopify/temp-project-mover-megswim-20250326195306/issues/27 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't tophat but this looks good to me
Good catch! Looks like there is a deeper issue where error messages get swallowed completely |
Background
For https://github.com/Shopify/ui-extensions/issues/320.
This PR brings over the latest versions of the
checkout-ui-extensions
andcheckout-ui-extensions-react
from thecheckout-web
repo. A follow-up PR will publish the packages.In addition, the docs have been re-generated based off the latest package sources.
This has a sibling PR https://github.com/Shopify/shopify-dev/pull/20496 that shows the re-generated documentation that will be shipped to shopify.dev
Solution
Followed the publishing packages instructions.
Notes:
package.json
for both packages because they had newer versions of dependancies."@quilted/react-testing": "^0.4.10"
in theui-extension
repo as it causes errors when running tests. The package causing issues moved to only using export conditions, which jest doesn't support yet. To get around this and not have to manually revert the version, added aresolution
for it:ui-extensions/package.json
Lines 60 to 65 in 1816206
🎩
Questions for Reviewers
yarn.lock
that I think have been excluded in past merges, but probably should be updated. Any red flags?Doc Updates
Review the doc files changed by this PR both in this repo and in https://github.com/Shopify/shopify-dev/pull/20496.
Package Update
It's important to do a smoke test on how this package will function before we publish to NPM. Normally, you would use
yarn link
to do this, but there's an issue with that right now that causes an invalid react hook error.yarn && yarn build
../packages/checkout-ui-extensions
and./packages/checkout-ui-extensions-react
and paste them into the./node_modules/@shopify
folder in your an existing checkout extension, or a newly created one.Verify that the extension runs using
shopify extension serve
.What changes to look for - to confirm you are using the latest package when testing?
There are many changes, but one easy thing to look for is there should no longer be a
ButtonGroup
component. That has been removed in the latest version.Checklist