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

Replace d3 import with imports from smaller d3 modules in ui-maps #1217

Open
jaronheard opened this issue Sep 6, 2020 · 0 comments
Open
Labels
bug dependencies Pull requests that update a dependency file good-first-issue

Comments

@jaronheard
Copy link
Contributor

Description

All of d3 gets bundled with @hackoregon/ui-maps, in places where only some of d3 is needed. All places where import * as d3 from "d3"; is used should be replaced with imports of the needed functions from the smaller d3 modules such as d3-geo.

Steps to reproduce

Use create-react-app to start a new project, yarn add @hackoregon/ui-maps, and use a component like PolygonPreview. Then build, and inspect your bundle using source-map-explorer to see that all of d3 is there.

Screenshot of source-map-explorer showing d3 bundles

image

Expected result

Should only import needed functions from d3-geo

Actual result

Imported all of d3

@jaronheard jaronheard added bug good-first-issue dependencies Pull requests that update a dependency file labels Sep 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug dependencies Pull requests that update a dependency file good-first-issue
Projects
None yet
Development

No branches or pull requests

1 participant