Releases: tjw-lint/vue3-snapshot-serializer
v0.13.0 - Nested attr indent on whitespace children
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
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
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
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.
- Note: SVG elements must have a closing indicator, so
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
Features:
- If using
global.vueSnapshots.formatting.escapeInnerText = true;
(defaults to true), then non-breaking spaces will now be encoded as
in your snapshots, and"
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
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
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
Features:
- Snapshots now escape
innerText
nodes with named HTML entities.- Previously
<pre><div>Example</div></pre>
would become<pre><div>Example</div></pre>
. - You can toggle this via the
global.vueSnapshots.formatting.escapeInnerText
boolean setting.
- Previously
Maintenance:
- Updated all dependencies.
- Test coverage remains at 100%.
Diff:
v0.5.0 - Tags With Whitespace Preserved
Features:
- The diffable format settings
globalThis.vueSnapshots.formatting.tagsWithWhitespacePreserved
has been implemented by @mauryapari.- By default that means
a
andpre
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.
- By default that means
Maintenance
- Updated all dependencies
- Test coverage remains at 100%
Diff:
v0.4.0 - Self-Closing Tags formatting option
Features:
- The Diffable formatting option
selfClosingTags
was implemented by @mauryapari.- It allows you to pick between
<div></div>
or<div />
in your snapshots.
- It allows you to pick between
- JSDocs types file (
./types.js
) was cleaned up and documented on the website.
Bug fix:
- In some places the
emptyAttributes
setting was calledshowEmptyAttributes
, 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: