From fb8e3c39a8b265003e98c8c6b5a9ec898223249f Mon Sep 17 00:00:00 2001 From: Charles Lyding <19598772+clydin@users.noreply.github.com> Date: Mon, 1 Jul 2024 16:48:05 -0400 Subject: [PATCH] fix(@angular/build): allow top-level await in zoneless applications With the potential future introduction of features such as WASM/ES module integration and the experimental chunk optimizer, the need to restrict top-level await usage is no longer needed and a blocker for new features. As such, top-level await will now be available if an application has been configured to be zoneless. Zoneless Angular is currently experimental and more details can be found here: https://angular.dev/guide/experimental/zoneless (cherry picked from commit fea8044f996dbb53e93e2c34774e0e72dbbb5b87) --- packages/angular/build/src/tools/esbuild/utils.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/angular/build/src/tools/esbuild/utils.ts b/packages/angular/build/src/tools/esbuild/utils.ts index 3b64ddd60e83..2f13ebee3c4f 100644 --- a/packages/angular/build/src/tools/esbuild/utils.ts +++ b/packages/angular/build/src/tools/esbuild/utils.ts @@ -180,8 +180,6 @@ export function getFeatureSupport( // will be used instead which provides a workaround for the performance issue. // For more details: https://bugs.chromium.org/p/v8/issues/detail?id=11536 'object-rest-spread': false, - // Using top-level-await is not guaranteed to be safe with some code optimizations. - 'top-level-await': false, }; // Detect Safari browser versions that have a class field behavior bug