Repository navigation
Conversation
Signed-off-by: Guillaume LADORME <Gladorme@users.noreply.github.com>
Signed-off-by: Guillaume LADORME <Gladorme@users.noreply.github.com>
Nexucis
left a comment
There was a problem hiding this comment.
Together with perses/shared#390, the use-resize-observer v10 migration and the wider react/react-dom ranges look good.
One thing still prevents plugins from running on a React 19 host. The lockfile still builds plugins with React 18.3.1, and plugins share only react and react-dom, so every bundle includes React 18's react/jsx-runtime. On a React 19 host, that runtime gets the shared React 19 as react and crashes as soon as it loads:
Cannot read properties of undefined (reading 'ReactCurrentOwner')
I reproduced this with React 18.3.1's production runtime against React 19. Until it's fixed, the READMEs' "requires react and react-dom 18 or 19" doesn't hold at runtime. The host-side change is suggested in perses/shared#390.
| react: { requiredVersion: '^18.2.0 || ^19.0.0', singleton: true }, | ||
| 'react-dom': { requiredVersion: '^18.2.0 || ^19.0.0', singleton: true }, |
There was a problem hiding this comment.
This applies to every plugin's rsbuild.config.ts. Sharing the JSX runtime makes the plugin use the host's runtime (React 18 or 19) instead of the bundled React 18 one. The host also has to provide it (suggested in perses/shared#390).
| react: { requiredVersion: '^18.2.0 || ^19.0.0', singleton: true }, | |
| 'react-dom': { requiredVersion: '^18.2.0 || ^19.0.0', singleton: true }, | |
| react: { requiredVersion: '^18.2.0 || ^19.0.0', singleton: true }, | |
| 'react-dom': { requiredVersion: '^18.2.0 || ^19.0.0', singleton: true }, | |
| 'react/jsx-runtime': { requiredVersion: '^18.2.0 || ^19.0.0', singleton: true }, |
Dev builds use react/jsx-dev-runtime instead, so plugin dev mode against a React 19 host is worth checking too.
Description
Depends on PR: perses/shared#390.
Add support for React 19+, while still keeping React 18 as base.
Related to perses/perses#4578
Done by IA (Opus 5.5)
Screenshots
Checklist
[<catalog_entry>] <commit message>naming convention using one of thefollowing
catalog_entryvalues:FEATURE,ENHANCEMENT,BUGFIX,BREAKINGCHANGE,DOC,IGNORE.UI Changes