react-bits icon indicating copy to clipboard operation
react-bits copied to clipboard

[FEAT] Bump The Project To React 19

Open DavidHDev opened this issue 10 months ago • 5 comments

Description The current React version used by this project is "react": "^18.3.1".

Proposal Upgrade the project to React 19 to take advantage of the latest features, performance improvements, and bug fixes. Ensure compatibility across all dependencies and address any breaking changes.

Problems The main issue is that React Spring does not yet have a stable React 19 release. It will also be difficult to update libraries connected to three.js.

Acceptance Criteria

  • [ ] Update react and react-dom to 19.x.x in package.json.
  • [ ] Update other related dependencies (e.g., @types/react, react-router, etc.).
  • [ ] Check and update any deprecated APIs or breaking changes.
  • [ ] Run the project and fix any runtime issues.
  • [ ] Verify compatibility with third-party libraries.
  • [ ] Check all components are working without issues
  • [ ] Update documentation (if needed).

DavidHDev avatar Jan 27 '25 16:01 DavidHDev

Will this create a dependency? wondering if may create issues if installed in projects that haven't migrated to React19 and may not (many)

Vanals avatar Jan 28 '25 23:01 Vanals

@Vanals Upgrading to 19 will most likely introduce problems like that, but since not all the dependencies already used in the components have good React 19 support, it will be a while before I'll tackle this, so for the time being any component you copy to your projects will continue being a React 18 component.

Maybe we could add a version picker to the website to support react 18, but that is a big stretch.

DavidHDev avatar Jan 29 '25 08:01 DavidHDev

@DavidHDev I have just added the ability to have 'peerDependencies' in the registry. This allows you to give warns like:

Image

This might be useful while you are still working on React 19 support. And whenever you move off of 18 and want to support >= 19

ieedan avatar Feb 20 '25 15:02 ieedan

@ieedan thanks for letting me know, do I need to do anything to enable this?

DavidHDev avatar Feb 20 '25 18:02 DavidHDev

@ieedan thanks for letting me know, do I need to do anything to enable this?

Yeah just add the key in the config file and rebuild the manifest. (It can accept the same style of versions as npm)

https://jsrepo.dev/docs/setup/registry#Peer%20Dependencies

What this looks like for one of my projects: https://github.com/ieedan/shadcn-svelte-extras/blob/main/jsrepo-build-config.json

ieedan avatar Feb 20 '25 18:02 ieedan

✅ All the boxes have been ticked - the project with all its components are now migrated to React 19. Did as much testing locally, but I did not find any major breaking change (the ones I did find have been fixed as part of the migration).

DavidHDev avatar Jun 09 '25 15:06 DavidHDev