fix(angular-compiler): improve handling of type elision for imports/exports#2257
Conversation
Imports referenced only in `export type { Foo }` or `export { type Foo }`
were incorrectly treated as value references, preventing elision. The
walker now skips type-only export specifiers while still walking value
re-exports and export declarations normally.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
✅ Deploy Preview for analog-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for analog-app ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for analog-blog ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📝 WalkthroughWalkthroughThe changes expand type-elision testing and implementation to handle TypeScript export-context usages. Documentation in COMPILER.md was updated to reflect increased test coverage (from 31 to 45 tests). The Vitest suite (type-elision.spec.ts) was extended with many cases covering Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…sitions Verify typeof in type positions, enum dual usage, class extends, instanceof, and extends+implements are handled correctly by the type-only import detection. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
PR Checklist
Affected scope
Recommended merge strategy for maintainer [optional]
What is the new behavior?
Fix type-elision incorrectly treating
export type { Foo }andexport { type Foo }as value references, which prevented the corresponding imports from being elided.Test plan
npx vitest run packages/angular-compiler/src/lib/type-elision.spec.ts— 40 tests passing (9 new)npx vitest run packages/angular-compiler/src/lib/integration.spec.ts— 76 tests passingpnpm buildpnpm testDoes this PR introduce a breaking change?
Other information