address png encoding bug, path changes#7378
Open
JoshuaWhite1 wants to merge 1 commit into04-21-add_assets_config_key_support_for_ui_extension_pointsfrom
Open
address png encoding bug, path changes#7378JoshuaWhite1 wants to merge 1 commit into04-21-add_assets_config_key_support_for_ui_extension_pointsfrom
JoshuaWhite1 wants to merge 1 commit into04-21-add_assets_config_key_support_for_ui_extension_pointsfrom
Conversation
4 tasks
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
4 tasks
3d8f4eb to
e70418a
Compare
bf935ec to
8d94171
Compare
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.

Closes https://github.com/shop/issues-admin-extensibility/issues/2452
WHY are these changes introduced?
When serving static assets for UI extensions during development, the dev server only looked in the build output directory and the extension's root source directory. Extensions that declare a per-extension-point
assetsfolder (via theassetsconfig key) had no way to serve those static files through the dev server, leaving assets like images inaccessible at runtime.WHAT is this pull request doing?
Adds a third candidate lookup path when resolving extension assets: the per-extension-point
assetsdirectory declared in the extension configuration. The resolution order is now:dist/handle.js)tools,instructions)assetsconfig key (e.g../assets/logo.png)This mirrors how the admin spec's
static_rootserves a whole directory of static files.Additionally,
readFileis called with an explicit options argument ({}) so that it returns aBufferrather than astring, and test assertions are updated to use.toString()accordingly.A new test covers the fallback to the extension-point
assetsfolder, verifying that a static asset (e.g.logo.png) is correctly resolved and served with the appropriateContent-Type.How to test your changes?
extension_pointsentry that includes anassetskey pointing to a local directory (e.g.assets: './assets').logo.png) in that directory.shopify app devand request the asset via the extension dev server URL.Content-Typeheader.Alternatively, run the existing test suite:
Checklist
patchfor bug fixes ·minorfor new features ·majorfor breaking changes) and added a changeset withpnpm changeset add