Skip to content

Conversation

dai-shi
Copy link
Owner

@dai-shi dai-shi commented Feb 20, 2020

  • new API: useContext(context, selector)
  • new implementation with useMutableSource in the RFC
  • in TypeScript

Check list:

  • implementation
  • readme
@dai-shi
Copy link
Owner Author

dai-shi commented Feb 21, 2020

Just did a quick benchmark. This is very simplified usage, and it may not reflect real use cases. react-redux-use-context-selector-2-keyed represents ff52b56 with useMutableSource-enabled (wip) React. (while others use React 16.8.6, so they are totally incomparable.)

image

@dai-shi
Copy link
Owner Author

dai-shi commented Feb 21, 2020

Here's another trial. both v1 and v2 use facebook/react@b028a0b.

image

@dai-shi
Copy link
Owner Author

dai-shi commented Feb 23, 2020

If we still need to use calculateChangedBits, we should stick with v1 without useMutableSource. That's very unfortunate though.

@dai-shi
Copy link
Owner Author

dai-shi commented Sep 4, 2021

uMS will not land, and v1.3 already works well with concurrent rendering at its best. Closing.

@dai-shi dai-shi closed this Sep 4, 2021
@dai-shi dai-shi deleted the v2 branch September 18, 2022 03:12
@HansBrende
Copy link

@dai-shi the replacement for useMutableSource is useSyncExternalStore.... why not use that function instead?

@dai-shi
Copy link
Owner Author

dai-shi commented Dec 15, 2022

It doesn't work as we want. It's "Sync" and its behavior isn't well in concurrent rendering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

5 participants