Compare commits

...

3 Commits

Author SHA1 Message Date
Nicolas Gallagher
4ab6305f6d Move eventSystemFlags to last argument in event plugin extractors (#16978)
Fix for necolas/react-native-web#1443
2019-10-03 11:24:32 -07:00
Andrew Clark
2f2ab82af6 Update local version numbers for 16.10.1 release 2019-09-28 21:39:28 -07:00
Sebastian Markbåge
d346d92084 Allow Suspense Mismatch on the Client to Silently Proceed (#16943)
* Regression test: Suspense + hydration + legacy

* Allow Suspense Mismatch on the Client to Silently Proceed

This fixes but isn't actually the semantics that we want this case to have.
2019-09-28 10:50:57 -07:00
29 changed files with 50 additions and 40 deletions

View File

@@ -1,7 +1,7 @@
{
"name": "create-subscription",
"description": "utility for subscribing to external data sources inside React components",
"version": "16.9.0",
"version": "16.10.1",
"repository": {
"type": "git",
"url": "https://github.com/facebook/react.git",

View File

@@ -1,7 +1,7 @@
{
"name": "eslint-plugin-react-hooks",
"description": "ESLint rules for React Hooks",
"version": "2.0.1",
"version": "2.1.1",
"repository": {
"type": "git",
"url": "https://github.com/facebook/react.git",

View File

@@ -1,6 +1,6 @@
{
"name": "jest-react",
"version": "0.7.0",
"version": "0.8.1",
"description": "Jest matchers and utilities for testing React components.",
"main": "index.js",
"repository": {

View File

@@ -132,10 +132,10 @@ export function getListener(inst: Fiber, registrationName: string) {
*/
function extractPluginEvents(
topLevelType: TopLevelType,
eventSystemFlags: EventSystemFlags,
targetInst: null | Fiber,
nativeEvent: AnyNativeEvent,
nativeEventTarget: EventTarget,
eventSystemFlags: EventSystemFlags,
): Array<ReactSyntheticEvent> | ReactSyntheticEvent | null {
let events = null;
for (let i = 0; i < plugins.length; i++) {
@@ -144,10 +144,10 @@ function extractPluginEvents(
if (possiblePlugin) {
const extractedEvents = possiblePlugin.extractEvents(
topLevelType,
eventSystemFlags,
targetInst,
nativeEvent,
nativeEventTarget,
eventSystemFlags,
);
if (extractedEvents) {
events = accumulateInto(events, extractedEvents);
@@ -159,17 +159,17 @@ function extractPluginEvents(
export function runExtractedPluginEventsInBatch(
topLevelType: TopLevelType,
eventSystemFlags: EventSystemFlags,
targetInst: null | Fiber,
nativeEvent: AnyNativeEvent,
nativeEventTarget: EventTarget,
eventSystemFlags: EventSystemFlags,
) {
const events = extractPluginEvents(
topLevelType,
eventSystemFlags,
targetInst,
nativeEvent,
nativeEventTarget,
eventSystemFlags,
);
runEventsInBatch(events);
}

View File

@@ -25,10 +25,10 @@ export type PluginModule<NativeEvent> = {
eventTypes: EventTypes,
extractEvents: (
topLevelType: TopLevelType,
eventSystemFlags: EventSystemFlags,
targetInst: null | Fiber,
nativeTarget: NativeEvent,
nativeEventTarget: EventTarget,
eventSystemFlags: EventSystemFlags,
) => ?ReactSyntheticEvent,
tapMoveThreshold?: number,
};

View File

@@ -504,10 +504,10 @@ const ResponderEventPlugin = {
*/
extractEvents: function(
topLevelType,
eventSystemFlags,
targetInst,
nativeEvent,
nativeEventTarget,
eventSystemFlags,
) {
if (isStartish(topLevelType)) {
trackedTouchCount += 1;

View File

@@ -314,10 +314,10 @@ const run = function(config, hierarchyConfig, nativeEventConfig) {
// Trigger the event
const extractedEvents = ResponderEventPlugin.extractEvents(
nativeEventConfig.topLevelType,
PLUGIN_EVENT_SYSTEM,
nativeEventConfig.targetInst,
nativeEventConfig.nativeEvent,
nativeEventConfig.target,
PLUGIN_EVENT_SYSTEM,
);
// At this point the negotiation events have been dispatched as part of the

View File

@@ -1,7 +1,7 @@
{
"name": "react-art",
"description": "React ART is a JavaScript library for drawing vector graphics using React. It provides declarative and reactive bindings to the ART library. Using the same declarative API you can render the output to either Canvas, SVG or VML (IE8).",
"version": "16.9.0",
"version": "16.10.1",
"main": "index.js",
"repository": {
"type": "git",
@@ -27,7 +27,7 @@
"loose-envify": "^1.1.0",
"object-assign": "^4.1.1",
"prop-types": "^15.6.2",
"scheduler": "^0.15.0"
"scheduler": "^0.16.1"
},
"peerDependencies": {
"react": "^16.0.0"

View File

@@ -11,7 +11,7 @@ import React, {Fragment, useState} from 'react';
import {Button, Text, View} from 'react-native-web';
export default function ReactNativeWeb() {
const [backgroundColor, setBackgroundColor] = useState('blue');
const [backgroundColor, setBackgroundColor] = useState('purple');
const toggleColor = () =>
setBackgroundColor(backgroundColor === 'purple' ? 'green' : 'purple');
return (
@@ -29,8 +29,8 @@ export default function ReactNativeWeb() {
left
</Text>
<Button
color={backgroundColor}
onPress={toggleColor}
style={{backgroundColor}}
title={`Switch background color to "${
backgroundColor === 'purple' ? 'green' : 'purple'
}"`}

View File

@@ -1,6 +1,6 @@
{
"name": "react-dom",
"version": "16.9.0",
"version": "16.10.1",
"description": "React package for working with the DOM.",
"main": "index.js",
"repository": {
@@ -20,7 +20,7 @@
"loose-envify": "^1.1.0",
"object-assign": "^4.1.1",
"prop-types": "^15.6.2",
"scheduler": "^0.15.0"
"scheduler": "^0.16.1"
},
"peerDependencies": {
"react": "^16.0.0"

View File

@@ -659,4 +659,15 @@ describe('ReactDOMServerHydration', () => {
document.body.removeChild(parentContainer);
});
it('regression test: Suspense + hydration in legacy mode ', () => {
const element = document.createElement('div');
element.innerHTML = '<div>Hello World</div>';
ReactDOM.hydrate(
<React.Suspense>
<div>Hello World</div>
</React.Suspense>,
element,
);
});
});

View File

@@ -464,10 +464,10 @@ const BeforeInputEventPlugin = {
extractEvents: function(
topLevelType,
eventSystemFlags,
targetInst,
nativeEvent,
nativeEventTarget,
eventSystemFlags,
) {
const composition = extractCompositionEvent(
topLevelType,

View File

@@ -262,10 +262,10 @@ const ChangeEventPlugin = {
extractEvents: function(
topLevelType,
eventSystemFlags,
targetInst,
nativeEvent,
nativeEventTarget,
eventSystemFlags,
) {
const targetNode = targetInst ? getNodeFromInstance(targetInst) : window;

View File

@@ -54,10 +54,10 @@ const EnterLeaveEventPlugin = {
*/
extractEvents: function(
topLevelType,
eventSystemFlags,
targetInst,
nativeEvent,
nativeEventTarget,
eventSystemFlags,
) {
const isOverEvent =
topLevelType === TOP_MOUSE_OVER || topLevelType === TOP_POINTER_OVER;

View File

@@ -181,10 +181,10 @@ function handleTopLevel(bookKeeping: BookKeepingInstance) {
runExtractedPluginEventsInBatch(
topLevelType,
bookKeeping.eventSystemFlags,
targetInst,
nativeEvent,
eventTarget,
bookKeeping.eventSystemFlags,
);
}
}

View File

@@ -162,10 +162,10 @@ const SelectEventPlugin = {
extractEvents: function(
topLevelType,
eventSystemFlags,
targetInst,
nativeEvent,
nativeEventTarget,
eventSystemFlags,
) {
const doc = getEventTargetDocument(nativeEventTarget);
// Track whether all listeners exists for this plugin. If none exist, we do

View File

@@ -248,10 +248,10 @@ const SimpleEventPlugin: PluginModule<MouseEvent> & {
extractEvents: function(
topLevelType: TopLevelType,
eventSystemFlags: EventSystemFlags,
targetInst: null | Fiber,
nativeEvent: MouseEvent,
nativeEventTarget: EventTarget,
eventSystemFlags: EventSystemFlags,
): null | ReactSyntheticEvent {
const dispatchConfig = topLevelEventsToDispatchConfig[topLevelType];
if (!dispatchConfig) {

View File

@@ -1,6 +1,6 @@
{
"name": "react-is",
"version": "16.9.0",
"version": "16.10.1",
"description": "Brand checking of React Elements.",
"main": "index.js",
"repository": {

View File

@@ -42,10 +42,10 @@ export function dispatchEvent(
// Heritage plugin event system
runExtractedPluginEventsInBatch(
topLevelType,
PLUGIN_EVENT_SYSTEM,
targetFiber,
nativeEvent,
nativeEvent.target,
PLUGIN_EVENT_SYSTEM,
);
});
// React Native doesn't use ReactControlledComponent but if it did, here's

View File

@@ -33,10 +33,10 @@ const ReactNativeBridgeEventPlugin = {
*/
extractEvents: function(
topLevelType: TopLevelType,
eventSystemFlags: EventSystemFlags,
targetInst: null | Object,
nativeEvent: AnyNativeEvent,
nativeEventTarget: Object,
eventSystemFlags: EventSystemFlags,
): ?Object {
if (targetInst == null) {
// Probably a node belonging to another renderer's tree.

View File

@@ -101,10 +101,10 @@ function _receiveRootNodeIDEvent(
batchedUpdates(function() {
runExtractedPluginEventsInBatch(
topLevelType,
PLUGIN_EVENT_SYSTEM,
inst,
nativeEvent,
nativeEvent.target,
PLUGIN_EVENT_SYSTEM,
);
});
// React Native doesn't use ReactControlledComponent but if it did, here's

View File

@@ -1,7 +1,7 @@
{
"name": "react-reconciler",
"description": "React package for creating custom renderers.",
"version": "0.21.0",
"version": "0.22.1",
"keywords": [
"react"
],
@@ -33,7 +33,7 @@
"loose-envify": "^1.1.0",
"object-assign": "^4.1.1",
"prop-types": "^15.6.2",
"scheduler": "^0.15.0"
"scheduler": "^0.16.1"
},
"browserify": {
"transform": [

View File

@@ -404,11 +404,10 @@ function skipPastDehydratedSuspenseInstance(
let suspenseState: null | SuspenseState = fiber.memoizedState;
let suspenseInstance: null | SuspenseInstance =
suspenseState !== null ? suspenseState.dehydrated : null;
invariant(
suspenseInstance,
'Expected to have a hydrated suspense instance. ' +
'This error is likely caused by a bug in React. Please file an issue.',
);
if (suspenseInstance === null) {
// This Suspense boundary was hydrated without a match.
return nextHydratableInstance;
}
return getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance);
}

View File

@@ -4,7 +4,7 @@
"keywords": [
"react"
],
"version": "0.4.2",
"version": "0.5.1",
"homepage": "https://reactjs.org/",
"bugs": "https://github.com/facebook/react/issues",
"license": "MIT",

View File

@@ -1,6 +1,6 @@
{
"name": "react-test-renderer",
"version": "16.9.0",
"version": "16.10.1",
"description": "React package for snapshot testing.",
"main": "index.js",
"repository": {
@@ -22,7 +22,7 @@
"object-assign": "^4.1.1",
"prop-types": "^15.6.2",
"react-is": "^16.8.6",
"scheduler": "^0.15.0"
"scheduler": "^0.16.1"
},
"peerDependencies": {
"react": "^16.0.0"

View File

@@ -4,7 +4,7 @@
"keywords": [
"react"
],
"version": "16.9.0",
"version": "16.10.1",
"homepage": "https://reactjs.org/",
"bugs": "https://github.com/facebook/react/issues",
"license": "MIT",

View File

@@ -1,6 +1,6 @@
{
"name": "scheduler",
"version": "0.15.0",
"version": "0.16.1",
"description": "Cooperative scheduler for the browser environment.",
"main": "index.js",
"repository": {

View File

@@ -8,4 +8,4 @@
'use strict';
// TODO: this is special because it gets imported during build.
module.exports = '16.8.6';
module.exports = '16.10.1';

View File

@@ -1,7 +1,7 @@
{
"name": "use-subscription",
"description": "Reusable hooks",
"version": "1.0.0",
"version": "1.1.1",
"repository": {
"type": "git",
"url": "https://github.com/facebook/react.git",