@@ -23,15 +23,6 @@ import { loadEsmModule } from '../../../utils/load-esm';
2323 */
2424let needsLinking : typeof import ( '@angular/compiler-cli/linker' ) . needsLinking | undefined ;
2525
26- /**
27- * List of browsers which are affected by a WebKit bug where class field
28- * initializers might have incorrect variable scopes.
29- *
30- * See: https://github.com/angular/angular-cli/issues/24355#issuecomment-1333477033
31- * See: https://github.com/WebKit/WebKit/commit/e8788a34b3d5f5b4edd7ff6450b80936bff396f2
32- */
33- let safariClassFieldScopeBugBrowsers : ReadonlySet < string > ;
34-
3526export type DiagnosticReporter = ( type : 'error' | 'warning' | 'info' , message : string ) => void ;
3627
3728/**
@@ -188,37 +179,12 @@ export default function (api: unknown, options: ApplicationPresetOptions) {
188179 // However, this doesn't effect libraries and hence we use preset-env to downlevel ES features
189180 // based on the supported browsers in browserslist.
190181 if ( options . supportedBrowsers ) {
191- const includePlugins : string [ ] = [ ] ;
192-
193- if ( safariClassFieldScopeBugBrowsers === undefined ) {
194- const browserslist = require ( 'browserslist' ) as typeof import ( 'browserslist' ) ;
195- safariClassFieldScopeBugBrowsers = new Set (
196- browserslist ( [
197- // Safari <15 is technically not supported via https://angular.dev/reference/versions#browser-support
198- // but we apply the workaround if forcibly selected.
199- 'Safari <=15' ,
200- 'iOS <=15' ,
201- ] ) ,
202- ) ;
203- }
204-
205- // If a Safari browser affected by the class field scope bug is selected, we
206- // downlevel class properties by ensuring the class properties Babel plugin
207- // is always included- regardless of the preset-env targets.
208- if ( options . supportedBrowsers . some ( ( b ) => safariClassFieldScopeBugBrowsers . has ( b ) ) ) {
209- includePlugins . push (
210- '@babel/plugin-proposal-class-properties' ,
211- '@babel/plugin-proposal-private-methods' ,
212- ) ;
213- }
214-
215182 presets . push ( [
216183 require ( '@babel/preset-env' ) . default ,
217184 {
218185 bugfixes : true ,
219186 modules : false ,
220187 targets : options . supportedBrowsers ,
221- include : includePlugins ,
222188 exclude : [ 'transform-typeof-symbol' ] ,
223189 } ,
224190 ] ) ;
0 commit comments