github facebook/lexical v0.5.0

latest releases: v0.14.5, v0.14.4, v0.14.4-next.0...
pre-release19 months ago

v0.5.0 (20 days after v0.4.0) comes with a meaty set of features, API refinements and bugfixes.

Draggable blocks

One of the most beloved features of Notion is the ability to seamlessly move blocks within the same document. @LuciNyan has ported this behavior to Lexical under the DraggableBlockPlugin name. You can check it out in our playground!

2022-09-14.23.41.11.mov

LexicalTablePlugin makes its way to Meta production

We started our tables (@lexical/react/LexicalTablePlugin) development at the start of the year, one of the most ambitious and complex plugins we have built for rich text. We have blocked a good amount of time during this past month to work with multiple internal teams to identify and squash most of these (10+) high-pri bugs that make the experience unideal and we believe they are now in a good shape to meet their first internal users.

Screen Shot 2022-09-23 at 3 08 54 pm

Shadow Root

We have introduced a new advanced concept for Lexical ElementNodes: [Shadow Root](https://lexical.dev/docs/api/classes/lexical.ElementNode#isshadowroot). A Shadow Root is a Node that behaves like a root (we stole the name from Shadow DOM). This method enables you to have complex deep rich text hierarchies where children node shouldn't see beyond the parent. For example, the cell node content.

$insertNodes with NodeSelection and GridSelection support

We introduced a seamless way to handle node insertion. We bundled {rangeSelection/nodeSelection/gridSelection}.insertNode into just one method: $insertNodes. We also added insertNodes support for NodeSelection and GridSelection that was previously not supported.

Screen.Recording.2022-07-13.at.3.37.18.pm.mov

Various API changes

  1. PlainTextPlugin and RichTextPlugin will no longer take an initialEditorState. We found that this is unintuitive to handle nested editors and harder to control SSR-enabled pages. Instead, MLCComposer will take and apply the initialEditorState on editor creation
  2. We killed INERT nodes. We found them cumbersome to use, not accessible and they didn't meet the requirements for our one and only use case (AutocompletePlugin) where private node data is required. Instead, the recommended approach for now is to use a DecoratorNode.
  3. We deprecated the Grid API. The future of the Grid API is uncertain but if there's something we know is that it isn't a good fit in the lexical package, it serves a very specific use case and it's redundant for plain text.
  4. Killed isTopElement in favor for isInline on ElementNodes to reflect what they do better.
  5. And some more (see [0.5] prefixed in the list below).

Lots of bugfixes

  • Formatting, composition, MD, etc. (see changelog below for a complete list).

Release automation: nightly releases

We listened to your (mostly Discord) feedback, you want to have the latest, more frequently, especially when some of you are heavily involved into the development and growth of the Lexical framework.

The reality is, we didn't choose to postpone releases for 2 weeks. It has mostly been a lack of automation and making sure we bundle breaking API changes to avoid developer churn.

We know that there's no one-size-fits-all when it comes to developers, and that's why we want to offer different ways to play with the library, what we have now, a slow-ish but less time-consuming (for you) release cycle but also offer nightly releases that would happen automatically once per day and would include the very latest of the development.

The work is still under development but we plan to start this soon, stay tuned!

Changelog

New Contributors

Full Changelog: v0.4.1...v0.5.0


Thank you open-source community for your help shaping this brand new release, either via direct PR contributions, feedback or bug reports!

Don't miss a new lexical release

NewReleases is sending notifications on new releases.