ZINC-FYP-2022-23 / console

ZINC UI for teaching assistants
1 stars 0 forks source link

feat(gui): replace `js-yaml` with comment-retaining parser library #12

Open AnsonH opened 2 years ago

AnsonH commented 2 years ago

Description

The disadvantage of using js-yaml is that comments are discarded after a round trip (i.e. YAML -> JSON -> YAML). We should use another YAML parsing library that supports comments parsing.

Solution

We can use the following libraries:

yaml is more actively retained (yawn-yaml's last commit is 2 years ago), but yaml's bundle size is huge (29.6 kB minified + gzipped).

yaml

Upon experimentation, this library makes editing a YAML field extremely tedious. Let's say I wish to edit _settings.lang. It involves a lot of relatively low level programming in order to get that field modified.

yawn-yaml

Not working

image

AnsonH commented 1 year ago

Marking this as "Won't Do" means that this is out of the scope of the FYP (due to time limitations). However, this issue will remain open for future maintainers to investigate.

As a workaround, the user is appropriately warned when they create a new config:

image