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

refactor: Move Prism to the server #1204

Merged
merged 4 commits into from
Dec 7, 2024
Merged

Conversation

rschristian
Copy link
Member

@rschristian rschristian commented Dec 6, 2024

Other half of #1118, effectively.

Like markdown, all of our code blocks can be pre-built on the server, eliminating the need for Prism to run at all on the client. Reduces bundles by ~10kb or so (Netlify preview actually makes it look like ~20kb but that seems to be due to compression differences in preview vs prod envs) and skips a considerably large chunk of client work on nav.

We had a couple of silly language annotations in our content which I've taken the opportunity to fix -- sh has always been converted to bash (even though we don't actually highlight it -- might take a peek at that later & separately), language-node is just a mistake, and lang-jsx (as opposed to language-..., as we use everywhere else) is just an inconsistency we shouldn't support. I've added warning messages on build and right now it only sounds off about language-bash.

Bumping marked could simplify some things a fair bit but they've gone through 15 majors in the last 4.5 years, 5 in the past year alone. That's something for a separate PR.


Everything looks good to me, but would appreciate another set of eyes to quickly skim through as this is a bigger change. Code blocks look right, the "Run in REPL" button seems good, nav, etc.

@rschristian rschristian merged commit 287ce5c into master Dec 7, 2024
5 checks passed
@rschristian rschristian deleted the refactor/prism-off-client branch December 7, 2024 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants