Files
flipper/desktop/flipper-plugin
Michel Weststrate f7fc00cde2 Fix bug where high frequent updates could be skipped
Summary:
As reported in https://fb.workplace.com/groups/flippersupport/permalink/1346149929198995/, data updates would sometimes not render in DataTable. After some debugging, this happens when multiple updates are scheduled with high frequency, and is bug in the internal render scheduler. (it might be that this never triggered before React 18, but it was a lingering bug).

Basically in the following sequence, no second render of the data table would happen:

1. emit update
2. schedule render
3. React renders
4. emit a second update
5. scheduler bails out because update is already scheduled
6. React useEffect will clear out the scheduler state that was causing the render at point 3.

Now the second update never gets rendered out (well, not until something else causes a new render).

The problem here is that the scheduler state should be immediately reset as soon as React starts rendering, so that any new incoming update should trigger a new render, even though useEffect of the first render didn't finish. New flow now becomes:

1. emit update
2. schedule render
3. React renders & clears out scheduler state
4. emit a second update
5. scheduler schedules fresh render
6. etc...

Reviewed By: nikoant

Differential Revision: D35501325

fbshipit-source-id: 8af58c0da7bb024f360b750c856865f220dc6272
2022-04-08 11:10:29 -07:00
..
2020-07-01 09:12:35 -07:00
2022-03-31 04:01:33 -07:00

flipper-plugin

flipper-plugin is the dependency used by all modern Flipper plugins (project "Tommy").

For background: https://fb.quip.com/YHOGAnaPqAVJ

flipper-plugin is to be used as dev and peer dependency of all Flipper plugins. It provides:

  1. (TODO) Standard API's to interact with Flipper, such as the client connection.
  2. (TODO) Standard components to organize the UI
  3. (TODO) Testing utilities

API's provided by flipper-plugin are documented at fbflipper.com (TODO).

There should normally be no need to install flipper-plugin as dependency. Rather, plugins should be scaffolded using npx flipper-pkg init (TODO) as documented here