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

オープン
#702 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
リファクタリング
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
react, typescript
領域
frontend

調査の方向性

この issue では、列挙されたコマンド、ユーティリティ、型、TextArea ヘルパー、Context、Editor のエクスポートを備えた、core と ui の個別のエントリポイントまたはパッケージを提案しています。まず、これらのコンポーネント周辺にある現在のパッケージのエクスポートと依存関係を整理してください。ファイルやテストは指定されていません。UI コンポーネントを除外するドキュメント化された headless エントリポイントと、Editor およびスタイルを提供する UI エントリポイントがあれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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?

主要言語
TypeScript
スター
2.9k
フォーク
200
平均マージ
6時間 38分
マージ済み PR(30日)
16

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

uiwjs/react-md-editor のほかの issue

uiwjs/react-md-editor の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。