jonschlinkert / gray-matter

Smarter YAML front matter parser, used by metalsmith, Gatsby, Netlify, Assemble, mapbox-gl, phenomic, vuejs vitepress, TinaCMS, Shopify Polaris, Ant Design, Astro, hashicorp, garden, slidev, saber, sourcegraph, and many others. Simple to use, and battle tested. Parses YAML by default but can also parse JSON Front Matter, Coffee Front Matter, TOML Front Matter, and has support for custom parsers. Please follow gray-matter's author: https://github.com/jonschlinkert
https://github.com/jonschlinkert
MIT License
3.97k stars 138 forks source link

todo: switch yaml libraries #114

Open jonschlinkert opened 3 years ago

jonschlinkert commented 3 years ago

I've spent quite a bit of time reviewing the code in https://github.com/eemeli/yaml, it's amazing. Very well done @eemeli!

If someone wants to do a PR to swap js-yaml for yaml, that would be great. Otherwise I'll do it when I get a chance.

robertmassaioli commented 3 years ago

For those of us that have not read it yet, what's amazing about the code? (Now considering if I should also try it for other projects) And would this require a major version bump because potentially the two yaml libraries behave differently?

jonschlinkert commented 3 years ago

what's amazing about the code?

Thanks for asking!

The only small gripe I have is that the package is published with browser code, which adds 299Kb to the download and should be released separately. But IMHO that's not important enough to dissuade me.

because potentially the two yaml libraries behave differently?

I'm not aware of any differences in expected output, and the comprehensive test suite and documentation indicate that yaml will be a drop-in replacement.

sakulstra commented 2 years ago

@jonschlinkert any chance of merging and releasing this? https://github.com/jonschlinkert/gray-matter/pull/147

remcohaszing commented 11 months ago

I'm less concerned about library size and performance. The biggest reason to prefer yaml over js-yaml, is that it's compliant with the YAML spec.