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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps(demo): upgrade to next@11 #1627

Merged
merged 16 commits into from Jan 5, 2023
Merged

deps(demo): upgrade to next@11 #1627

merged 16 commits into from Jan 5, 2023

Conversation

williaster
Copy link
Collaborator

@williaster williaster commented Jan 5, 2023

馃彔 Internal

Before it was reverted, #1578 broke the nextjs site due to the resulting d3-* ESM modules with the error

Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/christopher-williams/dev/visx/packages/visx-demo/node_modules/@visx/scale/node_modules/d3-scale/src/index.js from /Users/christopher-williams/dev/visx/packages/visx-demo/node_modules/@visx/scale/lib/scales/band.js not supported.

This PR

  • updates the demo site from next@9.5.4 to next@^11 and turns on its experimental support for esm modules
    • no breaking changes for 9=>10
    • no breaking changes for us for 10=>11 because we're on react@18, but some SSR mismatch errors surfaced and I had to refactor some of our next-config + happo config which references next's webpack configuration.
  • adds next-transpile-modules with config for the problematic d3-* packages
    • when trying different combinations I found this was still necessary
  • fixed a @visx/visx version in visx-demo
  • updated the tsconfig for visx-demo which was trying to extend a base root config which wasn't working great

verified that the site builds locally when rebased on #1578

@@ -66,7 +66,7 @@
"@visx/text": "2.17.0",
"@visx/threshold": "2.18.0",
"@visx/tooltip": "2.17.0",
"@visx/visx": "2.16.0",
"@visx/visx": "2.18.0",
Copy link
Collaborator Author

@williaster williaster Jan 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was not the latest, which meant a copy of all @visx/* packages were in a local node_modules which would hide some errors (e.g., because they were the non-ESM versions)

@williaster williaster merged commit 21d4bf2 into master Jan 5, 2023
@williaster williaster deleted the chris--next-10 branch January 5, 2023 22:56
@williaster williaster mentioned this pull request Jan 20, 2023
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