-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(icon)!: remove getIconUrl for webpack's sake (#2766)
* fix(icon)!: remove getIconUrl for webpack's sake * test(icon): refactor tests * chore: update icons * docs(icon): fix custom sets demo * chore: update rhds dep
- Loading branch information
1 parent
6d5743f
commit 7901999
Showing
10 changed files
with
335 additions
and
262 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
"@patternfly/elements": major | ||
--- | ||
`<pf-icon>`: removed the `getIconUrl` static method, and replaced it with the | ||
`resolve` static method | ||
|
||
The steps for overriding icon loading behaviour have changed. Before, you had to | ||
return a string from the `getIconUrl` method, or the second argument to | ||
`addIconSet`. Now, both of those functions must return a Node, or any lit-html | ||
renderable value, or a Promise thereof. | ||
|
||
BEFORE: | ||
|
||
```js | ||
PfIcon.addIconSet('local', (set, icon) => | ||
new URL(`/assets/icons/${set}-${icon}.js`)); | ||
|
||
// or | ||
PfIcon.getIconUrl = (set, icon) => | ||
new URL(`/assets/icons/${set}-${icon}.js`)) | ||
``` | ||
|
||
AFTER | ||
```js | ||
PfIcon.addIconSet('local', (set, icon) => | ||
import(`/assets/icons/${set}-${icon}.js`)) | ||
.then(mod => mod.default); | ||
|
||
// or | ||
PfIcon.resolve = (set, icon) => | ||
import(`/assets/icons/${set}-${icon}.js`)) | ||
.then(mod => mod.default); | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
"@patternfly/elements": major | ||
--- | ||
`<pf-icon>`: removed the `defaultIconSet` static field. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.