React-data-grid: Material-ui is a heavy dependency for a few icons

Created on 16 Apr 2020  路  2Comments  路  Source: adazzle/react-data-grid

Is @material-ui/core and @material-ui/icons really needed as dependencies?

I was sort of surprised when checking in a package-lock.json file that so many packages had been installed when I added react-data-grid. After looking in to it, it seams that only icons are used from material-ui, which makes it seem kind of a heavy dependency.

I know a dependency does not equal me deploying a larger bundle, but I still want my dependencies to be manageable.

Most helpful comment

I might have a proposal to make the icons usable in this context. I would love to hear feedback on it, some of these items are optional:

  1. We can expose the SVG path:
import Clear from '@material-ui/icons/Clear';

function ClearIcon() {
  return <svg viewBox="0 0 24 24" style={someStyles}>{Clear.path}</svg>;
}

You still get about 9 MB on your file system, for comparison:

I'm curious to learn more about the point where it's good enough. cc @eps1lon.

Maybe the best solution, in the context of this project, is to copy and paste the source of a few icons 馃槵.

All 2 comments

@markusjohnsson I would recommend these three tools to keep track of this "size" aspect when committing into new dependencies:

I might have a proposal to make the icons usable in this context. I would love to hear feedback on it, some of these items are optional:

  1. We can expose the SVG path:
import Clear from '@material-ui/icons/Clear';

function ClearIcon() {
  return <svg viewBox="0 0 24 24" style={someStyles}>{Clear.path}</svg>;
}

You still get about 9 MB on your file system, for comparison:

I'm curious to learn more about the point where it's good enough. cc @eps1lon.

Maybe the best solution, in the context of this project, is to copy and paste the source of a few icons 馃槵.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ganapativs picture ganapativs  路  4Comments

ryanwtyler picture ryanwtyler  路  3Comments

JimLynchCodes picture JimLynchCodes  路  4Comments

daniel1943 picture daniel1943  路  3Comments

jlarso11 picture jlarso11  路  3Comments