react/scripts/flow
Andrew Clark 376d5c1b5a Split cross-package types from implementation
Some of our internal reconciler types have leaked into other packages.
Usually, these types are treated as opaque; we don't read and write
to its fields. This is good.

However, the type is often passed back to a reconciler method. For
example, React DOM creates a FiberRoot with `createContainer`, then
passes that root to `updateContainer`. It doesn't do anything with the
root except pass it through, but because `updateContainer` expects a
full FiberRoot, React DOM is still coupled to all its fields.

I don't know if there's an idiomatic way to handle this in Flow. Opaque
types are simlar, but those only work within a single file. AFAIK,
there's no way to use a package as the boundary for opaqueness.

The immediate problem this presents is that the reconciler refactor will
involve changes to our internal data structures. I don't want to have to
fork every single package that happens to pass through a Fiber or
FiberRoot, or access any one of its fields. So my current plan is to
share the same Flow type across both forks. The shared type will be a
superset of each implementation's type, e.g. Fiber will have both an
`expirationTime` field and a `lanes` field. The implementations will
diverge, but not the types.

To do this, I lifted the type definitions into a separate module.
2020-04-08 23:49:23 -07:00
..
config [Flight] Split Streaming from Relay Implemenation (#18260) 2020-03-10 14:55:04 -07:00
createFlowConfigs.js Enable prefer-const lint rules (#18451) 2020-04-01 12:35:52 -07:00
environment.js Formalize the Wakeable and Thenable types (#18391) 2020-03-25 16:49:37 -07:00
react-devtools.js Inlined DevTools event emitter impl (#18378) 2020-03-25 10:26:40 -07:00
react-native-host-hooks.js Split cross-package types from implementation 2020-04-08 23:49:23 -07:00
react-relay-hooks.js Pass BundlerConfig through to Relay Integration (#18393) 2020-03-25 20:25:54 -07:00
runFlow.js Drop the year from Facebook copyright headers and the LICENSE file. (#13593) 2018-09-07 15:11:23 -07:00