New TOAST UI Editor 🎉🎉🎉
TOAST UI Editor 2.0 is finally release! This release does not contain shiny new features, but this is more about structural changes aimed for preparing for the next huge step. With this release, we concentred on improving the consistency and performance of markdown editing, modularizing of the extensible features, and reducing the bundle size.
You can see a more detailed explanation about this release on the TOAST UI Weekly.
What's New?
ToastMark: a New Markdown Parser
The biggest change in v2.0 is the newly implemented markdown parser, ToastMark. ToastMark is an extension of the opensource CommonMark.js which strictly adheres to the CommonMark specs, and provides an API that can directly access the abstract syntax tree, which contains the markdown documents' source mapping information, enabling us to be able to solve the previous problems.
The following lists enumerate what has been improved in v2.0 by implementing ToastMark.
- More accurate syntax highlighting in markdown editor
- Improved live preview performance and scroll sync accuracy
- Improved cursor location based toolbar button activation
Monorepo Structure
TOAST UI Editor, starting from v2.0, uses monorepo structure with GitHub repository, and all packages related to the editor will be managed under this single repository. The main app as well as the wrapper, Editor's extensible features, and library modules are maintained in the apps
folder, plugins
folder, and libs
folder, respectively.
Separation of Plugin Packages
Starting from v2.0, extensible features like chart and uml are called plugins instead of extensions. As each plugin is registered on npm as a separate package, users can install only what the need.
Reduced Bundle Size
By removing jQuery, separating plugins and internationalization files, and unnecessary codes, we were able to ameliorate the problem of heavy bundle size. If we consider the language files of highlight.js which were unnecessarily included in the bundle before, the total bundle size has reduced from 1.42MB to 582KB.
Breaking Changes
Because of the structural changes above, there are some breaking changes you should care when upgrading to v2.0. Most of the API's are still the same as before, but the way of using plugins and i18n has changed. The full list of changes you should follow to upgrade is well documented in Migration Guide.