Skip to content

Commit e1656cf

Browse files
authored
Merge pull request #6303 from Shopify/08-22-remove_bundling_feature
Remove bundling feature
2 parents e73fc20 + e66f668 commit e1656cf

16 files changed

+21
-34
lines changed

packages/app/src/cli/models/extensions/extension-instance.ts

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ export class ExtensionInstance<TConfiguration extends BaseConfigType = BaseConfi
342342
}
343343

344344
async build(options: ExtensionBuildOptions): Promise<void> {
345-
const mode = this.buildMode(options)
345+
const mode = this.buildMode(options.environment)
346346

347347
switch (mode) {
348348
case 'theme':
@@ -363,10 +363,7 @@ export class ExtensionInstance<TConfiguration extends BaseConfigType = BaseConfi
363363
}
364364

365365
async buildForBundle(options: ExtensionBuildOptions, bundleDirectory: string, outputId?: string) {
366-
if (this.features.includes('bundling')) {
367-
// Modules that are going to be inclued in the bundle should be built in the bundle directory
368-
this.outputPath = this.getOutputPathForDirectory(bundleDirectory, outputId)
369-
}
366+
this.outputPath = this.getOutputPathForDirectory(bundleDirectory, outputId)
370367

371368
await this.build(options)
372369
if (this.isThemeExtension) {
@@ -380,11 +377,9 @@ export class ExtensionInstance<TConfiguration extends BaseConfigType = BaseConfi
380377
async copyIntoBundle(options: ExtensionBuildOptions, bundleDirectory: string, extensionUuid?: string) {
381378
const defaultOutputPath = this.outputPath
382379

383-
if (this.features.includes('bundling')) {
384-
this.outputPath = this.getOutputPathForDirectory(bundleDirectory, extensionUuid)
385-
}
380+
this.outputPath = this.getOutputPathForDirectory(bundleDirectory, extensionUuid)
386381

387-
const buildMode = this.buildMode(options)
382+
const buildMode = this.buildMode(options.environment)
388383

389384
if (this.isThemeExtension) {
390385
await bundleThemeExtension(this, options)
@@ -464,14 +459,14 @@ export class ExtensionInstance<TConfiguration extends BaseConfigType = BaseConfi
464459
await this.specification.contributeToSharedTypeFile?.(this, typeDefinitionsByFile)
465460
}
466461

467-
private buildMode(options: ExtensionBuildOptions): BuildMode {
462+
buildMode(environment: 'production' | 'development'): BuildMode {
468463
if (this.isThemeExtension) {
469464
return 'theme'
470465
} else if (this.isFunctionExtension) {
471466
return 'function'
472467
} else if (this.features.includes('esbuild')) {
473468
return 'ui'
474-
} else if (this.specification.identifier === 'flow_template' && options.environment === 'production') {
469+
} else if (this.specification.identifier === 'flow_template' && environment === 'production') {
475470
return 'flow'
476471
}
477472

packages/app/src/cli/models/extensions/specification.integration.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ describe('allLocalSpecs', () => {
3131
describe('createContractBasedModuleSpecification', () => {
3232
test('creates a specification with the given identifier', () => {
3333
// When
34-
const got = createContractBasedModuleSpecification('test', ['bundling'])
34+
const got = createContractBasedModuleSpecification('test', ['localization'])
3535

3636
// Then
3737
expect(got).toMatchObject(
@@ -41,7 +41,7 @@ describe('createContractBasedModuleSpecification', () => {
4141
uidStrategy: 'uuid',
4242
}),
4343
)
44-
expect(got.appModuleFeatures()).toEqual(['bundling'])
44+
expect(got.appModuleFeatures()).toEqual(['localization'])
4545
})
4646
})
4747

packages/app/src/cli/models/extensions/specification.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ export type ExtensionFeature =
1717
| 'ui_preview'
1818
| 'function'
1919
| 'theme'
20-
| 'bundling'
2120
| 'cart_url'
2221
| 'esbuild'
2322
| 'single_js_entry_path'

packages/app/src/cli/models/extensions/specifications/checkout_post_purchase.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const checkoutPostPurchaseSpec = createExtensionSpecification({
1313
dependency,
1414
partnersWebIdentifier: 'post_purchase',
1515
schema: CheckoutPostPurchaseSchema,
16-
appModuleFeatures: (_) => ['ui_preview', 'bundling', 'cart_url', 'esbuild', 'single_js_entry_path'],
16+
appModuleFeatures: (_) => ['ui_preview', 'cart_url', 'esbuild', 'single_js_entry_path'],
1717
deployConfig: async (config, _) => {
1818
return {metafields: config.metafields ?? []}
1919
},

packages/app/src/cli/models/extensions/specifications/checkout_ui_extension.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,7 @@ const checkoutSpec = createExtensionSpecification({
2020
identifier: 'checkout_ui_extension',
2121
dependency,
2222
schema: CheckoutSchema,
23-
appModuleFeatures: (_) => [
24-
'ui_preview',
25-
'bundling',
26-
'cart_url',
27-
'esbuild',
28-
'single_js_entry_path',
29-
'generates_source_maps',
30-
],
23+
appModuleFeatures: (_) => ['ui_preview', 'cart_url', 'esbuild', 'single_js_entry_path', 'generates_source_maps'],
3124
deployConfig: async (config, directory) => {
3225
return {
3326
extension_points: config.extension_points,

packages/app/src/cli/models/extensions/specifications/flow_action.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const flowActionSpecification = createExtensionSpecification({
4444
// ensure that the extension configuration is uploaded after registration in
4545
// https://github.com/Shopify/cli/blob/73ac91c0f40be0a57d1b18cb34254b12d3a071af/packages/app/src/cli/services/deploy.ts#L107
4646
// Should be removed after unified deployment is 100% rolled out
47-
appModuleFeatures: (_) => ['bundling'],
47+
appModuleFeatures: (_) => [],
4848
deployConfig: async (config, extensionPath) => {
4949
return {
5050
title: config.name,

packages/app/src/cli/models/extensions/specifications/flow_template.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const FlowTemplateExtensionSchema = BaseSchemaWithHandle.extend({
4848
const flowTemplateSpec = createExtensionSpecification({
4949
identifier: 'flow_template',
5050
schema: FlowTemplateExtensionSchema,
51-
appModuleFeatures: (_) => ['ui_preview', 'bundling'],
51+
appModuleFeatures: (_) => ['ui_preview'],
5252
deployConfig: async (config, extensionPath) => {
5353
return {
5454
template_handle: config.handle,

packages/app/src/cli/models/extensions/specifications/flow_trigger.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const flowTriggerSpecification = createExtensionSpecification({
4343
// ensure that the extension configuration is uploaded after registration in
4444
// https://github.com/Shopify/cli/blob/73ac91c0f40be0a57d1b18cb34254b12d3a071af/packages/app/src/cli/services/deploy.ts#L107
4545
// Should be removed after unified deployment is 100% rolled out
46-
appModuleFeatures: (_) => ['bundling'],
46+
appModuleFeatures: (_) => [],
4747
deployConfig: async (config, extensionPath) => {
4848
return {
4949
title: config.name,

packages/app/src/cli/models/extensions/specifications/function.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ const functionSpec = createExtensionSpecification({
8080
'pickup_point_delivery_option_generator',
8181
],
8282
schema: FunctionExtensionSchema,
83-
appModuleFeatures: (_) => ['function', 'bundling'],
83+
appModuleFeatures: (_) => ['function'],
8484
deployConfig: async (config, directory, apiKey) => {
8585
let inputQuery: string | undefined
8686
const moduleId = randomUUID()

packages/app/src/cli/models/extensions/specifications/pos_ui_extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const posUISpec = createExtensionSpecification({
1010
identifier: 'pos_ui_extension',
1111
dependency,
1212
schema: BaseSchema.extend({name: zod.string()}),
13-
appModuleFeatures: (_) => ['ui_preview', 'bundling', 'esbuild', 'single_js_entry_path'],
13+
appModuleFeatures: (_) => ['ui_preview', 'esbuild', 'single_js_entry_path'],
1414
deployConfig: async (config, directory) => {
1515
const result = await getDependencyVersion(dependency, directory)
1616
if (result === 'not_found') throw new BugError(`Dependency ${dependency} not found`)

0 commit comments

Comments
 (0)