You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit cf2f30a
Browse filesBrowse the repository at this point in the historyBrowse files
fix(@angular-devkit/build-angular): downlevel class fields with Safari <= v15 for esbuild
To provide a workaround for a Safari bug involving class fields and variable scoping,
the esbuild-based browser application builder will now downlevel class fields if Safari
(desktop or iOS) v15.x or earlier is within the target browsers for an application.
This is an esbuild variant of the fix for the Webpack-based builder. For more details
regarding the issue, please see: #24357
Copy file name to clipboardExpand all lines: packages/angular_devkit/build_angular/src/builders/browser-esbuild/index.ts
+52-13Lines changed: 52 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -253,19 +253,7 @@ function createCodeBundleOptions(
253
253
entryNames: outputNames.bundles,
254
254
assetNames: outputNames.media,
255
255
target,
256
-
supported: {
257
-
// Native async/await is not supported with Zone.js. Disabling support here will cause
258
-
// esbuild to downlevel async/await and for await...of to a Zone.js supported form. However, esbuild
259
-
// does not currently support downleveling async generators. Instead babel is used within the JS/TS
260
-
// loader to perform the downlevel transformation.
261
-
// NOTE: If esbuild adds support in the future, the babel support for async generators can be disabled.
262
-
'async-await': false,
263
-
// V8 currently has a performance defect involving object spread operations that can cause signficant
264
-
// degradation in runtime performance. By not supporting the language feature here, a downlevel form
265
-
// will be used instead which provides a workaround for the performance issue.
266
-
// For more details: https://bugs.chromium.org/p/v8/issues/detail?id=11536
267
-
'object-rest-spread': false,
268
-
},
256
+
supported: getFeatureSupport(target),
269
257
mainFields: ['es2020','browser','module','main'],
270
258
conditions: ['es2020','es2015','module'],
271
259
resolveExtensions: ['.ts','.tsx','.mjs','.js'],
@@ -314,6 +302,57 @@ function createCodeBundleOptions(
314
302
};
315
303
}
316
304
305
+
/**
306
+
* Generates a syntax feature object map for Angular applications based on a list of targets.
307
+
* A full set of feature names can be found here: https://esbuild.github.io/api/#supported
308
+
* @param target An array of browser/engine targets in the format accepted by the esbuild `target` option.
309
+
* @returns An object that can be used with the esbuild build `supported` option.
0 commit comments