Support Babel 8 in babelParser (loadPartialConfigSync)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 78/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- react, typescript
- Lĩnh vực
- tooling
Hướng nghiên cứu
Bắt đầu từ đường dẫn babelParser đồng bộ được hiển thị trong dist/babelParser.js và kiểm tra lệnh gọi loadPartialConfig. Sử dụng repro.mjs được cung cấp với @babel/core 8.0.1, sau đó xác minh rằng việc phân tích cú pháp thành công với Babel 8 trong khi vẫn duy trì khả năng tương thích với Babel 7.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
react-docgen@8.0.3 cannot parse components when its @babel/core dependency is resolved to Babel 8.
babelParser calls loadPartialConfig synchronously. Starting with Babel 8, that API expects a callback; synchronous callers must use loadPartialConfigSync.
This surfaced through Storybook's react-docgen plugin when a workspace-wide override resolved Babel to 8.0.1. Storybook is currently tracking Babel 8 support and explicitly waiting for react-docgen compatibility: https://github.com/storybookjs/storybook/issues/35295
Minimal reproduction
package.json:
{
"private": true,
"type": "module",
"packageManager": "pnpm@11.13.0",
"dependencies": {
"@babel/core": "8.0.1",
"react-docgen": "8.0.3"
}
}
pnpm-workspace.yaml:
packages:
- .
overrides:
'@babel/core': 8.0.1
repro.mjs:
import { parse } from 'react-docgen';
parse('export const Button = ({ label }) => <button>{label}</button>;');
Run:
pnpm install
node repro.mjs
Actual result
Error: Starting from Babel 8.0.0, the 'loadPartialConfig' function expects a callback. If you need to call it synchronously, please use 'loadPartialConfigSync'.
at loadPartialConfig (.../@babel/core/lib/index-shared.js:2207:11)
at buildPluginList (.../react-docgen/dist/babelParser.js:34:27)
Expected result
Parsing succeeds with Babel 8, while retaining Babel 7 compatibility.
Versions
react-docgen: 8.0.3@babel/core: 8.0.1- Node.js: 24.18.0
- pnpm: 11.13.0
The likely compatibility change is to use loadPartialConfigSync for this synchronous code path; that API is also available in Babel 7.
- Ngôn ngữ chính
- TypeScript
- Star
- 3.8k
- Fork
- 316
- Merge trung bình
- 3 giờ 28 phút
- Pull request đã merge (30 ngày)
- 6
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của reactjs/react-docgen
-
Typescript Status Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
reactjs/react-docgen#1005 · 4 reaction ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
reactjs/react-docgen#997 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 42/100
reactjs/react-docgen#994 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
reactjs/react-docgen#982 · 2 bình luận ·
-
Escapable commas in CLI options? Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
reactjs/react-docgen#962 · 1 bình luận ·
Tất cả issue của reactjs/react-docgen
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
[Bug]: Matrix progress drafts fail with "Matrix runtime not initialized" during tool activity Đang mởbug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Client support matrix inclusion Đang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
calcite-components needs triage refactor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Esri/calcite-design-system#15203 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
danielmiessler/LifeOS#2218 ·