Skip to content

Releases: tjw-lint/vue3-snapshot-serializer

v0.13.0 - Nested attr indent on whitespace children

29 Nov 23:12
b6f9252
Compare
Choose a tag to compare

Features:

  • Nested attribute indentation on whitespace preserved children is now improved.

Maintenance:

  • Updated dependencies
  • Test coverage remains at 100%

Diff:

v0.12.0 - Whitespace dependent tag improvements

29 Nov 22:21
1734a94
Compare
Choose a tag to compare

Bug fixes:

  • global.vueSnapshots.formatting.tagsWithWhitespacePreserved
    • Fixed but where child element white space was not retained.
    • Fixed bug where the closing tag was not followed by a return.

Maintenance:

  • Updated dependencies
  • Test coverage remains at 100%

Diff:

v0.11.0 - Simplify whitespace preservation feature

24 Nov 18:49
de5b740
Compare
Choose a tag to compare

Breaking Changes:

The global.vueSnapshots.formatting.tagsWithWhitespacePreserved feature previously supported

  • undefined would default to ['a', 'pre']
  • false would be the same as []
  • Any array of strings
  • true would apply to all tags

However, the true option ran into complex technical issues with the implementation, and likely isn't really possible (without 3rd party libraries that don't exist currently). So it is removed. Since false is equivalent to an empty array, it was removed too, to simplify this rule.

Now global.vueSnapshots.formatting.tagsWithWhitespacePreserved only accepts undefined and an array of string tag names (or an empty array).

Maintenance:

  • Added JSDocs linting
  • Added JSDoc comments throughout the codebase
  • Updated all dependencies
  • Test coverage remains at 100%

Diff:

v0.10.0 - SVG elements format similar to Void elements

12 Nov 02:47
565dcd1
Compare
Choose a tag to compare

Features:

  • When setting global.vueSnapshots.formatting.voidElements, it will now impact SVG elements like so:
    • html - <path />
      • Note: SVG elements must have a closing indicator, so <path> on its own is invalid.
    • xhtml - <path />
    • xml - <path></path>
  • Empty comments are now minified. <!-- --> becomes <!---->

Maintenance:

  • Updated dependencies
  • Test coverage remains at 100%

Diff:

v0.9.0 - HTML Entity encoding changes

11 Nov 16:31
6d26598
Compare
Choose a tag to compare

Features:

  • If using global.vueSnapshots.formatting.escapeInnerText = true; (defaults to true), then non-breaking spaces will now be encoded as &nbsp; in your snapshots, and &quot; will now become " because in most cases it looks better and I haven't seen an example yet were keeping double quotes encoded was an important distinction.

Maintenance:

  • Test coverage remains at 100%

Diff:

v0.8.0 - Rename `closingTags` to `xml` in `voidElements` setting

08 Nov 23:01
5d31977
Compare
Choose a tag to compare

Breaking changes:

  • Before: global.vueSnapshots.formatting.voidElements = 'closingTag';
  • After: global.vueSnapshots.formatting.voidElements = 'xml';
  • The functionality is exactly the same, just with a different string.

Maintenance:

  • Minor bug fixes and testing improvements around formatting settings.
  • Test coverage remains at 100%

Diff:

v0.7.0 - Attributes per line

07 Nov 14:27
54193b4
Compare
Choose a tag to compare

Features:

  • You can now specify how many attributes are allowed on the same line as the starting tag before they get broken up into multiple lines. The vueSnapshots.formatting.attributesPerLine = 1 feature was implemented by the studious @mauryapari.

Maintenance:

  • Added helpful error messages to API validation check
  • Updated all dependencies
  • Test coverage remains at 100%

Diff:

v0.6.0 - Escape inner text

07 Nov 03:06
2978753
Compare
Choose a tag to compare

Features:

  • Snapshots now escape innerText nodes with named HTML entities.
    • Previously <pre>&lt;div&gt;Example&lt;/div&gt;</pre> would become <pre><div>Example</div></pre>.
    • You can toggle this via the global.vueSnapshots.formatting.escapeInnerText boolean setting.

Maintenance:

  • Updated all dependencies.
  • Test coverage remains at 100%.

Diff:

v0.5.0 - Tags With Whitespace Preserved

06 Nov 14:29
fe64c65
Compare
Choose a tag to compare

Features:

  • The diffable format settings globalThis.vueSnapshots.formatting.tagsWithWhitespacePreserved has been implemented by @mauryapari.
    • By default that means a and pre tags will not have their internal whitespace (returns/indentation) touched by the formatter.
    • It also means you can pass in an array of any tags to do this for.
    • Or you can pass in true for all tags to have whitespace preserved
    • Or pass in false (or []) for all tags to be indented and broken up on to separate lines.

Maintenance

  • Updated all dependencies
  • Test coverage remains at 100%

Diff:

v0.4.0 - Self-Closing Tags formatting option

03 Nov 17:19
1a7c899
Compare
Choose a tag to compare

Features:

  • The Diffable formatting option selfClosingTags was implemented by @mauryapari.
    • It allows you to pick between <div></div> or <div /> in your snapshots.
  • JSDocs types file (./types.js) was cleaned up and documented on the website.

Bug fix:

  • In some places the emptyAttributes setting was called showEmptyAttributes, this was spotted and fixed by @mauryapari.

Documentation:

  • Removed all documentation from the README.md and pointed to the website for docs.
  • All dependencies/devDependencies are up-to-date.
  • Test coverage remains at 100%.

Diff: