Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
c65984a to
bf92dc4
Compare
96d95ba to
d8b0d4a
Compare
6e09feb to
5c1ddf1
Compare
d8b0d4a to
f042d96
Compare
5c1ddf1 to
06dee38
Compare
06dee38 to
40bf3e5
Compare
8cc6cc8 to
cc438ef
Compare
| * Run client steps that aren't handled by esbuild (e.g. include_assets). | ||
| * Skips bundle_ui since esbuild already handled it. | ||
| */ | ||
| private async runPostEsbuildSteps(extension: ExtensionInstance): Promise<void> { |
There was a problem hiding this comment.
we need to find a better way to do this, @alfonso-noriega it makes sense for dev to execute this missing steps. Wonder how much we gain from having a custom esbuild for dev (in theory is faster because it uses contexts and only rebuilds what changed, not the whole extension)
There was a problem hiding this comment.
I have an agent working on this, will have an independent PR solving this on monday morning
There was a problem hiding this comment.
Thank you so much Isaac!
There was a problem hiding this comment.
This PR should handle this: https://app.graphite.com/github/pr/Shopify/cli/7252
cc438ef to
91e9fca
Compare
Include built assets in the manifest.json Allow serving static assets from the extensions directory
91e9fca to
a6d5ab9
Compare
| AssetIdentifier.Instructions, | ||
| 'instructions', | ||
| ) | ||
| if (missingInstructionsError) { |
There was a problem hiding this comment.
should we get something similar for schema property in the intents definition? validate that the path is there and it is right?
There was a problem hiding this comment.
Oops, this is left over code from when we were not using client steps. I'm thinking this should be moved over to the client steps instead? Maybe we can support a required prop so the steps will throw if the asset is missing?
| return fileServerMiddleware(event, { | ||
| filePath: joinPath(buildDirectory, assetPath), | ||
| }) | ||
| // Try the build output directory first (for compiled bundles), then fall back |
There was a problem hiding this comment.
if everything is working fine, the dev bundle should have the static assets and therfore this won't be needed, right?
There was a problem hiding this comment.
We still will need this. The build directory is a local directory not the dev bundle directory. Assets are compiled locally and then copied over to the dev bundle. The Dev Server serves local assets and we create a timestamp for when the files are updated. If we switch to using the dev bundle then I believe the timestamp will be wrong since it re-creates the bundle every time. This will cause unnecessary updates for consumers.
| type: 'include_assets', | ||
| config: { | ||
| generatesAssetsManifest: true, | ||
| builtAssets: {anchor: 'extension_points[]', groupBy: 'target', key: 'build_manifest'}, |
There was a problem hiding this comment.
I think this should be also part of the inclusions, not on the top level. actually, i am wondering if it wouldn't work as a normal type configKey?
There was a problem hiding this comment.
It doesn't work because the toml points to the raw module which we don't want to copy over. We need to the compiled asset copied over and there's no toml reference for that. The bundle_ui step already handles the building and copying. What we're missing is putting an entry for it inside the manifest.json for the generatesAssetsManifest step. If we can update bundle_ui to take ingeneratesAssetsManifestthat would work but right now the manifest.json does a replace only instead of each step adding to it.

WHY are these changes introduced?
This change modernizes the UI extension asset handling system by replacing the legacy
build_manifestapproach with a new manifest.json-based system that supports additional asset types including intents.Related https://github.com/shop/issues-admin-extensibility/issues/2274
WHAT is this pull request doing?
intentsfield in extension point schemas with type, action, schema, name, and description propertiesIntentsto theAssetIdentifierenum for asset handlinginclude_assetsstep instead ofcopy_static_assets, with support for tools, instructions, and intent schemasHow to test your changes?
Measuring impact
How do we know this change was effective? Please choose one:
Checklist