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
.