Fix UI extension dev bundle path#7614
Open
devisscher wants to merge 1 commit into
Open
Conversation
Contributor
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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