-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Feature: Add version/build identifier to LexicalEditor #6145
Description
It's useful when debugging, and will presumably be useful for devtools, if details of the lexical build are present in the editor. The __DEV__ checks could also use this introspection capability to help people debug the dreaded LexicalComposerContext.useLexicalComposerContext: cannot find a LexicalComposerContext when there is a bundler configuration issue causing multiple builds of lexical to be present. Possibly something like '0.15.0+dev.cjs' or '0.15.0+prod.esm'.
It could be present on the editor as a static, so it would be accessible with lexicalEditor.constructor.version.
I think the three important things are:
- Version
- CJS/ESM
- prod/dev
It wouldn't prevent all possible problems (e.g. a dependency could bundle the same build of lexical not as an external) but I think it would be helpful and have negligible impact to build size or runtime.