Files
Donny/강동윤andGitHub 717ea8a9a2 refactor: Remove production tracing hooks (#11945)
**Description:**

This removes the production tracing implementation paths from SWC while
preserving the JS and CLI compatibility surfaces as deprecated no-ops.

- Delete the `swc_timer` and `swc_trace_macro` crates.
- Remove `swc_core`'s `trace_macro` feature and re-export.
- Remove timer and `#[swc_trace]` usages from Rust crates.
- Gate remaining tracing spans/events/instrumentation so they do not run
in release builds.
- Keep JS, Node binding, and CLI trace APIs available as deprecated
no-ops.
- Remove unused tracing subscriber/chrome dependencies and refresh
committed lockfiles.

**BREAKING CHANGE:**

The Rust crates `swc_timer` and `swc_trace_macro` are removed. The
`swc_core/trace_macro` feature is removed instead of being kept as a
compatibility alias. JS and CLI trace entrypoints remain available but
are deprecated no-ops and no trace output files are produced.

**Validation:**

- `git submodule update --init --recursive`
- `cargo fmt --all`
- `cargo check --all --all-targets`
- `cargo check --release --all --all-targets`
- `cargo clippy --all --all-targets -- -D warnings`
- `pnpm install --frozen-lockfile`
- `(cd packages/core && pnpm build:dev && pnpm test)`
- `(cd packages/minifier && pnpm build:dev && pnpm test)`
- Verified no remaining `swc_timer`, `swc_trace_macro`, `trace_macro`,
`timer!`, or `#[swc_trace]` references in source/manifests/lockfiles.

Broad `cargo test` was attempted and stopped on unrelated/environment
issues: an existing Flow fixture failure in `swc`, missing local `deno`
for `swc_bundler`, and a helper fixture diff in
`swc_ecma_transforms_base`.

**Related issue (if exists):**

N/A
2026-06-18 17:24:12 +09:00

61 lines
2.5 KiB
TypeScript

/* auto-generated by NAPI-RS */
/* eslint-disable */
export class Compiler {
constructor()
}
export type JsCompiler = Compiler
export declare function analyze(src: string, options: Buffer, signal?: AbortSignal | undefined | null): Promise<string>
export declare function bundle(confItems: Buffer, signal?: AbortSignal | undefined | null): Promise<{ [index: string]: { code: string, map?: string } }>
export declare function getTargetTriple(): string
/** @deprecated Trace profiling is disabled. This function is kept as a no-op for compatibility. */
export declare function initCustomTraceSubscriber(traceOutFilePath?: string | undefined | null): void
export declare function minify(code: Buffer, opts: Buffer, isJson: boolean, extras: NapiMinifyExtra, signal?: AbortSignal | undefined | null): Promise<TransformOutput>
export declare function minifySync(code: Buffer, opts: Buffer, isJson: boolean, extras: NapiMinifyExtra): TransformOutput
export interface NapiMinifyExtra {
mangleNameCache?: object
}
export declare function newMangleNameCache(): object
export declare function parse(src: Buffer | string, options: Buffer, filename?: string | undefined | null, signal?: AbortSignal | undefined | null): Promise<string>
export declare function parseFile(path: string, options: Buffer, signal?: AbortSignal | undefined | null): Promise<string>
export declare function parseFileSync(path: string, opts: Buffer): string
export declare function parseSync(src: Buffer | string, opts: Buffer, filename?: string | undefined | null): string
export declare function print(programJson: string, options: Buffer, signal?: AbortSignal | undefined | null): Promise<TransformOutput>
export declare function printSync(program: string, options: Buffer): TransformOutput
export declare function transform(src: string, isModule: boolean, options: Buffer, signal?: AbortSignal | undefined | null): Promise<TransformOutput>
export declare function transformFile(src: string, isModule: boolean, options: Buffer, signal?: AbortSignal | undefined | null): Promise<TransformOutput>
export declare function transformFileSync(s: string, isModule: boolean, opts: Buffer): TransformOutput
export interface TransformOutput {
code: string
map?: string
output?: string
extractedComments?: Array<string>
diagnostics: Array<string>
}
/** Hack for `Type Generation` */
export interface TransformOutput {
code: string
map?: string
}
export declare function transformSync(s: string, isModule: boolean, opts: Buffer): TransformOutput