react-d3-speedometer icon indicating copy to clipboard operation
react-d3-speedometer copied to clipboard

v2.0 - React v18 support

Open palerdot opened this issue 3 years ago • 3 comments

v2.0 with React v18 support is in RC and available as next tag. You can install it with

npm install react-d3-speedometer@next

This PR has support for v18 React - https://github.com/palerdot/react-d3-speedometer/pull/143. The changes will be published as a major version of the package v2.0. Along with this upgrade, some notable changes to the package are

  • Slim Build: Starting from v2.0, a slim build of the package will be available without bundling d3 related modules. If you are already using d3 (prefarably via d3 microbundles like d3-selection etc), you can take advantage of the slim build.
  • Vite: Switching to vite for dev/prod building
  • Vitest: Switching to vitest for testing
  • Cypress/RTL: For testing, this package will be moving away from enzyme. For more context, please check https://dev.to/wojtekmaj/enzyme-is-dead-now-what-ekl
  • Exporting es, umd builds. The package will now both export es compatible build and umd compatible build by default. Library users are encouraged to make use of es build for better tree shaking in their app. Please note, slim build will not be available as a umd build. Also, the package has switched to d3 micromodules (eg: d3-ease, d3-transition etc) for better tree shaking.

palerdot avatar Apr 10 '22 03:04 palerdot

Hey @palerdot Thanks for the package first of all

I just upgraded to v18 react and can confirm I was having issues with react-d3-speedometer. Luckily I found this issue where you are already on top of it and using the @next has solved the issue I had. My error was

TypeError: b.pointer.transition is not a function

Great job, thanks!

hect1c avatar Apr 17 '22 14:04 hect1c

Hey @hect1c

Good to know. In case you face any troubles with v2.0/ v18 React, please raise an issue.

palerdot avatar Apr 18 '22 03:04 palerdot

PS: I'm locking this issue to avoid people posting their issues as comment. Please open a new issue if you are facing any problem. This issue is for information/announcement purposes only.

palerdot avatar Jul 12 '22 13:07 palerdot