-
Notifications
You must be signed in to change notification settings - Fork 36
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
Add shouldRender method to ui-extensions #2458
base: unstable
Are you sure you want to change the base?
Conversation
/snapit |
🫰✨ Thanks @elanalynn! Your snapshots have been published to npm. Test the snapshots by updating your "@shopify/data-extensions": "0.0.0-snapshot-20241106220158",
"@shopify/ui-extensions": "0.0.0-snapshot-20241106220158",
"@shopify/ui-extensions-react": "0.0.0-snapshot-20241106220158" |
a797cef
to
09e4ef5
Compare
09e4ef5
to
4a71d84
Compare
/snapit |
🫰✨ Thanks @elanalynn! Your snapshots have been published to npm. Test the snapshots by updating your "@shopify/data-extensions": "0.0.0-snapshot-20241107212535",
"@shopify/ui-extensions": "0.0.0-snapshot-20241107212535",
"@shopify/ui-extensions-react": "0.0.0-snapshot-20241107212535" |
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.
Looks fantastic!!!
4a71d84
to
e1e195c
Compare
packages/ui-extensions/src/utilities/shouldRenderRegistration.ts
Outdated
Show resolved
Hide resolved
/snapit |
🫰✨ Thanks @elanalynn! Your snapshots have been published to npm. Test the snapshots by updating your "@shopify/data-extensions": "0.0.0-snapshot-20241113210423",
"@shopify/ui-extensions": "0.0.0-snapshot-20241113210423",
"@shopify/ui-extensions-react": "0.0.0-snapshot-20241113210423" |
packages/ui-extensions/src/utilities/shouldRenderRegistration.ts
Outdated
Show resolved
Hide resolved
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.
Just a couple of minor things
packages/ui-extensions/src/surfaces/admin/api/should-render/should-render.ts
Show resolved
Hide resolved
packages/ui-extensions/src/utilities/shouldRenderRegistration.ts
Outdated
Show resolved
Hide resolved
packages/ui-extensions/src/surfaces/admin/should-render-targets.ts
Outdated
Show resolved
Hide resolved
packages/ui-extensions/src/surfaces/admin/should-render-targets.ts
Outdated
Show resolved
Hide resolved
packages/ui-extensions/src/surfaces/admin/should-render-targets.ts
Outdated
Show resolved
Hide resolved
3090c84
to
2b43f0f
Compare
2b43f0f
to
a68c13a
Compare
Background
Part of the project for conditional rendering admin extensions, we need to introduce a
shouldRender
method to register the functions that control the rendering of the action extensions.Solution
shouldRender
method🎩
For complete e2e testing of conditional rendering, see instruction here.
You can just test that this version of
ui-extensions
works by pointing the reference in the extension'spackage.json
"@shopify/ui-extensions": "0.0.0-snapshot-20241107212535"
.You should be able to import the
shouldRender
method from@shopify/ui-extensions
and use it in your extension.Checklist