confbox icon indicating copy to clipboard operation
confbox copied to clipboard

switch from js-yaml to yaml

Open pi0 opened this issue 1 year ago • 4 comments

Context: Pointed out by @remcohaszing in x npm:yaml is much more spec-compliant than npm:js-yaml

The main reason for choosing js-yaml was that it is ~10x faster and it is important for recurring reads (especially for cases like markdown front matter) but if spec compliant is better I think switch would make sense.

pi0 avatar Oct 06 '24 22:10 pi0

You can see some reasoning in https://github.com/orgs/remarkjs/discussions/1006#discussioncomment-2955255. Also js-yaml hasn’t been updated for a while. It appears to be abandoned.

remcohaszing avatar Oct 07 '24 07:10 remcohaszing

(seems pnpm is using js-yaml now too https://pnpm.io/package_json)

pi0 avatar May 30 '25 10:05 pi0

Another benefit of yaml over js-yaml is that it has a powerful AST API. It can preserve comments and to some extent formatting.

remcohaszing avatar May 30 '25 11:05 remcohaszing

Yeah i agree comment alone is really good reason to move for us. Just mentioned as found about it today about pnpm.

pi0 avatar May 30 '25 11:05 pi0

I support this, I'm also looking for a great all in one solution for AST generation for all of these file types, specifically in the context of OpenAPI files.

LukeHagar avatar Dec 03 '25 17:12 LukeHagar