Separate UI and tools into different entrypoints to create a fully headless editor with minimal bundle size

Đang mở
#702 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
25/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
react, typescript
Lĩnh vực
frontend

Hướng nghiên cứu

Issue đề xuất các entrypoint hoặc package riêng biệt core và ui, với các command, utility, type, helper của TextArea, Context và export của Editor được liệt kê. Hãy bắt đầu bằng cách lập bản đồ các package export và dependency hiện tại liên quan đến những component này; không có file hoặc test nào được nêu tên. Công việc được xem là hoàn tất khi có một headless entrypoint được tài liệu hóa, loại trừ các UI component, và một UI entrypoint cung cấp Editor cùng styles.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

First of all, love the package and I think it fills a gap in the ecosystem.

I'm creating this issue to discuss and get alignment on a possible future refactor that would allow this package to be even more useful.

After https://github.com/uiwjs/react-md-editor/pull/697 the package already allows to replace all UI elements and use your own, which is great for uses when the look and feel is meant to come from an external component/design system. The only problem is that right now the bundle still includes some UI components, so they are added to the application's final bundle size even if they're not needed.

What do you think about separating the package like this:

  1. @uiwjs/react-md-editor/core: exports all headless tools and utilities, allowing the user the build a fully custom UI with them

Exports:

  • commands
  • utils
  • types
  • components/TextArea/shortcuts
  • components/TextArea/handleKeyDown
  • Context
  1. @uiwjs/react-md-editor/ui: ready-made React components, allowing the user to quickly integrate an existing editor into their application

Exports:

  • Editor

Bundles LESS styles
Uses the core package internally


Alternatively, they could be separate packages, published separately.

I may be forgetting an import here or there, but I hope this describes the idea.

Do you have any questions, concerns, thoughts on this? Maybe we could agree on a final scope and take this into consideration for the next major version?

Ngôn ngữ chính
TypeScript
Star
2.9k
Fork
200
Merge trung bình
6 giờ 38 phút
Pull request đã merge (30 ngày)
16

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của uiwjs/react-md-editor

Tất cả issue của uiwjs/react-md-editor

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.