Skip to content

Commit

Permalink
Check each renderer's config with Flow
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed May 18, 2018
1 parent d292923 commit 34c11a9
Show file tree
Hide file tree
Showing 54 changed files with 1,480 additions and 794 deletions.
2 changes: 1 addition & 1 deletion packages/react-art/src/ReactART.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import React from 'react';
import * as ARTRenderer from 'react-reconciler/inline';
import * as ARTRenderer from 'react-reconciler/inline.art';
import Transform from 'art/core/transform';
import Mode from 'art/modes/current';
import FastNoSideEffects from 'art/modes/fast-noSideEffects';
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/client/ReactDOM.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import type {Container} from './ReactDOMHostConfig';
import '../shared/checkReact';
import './ReactDOMClientInjection';

import * as DOMRenderer from 'react-reconciler/inline';
import * as DOMRenderer from 'react-reconciler/inline.dom';
import * as ReactPortal from 'shared/ReactPortal';
import ExecutionEnvironment from 'fbjs/lib/ExecutionEnvironment';
import * as ReactGenericBatching from 'events/ReactGenericBatching';
Expand Down
51 changes: 44 additions & 7 deletions packages/react-dom/src/client/ReactDOMHostConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,19 @@ import {
DOCUMENT_FRAGMENT_NODE,
} from '../shared/HTMLNodeType';


export type T = string;
export type P = Object;
export type I = Element;
export type TI = Text;
export type HI = Element | Text;
export type PI = Element | Text;
export type C = Element | Document;
export type CC = void;
export type CX = string | { namespace: string, ancestorInfo: mixed };
export type PL = Array<mixed>;


export type Container = Element | Document;
type Props = {
autoFocus?: boolean,
Expand Down Expand Up @@ -111,6 +124,7 @@ export function getRootHostContext(rootContainerInstance: Container): HostContex
export function getChildHostContext(
parentHostContext: HostContext,
type: string,
instance: *
): HostContext {
if (__DEV__) {
const parentHostContextDev = ((parentHostContext: any): HostContextDev);
Expand All @@ -130,13 +144,13 @@ export function getPublicInstance(instance: Instance | TextInstance): * {
return instance;
}

export function prepareForCommit(): void {
export function prepareForCommit(containerInfo: *): void {
eventsEnabled = ReactBrowserEventEmitter.isEnabled();
selectionInformation = ReactInputSelection.getSelectionInformation();
ReactBrowserEventEmitter.setEnabled(false);
}

export function resetAfterCommit(): void {
export function resetAfterCommit(containerInfo: *): void {
ReactInputSelection.restoreSelection(selectionInformation);
selectionInformation = null;
ReactBrowserEventEmitter.setEnabled(eventsEnabled);
Expand Down Expand Up @@ -194,6 +208,7 @@ export function finalizeInitialChildren(
type: string,
props: Props,
rootContainerInstance: Container,
hostContext: *,
): boolean {
setInitialProperties(domElement, type, props, rootContainerInstance);
return shouldAutoFocusHostComponent(type, props);
Expand Down Expand Up @@ -566,23 +581,45 @@ export function prepareUpdate(
export const cancelDeferredCallback = ReactScheduler.cancelScheduledWork;


export function cloneInstance() {
// TODO

export function cloneInstance(
instance: Instance,
updatePayload: null | Array<mixed>,
type: string,
oldProps: Props,
newProps: Props,
internalInstanceHandle: Object,
keepChildren: boolean,
recyclableInstance: Instance,
): Instance {
return instance;
// not supported
}

export function createContainerChildSet() {
export function createContainerChildSet(
container: Container
): void {
// not supported
}

export function appendChildToContainerChildSet() {
export function appendChildToContainerChildSet(
childSet: void, child: Instance | TextInstance
): void {
// not supported
}

export function finalizeContainerChildren() {
export function finalizeContainerChildren(
container: Container,
newChildren: void
) {
// not supported
}

export function replaceContainerChildren() {
export function replaceContainerChildren(
container: Container,
newChildren: void
) {
// not supported
}

4 changes: 2 additions & 2 deletions packages/react-native-renderer/src/ReactFabric.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type {ReactNodeList} from 'shared/ReactTypes';

import './ReactFabricInjection';

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

import * as ReactPortal from 'shared/ReactPortal';
import * as ReactGenericBatching from 'events/ReactGenericBatching';
Expand Down Expand Up @@ -65,7 +65,7 @@ function findNodeHandle(componentOrHandle: any): ?number {
}
if (hostInstance.canonical) {
// Fabric
return hostInstance.canonical._nativeTag;
return (hostInstance.canonical: any)._nativeTag;
}
return hostInstance._nativeTag;
}
Expand Down
Loading

0 comments on commit 34c11a9

Please sign in to comment.