swc-project
swc
Blog
Docs
Changelog
Blog
Docs
Changelog
Overview
Branches
Benchmarks
Runs
Performance History
Latest Results
fix(swc): drop spans of cached `globals` values `GlobalPassOption::build` parses each `jsc.transform.optimizer.globals.vars` value into an anonymous file of the `SourceMap` it is handed, and memoizes the parsed expression in a process-wide cache. A span is only meaningful to the `SourceMap` that produced it, so the cache outlives what its contents point at, and the emitted source map ends up depending on three things that should not affect it: whether the call hit the cache, the order the host passed the defines in (the cache key is order sensitive), and which file was compiled first in the process (the cached position is derived from its size). Drop the spans before the value is cached. Parsing still happens in the caller's `SourceMap`, so a syntax error in a define value keeps its position, but nothing `SourceMap` dependent survives into the cache. Substituted values now carry `DUMMY_SP`, which codegen skips, so no mapping is emitted for them on any call.
upupming:fix/inline-globals-span
1 hour ago
fix(swc): drop spans of cached `globals` values `GlobalPassOption::build` parses each `jsc.transform.optimizer.globals.vars` value into an anonymous file of the `SourceMap` it is handed, and memoizes the parsed expression in a process-wide cache. A span is only meaningful to the `SourceMap` that produced it, so the cache outlives what its contents point at, and the emitted source map ends up depending on three things that should not affect it: whether the call hit the cache, the order the host passed the defines in (the cache key is order sensitive), and which file was compiled first in the process (the cached position is derived from its size). Drop the spans before the value is cached. Parsing still happens in the caller's `SourceMap`, so a syntax error in a define value keeps its position, but nothing `SourceMap` dependent survives into the cache. Substituted values now carry `DUMMY_SP`, which codegen skips, so no mapping is emitted for them on any call.
upupming:fix/inline-globals-span
2 hours ago
fix(es/optimization): give substituted globals the span they replace
upupming:fix/inline-globals-span
8 hours ago
test(parser): remove codegen dev dependency
trueadm:codex/tsrx-parser
1 day ago
chore: Add changeset
trueadm:codex/tsrx-parser
1 day ago
fix(es/react): handle apos JSX entities (#12125) **Description:** Fixes a panic when JSX text contains `'` followed by another supported character reference, for example: ```jsx const a = <p>'&</p>; ``` SWC's JSX lexer already decodes `'`, but the React transform maintains an independent entity list for correlating decoded JSX text with its raw source. Because that list did not include `apos`, the decoded and raw character offsets could diverge and cause entity mask construction to panic. This change recognizes `apos` in the transform's entity list, restoring consistency with SWC's existing parser behavior. Although the [JSX specification](https://react.github.io/jsx/#sec-HTMLCharacterReference) text limits named references to HTML4's 252 entities, Babel and TypeScript also decode `apos`. This option preserves that de-facto compatibility behavior. **BREAKING CHANGE:** No. **Related issue (if exists):** - Close: #12123
main
2 days ago
fix(es/minifier): Preserve for init (#12121) **Related issue:** - Closes #12118
main
2 days ago
fix
Austaras:main
2 days ago
Latest Branches
CodSpeed Performance Gauge
0%
fix(swc): drop spans of cached `globals` values
#12129
1 hour ago
d1af188
upupming:fix/inline-globals-span
CodSpeed Performance Gauge
0%
feat(es/parser): add opt-in parser-only TSRX lowering
#12120
1 day ago
187e9ad
trueadm:codex/tsrx-parser
CodSpeed Performance Gauge
0%
fix(es/minifier): Preserve for init
#12121
2 days ago
4eeac46
Austaras:main
© 2026 CodSpeed Technology
Home
Terms
Privacy
Docs