Skip to content
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

Merged
merged 36 commits into from
Mar 14, 2018

Commits on Mar 5, 2018

  1. Configuration menu
    Copy the full SHA
    81ed4ee View commit details
    Browse the repository at this point in the history

Commits on Mar 6, 2018

  1. Configuration menu
    Copy the full SHA
    d27ab4e View commit details
    Browse the repository at this point in the history
  2. 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.
    oandregal committed Mar 6, 2018
    Configuration menu
    Copy the full SHA
    6946b70 View commit details
    Browse the repository at this point in the history
  3. Rename build/ to react-icons/

    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.
    oandregal committed Mar 6, 2018
    Configuration menu
    Copy the full SHA
    e7b114c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    5fbbef9 View commit details
    Browse the repository at this point in the history
  5. 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.
    oandregal committed Mar 6, 2018
    Configuration menu
    Copy the full SHA
    a82adb3 View commit details
    Browse the repository at this point in the history
  6. Add classes to SVG

    oandregal committed Mar 6, 2018
    Configuration menu
    Copy the full SHA
    b32bf60 View commit details
    Browse the repository at this point in the history

Commits on Mar 8, 2018

  1. 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.
    oandregal committed Mar 8, 2018
    Configuration menu
    Copy the full SHA
    a9010c9 View commit details
    Browse the repository at this point in the history
  2. Convert to templates

    By creating the files dynamically form a template literal,
    we're able to centralize the declaration of icons that need offset.
    oandregal committed Mar 8, 2018
    Configuration menu
    Copy the full SHA
    2c0e264 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1344565 View commit details
    Browse the repository at this point in the history
  4. Save some bytes in example

    oandregal committed Mar 8, 2018
    Configuration menu
    Copy the full SHA
    15357c6 View commit details
    Browse the repository at this point in the history
  5. 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.
    oandregal committed Mar 8, 2018
    Configuration menu
    Copy the full SHA
    df051c3 View commit details
    Browse the repository at this point in the history
  6. Publish both CommonJS and ESModules

    Props to @ockham for the push of publishing both.
    ockham authored and oandregal committed Mar 8, 2018
    Configuration menu
    Copy the full SHA
    b4ad138 View commit details
    Browse the repository at this point in the history
  7. Fix .gitignore

    oandregal committed Mar 8, 2018
    Configuration menu
    Copy the full SHA
    482b142 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    b4ca433 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    eb60b9c View commit details
    Browse the repository at this point in the history
  10. Update docs

    oandregal committed Mar 8, 2018
    Configuration menu
    Copy the full SHA
    dbb5a2c View commit details
    Browse the repository at this point in the history
  11. Update docs

    oandregal committed Mar 8, 2018
    Configuration menu
    Copy the full SHA
    64fb4ba View commit details
    Browse the repository at this point in the history

Commits on Mar 9, 2018

  1. Configuration menu
    Copy the full SHA
    42fae14 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    84d9357 View commit details
    Browse the repository at this point in the history
  3. Bump to v3.0.1-alpha

    oandregal committed Mar 9, 2018
    Configuration menu
    Copy the full SHA
    568cbde View commit details
    Browse the repository at this point in the history
  4. Remove ssr-pragma

    oandregal committed Mar 9, 2018
    Configuration menu
    Copy the full SHA
    d5963b9 View commit details
    Browse the repository at this point in the history
  5. Remove extension in import

    oandregal committed Mar 9, 2018
    Configuration menu
    Copy the full SHA
    d2d1478 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    bed88b4 View commit details
    Browse the repository at this point in the history
  7. Bump to v3.0.2

    oandregal committed Mar 9, 2018
    Configuration menu
    Copy the full SHA
    fbd44f9 View commit details
    Browse the repository at this point in the history
  8. Update CHANGELOG

    oandregal committed Mar 9, 2018
    Configuration menu
    Copy the full SHA
    7001b5d View commit details
    Browse the repository at this point in the history
  9. Bump to v3.0.0-alpha.1

    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.
    oandregal committed Mar 9, 2018
    Configuration menu
    Copy the full SHA
    31ccaf0 View commit details
    Browse the repository at this point in the history

Commits on Mar 13, 2018

  1. Remove esnext key

    oandregal committed Mar 13, 2018
    Configuration menu
    Copy the full SHA
    27ca79f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c0d1361 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a5bed97 View commit details
    Browse the repository at this point in the history
  4. Update README

    oandregal committed Mar 13, 2018
    Configuration menu
    Copy the full SHA
    6337624 View commit details
    Browse the repository at this point in the history

Commits on Mar 14, 2018

  1. Update ignored folders

    oandregal committed Mar 14, 2018
    Configuration menu
    Copy the full SHA
    37f871a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    65ce3d9 View commit details
    Browse the repository at this point in the history
  3. Bump to 3.0.0-alpha.2

    oandregal committed Mar 14, 2018
    Configuration menu
    Copy the full SHA
    0262b6b View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    b884c31 View commit details
    Browse the repository at this point in the history
  5. Bump version to 3.0.0

    oandregal committed Mar 14, 2018
    Configuration menu
    Copy the full SHA
    da5f24e View commit details
    Browse the repository at this point in the history