[DevTools Bug]: Context display does not support HOC name tagging
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- JavaScript
- Star
- 251k
- Fork
- 51.4k
- Merge trung bình
- 2 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 53
Mô tả
Repro steps
We're using HOCs as a way to tag components with certain concerns, this gives us the ability to trim the React Devtools tree to trim down on components that are irrelevant or out of scope (or even specifically in scope).
This works well, except that the name parsing does not apply for named contexts:
const MyOverlayContext = createContext<ContextData | undefined>(undefined);
MyOverlayContext.displayName = 'overlay(MyOverlayContext)'
// shows up as overlay(MyOverlayContext).Provider, instead of MyOverlayContext.Provider [overlay]
() => <MyOverlayContext.Provider />
(We're aware that this isn't how ExoticNamedComponent or HOCs are meant to be used, but they give us the ability to quickly search the tree for certain tags, quickly filter out many browser- or display-like nodes, like <Button />, ` and so on. If you're taking PRs, I would have a look at that, too.)
How often does this bug happen?
Every time
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.
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện ví dụ named-context và lần theo quá trình phân tích tên hiển thị của context trong DevTools; báo cáo không xác định file hoặc test nào. Hoàn thành khi một context có displayName 'overlay(MyOverlayContext)' được hiển thị là MyOverlayContext.Provider [overlay], với coverage cho trường hợp được báo cáo.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- javascript, react
- Lĩnh vực
- devtools, frontend
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100