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

Feature: React 19 testing and documentation #6044

Open
etrepum opened this issue May 7, 2024 · 0 comments · May be fixed by #6048
Open

Feature: React 19 testing and documentation #6044

etrepum opened this issue May 7, 2024 · 0 comments · May be fixed by #6048
Assignees
Labels
enhancement Improvement over existing feature soon-will-cause-trouble These issues will soon turn into bugs if not addresses in a timely manner.

Comments

@etrepum
Copy link
Contributor

etrepum commented May 7, 2024

Some of the behavior changes in React 19, particularly the ones relevant to StrictMode, can have observable effects when people upgrade (#6040 for example). After spending a little time looking into it, I think the library usage is correct enough, but we should try and write some tests that exercise the issues that StrictMode can cause.

Here are some things I think we should address for React 19:

  • Add some jobs to CI that run tests against react@beta react-dom@beta (probably unit tests and one platform+browser set of e2e). I think the workspaces make this a little tricky but locally it seemed to work if I upgraded it in each workspace that has a direct dependency on react
$ grep version node_modules/react/package.json
  "version": "18.2.0",
$ for x in website devtools playground; do npm -w packages/lexical-$x i react@beta react-dom@beta; done
…
$ grep version node_modules/react/package.json
  "version": "19.0.0-beta-b498834eab-20240506",
  • Scan the library for React usage that should change in the React 19 Upgrade Guide, particularly the StrictMode improvements… but also our tests would need workarounds because act moved with a deprecation warning so we'll need a wrapper for that.
  • Write new tests that try and exercise potential issues with StrictMode, particularly around LexicalComposer and the function version of editorState, but also other situations where callbacks might be expected and not happen if certain things were initialized in the first pass of the double-render (e.g. editable or rootListener, update, etc.)
  • Add FAQ entries and/or a usage guide to the lexical react docs that covers how to use (and not use) effects, useLexicalSubscription, etc.
@etrepum etrepum added the enhancement Improvement over existing feature label May 7, 2024
@etrepum etrepum linked a pull request May 7, 2024 that will close this issue
@StyleT StyleT added the soon-will-cause-trouble These issues will soon turn into bugs if not addresses in a timely manner. label May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement over existing feature soon-will-cause-trouble These issues will soon turn into bugs if not addresses in a timely manner.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants