Page MenuHomePhabricator

In-project JSON files should be minified
Open, Needs TriagePublic

Description

Stumbled upon such a problem. Changing the content of the model increases the file size by 6 times. Example:
https://ru.wikipedia.org/w/index.php?title=Модуль:Graph/WorldMap-iso2.json&action=history

This happens because the file is saved with a description of the structure. Everything would be nice, but the file in this form is used in modules. Look at Lua memory usage:
https://de.wikipedia.org/wiki/Benutzer:Iniquity/sandbox.

Current result

When we save the JSON file, the file is saving with a description of the structure (spaces). Unable to change file structure and cannot save file with minified structure.

Expected result

1 variant

The file is always saved in the minified form, but when CodeEditor is enabled, the CodeEditor itself expands it into a readable form.

2 variant

The file structure is not important, but a minified version is always sent to the modules.

Event Timeline

Krinkle removed a project: MediaWiki-ContentHandler.
Krinkle added a subscriber: TheDJ.
Krinkle subscribed.

(Tagging per mw:Maintainers.)

There does not appear to be a performance issue here. The JSON is only served when editing, where we want it to be human readable. As far as I know, it is already minified when it is serialised for consumption by client JS or internal services. I'm not sure what performance issue there would be.

There is however UX issue, in that it should be saved in human readable form to the wiki page, and also be readable on page view. Not sure what's going on there, so leaving up for that reason. Feel free to re-tag as Performance-Team for further input.