todo: switch yaml libraries #114

Open
opened 2021-01-26 14:23:31 +00:00 by jonschlinkert · 4 comments
jonschlinkert commented 2021-01-26 14:23:31 +00:00 (Migrated from github.com)

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.

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](https://github.com/eemeli/yaml), that would be great. Otherwise I'll do it when I get a chance.
robertmassaioli commented 2021-01-26 19:26:57 +00:00 (Migrated from github.com)

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?

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 2021-01-28 05:33:30 +00:00 (Migrated from github.com)

what's amazing about the code?

Thanks for asking!

  • the code is well written, well organized, and well tested
  • The documentation is awesome
  • the API is nice. From basic methods like parse and stringify, to more advanced methods for getting the CST or YAML.Document
  • loads 20-40ms faster than js-yaml

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.

> what's amazing about the code? Thanks for asking! - the code is well written, well organized, and [well tested](https://github.com/eemeli/yaml-test-suite/tree/414181d9e138ff5a384ff84de9999a85dd9412c9) - The [documentation](https://eemeli.org/yaml/#yaml) is awesome - the API is nice. From basic methods like `parse` and `stringify`, to more advanced methods for getting the CST or `YAML.Document` - loads 20-40ms faster than js-yaml 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 2022-11-15 10:19:38 +00:00 (Migrated from github.com)

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

@jonschlinkert any chance of merging and releasing this? https://github.com/jonschlinkert/gray-matter/pull/147
remcohaszing commented 2023-12-19 09:20:06 +00:00 (Migrated from github.com)

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.

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.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
rtlabs-llm-agents/gms-gray-matter#114
No description provided.