Releases: dmester/jdenticon
Releases · dmester/jdenticon
Version 3.3.0
Version 3.2.0
Improvements:
- Support for using Jdenticon from TypeScript with module resolution set to Node16.
- New exports for explicitly picking a bundle:
- Importing
jdenticon/browser
will ensure the browser bundle is used. - Importing
jdenticon/node
will ensure the Node.js bundle is used.
- Importing
Version 3.1.1
Improvement:
- Fixed type error when using Jdenticon with v16 of
@type/node
(#45).
Version 3.1.0
Bug fixes:
- Webpack 5 was always picking node implementation. #39
Improvements:
- Slightly smaller builds due to replacement of minifier (Terser is now being used).
Version 3.0.1
Fixes in TypeScript typings:
- Allow using the Jdenticon package without adding
"dom"
to"lib"
intsconfig.json
. - Node typings do no longer leak from the Jdenticon package.
Version 3.0.0
Breaking changes
- The exported file for bundlers does no longer automatically render icons at startup. You need to call any of the update methods from your code to render icons. You can also choose to import "jdenticon/standalone" instead of "jdenticon" to keep the old behavior. If you are importing
jdenticon.js
orjdenticon.min.js
you donät have to do anything. - The default padding of
drawIcon
is now 0.08 from the previous default 0. This was changed to remove code for backward compatibility, and to harmonize the API. - TypeScript: Jdenticon interfaces must be imported when using the Jdenticon module bundle. The interfaces are no longer declared in the global namespace. The UMD bundle (used when importing
"jdenticon/standalone"
) still declares the interfaces in the global namespace.
Changes
- New methods
updateSvg()
andupdateCanvas()
. These only contain references to the logics needed for each element type, providing better code optimization opportunities. They are now preferred overupdate()
where the element type is known. - An ES bundle is now provided. Just import the "jdenticon" package and the bundler will choose the ES bundle when possible. This will improve code optimizations hopefully causing smaller builds.
configure()
is a new method for providing a default style configuration. This plays nicer when imported as an ES module, than the oldconfig
property, which was made read-only by the ES import statement.jdenticon.config
is deprecated. Use the globaljdenticon_config
variable orjdenticon.configure()
method instead.
Bug fixes
- The typings of the
update()
method were incorrectly only acceptingHTMLElement
. An<svg>
element (SVGSVGElement
) is not anHTMLElement
. NowElement
is accepted. update()
incorrectly rendered SVG data in any element with a tag name containingsvg
, instead of being exactlysvg
.
Version 2.2.0
Improvements:
- TypeScript typings are now bundled in NPM package.
- New configuration property
padding
. - The
padding
parameter of API methods has been replaced with aconfig
parameter. For backward compatibility a padding value is still allowed as value to theconfig
parameter. - Added CLI tool.
jdenticon.drawIcon
is now also available on Node for usage with canvas compatible packages.- Updated universal module definition.
Version 2.1.1
Bug fix:
- An exception was thrown when generating large PNG icons on Node 10.x.
Version 2.1.0
Changes:
- Setting
jdenticon_config.saturation
directly is now deprecated. Usejdenticon_config.saturation.color
instead.
Improvements:
- New
jdenticon_config
style options:saturation.color
,saturation.grayscale
andhues
. - New
jdenticon_config
optionreplaceMode
which has the following values:- "once" - icons are replaced once upon page load. This is the default value and how Jdenticon has always behaved.
- "never" - no icons are replaced automatically. Good for folks who have written their own components for triggering icon updates.
- "observe" - icons are replaced upon page load, and the DOM is then monitored for new identicons. This mode is useful in applications where new icons are inserted dynamically into the page, e.g. by using React or Angular.
- Source maps are now provided for jdenticon.min.js.
Bug fixes:
- No icon was rendered when a falsy value was passed to jdenticon.update.
- Smaller circles were rendered very badly to PNG in smaller sizes (changes in the dependency canvas-renderer).
- Padding is now rounded instead of truncated to nearest integer to avoid floating point rounding errors.
Version 2.0.0
Breaking changes:
- Now licensed under the MIT license. This change was done to simplify using Jdenticon in businesses utilizing list of allowed open source licenses.
Improvements:
- Improved performance for the
toPng
function when running on Node.js. Benchmarks have shown performance boosts up to 50%. - New option
backColor
for configuring background color of generated icons. - Added
padding
parameter to thedrawIcon
method.