Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add version/build identifier to LexicalEditor #6145

Open
etrepum opened this issue May 20, 2024 · 0 comments
Open

Feature: Add version/build identifier to LexicalEditor #6145

etrepum opened this issue May 20, 2024 · 0 comments
Labels
enhancement Improvement over existing feature infra

Comments

@etrepum
Copy link
Contributor

etrepum commented May 20, 2024

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-cjs-dev' or '0.15.0-esm-prod'. I don't have any strong opinions on the format of the version or build string that is included.

It could be present on the editor as a static, so it would be accessible with lexicalEditor.constructor.BUILD_IDENTIFIER or whatever naming convention is decided upon.

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.

@etrepum etrepum added the enhancement Improvement over existing feature label May 20, 2024
@StyleT StyleT added the infra label Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement over existing feature infra
Projects
None yet
Development

No branches or pull requests

2 participants