Skip to content

Feature: Add version/build identifier to LexicalEditor #6145

Closed

Description

@etrepum

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementinfra

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions