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

[Umbrella] Releasing Time Slicing #13306

Closed
3 of 13 tasks
gaearon opened this issue Aug 1, 2018 · 10 comments
Closed
3 of 13 tasks

[Umbrella] Releasing Time Slicing #13306

gaearon opened this issue Aug 1, 2018 · 10 comments
Labels
React Core Team Opened by a member of the React Core Team Type: Umbrella

Comments

@gaearon
Copy link
Collaborator

gaearon commented Aug 1, 2018

Let's use this to track what's missing before Time Slicing is usable internally and in open source.

(Note: the list below is very outdated and doesn't reflect the actual amount of work that went into this)

Initial release (MVP)

Core

Scheduler

  • Decide on naming (@flarnie, React Core team)
  • Adding support for priority (@flarnie)
    • May involve bikeshedding, iteration
    • Will require changes to React Fiber Scheduler
    • Add a fixture showing using JS Scheduler with React and also external JS
  • Better handle when tab is backgrounded (@flarnie)
  • Improvements to polyfill for rAF
  • Integrate and dogfood with internal FB products - see internal task T32773869 (@flarnie)
  • Create final API which is not renderer-dependent
  • Make react-dom depend on it, and publish it in open source (@flarnie, others internally)

Related: Suspense Umbrella (#13206)

@flarnie
Copy link
Contributor

flarnie commented Aug 3, 2018

Thanks for creating this!
I would change

Figure out if it needs a priority API
to
Implement and try out the priority API

I can pick up that work again next week.

@gaearon
Copy link
Collaborator Author

gaearon commented Aug 3, 2018

@flarnie Feel free to edit :-)

@gaearon gaearon mentioned this issue Aug 9, 2018
4 tasks
@raibima
Copy link

raibima commented Aug 13, 2018

hi @gaearon, questions:

  1. Is time-slicing a React or ReactDOM specific feature?
  2. Any reason why it's currently part of ReactDOM API as opposed to just another React.Component method (e.g., Component.prototype.deferSetState)?

@gaearon
Copy link
Collaborator Author

gaearon commented Aug 13, 2018

The unstable_deferredUpdates API is just a placeholder and will be removed. I imagine the actual API we’ll end up with should be renderer-independent.

facebook-github-bot pushed a commit to facebookarchive/nuclide that referenced this issue Sep 13, 2018
Summary:
The async mode unstable API deferredUpdates was removed in React 16.5.0 with
facebook/react#13488

As discussed there, the alternative workaround is to simply use requestIdleCallback or requestAnimationFrame.

Once a better API is released (tracking facebook/react#13306) we can use that instead for deferred async updates.

Reviewed By: hansonw

Differential Revision: D9814299

fbshipit-source-id: 8848cf05cd11ffba65b6d87233e2f5205121179b
@TrySound
Copy link
Contributor

Will offscreen api work with fragments? Like this

<React.Fragment hidden={!visible}>
  {content}
</React.Fragment>

@NE-SmallTown
Copy link
Contributor

@TrySound IIRC, React doesn't support any attribute on Fragment except one or two special(I don't remember)?

@TrySound
Copy link
Contributor

@NE-SmallTown I know that Fragment supports only key prop. That's why I'm asking. This will be a quite useful feature for example in windowing.

@ccarse
Copy link

ccarse commented Oct 24, 2018

I think this needs updated since the latest release? At least it seems so from https://reactjs.org/blog/2018/10/23/react-v-16-6.html#scheduler-experimental ?

pelmers added a commit to facebookarchive/atom-ide-ui that referenced this issue Nov 15, 2018
Summary:
The async mode unstable API deferredUpdates was removed in React 16.5.0 with
facebook/react#13488

As discussed there, the alternative workaround is to simply use requestIdleCallback or requestAnimationFrame.

Once a better API is released (tracking facebook/react#13306) we can use that instead for deferred async updates.

Reviewed By: hansonw

Differential Revision: D9814299

fbshipit-source-id: 8848cf05cd11ffba65b6d87233e2f5205121179b
@necolas necolas added the React Core Team Opened by a member of the React Core Team label Jan 8, 2020
@gaearon
Copy link
Collaborator Author

gaearon commented Jun 9, 2021

Yesterday, we announced the plan for React 18 and released React 18 Alpha.

In React 18, time slicing will be opt-in rather than on by default. The way you opt into it is with startTransition (and its Hook cousin useTransition). Here is the original time slicing demo from JSConf Iceland 2018 running a recent React build with startTransition. It works pretty well!

Since time slicing is essentially implemented, I am closing this issue. Please refer to the blog post for more information about the release, including the projected timeline. Thank you for bearing with us on this journey.

@gaearon gaearon closed this as completed Jun 9, 2021
@gaearon
Copy link
Collaborator Author

gaearon commented Jun 17, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
React Core Team Opened by a member of the React Core Team Type: Umbrella
Projects
None yet
Development

No branches or pull requests

7 participants