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

feat: option for enabling concurrent rendering #1685

Merged
merged 12 commits into from
Oct 25, 2024

Conversation

mdjastrzebski
Copy link
Member

@mdjastrzebski mdjastrzebski commented Oct 24, 2024

Summary

Add concurrentRendering option to both render and configure that allows enabling concurrent rendering in the underlying React Test Renderer. The option is disabled by default not to break user tests but should be enabled in the next major release.

Test plan

@mdjastrzebski mdjastrzebski merged commit f231ea3 into main Oct 25, 2024
8 checks passed
@mdjastrzebski mdjastrzebski deleted the feat/enable-concurrent-rendering branch October 25, 2024 07:06
const testRendererOptions: TestRendererOptions = {
...rest,
// @ts-expect-error incomplete typing on RTR package
unstable_isConcurrent: concurrentRoot ?? getConfig().concurrentRoot,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, with RTR being deprecated, do you plan to remove it?

https://github.com/facebook/react/tree/main/packages/react-test-renderer

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@slorber I've got a working prototype for alternative test renderer built using React Reconciler (the package that virtually all alt React renderers use) in #1669. It passes all of RNTL tests and would be a good replacement for RTR. I still need to modify it for React 19 (in #1690). While transition to the new render will happen, there is no immediate urgency to replace RTR, as it still works with React 19, although with deprecation warning (which is btw disabled for RN testing).

My plan is as follows:

  • RNTL v13 (alpha version already published) will be based on RTR and support React 18 & 19.
  • RNTL v14 will be based on the new renderer and support probably React 19+

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see thanks 👍

@mdjastrzebski
Copy link
Member Author

This PR has been released in v12.8.0 🎉

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

Successfully merging this pull request may close these issues.

2 participants