-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(ffe-icons-react): Improve API
BREAKING CHANGE: Improve the API of ffe-icons-react. This commit changes the API of the ffe-icons-react package to take advantage of dead code eliminination and tree shaking in Webpack >= 2. Previously, you imported one and one icon from the corresponding JSX file. Now all icons are available as named exports from the root level of `ffe-icons-react`. If you're using webpack@>=2.0.0, please make the following changes to migrate: ```diff - import ChevronIkon from 'ffe-icons-react/chevron-ikon'; - import FamilieIkon from 'ffe-icons-react/familie-ikon'; + import { ChevronIkon, FamilieIkon } from 'ffe-icons-react'; ``` If you're not using a build tool that enables dead code elimination and tree shaking, please make the following changes to migrate: ```diff - import ChevronIkon from 'ffe-icons-react/chevron-ikon'; - import FamilieIkon from 'ffe-icons-react/familie-ikon'; + import ChevronIkon from 'ffe-icons-react/lib/chevron-ikon'; + import FamilieIkon from 'ffe-icons-react/lib/familie-ikon'; ``` This API change allows for cleaner usage and better documentation.
- Loading branch information
Kristofer Selbekk
committed
Dec 27, 2017
1 parent
7258fcc
commit e9b88a4
Showing
13 changed files
with
66 additions
and
117 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
.idea/ | ||
# Dependencies | ||
node_modules/ | ||
|
||
# Editors | ||
.idea/ | ||
|
||
# Built files | ||
iconlist.json | ||
jsx/ | ||
tmp/ | ||
/*-ikon.js | ||
/ffe-icons-react.js | ||
lib/ |
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 |
---|---|---|
@@ -1,10 +1,7 @@ | ||
buildCI.sh | ||
src/build-iconlist.js | ||
src/build-jsx-components.js | ||
clean.js | ||
src/example.jsx | ||
index.html | ||
iconlist.json | ||
svg.sprite.config.json | ||
webpack.config.js | ||
src/icons.js.mustache |
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 was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import * as icons from '../lib'; | ||
|
||
ReactDOM.render( | ||
<div className="example-container"> | ||
{Object.entries(icons).map(([iconName, Icon]) => ( | ||
<div className="icon-container" key={iconName}> | ||
<Icon className="icon" /> | ||
<p>{iconName}</p> | ||
</div> | ||
))} | ||
</div>, | ||
document.getElementById('app') | ||
); |
This file was deleted.
Oops, something went wrong.
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