From 016a53c9eb0445da9578a22dae1950bed7cf19c6 Mon Sep 17 00:00:00 2001 From: bc-maxy Date: Thu, 3 Sep 2026 15:50:11 +1000 Subject: [PATCH] chore(checkout): CHECKOUT-10115 Remove rolled out CHECKOUT-10115 experiment --- packages/core/src/app/auto-loader.ts | 16 +++------------- packages/core/src/app/loader.test.ts | 28 ++++------------------------ packages/core/src/app/loader.ts | 4 +--- 3 files changed, 8 insertions(+), 40 deletions(-) diff --git a/packages/core/src/app/auto-loader.ts b/packages/core/src/app/auto-loader.ts index 86b6f81083..0b3e73335a 100644 --- a/packages/core/src/app/auto-loader.ts +++ b/packages/core/src/app/auto-loader.ts @@ -16,7 +16,6 @@ export interface CustomCheckoutWindow extends Window { publicPath?: string; sentryConfig?: BrowserOptions; permalinkStatus?: OrderPermalinkStatus | null; - isConsistentCrossOriginFixEnabled?: boolean; }; } @@ -31,18 +30,9 @@ function isCustomCheckoutWindow(window: Window): window is CustomCheckoutWindow throw new Error('Checkout config is missing.'); } - const { renderOrderConfirmation, renderCheckout } = await loadFiles({ - isConsistentCrossOriginFixEnabled: Boolean( - window.checkoutConfig.isConsistentCrossOriginFixEnabled, - ), - }); - - const { - orderId, - checkoutId, - isConsistentCrossOriginFixEnabled: _isConsistentCrossOriginFixEnabled, - ...appProps - } = window.checkoutConfig; + const { renderOrderConfirmation, renderCheckout } = await loadFiles(); + + const { orderId, checkoutId, ...appProps } = window.checkoutConfig; if (orderId) { renderOrderConfirmation({ ...appProps, orderId }); diff --git a/packages/core/src/app/loader.test.ts b/packages/core/src/app/loader.test.ts index 118ba1841a..7f279a2bc3 100644 --- a/packages/core/src/app/loader.test.ts +++ b/packages/core/src/app/loader.test.ts @@ -119,44 +119,24 @@ describe('loadFiles', () => { ); }); - it('prefetches dynamic JS chunks listed in manifest', async () => { + it('prefetches dynamic JS chunks with crossorigin matching the real chunk requests', async () => { await loadFiles(options); expect(getScriptLoader().preloadScripts).toHaveBeenCalledWith( ['https://cdn.foo.bar/step-a.js', 'https://cdn.foo.bar/step-b.js'], - { prefetch: true }, + { prefetch: true, crossOrigin: 'anonymous' }, ); }); - it('prefetches dynamic CSS chunks listed in manifest', async () => { + it('prefetches dynamic CSS chunks with crossorigin matching the real chunk requests', async () => { await loadFiles(options); expect(getStylesheetLoader().preloadStylesheets).toHaveBeenCalledWith( ['https://cdn.foo.bar/step-a.css', 'https://cdn.foo.bar/step-b.css'], - { prefetch: true }, + { prefetch: true, crossOrigin: 'anonymous' }, ); }); - describe('when isConsistentCrossOriginFixEnabled is true', () => { - it('prefetches dynamic JS chunks with crossorigin matching the real chunk requests', async () => { - await loadFiles({ ...options, isConsistentCrossOriginFixEnabled: true }); - - expect(getScriptLoader().preloadScripts).toHaveBeenCalledWith( - ['https://cdn.foo.bar/step-a.js', 'https://cdn.foo.bar/step-b.js'], - { prefetch: true, crossOrigin: 'anonymous' }, - ); - }); - - it('prefetches dynamic CSS chunks with crossorigin matching the real chunk requests', async () => { - await loadFiles({ ...options, isConsistentCrossOriginFixEnabled: true }); - - expect(getStylesheetLoader().preloadStylesheets).toHaveBeenCalledWith( - ['https://cdn.foo.bar/step-a.css', 'https://cdn.foo.bar/step-b.css'], - { prefetch: true, crossOrigin: 'anonymous' }, - ); - }); - }); - it('resolves with app version', async () => { const result = await loadFiles(options); diff --git a/packages/core/src/app/loader.ts b/packages/core/src/app/loader.ts index c32b4286e3..01b9207246 100644 --- a/packages/core/src/app/loader.ts +++ b/packages/core/src/app/loader.ts @@ -21,7 +21,6 @@ export interface AssetManifest { export interface LoadFilesOptions { publicPath?: string; - isConsistentCrossOriginFixEnabled?: boolean; } export interface LoadFilesResult { @@ -32,7 +31,6 @@ export interface LoadFilesResult { export function loadFiles(options?: LoadFilesOptions): Promise { const publicPath = configurePublicPath(options && options.publicPath); - const isConsistentCrossOriginFixEnabled = Boolean(options?.isConsistentCrossOriginFixEnabled); const { appVersion, @@ -74,7 +72,7 @@ export function loadFiles(options?: LoadFilesOptions): Promise const preloadOptions = { prefetch: true, - ...(isConsistentCrossOriginFixEnabled && { crossOrigin: 'anonymous' as const }), + crossOrigin: 'anonymous' as const, }; getScriptLoader().preloadScripts(