fix(codegen): remove spaces around = in minified type parameter defaults#17989
fix(codegen): remove spaces around = in minified type parameter defaults#17989graphite-app[bot] merged 1 commit intomainfrom
= in minified type parameter defaults#17989Conversation
There was a problem hiding this comment.
Pull request overview
This PR optimizes minified output by removing unnecessary spaces around the = operator in TypeScript type parameter defaults and import equals declarations. The changes leverage the existing print_soft_space() method which only prints spaces in non-minified mode.
Changes:
- Remove spaces around
=in type parameter defaults (e.g.,<Props = any>→<Props=any>) - Remove spaces around
=in TypeScript import equals declarations (e.g.,import a = require("a")→import a=require("a")) - Update test snapshots to reflect the new minified output
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| crates/oxc_codegen/src/gen.rs | Replace hardcoded " = " with print_soft_space() + '=' + print_soft_space() in TSTypeParameter and TSImportEqualsDeclaration implementations |
| crates/oxc_codegen/tests/integration/snapshots/minify.snap | Update expected minified output to reflect removal of spaces around = |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merging this PR will not alter performance
Comparing Footnotes
|
Merge activity
|
…aults (#17989) ## Summary - Remove unnecessary spaces around `=` in type parameter defaults - Remove unnecessary spaces around `=` in import equals declarations ## Changes - `<Props = any>` → `<Props=any>` - `import a = require("a")` → `import a=require("a")` Both syntaxes parse correctly without spaces (verified). ## Test plan - [x] All codegen tests pass - [x] All coverage tests pass (100%) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
e1098fd to
30db4d4
Compare
…aults (#17989) ## Summary - Remove unnecessary spaces around `=` in type parameter defaults - Remove unnecessary spaces around `=` in import equals declarations ## Changes - `<Props = any>` → `<Props=any>` - `import a = require("a")` → `import a=require("a")` Both syntaxes parse correctly without spaces (verified). ## Test plan - [x] All codegen tests pass - [x] All coverage tests pass (100%) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
30db4d4 to
9d83519
Compare
…aults (#17989) ## Summary - Remove unnecessary spaces around `=` in type parameter defaults - Remove unnecessary spaces around `=` in import equals declarations ## Changes - `<Props = any>` → `<Props=any>` - `import a = require("a")` → `import a=require("a")` Both syntaxes parse correctly without spaces (verified). ## Test plan - [x] All codegen tests pass - [x] All coverage tests pass (100%) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
9d83519 to
4c16ae7
Compare
Summary
=in type parameter defaults=in import equals declarationsChanges
<Props = any>→<Props=any>import a = require("a")→import a=require("a")Both syntaxes parse correctly without spaces (verified).
Test plan
🤖 Generated with Claude Code