Skip to content

Commit

Permalink
Reverted to v3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentpayot committed Apr 14, 2023
1 parent 4cf3084 commit 00c9694
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 8 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Minidenticons changelog

## 3.1.2

_2023-04-14_

### New features

- Reverted to v3.1.0 (custom element size optimization was canceling v3 performance gain)

## 3.1.1

_2023-04-14_
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Minidenticons uses [ES modules](https://jakearchibald.com/2017/es-modules-in-bro

```html
<script type="module">
import { identiconSvg } from 'https://cdn.jsdelivr.net/npm/minidenticons@3.1.1/minidenticons.min.js'
import { identiconSvg } from 'https://cdn.jsdelivr.net/npm/minidenticons@3.1.2/minidenticons.min.js'
</script>
```

Expand Down
10 changes: 6 additions & 4 deletions minidenticons.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,13 @@ export const identiconSvg =
static observedAttributes = ['username', 'saturation', 'lightness']
// private fields to allow Terser mangling
static #memoized = {}
connectedCallback() { this.#setContent() }
// attributeChangedCallback() is called for every observed attribute before connectedCallback()
attributeChangedCallback(name, oldValue, newValue) {
if (oldValue !== newValue) this.#setContent()
#isConnected = false
connectedCallback() {
this.#setContent()
this.#isConnected = true
}
// attributeChangedCallback() is called for every observed attribute before connectedCallback()
attributeChangedCallback() { if (this.#isConnected) this.#setContent() }
#setContent() {
const args = IdenticonSvg.observedAttributes
.map(key => this.getAttribute(key) || undefined)
Expand Down
2 changes: 1 addition & 1 deletion minidenticons.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion minidenticons.min.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "minidenticons",
"version": "3.1.1",
"version": "3.1.2",
"description": "Super lightweight SVG identicon (icon avatar) generator",
"author": "Laurent Payot",
"license": "MIT",
Expand Down

0 comments on commit 00c9694

Please sign in to comment.