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

fix: vendor esm-only packages #1716

Merged
merged 13 commits into from
Jun 28, 2023
Merged

fix: vendor esm-only packages #1716

merged 13 commits into from
Jun 28, 2023

Conversation

williaster
Copy link
Collaborator

@williaster williaster commented Jun 21, 2023

This is a WIP umbrella branch to fix

Generally our approach will be similar to VictoryVendor, where we will vendor and re-export any esm-only dependencies we have as CJS + ESM, to continue to support both types. I don't believe it's feasible to simply reference victory-vendor because they don't vendor all d3 ESM-only packages (since visx is more low-level, we reference more esoteric d3 packages e.g., d3-chord)

Will PR into this branch to break up the changes for easier review and tracking

@github-actions
Copy link

Size Changes

Package Diff ESM Prev ESM CJS Prev CJS
visx-scale +1.2% 18.43 KB 18.21 KB 29.84 KB 29.62 KB
visx-xychart +0.0% 174.03 KB 173.98 KB 234.38 KB 234.33 KB

Compared to master. File sizes are unminified and ungzipped.

View raw build stats

Previous (master)

{
  "visx-annotation": {
    "esm": 31002,
    "lib": 43431
  },
  "visx-axis": {
    "esm": 21699,
    "lib": 26304
  },
  "visx-bounds": {
    "esm": 2948,
    "lib": 3371
  },
  "visx-brush": {
    "esm": 54136,
    "lib": 58297
  },
  "visx-chord": {
    "esm": 3478,
    "lib": 4691
  },
  "visx-clip-path": {
    "esm": 4524,
    "lib": 6062
  },
  "visx-curve": {
    "esm": 323,
    "lib": 1462
  },
  "visx-demo": {
    "esm": 0,
    "lib": 36504
  },
  "visx-drag": {
    "esm": 12756,
    "lib": 14402
  },
  "visx-event": {
    "esm": 3878,
    "lib": 5194
  },
  "visx-geo": {
    "esm": 13515,
    "lib": 16741
  },
  "visx-glyph": {
    "esm": 15177,
    "lib": 19992
  },
  "visx-gradient": {
    "esm": 18202,
    "lib": 22847
  },
  "visx-grid": {
    "esm": 18982,
    "lib": 22665
  },
  "visx-group": {
    "esm": 1648,
    "lib": 2267
  },
  "visx-heatmap": {
    "esm": 7394,
    "lib": 8731
  },
  "visx-hierarchy": {
    "esm": 12093,
    "lib": 17910
  },
  "visx-legend": {
    "esm": 26944,
    "lib": 34024
  },
  "visx-marker": {
    "esm": 9152,
    "lib": 11350
  },
  "visx-mock-data": {
    "esm": 326040,
    "lib": 329480
  },
  "visx-network": {
    "esm": 4674,
    "lib": 6809
  },
  "visx-pattern": {
    "esm": 11689,
    "lib": 15763
  },
  "visx-point": {
    "esm": 1003,
    "lib": 1818
  },
  "visx-react-spring": {
    "esm": 14000,
    "lib": 17725
  },
  "visx-responsive": {
    "esm": 12972,
    "lib": 16175
  },
  "visx-scale": {
    "esm": 18649,
    "lib": 30334
  },
  "visx-shape": {
    "esm": 86912,
    "lib": 108820
  },
  "visx-stats": {
    "esm": 13738,
    "lib": 15320
  },
  "visx-text": {
    "esm": 8567,
    "lib": 10114
  },
  "visx-threshold": {
    "esm": 2907,
    "lib": 3806
  },
  "visx-tooltip": {
    "esm": 15233,
    "lib": 21734
  },
  "visx-visx": {
    "esm": 1524,
    "lib": 4487
  },
  "visx-voronoi": {
    "esm": 2314,
    "lib": 3021
  },
  "visx-wordcloud": {
    "esm": 2620,
    "lib": 3455
  },
  "visx-xychart": {
    "esm": 178152,
    "lib": 239950
  },
  "visx-zoom": {
    "esm": 16239,
    "lib": 19297
  }
}

Current

{
  "visx-annotation": {
    "esm": 31002,
    "lib": 43431
  },
  "visx-axis": {
    "esm": 21699,
    "lib": 26304
  },
  "visx-bounds": {
    "esm": 2948,
    "lib": 3371
  },
  "visx-brush": {
    "esm": 54136,
    "lib": 58297
  },
  "visx-chord": {
    "esm": 3478,
    "lib": 4691
  },
  "visx-clip-path": {
    "esm": 4524,
    "lib": 6062
  },
  "visx-curve": {
    "esm": 323,
    "lib": 1462
  },
  "visx-demo": {
    "esm": 0,
    "lib": 36517
  },
  "visx-drag": {
    "esm": 12756,
    "lib": 14402
  },
  "visx-event": {
    "esm": 3878,
    "lib": 5194
  },
  "visx-geo": {
    "esm": 13515,
    "lib": 16741
  },
  "visx-glyph": {
    "esm": 15177,
    "lib": 19992
  },
  "visx-gradient": {
    "esm": 18202,
    "lib": 22847
  },
  "visx-grid": {
    "esm": 18982,
    "lib": 22665
  },
  "visx-group": {
    "esm": 1648,
    "lib": 2267
  },
  "visx-heatmap": {
    "esm": 7394,
    "lib": 8731
  },
  "visx-hierarchy": {
    "esm": 12093,
    "lib": 17910
  },
  "visx-legend": {
    "esm": 26944,
    "lib": 34024
  },
  "visx-marker": {
    "esm": 9152,
    "lib": 11350
  },
  "visx-mock-data": {
    "esm": 326040,
    "lib": 329480
  },
  "visx-network": {
    "esm": 4674,
    "lib": 6809
  },
  "visx-pattern": {
    "esm": 11689,
    "lib": 15763
  },
  "visx-point": {
    "esm": 1003,
    "lib": 1818
  },
  "visx-react-spring": {
    "esm": 14000,
    "lib": 17725
  },
  "visx-responsive": {
    "esm": 12972,
    "lib": 16175
  },
  "visx-scale": {
    "esm": 18870,
    "lib": 30555
  },
  "visx-shape": {
    "esm": 86912,
    "lib": 108820
  },
  "visx-stats": {
    "esm": 13738,
    "lib": 15320
  },
  "visx-text": {
    "esm": 8567,
    "lib": 10114
  },
  "visx-threshold": {
    "esm": 2907,
    "lib": 3806
  },
  "visx-tooltip": {
    "esm": 15233,
    "lib": 21734
  },
  "visx-vendor": {
    "esm": 2002,
    "lib": 2170
  },
  "visx-visx": {
    "esm": 1524,
    "lib": 4487
  },
  "visx-voronoi": {
    "esm": 2314,
    "lib": 3021
  },
  "visx-wordcloud": {
    "esm": 2620,
    "lib": 3455
  },
  "visx-xychart": {
    "esm": 178204,
    "lib": 240002
  },
  "visx-zoom": {
    "esm": 16239,
    "lib": 19297
  }
}

williaster and others added 13 commits June 28, 2023 10:51
* vendor: add working transpilation scripts

* vendor: update readme

* vendor: fix package.json conflicts

* vendor: add remaining packages

* vendor: tweak type exports

* vendor: fix type and index generation

* vendor: fix relative path generation

* vendor: add tests for all vendored packages

* vendor: use yarn nohoist instead of npm aliases
* scale: point to vendor package

* demo: remove next-transpile-modules

* demo: point to vendor package

* scale: point to vendor package (again)

* xychart: point to vendor package

* scale: point to vendor package (again)

* update yarn.lock

* deps: try lerna@7

* types: update ts refs

* fix things to fully build

* vendor: add tsconfig note

* demo: name Show function to silence warning

* vendor: fix conditional exports and types export

* demo: add NoSsr component

* vendor: remove internmap types export

* vendor: internmap fix again
* vendor: add scripts/flagVendorRequirements

* vendor: tweak esm map

* github: add vendor-check to PR workflow
@williaster williaster merged commit ca918b3 into master Jun 28, 2023
2 checks passed
@github-actions
Copy link

🎉 This PR is included in version v3.2.0-alpha.0 of the packages modified 🎉

@github-actions
Copy link

🎉 This PR is included in version v3.2.0 of the packages modified 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant