Skip to content

Split Content Model code (step 1)#1905

Merged
JiuqingSong merged 10 commits intomasterfrom
u/jisong/splitcontentmodel
Jun 22, 2023
Merged

Split Content Model code (step 1)#1905
JiuqingSong merged 10 commits intomasterfrom
u/jisong/splitcontentmodel

Conversation

@JiuqingSong
Copy link
Collaborator

@JiuqingSong JiuqingSong commented Jun 20, 2023

To better consume Content Model and reduce initial bundle size, I'm splitting content model code into several packages, including

  • roosterjs-content-model-types: Similar with roosterjs-editor-types, it provides type definitions for Content Model. This package will not generate any target js file
  • roosterjs-content-model-dom: This package provides dom-to-model and model-to-dom conversion
  • roosterjs-content-model-editor: This package provides ContentModelEditor and its core API, core plugins and other plugins, as well as format API. For now I have not split them into different packages like roosterjs-editor-core, roosterjs-editor-api, roosterjs-editor-plugins. But later we may do this change if need.
  • roosterjs-content-model: Provide a general API createContentModelEditor(), also re-export functions from other packages

I also moved content model code to folder packages-content-model. After this change, the folder structure is like

  • root
    • packages
      • roosterjs-editor-types
      • roosterjs-editor-dom
      • roosterjs-editor-core
      • roosterjs-editor-api
      • roosterjs-editor-plugins
      • roosterjs-color-utils
      • roosterjs-editor-types-compatible
      • roosterjs
    • packages-ui
      • roosterjs-react
    • packages-content-model
      • roosterjs-content-model-types
      • roosterjs-content-model-dom
      • roosterjs-content-model-editor
      • roosterjs-content-model

Also fixed test cases, and build scripts to adopt new file structures.

After this change, the bundle layout of content model is
image

@JiuqingSong JiuqingSong changed the title Split Content Model (draft) Split Content Model code (step 1) Jun 22, 2023
@JiuqingSong JiuqingSong marked this pull request as ready for review June 22, 2023 05:39
@JiuqingSong JiuqingSong merged commit 98fcf47 into master Jun 22, 2023
@JiuqingSong JiuqingSong deleted the u/jisong/splitcontentmodel branch June 22, 2023 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants