cerner / terra-core

Terra offers a set of configurable React components designed to help build scalable and modular application UIs. This UI library was created to solve real-world issues in projects we work on day to day.

Home Page:http://terra-ui.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[terra-form-select] The size has been increased significantly since version 6.x.x

yhatcerner opened this issue · comments

Bug Report

Description

Some of our dependencies are pulling terra-form-select which has a significant size increase since version 6.x.x, so it also increases the size of our project after the dependency updates.

Size Reference of terra-form-select: https://bundlephobia.com/result?p=terra-form-select@5.45.0

Steps to Reproduce

  1. Install webpack-bundle-analyzer: https://www.npmjs.com/package/webpack-bundle-analyzer
  2. Run 'npm run build:development' and you should be able to see a generated graph of the dependency size in the web browser

Additional Context / Screenshots

image

Expected Behavior

As you can see in the above screenshot, Frame.js and Menu.js could be reused which could decrease the size.

Possible Solution

There should be different versions of Frame.js and Menu.js used in the dependencies of terra-form-select. Unifying the version should help to fix the size issue.

Environment

  • Component Name and Version:
  • Browser Name and Version:
  • Node/npm Version: [e.g. Node 8/npm 5] Node^8.10.0 || ^10.13.0/npm 6.14.5
  • Webpack Version: 4.44.1
  • Operating System and version (desktop or mobile): macOS Catalina@10.15.7

@ Mentions

n/a

Hi @yhatcerner, we split up the select into multiple different components a while back which causes some of the duplication you are seeing. Not all of the logic that is in each of those individual Frame and Menu modules is exactly the same but there certainly is room for de-duplication. Long term, we have some plans to evolve Select in terms of usability, accessibility, and maintainability and this will be something good for us to keep in mind as we do so (so I will go ahead and backlog this). In the meantime, you can definitely minimize the footprint of the select by ensuring you're only importing the specific versions that you want:

e.g.

import Combobox from 'terra-form-select/lib/Combobox';
commented

This issue has been automatically marked as inactive because it has not had recent activity. It will be closed in seven days if no further activity occurs. Thank you for your contributions.