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

Add support for React 19 #7115

Open
cacabo opened this issue Dec 8, 2024 · 7 comments
Open

Add support for React 19 #7115

cacabo opened this issue Dec 8, 2024 · 7 comments

Comments

@cacabo
Copy link

cacabo commented Dec 8, 2024

Environment

  • Package version(s): "@blueprintjs/core": "^5.11.0"
  • Browser and OS versions: n/a

Feature request

I want to leverage React 19 in my app which uses Blueprint in order to benefit from the React compiler, other performance improvements, and the new hooks.

Blueprint currently requires:

npm error peer react@"^16.8 || 17 || 18" from @blueprintjs/[email protected]

I can use the beta compiler runtime until Blueprint can upgrade:

// package.json
{
    // ...
    "dependencies": {
        "react": "^18.3.1",
        "react-compiler-runtime": "^19.0.0-beta-63b359f-20241101",
        // ...
    }
}

Examples

@bofa
Copy link
Contributor

bofa commented Dec 12, 2024

I would love react 19 support to be able to leverage the improved custom elements integration.

@smeng9
Copy link

smeng9 commented Dec 17, 2024

Currently there are still a lot of use cases of ReactDOM.render in the codebase which react 19 dropped support of. All of these need to be migrated to use createRoot

@bradchristensen
Copy link
Contributor

Currently there are still a lot of use cases of ReactDOM.render in the codebase which react 19 dropped support of. All of these need to be migrated to use createRoot

I just had a quick scan through the repository and it looks like all the references to ReactDOM.render are either in tests/documentation, or they can be replaced on your app side if you provide a domRenderer prop to the relevant component. So I don't think this is a blocker, but it would be nice if Blueprint could either update to use the updated createRoot method by default, or provide an automatic backwards-compatible implementation.

@bppdddqqqq
Copy link

@bradchristensen I don't think so, see #7139

@bradchristensen
Copy link
Contributor

@bradchristensen I don't think so, see #7139

Oh of course - I hadn't considered dependencies, sorry. Good catch!

@bppdddqqqq
Copy link

bppdddqqqq commented Jan 3, 2025

@bradchristensen I don't think so, see #7139

Oh of course - I hadn't considered dependencies, sorry. Good catch!

Unfortunately. I have tested other parts of Blueprint and it seems the most acted-up library is the aforementioned React-Popper. Others maintain functionality as is on React 18 and lower. What I fear is that this refactor would require either keeping the old Popper.js code and creating a switch whether it's React 17 and higher or React 16 (@floating-ui/react that supports React 19 does not support React 16 per this PR floating-ui/floating-ui#3103 ), or dropping React 16 support entirely in favor of Floating-UI.

Worst case scenario is to find a more supported solution or start cooking Popper.js wrapper that supports all flavors of React

@bppdddqqqq
Copy link

2 weeks and no news, guess I will take a look at it myself

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

No branches or pull requests

5 participants