Fix UI extension dev bundle path - #7614
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes a regression in shopify app dev draft uploads for generic ui_extension extensions where the bundle output is written under a configured subfolder (e.g. dist/). The change updates how serialized_script is located so it matches the actual bundle output indicated by the generated manifest.json, while preserving legacy behavior for other extension types.
Changes:
- Resolve
ui_extensionserialized script path frommanifest.json(main) when available and safely within the bundle directory. - Keep a fallback to
extension.getOutputPathForDirectory(bundlePath)when the manifest is missing/invalid/unsafe. - Add unit tests covering manifest usage for generic
ui_extension, missing-manifest fallback, and unchanged behavior forcheckout_ui_extension.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/app/src/cli/services/dev/update-extension.ts | Adds manifest-aware path resolution for ui_extension draft uploads with safety checks and fallback behavior. |
| packages/app/src/cli/services/dev/update-extension.test.ts | Adds focused tests validating manifest-based resolution, fallback, and legacy behavior preservation. |
| .changeset/fix-ui-extension-dev-bundle-path.md | Adds a patch changeset documenting the fix for generic UI extension dev draft uploads. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
This PR seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action. |
69f0be9 to
985b1e5
Compare
Assisted-By: devx/d852f6cf-adfc-4c94-92f6-5a4b5c194b95
985b1e5 to
1fbbd71
Compare
|
This was for the old path when apps were on partners. Once our app is migrated to dev dashboard this fix won't be needed, so I'll close the PR. |
WHY are these changes introduced?
Fixes https://github.com/shop/issues-discounts/issues/2117
shopify app devregressed for genericui_extensionextensions whose bundle step writes assets under a configured bundle folder. The generated bundle manifest points at the real script path, for exampledist/<handle>.js, but draft upload was still readingextension.getOutputPathForDirectory(bundlePath), which resolves to<handle>.jsfor generic UI extensions.WHAT is this pull request doing?
updateExtensionDraft()to resolve genericui_extensionserialized scripts from the bundlemanifest.jsonmainpath when available.main, or resolves outside the bundle directory.ui_extension, preserving legacycheckout_ui_extensionandweb_pixel_extensionbehavior.How to test your changes?
Targeted test command:
Local note: I attempted this command, but dependencies are not installed in this checkout (
vitest: command not found;node_modulesmissing), so no tests executed locally.Manual verification path:
ui_extensiontargeting checkout and a generated bundle manifest like{ "purchase.checkout.block.render": { "main": "dist/<handle>.js" } }, runshopify app dev.<dev-bundle>/<uid>/dist/<handle>.jsforserialized_scriptinstead of<dev-bundle>/<uid>/<handle>.js.checkout_ui_extensionandweb_pixel_extensiondraft uploads still read their normal output paths.Checklist
patchfor bug fixes ·minorfor new features ·majorfor breaking changes) and added a changeset withpnpm changeset add