-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow Gridicons library to be imported by component #283
Commits on Mar 5, 2018
-
Configuration menu - View commit details
-
Copy full SHA for 81ed4ee - Browse repository at this point
Copy the full SHA 81ed4eeView commit details
Commits on Mar 6, 2018
-
Configuration menu - View commit details
-
Copy full SHA for d27ab4e - Browse repository at this point
Copy the full SHA d27ab4eView commit details -
Allow individual icons to be imported by gridicons/icon
To make this possible: import GridiconExternal from 'gridicons/external'; we need to publish the individual icons in the root of our npm package. This also changes how do we tell npm which files to include from whitelisting (using the files prop in package.json) to blacklisting (using the .npmignore file). The reason for that is that I've tried to whitelist every individual icon by setting the files prop to "*.js" and then blacklist only the Gruntfile.js within .npmignore. It seems that in case of conflict the files prop takes precedence over .npmignore, so the Gruntfile.js was still included.
Configuration menu - View commit details
-
Copy full SHA for 6946b70 - Browse repository at this point
Copy the full SHA 6946b70View commit details -
Note that this is necessary to prevent the build/ folder to be included in the npm package. For some reason, although the build/ folder was blacklisted in the .npmignore, it was not excluded from the package. https://docs.npmjs.com/misc/developers#keeping-files-out-of-your-package The docs don't mention the build/ folder as one of the always included directories, though.
Configuration menu - View commit details
-
Copy full SHA for e7b114c - Browse repository at this point
Copy the full SHA e7b114cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 5fbbef9 - Browse repository at this point
Copy the full SHA 5fbbef9View commit details -
Shrink icons by using a function instead of React.PureComponent
By using a function instead of React.PureComponent the transpiled icon is 1,5K smaller. Most individual components are between 4K and 5K, so this change means a ~30% size reduction.
Configuration menu - View commit details
-
Copy full SHA for a82adb3 - Browse repository at this point
Copy the full SHA a82adb3View commit details -
Configuration menu - View commit details
-
Copy full SHA for b32bf60 - Browse repository at this point
Copy the full SHA b32bf60View commit details
Commits on Mar 8, 2018
-
Use cjs and esm folders to publish the icons
The idea is that we want to prepare Gridicons to be able to distribute both CommonJS and ECMAScript Modules. Initially, the idea was to use the directory root to publish the CJS modules so others could: import external from 'gridicons/external'; The main disadvantage of that approach is that, in the future, when ECMAScript modules become more common that namespaced will be taken by the CommonJS modules and we won't be able to change that if we want to be backwards-compatible. So, instead, the approach we're taking is being agnostic about what module system the library user wants to use by default. So, either: import external from 'gridicons/cjs/external'; import external from 'gridicons/esm/external'; will work.
Configuration menu - View commit details
-
Copy full SHA for a9010c9 - Browse repository at this point
Copy the full SHA a9010c9View commit details -
By creating the files dynamically form a template literal, we're able to centralize the declaration of icons that need offset.
Configuration menu - View commit details
-
Copy full SHA for 2c0e264 - Browse repository at this point
Copy the full SHA 2c0e264View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1344565 - Browse repository at this point
Copy the full SHA 1344565View commit details -
Configuration menu - View commit details
-
Copy full SHA for 15357c6 - Browse repository at this point
Copy the full SHA 15357c6View commit details -
Use js extension for ESModules
The example file imports './index.js', so we need that extension to be used by both the CommonJS and ES modules.
Configuration menu - View commit details
-
Copy full SHA for df051c3 - Browse repository at this point
Copy the full SHA df051c3View commit details -
Publish both CommonJS and ESModules
Props to @ockham for the push of publishing both.
Configuration menu - View commit details
-
Copy full SHA for b4ad138 - Browse repository at this point
Copy the full SHA b4ad138View commit details -
Configuration menu - View commit details
-
Copy full SHA for 482b142 - Browse repository at this point
Copy the full SHA 482b142View commit details -
Configuration menu - View commit details
-
Copy full SHA for b4ca433 - Browse repository at this point
Copy the full SHA b4ca433View commit details -
Configuration menu - View commit details
-
Copy full SHA for eb60b9c - Browse repository at this point
Copy the full SHA eb60b9cView commit details -
Configuration menu - View commit details
-
Copy full SHA for dbb5a2c - Browse repository at this point
Copy the full SHA dbb5a2cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 64fb4ba - Browse repository at this point
Copy the full SHA 64fb4baView commit details
Commits on Mar 9, 2018
-
Configuration menu - View commit details
-
Copy full SHA for 42fae14 - Browse repository at this point
Copy the full SHA 42fae14View commit details -
Configuration menu - View commit details
-
Copy full SHA for 84d9357 - Browse repository at this point
Copy the full SHA 84d9357View commit details -
Configuration menu - View commit details
-
Copy full SHA for 568cbde - Browse repository at this point
Copy the full SHA 568cbdeView commit details -
Configuration menu - View commit details
-
Copy full SHA for d5963b9 - Browse repository at this point
Copy the full SHA d5963b9View commit details -
Configuration menu - View commit details
-
Copy full SHA for d2d1478 - Browse repository at this point
Copy the full SHA d2d1478View commit details -
Configuration menu - View commit details
-
Copy full SHA for bed88b4 - Browse repository at this point
Copy the full SHA bed88b4View commit details -
Configuration menu - View commit details
-
Copy full SHA for fbd44f9 - Browse repository at this point
Copy the full SHA fbd44f9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7001b5d - Browse repository at this point
Copy the full SHA 7001b5dView commit details -
In previous commits, I bumped to 3.0.1-alpha and 3.0.2-alpha instead of 3.0.0-alpha.1 and 3.0.0-alpha.2. I'm sorry! Taking advantage of the npm unpublish feature I've reverted those wrong alpha publications so I hope that, when you read this, they're available to you.
Configuration menu - View commit details
-
Copy full SHA for 31ccaf0 - Browse repository at this point
Copy the full SHA 31ccaf0View commit details
Commits on Mar 13, 2018
-
Configuration menu - View commit details
-
Copy full SHA for 27ca79f - Browse repository at this point
Copy the full SHA 27ca79fView commit details -
Configuration menu - View commit details
-
Copy full SHA for c0d1361 - Browse repository at this point
Copy the full SHA c0d1361View commit details -
Configuration menu - View commit details
-
Copy full SHA for a5bed97 - Browse repository at this point
Copy the full SHA a5bed97View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6337624 - Browse repository at this point
Copy the full SHA 6337624View commit details
Commits on Mar 14, 2018
-
Configuration menu - View commit details
-
Copy full SHA for 37f871a - Browse repository at this point
Copy the full SHA 37f871aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 65ce3d9 - Browse repository at this point
Copy the full SHA 65ce3d9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0262b6b - Browse repository at this point
Copy the full SHA 0262b6bView commit details -
Configuration menu - View commit details
-
Copy full SHA for b884c31 - Browse repository at this point
Copy the full SHA b884c31View commit details -
Configuration menu - View commit details
-
Copy full SHA for da5f24e - Browse repository at this point
Copy the full SHA da5f24eView commit details