refactor: Move Prism to the server #1204
Merged
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.
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 tobash
(even though we don't actually highlight it -- might take a peek at that later & separately),language-node
is just a mistake, andlang-jsx
(as opposed tolanguage-...
, 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 aboutlanguage-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.