fix: remove redundant prism-core import that breaks code formatting on logo hover #168
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.
Fix for #167: Code formatting breaks on logo hover
Problem
When hovering over the SeaQL logo in the navbar, Docusaurus prefetches the homepage JS bundle. The HomepageExample.js files in SeaORM, SeaQuery, SeaStreamer, and SeaORM-X all import a standalone prism-core instance and set it as window.Prism at module scope:
When this module-level code executes during prefetch, it overwrites the global window.Prism with a bare-bones prism-core instance, corrupting the syntax highlighting state that Docusaurus theme had already configured. This causes code blocks on the current page to lose their formatting and collapse to a single line.
Root Cause
Fix
Remove the 3 problematic lines from all 4 HomepageExample.js files. The Highlight component continues to work correctly using Docusaurus built-in Prism language registration.
Files Changed
Testing
Closes #167