@@ -23,15 +23,6 @@ import { loadEsmModule } from '../../../utils/load-esm';
23
23
*/
24
24
let needsLinking : typeof import ( '@angular/compiler-cli/linker' ) . needsLinking | undefined ;
25
25
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
-
35
26
export type DiagnosticReporter = ( type : 'error' | 'warning' | 'info' , message : string ) => void ;
36
27
37
28
/**
@@ -188,37 +179,12 @@ export default function (api: unknown, options: ApplicationPresetOptions) {
188
179
// However, this doesn't effect libraries and hence we use preset-env to downlevel ES features
189
180
// based on the supported browsers in browserslist.
190
181
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
-
215
182
presets . push ( [
216
183
require ( '@babel/preset-env' ) . default ,
217
184
{
218
185
bugfixes : true ,
219
186
modules : false ,
220
187
targets : options . supportedBrowsers ,
221
- include : includePlugins ,
222
188
exclude : [ 'transform-typeof-symbol' ] ,
223
189
} ,
224
190
] ) ;
0 commit comments