Skip to content

Conversation

@kdy1
Copy link
Member

@kdy1 kdy1 commented Jan 8, 2026

Summary

  • Convert resolver to VisitMutHook pattern
  • Convert fixer and hygiene to VisitMutHook pattern
  • Migrate TypeScript transform to Pass trait

Test plan

  • Existing tests pass
  • Fixture tests updated to reflect changes

🤖 Generated with Claude Code

kdy1 and others added 2 commits January 8, 2026 11:03
This converts `fixer` and `hygiene` passes to use the `VisitMutHook` pattern,
enabling composition with `CompositeHook`.

Changes:
- Convert `Fixer` struct to `FixerHook` implementing `VisitMutHook<FixerContext>`
- Convert `HygieneRemover` to `HygieneRemoverHook` implementing `VisitMutHook<()>`
- Add `hook()` and `paren_remover_hook()` exports for composable hooks
- Add `hygiene_remover_hook()` export
- Update test expected outputs for correct IIFE paren wrapping

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
This adds a hook-based resolver API (`ResolverHook` implementing
`VisitMutHook<ResolverContext>`) alongside the existing `resolver()`
function.

Key changes:
- Add `ResolverHook` struct implementing `VisitMutHook<ResolverContext>`
- Add `ResolverContext` for stack-based scope management
- Add `OwnedScope` struct (without lifetimes) for the scope stack
- Add `HookHoister` for hoisting in hook pattern
- Export `hook`, `default_context`, `ResolverHook`, `ResolverContext`

The hook-based resolver enables composing the resolver with other hooks
using `CompositeHook` for more efficient single-pass transformations.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@changeset-bot
Copy link

changeset-bot bot commented Jan 8, 2026

⚠️ No Changeset found

Latest commit: 7874b44

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 8, 2026

Merging this PR will degrade performance by 10.22%

Summary

⚡ 1 improved benchmark
❌ 16 regressed benchmarks
✅ 168 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
es/oxc/benches/assets/table.tsx/sourceMap=false/reactDev=true 6.1 ms 6.4 ms -3.46%
es/full/base/fixer 109.8 µs 122.3 µs -10.22%
es/oxc/benches/assets/table.tsx/sourceMap=true/reactDev=false 8 ms 8.2 ms -2.1%
es/full/minify/libraries/terser 507 ms 523.1 ms -3.09%
es/oxc/benches/assets/table.tsx/sourceMap=true/reactDev=true 8.9 ms 9.1 ms -2.31%
es/oxc/benches/assets/UserSettings.tsx/sourceMap=false/reactDev=false 914 µs 935.8 µs -2.33%
es/oxc/benches/assets/renderer.ts/sourceMap=false/reactDev=true 9.2 ms 9.5 ms -3.14%
es/oxc/benches/assets/parser.ts/sourceMap=true/reactDev=false 91.5 ms 93.4 ms -2.01%
es/oxc/benches/assets/UserSettings.tsx/sourceMap=false/reactDev=true 1.1 ms 1.1 ms -2.69%
es/oxc/benches/assets/parser.ts/sourceMap=false/reactDev=true 53.7 ms 55.6 ms -3.39%
es/oxc/benches/assets/UserSettings.tsx/sourceMap=true/reactDev=true 1.4 ms 1.5 ms -2.38%
es/oxc/benches/assets/renderer.ts/sourceMap=false/reactDev=false 9.2 ms 9.5 ms -3.14%
es/oxc/benches/assets/parser.ts/sourceMap=true/reactDev=true 91.3 ms 93.4 ms -2.18%
es/oxc/benches/assets/table.tsx/sourceMap=false/reactDev=false 5.2 ms 5.3 ms -2.93%
es/oxc/benches/assets/parser.ts/sourceMap=false/reactDev=false 53.7 ms 55.6 ms -3.36%
es/fixer/typescript 205.6 ms 227.3 ms -9.54%
es/lints/libs/three 50.7 ms 49.3 ms +2.9%

Comparing kdy1/fixer (7874b44) with main (dd007c6)

Open in CodSpeed

@kdy1 kdy1 closed this Jan 9, 2026
@kdy1 kdy1 deleted the kdy1/fixer branch January 9, 2026 00:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants