Skip to content

Commit fffec59

Browse files
committed
refactor(@angular/build): relocate oxc-transform to dedicated oxc directory
Moves oxc-transform implementation and its associated test files out of tools/babel/plugins into tools/oxc/.
1 parent 7468813 commit fffec59

7 files changed

Lines changed: 2 additions & 5 deletions

packages/angular/build/src/tools/esbuild/javascript-transformer-worker.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ async function transformJavaScriptImpl(
162162

163163
// Run advanced optimizations using our fast oxc-transform
164164
if (options.advancedOptimizations) {
165-
const { transform } = await import('../babel/plugins/oxc-transform.js');
165+
const { transform } = await import('../oxc/oxc-transform.js');
166166
const sideEffectFree = options.sideEffects === false;
167167
const safeAngularPackage =
168168
sideEffectFree && /[\\/]node_modules[\\/]@angular[\\/]/.test(filename);
@@ -171,7 +171,6 @@ async function transformJavaScriptImpl(
171171
const result = transform(filename, code, {
172172
sourcemap: useInputSourcemap,
173173
sideEffects: options.sideEffects,
174-
jit: options.jit,
175174
topLevelSafeMode,
176175
});
177176
code = result.code;

packages/angular/build/src/tools/babel/plugins/adjust-static-class-members_oxc_spec.ts renamed to packages/angular/build/src/tools/oxc/adjust-static-class-members_oxc_spec.ts

File renamed without changes.

packages/angular/build/src/tools/babel/plugins/adjust-typescript-enums_oxc_spec.ts renamed to packages/angular/build/src/tools/oxc/adjust-typescript-enums_oxc_spec.ts

File renamed without changes.

packages/angular/build/src/tools/babel/plugins/elide-angular-metadata_oxc_spec.ts renamed to packages/angular/build/src/tools/oxc/elide-angular-metadata_oxc_spec.ts

File renamed without changes.

packages/angular/build/src/tools/babel/plugins/oxc-transform.ts renamed to packages/angular/build/src/tools/oxc/oxc-transform.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@ import remapping, { type EncodedSourceMap } from '@ampproject/remapping';
1010
import type { BindingIdentifier, Class, Node } from '@oxc-project/types';
1111
import { MagicString } from 'magic-string';
1212
import { Visitor, parseSync } from 'oxc-parser';
13-
import { loadInputSourceMap } from '../../../utils/source-map';
13+
import { loadInputSourceMap } from '../../utils/source-map';
1414

1515
export interface OxcTransformOptions {
1616
sourcemap?: boolean;
17-
jit?: boolean;
1817
sideEffects?: boolean;
1918
topLevelSafeMode?: boolean;
2019
pureAnnotate?: boolean;
@@ -261,7 +260,6 @@ export function transform(filename: string, code: string, options: OxcTransformO
261260
const s = new MagicString(code);
262261

263262
const sideEffectFree = options.sideEffects === false;
264-
const safeAngularPackage = sideEffectFree && /[\\/]node_modules[\\/]@angular[\\/]/.test(filename);
265263
const topLevelSafeMode = options.topLevelSafeMode ?? false;
266264
const wrapDecorators = sideEffectFree;
267265
const pureAnnotate = options.pureAnnotate ?? true;

packages/angular/build/src/tools/babel/plugins/pure-toplevel-functions_oxc_spec.ts renamed to packages/angular/build/src/tools/oxc/pure-toplevel-functions_oxc_spec.ts

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)