From 71ca2e79d6d2dccc115a7d640003f2bc68a654c5 Mon Sep 17 00:00:00 2001 From: Igor Kozlov Date: Fri, 14 Aug 2026 15:09:39 -0400 Subject: [PATCH] Support the bundle_size_exception capability --- .changeset/spicy-crabs-bundle.md | 5 ++ .../app/src/cli/models/extensions/schemas.ts | 1 + .../specifications/ui_extension.test.ts | 47 +++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 .changeset/spicy-crabs-bundle.md diff --git a/.changeset/spicy-crabs-bundle.md b/.changeset/spicy-crabs-bundle.md new file mode 100644 index 00000000000..b16645d40e7 --- /dev/null +++ b/.changeset/spicy-crabs-bundle.md @@ -0,0 +1,5 @@ +--- +'@shopify/app': minor +--- + +Support the bundle_size_exception extension capability diff --git a/packages/app/src/cli/models/extensions/schemas.ts b/packages/app/src/cli/models/extensions/schemas.ts index 04978437b76..55d0b3d2526 100644 --- a/packages/app/src/cli/models/extensions/schemas.ts +++ b/packages/app/src/cli/models/extensions/schemas.ts @@ -26,6 +26,7 @@ const CapabilitiesSchema = zod.object({ api_access: zod.boolean().optional(), collect_buyer_consent: CollectBuyerConsentCapabilitySchema.optional(), iframe: IframeCapabilitySchema.optional(), + bundle_size_exception: zod.boolean().optional(), }) const SupportedFeaturesSchema = zod.object({ diff --git a/packages/app/src/cli/models/extensions/specifications/ui_extension.test.ts b/packages/app/src/cli/models/extensions/specifications/ui_extension.test.ts index 3d5d5f6f1a1..089bc427389 100644 --- a/packages/app/src/cli/models/extensions/specifications/ui_extension.test.ts +++ b/packages/app/src/cli/models/extensions/specifications/ui_extension.test.ts @@ -942,6 +942,53 @@ Please check the configuration in ${uiExtension.configurationPath}`), }) }) + test('includes the bundle_size_exception capability in the deploy config', async () => { + await inTemporaryDirectory(async (tmpDir) => { + // Given + vi.spyOn(loadLocales, 'loadLocalesConfig').mockResolvedValue({}) + const configurationPath = joinPath(tmpDir, 'shopify.extension.toml') + const allSpecs = await loadLocalExtensionsSpecifications() + const specification = allSpecs.find((spec) => spec.identifier === 'ui_extension')! + const parsed = specification.parseConfigurationObject({ + targeting: [ + { + target: 'EXTENSION::POINT::A', + module: './src/ExtensionPointA.js', + }, + ], + api_version: '2025-10' as const, + name: 'UI Extension', + type: 'ui_extension', + handle: 'test-ui-extension', + capabilities: { + bundle_size_exception: true, + }, + settings: {}, + }) + if (parsed.state !== 'ok') { + throw new Error("Couldn't parse configuration") + } + const uiExtension = new ExtensionInstance({ + configuration: parsed.data, + directory: tmpDir, + specification, + configurationPath, + entryPath: '', + }) + + // When + const deployConfig = await uiExtension.deployConfig({ + apiKey: 'apiKey', + appConfiguration: placeholderAppConfiguration, + }) + + // Then + expect(deployConfig?.capabilities).toStrictEqual({ + bundle_size_exception: true, + }) + }) + }) + test('returns supported_features with runs_offline true when configured', async () => { await inTemporaryDirectory(async (tmpDir) => { // Given