vanguard icon indicating copy to clipboard operation
vanguard copied to clipboard

Code highlighten broken with re-render

Open chadwhitacre opened this issue 3 years ago • 3 comments

Problem

We're a dev-first company. Code is front-and-center and should look good but does not.

Solution Brainstorm

Some Remix-integrated library already for this?

chadwhitacre avatar Aug 15 '22 16:08 chadwhitacre

I think we'll just need react-prismjs and our prism theme.

ckj avatar Aug 15 '22 16:08 ckj

So we have prism already installed - with the sentry theme even. Gonna look at why its not applying as expected here.

dcramer avatar Aug 16 '22 04:08 dcramer

I dug into this a bit..

The issue is on the client its re-rendering and removing the prism formatting. Ideally what we'd do here is only render this on the server, but the design of Remix doesn't make that convenient. It allows server-specific logic, but only at the route layer. Right now I'm not entirely sure how to fix this, but another option is to load this entirely in the browser (gross).

dcramer avatar Aug 16 '22 15:08 dcramer