jsonnext / codemirror-json-schema

A JSONSchema enabled mode for codemirror 6, for json4 and json5, inspired by monaco-json
https://codemirror-json-schema.netlify.app
MIT License
63 stars 12 forks source link

Lots of generated static js files after updating to 0.7.8 #125

Open oblak1 opened 3 months ago

oblak1 commented 3 months ago

I'm using react v18.2 with vite 5.2.12 and nx v19.2.1

After updating to codemirror-json-schema to 0.7.8 from 0.7.0 I get a lot of autogenerated javascript files when building the project, attaching images before/after below. It generates a file for every language/platform such as wasm,angular,cpp etc.. It could have something to do with the new dep @shikijs/markdown-it - afaik other packages stayed the same. Screenshot 2024-06-07 at 14 38 29 Screenshot 2024-06-07 at 14 39 43

acao commented 3 months ago

also noticed this @oblak1 i will look into it!

andreyqin commented 3 months ago

Hi @acao! Were you able to look into this? Experiencing the same issue which affects performance of my app :cry:

miguelgrc commented 1 month ago

Same issue here, any update @acao ? Rolling back to a previous version for the moment

AlexErrant commented 1 month ago

I think this code is the culprit https://github.com/jsonnext/codemirror-json-schema/blob/4fd7cc69084bdad3c8c93d9d0f0a936fa120cbae/src/utils/markdown.ts#L30-L38

We should use the "Fine-grained Bundle" documented here. Otherwise, "By default, the full bundle of shiki will be imported."

I'd PR a fix, but I'm not sure what language to import. JSON? (Do we even need to import a language at all?)