josdejong / jsoneditor

A web-based tool to view, edit, format, and validate JSON
http://jsoneditoronline.org
Apache License 2.0
11.63k stars 2.04k forks source link

Minimal version, exclude unneeded languages and modes #1438

Open mbeekhuis opened 2 years ago

mbeekhuis commented 2 years ago

Hi Jos

I'd like to have a real minimal version of jsoneditor, excluding Ace, Color picker etc ... unneeded languages and unneeded modes (I only need 'en' and tree mode). Is this possible using browserify and without hard coding?

josdejong commented 2 years ago

In the dist folder you'll find a smaller dist/jsoneditor-minimalist.min.js file which excludes ace, ajv and color picker, see dist/which files do I need.md for more explanation.

See: https://unpkg.com/browse/jsoneditor@9.7.4/dist/

mbeekhuis commented 2 years ago

Hi Jos thank's! I already use this "minimalist"-file, but wonder if there's a possibility to exlcude uneeded languages and modes as well ...

josdejong commented 2 years ago

There is currently no way to exclude unneeded languages.

I see the i18n.js file is currently 49 KB (not minified and not zipped), and the jsoneditor-minimalist.min.js file is 296 KB, so I guess including only one or two languages could save like 40 KB or so on the 296 KB file, which is a relevant amount.

I will not implement a solution for this myself on short term, but help would be welcome.

mbeekhuis commented 2 years ago

Hi Jos I think the file would shrink even more if there would be an option to exclude modes as well (if only one mode needed).

josdejong commented 2 years ago

Yes you're right, excluding modes would also help.

Anyone interested in looking into excluding modes/languages?