js-yaml breaking changes

npm

24 curated breaking changes across major versions of js-yaml. Use this as a migration checklist before bumping dependencies.

24
changes
Breaking changes by transition
  • 3.14.1 \u2192 4.0.0breaking

    `__proto__` key no longer overrides object prototype, #164.

  • 3.14.1 \u2192 4.0.0breaking

    Breaking: "unsafe" tags `!!js/function`, `!!js/regexp`, `!!js/undefined` are

  • 3.14.1 \u2192 4.0.0breaking

    Astral characters are no longer encoded by `dump()`, #587.

  • 3.14.1 \u2192 4.0.0breaking

    "duplicate mapping key" exception now points at the correct column, #452.

  • 3.14.1 \u2192 4.0.0breaking

    Extra commas in flow collections (e.g. `[foo,,bar]`) now throw an exception

  • 3.14.1 \u2192 4.0.0breaking

    Check [migration guide](migrate_v3_to_v4.md) to see details for all breaking changes.

  • 3.14.1 \u2192 4.0.0breaking

    `!!binary` now always mapped to `Uint8Array` on load.

  • 3.14.1 \u2192 4.0.0breaking

    Reduced nesting of `/lib` folder.

  • 3.14.1 \u2192 4.0.0breaking

    Parse numbers according to YAML 1.2 instead of YAML 1.1 (`01234` is now decimal,

  • 3.14.1 \u2192 4.0.0breaking

    `dump()` no longer quotes `:`, `[`, `]`, `(`, `)` except when necessary, #470, #557.

  • 3.14.1 \u2192 4.0.0breaking

    Line and column in exceptions are now formatted as `(X:Y)` instead of

  • 3.14.1 \u2192 4.0.0breaking

    Code snippet created in exceptions now contains multiple lines with line numbers.

  • 3.14.1 \u2192 4.0.0breaking

    `dump()` with `skipInvalid=true` now serializes invalid items in collections as null.

  • 3.14.1 \u2192 4.0.0breaking

    Custom tags starting with `!` are now dumped as `!tag` instead of `!<!tag>`, #576.

  • 3.14.1 \u2192 4.0.0breaking

    Custom tags starting with `tag:yaml.org,2002:` are now shorthanded using `!!`, #258.

  • 3.14.1 \u2192 4.0.0breaking

    Added `.mjs` (es modules) support.

  • 3.14.1 \u2192 4.0.0breaking

    Added `quotingType` and `forceQuotes` options for dumper to configure

  • 3.14.1 \u2192 4.0.0breaking

    Added `styles: { '!!null': 'empty' }` option for dumper

  • 3.14.1 \u2192 4.0.0breaking

    Added `replacer` option (similar to option in JSON.stringify), #339.

  • 3.14.1 \u2192 4.0.0breaking

    Custom `Tag` can now handle all tags or multiple tags with the same prefix, #385.

  • 3.14.1 \u2192 4.0.0removed

    Breaking: removed `safe*` functions. Use `load`, `loadAll`, `dump`

  • 3.14.1 \u2192 4.0.0removed

    `yaml.DEFAULT_SAFE_SCHEMA` and `yaml.DEFAULT_FULL_SCHEMA` are removed, use

  • 3.14.1 \u2192 4.0.0removed

    `yaml.Schema.create(schema, tags)` is removed, use `schema.extend(tags)` instead.

  • 3.14.1 \u2192 4.0.0removed

    `dump()` now serializes `undefined` as `null` in collections and removes keys with

API access

Get this data programmatically \u2014 free, no authentication.

curl https://depscope.dev/api/breaking/npm/js-yaml
js-yaml breaking changes — npm migration guide | DepScope