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

Add shouldRender method to ui-extensions #2458

Open
wants to merge 3 commits into
base: unstable
Choose a base branch
from

Conversation

elanalynn
Copy link
Contributor

@elanalynn elanalynn commented Nov 6, 2024

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

  • Add a shouldRender method
  • Add targets and register APIs that correspond to existing action and print action targets

🎩

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's package.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

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

@elanalynn
Copy link
Contributor Author

/snapit

@shopify-github-actions-access
Copy link
Contributor

🫰✨ Thanks @elanalynn! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

"@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"

@elanalynn elanalynn force-pushed the ek/add-should-render-method branch 2 times, most recently from a797cef to 09e4ef5 Compare November 7, 2024 21:17
@elanalynn elanalynn marked this pull request as ready for review November 7, 2024 21:17
@elanalynn
Copy link
Contributor Author

/snapit

@shopify-github-actions-access
Copy link
Contributor

🫰✨ Thanks @elanalynn! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

"@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"

Copy link
Contributor

@belalsj belalsj left a comment

Choose a reason for hiding this comment

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

Looks fantastic!!!

@elanalynn
Copy link
Contributor Author

/snapit

@shopify-github-actions-access
Copy link
Contributor

🫰✨ Thanks @elanalynn! Your snapshots have been published to npm.

Test the snapshots by updating your package.json with the newly published versions:

"@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"

Copy link
Member

@vividviolet vividviolet left a 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

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.

5 participants