swc-project
swc
Blog
Docs
Changelog
Blog
Docs
Changelog
Overview
Branches
Benchmarks
Runs
Performance History
Latest Results
fix(es/ast): support hashing non-finite numbers (#12043) **Description:** Canonicalize non-finite numeric values in `Lit::Num` while preserving the existing ECMA AST `Hash` API. SWC currently represents `Infinity` and `NaN` in several forms. `eval_global_vars` rewrites `Infinity` to `1 / 0`, while `eval_numbers` can rewrite division by zero back to an `Infinity` identifier. Other constant-evaluation paths produce `Lit::Num(INFINITY)`, which codegen prints as `Infinity`. This churn makes optimization passes repeatedly recognize equivalent values in different AST forms. Follow esbuild’s approach of using semantic constants during optimization. Allow `Lit::Num` to store valid JavaScript non-finite values as the canonical internal representation, and leave syntax selection to codegen. Codegen can emit readable `Infinity` and `NaN` when safe or shorter `1 / 0` and `0 / 0` when minifying. **BREAKING CHANGE:** `Number` now treats all NaN values as equal and distinguishes `-0.0` from `+0.0`.
main
1 hour ago
chore: Add changeset for identity rename optimization
kdy1:kdy1/changeset-12041
4 hours ago
perf(es/renamer): Skip identity rename mappings on apply (#12041) **Description:** Hygiene often builds a rename map that is almost entirely identity entries (`foo` → `foo`). The apply Operator already no-ops those lookups, but still walks the full AST. This change: - Keeps identity entries in the map **during** analysis so later scopes can still skip via `to.get(id)` (required when hygiene runs without resolver; shared Ids would otherwise blow up the reverse map). - Strips identity entries with `map.retain` **before** apply when `keep_class_names` is off. - Leaves identity entries in place when `keep_class_names` is on, so Operator can still rewrite `class Foo` into `let Foo = class Foo` (existing behavior relied on a non-empty identity map). Minifier `keep_classnames` preserves class Ids so they never enter the map and still skip apply.
main
4 hours ago
fix(es/ast): support hashing non-finite numbers
fix/ecma-number-hash
4 hours ago
refactor(es/ast): Remove Hash from ECMA AST nodes
refactor/remove-ecma-ast-hash
6 hours ago
fix(es/hygiene): Preserve identity map when keep_class_names Only strip identity rename entries when keep_class_names is off, so Operator still rewrites class decls for that path while minifier keep_classnames fixtures stay unchanged.
hamidrezahanafi:perf/hygiene-skip-identity-apply
7 hours ago
perf(es/hygiene): Skip identity rename mappings on apply
hamidrezahanafi:perf/hygiene-skip-identity-apply
8 hours ago
fix(ts/fast-strip): Preserve ASI before interpolated templates (#12040) **Related issue:** - Closes #12039
main
9 hours ago
Latest Branches
CodSpeed Performance Gauge
0%
chore: Add changeset for identity rename optimization
#12044
4 hours ago
203d5c1
kdy1:kdy1/changeset-12041
CodSpeed Performance Gauge
0%
fix(es/ast): support hashing non-finite numbers
#12043
4 hours ago
d9854d2
fix/ecma-number-hash
CodSpeed Performance Gauge
0%
refactor(es/ast): Remove Hash from ECMA AST nodes
#12042
7 hours ago
ac7d6e1
refactor/remove-ecma-ast-hash
© 2026 CodSpeed Technology
Home
Terms
Privacy
Docs