Define extensions with pinned lexxy #1091
Unanswered
arthurwozniak
asked this question in
Q&A
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi,
inspired by #721 (comment), I tried to add an extension in an app with no JS bundler, where
lexxyis pinned via importmaps.Defining an extension needs imports from lexical (e.g.
defineExtension,FORMAT_TEXT_COMMAND,COMMAND_PRIORITY_HIGH), so I also pinned lexical. The extension loads andregister(editor)runs on the same editor instance the host uses. But the command is never invoked.defineExtensionitself works fine cross-copy, andregisterNodeTransformworks too. So this isn't adefineExtensionproblem, it's specifically anything keyed by object identity or module state.Is there already a supported way to define extensions with a pinned lexxy? It would be great if lexxy re-exported the Lexical API needed for extensions (defineExtension, commands, priorities, $ helpers, node classes) from
lexxy.js, soimport { FORMAT_TEXT_COMMAND } from "lexxy"resolves to the same copy.I assume the original snippet works because it targets a bundler setup. It imports
@37signals/lexxyandlexicalthrough the same bundler, so both resolve to a single shared Lexical copy fromnode_modules, where command object identity lines up.All reactions