Skip to content

Commit 7c55e9e

Browse files
committed
Check each renderer's config with Flow
1 parent d292923 commit 7c55e9e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1044
-983
lines changed

packages/react-art/src/ReactART.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
import React from 'react';
9-
import * as ARTRenderer from 'react-reconciler/inline';
9+
import * as ARTRenderer from 'react-reconciler/inline.art';
1010
import Transform from 'art/core/transform';
1111
import Mode from 'art/modes/current';
1212
import FastNoSideEffects from 'art/modes/fast-noSideEffects';

packages/react-art/src/ReactARTHostConfig.js

Lines changed: 3 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,9 @@ function applyTextProps(instance, props, prevProps = {}) {
234234
}
235235
}
236236

237+
export * from 'shared/HostConfigWithNoPersistence';
238+
export * from 'shared/HostConfigWithNoHydration';
239+
237240
export function appendInitialChild(parentInstance, child) {
238241
if (typeof child === 'string') {
239242
// Noop for string children of Text (eg <Text>{'foo'}{'bar'}</Text>)
@@ -333,8 +336,6 @@ function applyTextProps(instance, props, prevProps = {}) {
333336
export const isPrimaryRenderer = false;
334337

335338
export const supportsMutation = true;
336-
export const supportsPersistence = false;
337-
export const supportsHydration = false;
338339

339340
export function appendChild(parentInstance, child) {
340341
if (child.parentNode === parentInstance) {
@@ -388,80 +389,3 @@ function applyTextProps(instance, props, prevProps = {}) {
388389
instance._applyProps(instance, newProps, oldProps);
389390
}
390391

391-
392-
export function cloneInstance() {
393-
// not supported
394-
}
395-
396-
export function createContainerChildSet() {
397-
// not supported
398-
}
399-
400-
export function appendChildToContainerChildSet() {
401-
// not supported
402-
}
403-
404-
export function finalizeContainerChildren() {
405-
// not supported
406-
}
407-
408-
export function replaceContainerChildren() {
409-
// not supported
410-
}
411-
412-
413-
export function canHydrateInstance() {
414-
// not supported
415-
}
416-
417-
export function canHydrateTextInstance() {
418-
// not supported
419-
}
420-
421-
export function getNextHydratableSibling() {
422-
// not supported
423-
}
424-
425-
export function getFirstHydratableChild() {
426-
// not supported
427-
}
428-
429-
export function hydrateInstance() {
430-
// not supported
431-
}
432-
433-
export function hydrateTextInstance() {
434-
// not supported
435-
}
436-
437-
export function didNotMatchHydratedContainerTextInstance() {
438-
// not supported
439-
}
440-
441-
export function didNotMatchHydratedTextInstance() {
442-
// not supported
443-
}
444-
445-
export function didNotHydrateContainerInstance() {
446-
// not supported
447-
}
448-
449-
export function didNotHydrateInstance() {
450-
// not supported
451-
}
452-
453-
export function didNotFindHydratableContainerInstance() {
454-
// not supported
455-
}
456-
457-
export function didNotFindHydratableContainerTextInstance() {
458-
// not supported
459-
}
460-
461-
export function didNotFindHydratableInstance() {
462-
// not supported
463-
}
464-
465-
export function didNotFindHydratableTextInstance() {
466-
// not supported
467-
}

packages/react-dom/src/client/ReactDOM.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import type {Container} from './ReactDOMHostConfig';
1919
import '../shared/checkReact';
2020
import './ReactDOMClientInjection';
2121

22-
import * as DOMRenderer from 'react-reconciler/inline';
22+
import * as DOMRenderer from 'react-reconciler/inline.dom';
2323
import * as ReactPortal from 'shared/ReactPortal';
2424
import ExecutionEnvironment from 'fbjs/lib/ExecutionEnvironment';
2525
import * as ReactGenericBatching from 'events/ReactGenericBatching';

packages/react-dom/src/client/ReactDOMHostConfig.js

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,19 @@ import {
2424
DOCUMENT_FRAGMENT_NODE,
2525
} from '../shared/HTMLNodeType';
2626

27+
28+
export type T = string;
29+
export type P = Object;
30+
export type I = Element;
31+
export type TI = Text;
32+
export type HI = Element | Text;
33+
export type PI = Element | Text;
34+
export type C = Element | Document;
35+
export type CC = void;
36+
export type CX = string | { namespace: string, ancestorInfo: mixed };
37+
export type PL = Array<mixed>;
38+
39+
2740
export type Container = Element | Document;
2841
type Props = {
2942
autoFocus?: boolean,
@@ -77,6 +90,10 @@ function shouldAutoFocusHostComponent(type: string, props: Props): boolean {
7790
return false;
7891
}
7992

93+
94+
export * from 'shared/HostConfigWithNoPersistence';
95+
96+
8097
export function getRootHostContext(rootContainerInstance: Container): HostContext {
8198
let type;
8299
let namespace;
@@ -111,6 +128,7 @@ export function getRootHostContext(rootContainerInstance: Container): HostContex
111128
export function getChildHostContext(
112129
parentHostContext: HostContext,
113130
type: string,
131+
instance: *
114132
): HostContext {
115133
if (__DEV__) {
116134
const parentHostContextDev = ((parentHostContext: any): HostContextDev);
@@ -130,13 +148,13 @@ export function getPublicInstance(instance: Instance | TextInstance): * {
130148
return instance;
131149
}
132150

133-
export function prepareForCommit(): void {
151+
export function prepareForCommit(containerInfo: *): void {
134152
eventsEnabled = ReactBrowserEventEmitter.isEnabled();
135153
selectionInformation = ReactInputSelection.getSelectionInformation();
136154
ReactBrowserEventEmitter.setEnabled(false);
137155
}
138156

139-
export function resetAfterCommit(): void {
157+
export function resetAfterCommit(containerInfo: *): void {
140158
ReactInputSelection.restoreSelection(selectionInformation);
141159
selectionInformation = null;
142160
ReactBrowserEventEmitter.setEnabled(eventsEnabled);
@@ -194,6 +212,7 @@ export function finalizeInitialChildren(
194212
type: string,
195213
props: Props,
196214
rootContainerInstance: Container,
215+
hostContext: *,
197216
): boolean {
198217
setInitialProperties(domElement, type, props, rootContainerInstance);
199218
return shouldAutoFocusHostComponent(type, props);
@@ -267,7 +286,6 @@ export function prepareUpdate(
267286
export const isPrimaryRenderer = true;
268287

269288
export const supportsMutation = true;
270-
export const supportsPersistence = false;
271289
export const supportsHydration = true;
272290

273291
export function commitMount(
@@ -565,24 +583,3 @@ export function prepareUpdate(
565583
export const scheduleDeferredCallback = ReactScheduler.scheduleWork;
566584
export const cancelDeferredCallback = ReactScheduler.cancelScheduledWork;
567585

568-
569-
export function cloneInstance() {
570-
// not supported
571-
}
572-
573-
export function createContainerChildSet() {
574-
// not supported
575-
}
576-
577-
export function appendChildToContainerChildSet() {
578-
// not supported
579-
}
580-
581-
export function finalizeContainerChildren() {
582-
// not supported
583-
}
584-
585-
export function replaceContainerChildren() {
586-
// not supported
587-
}
588-

packages/react-native-renderer/src/ReactFabric.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import type {ReactNodeList} from 'shared/ReactTypes';
1212

1313
import './ReactFabricInjection';
1414

15-
import * as ReactFabricRenderer from 'react-reconciler/inline';
15+
import * as ReactFabricRenderer from 'react-reconciler/inline.fabric';
1616

1717
import * as ReactPortal from 'shared/ReactPortal';
1818
import * as ReactGenericBatching from 'events/ReactGenericBatching';
@@ -65,7 +65,7 @@ function findNodeHandle(componentOrHandle: any): ?number {
6565
}
6666
if (hostInstance.canonical) {
6767
// Fabric
68-
return hostInstance.canonical._nativeTag;
68+
return (hostInstance.canonical: any)._nativeTag;
6969
}
7070
return hostInstance._nativeTag;
7171
}

0 commit comments

Comments
 (0)