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

Home Page:https://github.com/jonschlinkert

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Update to js-yaml 4.1.0 (was 3.13.0)

pelleknaap opened this issue · comments

Updating to js-yaml 4.1.0 will decrease bundle size.

According to Bundlephobia, the v4 release of js-yaml excludes the esprisma dependency. The exclusion dramatically reduces the bundle size of js-yaml and therefore gray-matter. See https://bundlephobia.com/package/gray-matter@4.0.3 and https://bundlephobia.com/package/js-yaml@4.1.0 .

The new version replaces the safeLoad and safeDump functions with the load and dump functions (both are safe by default now). Since gray-matter never used the old unsafe load function, we only have to replace the safeLoad function call with load.
See https://github.com/nodeca/js-yaml/blob/master/migrate_v3_to_v4.md for more information

I will make a PR with the changes.