Support Babel 8 dependency overrides - #1103
Conversation
✅ Deploy Preview for react-docgen ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
🦋 Changeset detectedLatest commit: 2fcf6eb The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Thanks, I looked into it a little and there seems to be still a bunch of stuff missing. The first thing we need to do is run all tests with babel8 in parallel to babel 7. To see what is breaking. |
d4e6aa4 to
ba11eec
Compare
✅ Deploy Preview for react-docgen ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Sorry for the delay, I just picked this up and am willing to implement it end-to-end, please let me know if you have any preferences or if "fixing what broke" is good enough! |
Summary
Babel 8 dependency overrides fail because react-docgen uses removed parser options and path APIs, and reads TypeScript AST fields that changed in Babel 8.
Use the synchronous config API, preserve Babel 7 parser defaults, replace removed path checks, and support both AST shapes for generic props, inherited interfaces, function types, and mapped types.
Run all library and CLI tests in separate Babel 7 and Babel 8 CI jobs. The Babel 8 jobs replace core, traverse, and types, so CLI subprocesses use Babel 8 too. Keep all jobs and both test suites running when a test fails. Use Babel 8's minimum supported Node.js version on the Node 22 job.
The declared Babel 7 dependency ranges remain unchanged. Packages build against those declared types before the runtime compatibility tests. Contributor instructions include the Babel 8 reproduction commands.
Validation
On macOS with Node.js 24.20.0:
pnpm buildandpnpm lintpass.Closes #1102