[lexical-code] Breaking Change: Extract Prism code highlighting to @lexical/code-prism (with internal module @lexical/code-core to avoid circular import)#8198
Merged
etrepum merged 9 commits intofacebook:mainfrom Mar 8, 2026
Conversation
…exical/code-prism (with internal module @lexical/code-core to avoid circular import)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
zurfyx
approved these changes
Mar 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Breaking Changes
Imports of Prism highlighting functionality should be changed from
@lexical/codeto@lexical/code-prism. These deprecated exports will be available for the next few versions of lexical (roughly ~0.47.0) to ease the transition.PrismTokenizerregisterCodeHighlightingTokenizerCODE_LANGUAGE_FRIENDLY_NAME_MAPCODE_LANGUAGE_MAPgetCodeLanguageOptionsgetCodeLanguagesgetCodeThemeOptionsgetLanguageFriendlyNameisCodeLanguageLoadedloadCodeLanguagenormalizeCodeLang(also renamed tonormalizeCodeLanguagein the move)The dependency from
@lexical/markdownto@lexical/codehas been changed to a new (temporary)@lexical/code-corepackage to avoid a transitive dependency on Prism. If you are directly using@lexical/codefunctionality without an explicit dependency on@lexical/codeyou may need to add one to your package.json (and/or change the dependency to@lexical/code-corefor now)Previously deprecated exports from
@lexical/codethat were missing the$prefixes have been removed.Description
Moves the functionality from
@lexical/codeto internal package@lexical/code-coreso that@lexical/codecan maintain short term export compatibility for highlighting functionality.Moves all Prism highlighting code to an independent
@lexical/code-prismpackageCloses #8197
Closes #5381
Test plan
Existing e2e, unit, and integration tests pass.