rxdb icon indicating copy to clipboard operation
rxdb copied to clipboard

feat: use shiki for ssr codeblocks

Open polvallverdu opened this issue 2 months ago • 4 comments

This PR contains:

  • IMPROVED DOCS

Describe the problem you have without this PR

I've switch from prismjs to shiki, using rehype to compile the codeblocks at build-time, not on the client.

Only detail is that the dracula theme changes from prismjs to shiki, here are some screenshots:

Currently, with prismjs Screenshot 2025-10-27 at 22 24 06

With shiki Screenshot 2025-10-27 at 22 23 37

I'm exploring rxdb for a personal sideproject, and I'd like to test some of the premium features to make it more performant, as per the premium task list.

Todos

  • [ ] Tests
  • [ ] Changelog

polvallverdu avatar Oct 27 '25 13:10 polvallverdu

I use prettier on save, and it formatted the docusaurus config file quite a lot. I couldn't find a formatter on the project to use.

polvallverdu avatar Oct 27 '25 13:10 polvallverdu

Hi @polvallverdu This PR adds shiki but does not remove the prismjs from the main javascript bundle which was the main reason to switch from something else. Please check the build main.js file by running npm run docs:build it should not contain prismjs afterwards.

Changing the theme and style is no problem. I think it looks ok to me.

pubkey avatar Oct 30 '25 22:10 pubkey

Yeah, I see... I think docusaurus comes with prismjs prebundled, even some examples that use shiki still pull prismjs. Let me try a few things and see what I can do.

polvallverdu avatar Nov 09 '25 20:11 polvallverdu

I think it has to be excluded with via webpack config somehow.

pubkey avatar Dec 01 '25 09:12 pubkey

#7590 seems to have got it, I think we can close this

polvallverdu avatar Dec 08 '25 17:12 polvallverdu