npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@mscharley/bs-material-ui-icons

v2.0.0

Published

Reason bindings for material-ui-icons

Downloads

38

Readme

Reason bindings for Material-UI-Icons

npm

Reason bindings for material-ui-icons.

Status

🚧 This is a WIP, not everything is supported yet but we're getting close. 🚧

Feel free to create an issue or PR if you find anything missing.

Installation

yarn add @mscharley/bs-material-ui-icons
yarn add @material-ui/core
yarn add @material-ui/icons

Then add @mscharley/bs-material-ui-icons to bs-dependencies in your bsconfig.json:

{
  // ...
  "bs-dependencies": ["@mscharley/bs-material-ui-icons"]
}

Usage

let component = ReasonReact.statelessComponent("Example");

let make = (_children) => {
  ...component,
  render: (_self) => <MscharleyBsMaterialUiIcons.Delete.Filled />
};

You can find a list of available icons here. The icons are exposed as <IconName.Theme /> from this library, which is slightly different to ReactJS which uses <IconNameTheme /> or <IconName /> for the filled theme.

Help! The icon I want to use isn't available

Maybe this library hasn't been updated yet to include the new icon. No problems! Just open an issue and let us know we're msising something. We'll get things updated as soon as possible.

Design decisions

Why does this module take so long to build?

There are an awful lot of icons available in @material-ui/icons; as of writing, around 5000 of them. Initially, this project exported all of these icons from one module file. This was very fast to build! However due to interactions with the way the bsb builds files and the way it writes imports this led to very big deployment packages, even with tree shaking. Using a single icon caused builds to increase in size by 3MB (~7x in my small project!) because all the icons were always being included.

This module now exports each group of icons into it's own file. This leads to a slightly different usage pattern to ReactJS, namely <Delete.Filled /> instead of <Delete /> or <Delete.Outlined /> instead of <DeleteOutlined />. This isn't that big a deal, really. It also lets packagers only include the icons you're using. Unfortunately, it means that the BSB build is a little bit longer.

Gotchas

Why can't I include MscharleyBsMaterialUiIcons?

MscharleyBsMaterialUiIcons.js is compiled in script mode while its dependent is not

Related to the build question above, this package uses the namespace option in BuckleScript. This means that MscharleyBsMaterialUiIcons is purely synthetic and there isn't actually a script to include and re-export. Even if this did work it would be discouraged because you would end up at square one with code elimination as highlighted in the design decision above.

The current recommended way to alias this library is as follows:

/* Icons.re */
open MscharleyBsMaterialUiIcons;

module PowerSettingsNew = PowerSettingsNew.Filled;
module ReportProblem = ReportProblem.Filled;
module Help = Help.Outlined;