Separate UI and tools into different entrypoints to create a fully headless editor with minimal bundle size
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.9k
- Forks
- 201
- Avg merge
- 12m
- Merged PRs (30d)
- 1
Description
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:
@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
@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?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue proposes separate core and ui entrypoints or packages, with the listed commands, utilities, types, TextArea helpers, Context, and Editor exports. Start by mapping the current package exports and dependencies around those components; no files or tests are named. Done would mean a documented headless entrypoint that excludes UI components and a UI entrypoint that provides the Editor and styles.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100