You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 55c7329
Browse filesBrowse the repository at this point in the historyBrowse files
feat(babel-plugin): support @babel/core 8 alongside 7 (#4309)
* feat(babel-plugin): support @babel/core 8 alongside 7
Widen the @babel/core peer to ^7.20.12 || ^8.0.0. Babel 8 is npm's
`latest`, so a direct Babel 8 setup (e.g. babel-jest 30) hit a peer
conflict.
- ssr/props: read Scope#uidsSet when present; Scope#uids throws on 8.
- dom/element: t.jSXExpressionContainer alias (removed in 8) renamed.
- Evaluated numbers use t.valueToNode; numericLiteral rejects negative
and non-finite values in @babel/types 8.
- Fixture harness pins jsescOption.minimal=false so snapshots match on
both majors; insertChildren fixtures parenthesize the JSX comma
expression, which Babel 8's parser rejects bare.
- CI: new babel-8 job runs the plugin suite against @babel/core 8.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01ReWJXCS5UoZC6vZ8vmQGJW
* fix(babel-plugin): Babel 8 ImportExpression and TSRX AST shapes
- isDynamic / callsOutsideFunctions treat `ImportExpression` like a call,
so `<Show>{import("./x")}</Show>` stays lazy when `import()` parses as
ImportExpression (Babel 8, or 7 with createImportExpressions). Matched
by node type, not a visitor key, so cores older than 7.23 still load.
- TSRX's ESTree-to-Babel pass targets the running core's major (from
`api.version`): Babel 8 keeps `typeArguments`, Identifier type
parameter names, `ImportExpression`, `TSEnumBody`, `TSImportType.source`,
`TSInterfaceHeritage` / `TSClassImplements` and `superTypeArguments`.
Fixes the generator crash on `function id<T>()` and dropped
`make<number>()` type arguments under Babel 8.
- TSRX no longer drops `import()` options or class method type
parameters (both majors).
- Tests: import-expression.spec.js, and tsrx-babel-ast.spec.js, which
compares TSRX ASTs with the installed core's own TypeScript parse, so
the babel-8 CI job checks the Babel 8 shapes.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01ReWJXCS5UoZC6vZ8vmQGJW
---------
Co-authored-by: Claude <[email protected]>
Support `@babel/core` 8 alongside 7: the peer range is now `^7.20.12 || ^8.0.0`. SSR no longer reads `Scope#uids` (removed in Babel 8), evaluated negative or non-finite numbers are built with `valueToNode`, `import()` parsed as `ImportExpression` stays dynamic, and TSRX emits the AST shape of the running Babel major (type arguments, type parameter names, `import()`, enums, heritage). TSRX also keeps `import()` options and class method type parameters, which it dropped before.
0 commit comments