Add allow_direct_linking to UIExtension schema
Part 2 of https://github.com/Shopify/core-issues/issues/74004 Vault project: https://vault.shopify.io/gsd/projects/39317
WHY are these changes introduced?
Following the decision on the tech design to introduce a property called allow_direct_linking for an extension point's configurable capabilities. This allows app developers to configure whether the app extension can be used inside navigations (do they render a root url)
https://github.com/Shopify/shopify/pull/524406 is for the core side validations and updates the UiExtension API schema to incorporate target-level capabilities. This pull request allows allow_direct_linking to be configured for a ui_extension target.
WHAT is this pull request doing?
Add an optional capabilities hash which includes an optional allow_direct_linking boolean to the NewExtensionPointSchema.
How to test your changes?
Make sure you have a spin instance with partners constellation, can use customer-accounts-dev-ui. Check out https://github.com/Shopify/shopify/pull/524406 there and enable the api client flag bin/rails g verdict:configure_flag enable_ui_extension_allow_direct_linking --subject_type "api_client" --percent 100
- Clone the CLI tool
dev clone clilocally - Checkout this branch. From the
clidirectory, install pnpmpnpm install, then create an appSHOPIFY_CLI_1P_DEV=1 SPIN_INSTANCE={spin_name} SHOPIFY_SERVICE_ENV=spin pnpm create @shopify/app - Create an extension,
SPIN_INSTANCE={spin_name} SHOPIFY_SERVICE_ENV=spin pnpm shopify app generate extensionfrom the app's directory - Install the app to your development store by using the partner dashboard > apps > select your app > test your app > select store
- Add allow_direct_linking to the
shopify.extension.tomlshopify.extension.toml configuration found inside your extension directory
[[extensions.targeting]]
module = "./src/FullPageExtension.tsx"
target = "customer-account.page.render"
[extensions.targeting.capabilities]
allow_direct_linking = true
- Change directory back to main cli directory and deploy
SPIN_INSTANCE={spin_name} SHOPIFY_SERVICE_ENV=spin pnpm shopify app deploy --path /Users/path_to_your_app
Post-release steps
We will need to have docs updated when Configure header menu for customer accounts is released tracked in this issue https://github.com/Shopify/core-issues/issues/75186
Measuring impact
How do we know this change was effective? Please choose one:
- [x] n/a - this doesn't need measurement, e.g. a linting rule or a bug-fix
- [x] Existing analytics will cater for this addition
- [ ] PR includes analytics changes to measure impact
Checklist
- [x] I've considered possible cross-platform impacts (Mac, Linux, Windows)
- [x] I've considered possible documentation changes
Thanks for your contribution!
Depending on what you are working on, you may want to request a review from a Shopify team:
- Themes: @shopify/advanced-edits
- UI extensions: @shopify/ui-extensions-cli
- Checkout UI extensions: @shopify/checkout-ui-extensions-api-stewardship
- Hydrogen: @shopify/hydrogen
- Other: @shopify/app-management
Coverage report
St.:grey_question: |
Category | Percentage | Covered / Total |
|---|---|---|---|
| π‘ | Statements | 72.8% (+0.1% πΌ) |
8030/11030 |
| π‘ | Branches | 69.23% (+0.04% πΌ) |
3913/5652 |
| π‘ | Functions | 71.51% (+0.01% πΌ) |
2103/2941 |
| π‘ | Lines | 73.13% (+0.1% πΌ) |
7592/10381 |
Test suite run success
1813 tests passing in 825 suites.
Report generated by π§ͺjest coverage report action from dacd9c8341e80c30c10647bf1c7cc3af3a612759
We detected some changes at either packages/*/src or packages/cli-kit/assets/cli-ruby/** and there are no updates in the .changeset. If the changes are user-facing, run "pnpm changeset add" to track your changes and include them in the next release CHANGELOG.
Wooohooo! πββοΈπ’ππ»ββοΈ