Skip to content

Commit e31a360

Browse files
committed
Merge branch 'master' of https://github.com/facebook/react into hide_portal_container
2 parents df5d478 + 10277cc commit e31a360

File tree

141 files changed

+3347
-633
lines changed

Some content is hidden

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

141 files changed

+3347
-633
lines changed

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,33 @@
66
</summary>
77
</details>
88

9+
## 16.10.1 (September 28, 2019)
10+
11+
### React DOM
12+
13+
* Fix regression in Next.js apps by allowing Suspense mismatch during hydration to silently proceed ([@sebmarkbage](https://github.com/sebmarkbage) in [#16943](https://github.com/facebook/react/pull/16943))
14+
15+
## 16.10.0 (September 27, 2019)
16+
17+
### React DOM
18+
19+
* Fix edge case where a hook update wasn't being memoized. ([@sebmarkbage](http://github.com/sebmarkbage) in [#16359](https://github.com/facebook/react/pull/16359))
20+
* Fix heuristic for determining when to hydrate, so we don't incorrectly hydrate during an update. ([@sebmarkbage](http://github.com/sebmarkbage) in [#16739](https://github.com/facebook/react/pull/16739))
21+
* Clear additional fiber fields during unmount to save memory. ([@trueadm](http://github.com/trueadm) in [#16807](https://github.com/facebook/react/pull/16807))
22+
* Fix bug with required text fields in Firefox. ([@halvves](http://github.com/halvves) in [#16578](https://github.com/facebook/react/pull/16578))
23+
* Prefer `Object.is` instead of inline polyfill, when available. ([@ku8ar](http://github.com/ku8ar) in [#16212](https://github.com/facebook/react/pull/16212))
24+
* Fix bug when mixing Suspense and error handling. ([@acdlite](http://github.com/acdlite) in [#16801](https://github.com/facebook/react/pull/16801))
25+
26+
27+
### Scheduler (Experimental)
28+
29+
* Improve queue performance by switching its internal data structure to a min binary heap. ([@acdlite](http://github.com/acdlite) in [#16245](https://github.com/facebook/react/pull/16245))
30+
* Use `postMessage` loop with short intervals instead of attempting to align to frame boundaries with `requestAnimationFrame`. ([@acdlite](http://github.com/acdlite) in [#16214](https://github.com/facebook/react/pull/16214))
31+
32+
### useSubscription
33+
34+
* Avoid tearing issue when a mutation happens and the previous update is still in progress. ([@bvaughn](http://github.com/bvaughn) in [#16623](https://github.com/facebook/react/pull/16623))
35+
936
## 16.9.0 (August 8, 2019)
1037

1138
### React

fixtures/dom/src/components/fixtures/mouse-events/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import FixtureSet from '../../FixtureSet';
22
import MouseMovement from './mouse-movement';
3+
import MouseEnter from './mouse-enter';
34

45
const React = window.React;
56

@@ -8,6 +9,7 @@ class MouseEvents extends React.Component {
89
return (
910
<FixtureSet title="Mouse Events">
1011
<MouseMovement />
12+
<MouseEnter />
1113
</FixtureSet>
1214
);
1315
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
import TestCase from '../../TestCase';
2+
3+
const React = window.React;
4+
const ReactDOM = window.ReactDOM;
5+
6+
const MouseEnter = () => {
7+
const containerRef = React.useRef();
8+
9+
React.useEffect(function() {
10+
const hostEl = containerRef.current;
11+
ReactDOM.render(<MouseEnterDetect />, hostEl, () => {
12+
ReactDOM.render(<MouseEnterDetect />, hostEl.childNodes[1]);
13+
});
14+
}, []);
15+
16+
return (
17+
<TestCase
18+
title="Mouse Enter"
19+
description=""
20+
affectedBrowsers="Chrome, Safari, Firefox">
21+
<TestCase.Steps>
22+
<li>Mouse enter the boxes below, from different borders</li>
23+
</TestCase.Steps>
24+
<TestCase.ExpectedResult>
25+
Mouse enter call count should equal to 1; <br />
26+
Issue{' '}
27+
<a
28+
rel="noopener noreferrer"
29+
target="_blank"
30+
href="https://github.com/facebook/react/issues/16763">
31+
#16763
32+
</a>{' '}
33+
should not happen.
34+
<br />
35+
</TestCase.ExpectedResult>
36+
<div ref={containerRef} />
37+
</TestCase>
38+
);
39+
};
40+
41+
const MouseEnterDetect = () => {
42+
const [log, setLog] = React.useState({});
43+
const firstEl = React.useRef();
44+
const siblingEl = React.useRef();
45+
46+
const onMouseEnter = e => {
47+
const timeStamp = e.timeStamp;
48+
setLog(log => {
49+
const callCount = 1 + (log.timeStamp === timeStamp ? log.callCount : 0);
50+
return {
51+
timeStamp,
52+
callCount,
53+
};
54+
});
55+
};
56+
57+
return (
58+
<React.Fragment>
59+
<div
60+
ref={firstEl}
61+
onMouseEnter={onMouseEnter}
62+
style={{
63+
border: '1px solid #d9d9d9',
64+
padding: '20px 20px',
65+
}}>
66+
Mouse enter call count: {log.callCount || ''}
67+
</div>
68+
<div ref={siblingEl} />
69+
</React.Fragment>
70+
);
71+
};
72+
73+
export default MouseEnter;

packages/create-subscription/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "create-subscription",
33
"description": "utility for subscribing to external data sources inside React components",
4-
"version": "16.9.0",
4+
"version": "16.10.1",
55
"repository": {
66
"type": "git",
77
"url": "https://github.com/facebook/react.git",

packages/eslint-plugin-react-hooks/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "eslint-plugin-react-hooks",
33
"description": "ESLint rules for React Hooks",
4-
"version": "2.0.1",
4+
"version": "2.1.1",
55
"repository": {
66
"type": "git",
77
"url": "https://github.com/facebook/react.git",

packages/jest-react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jest-react",
3-
"version": "0.7.0",
3+
"version": "0.8.1",
44
"description": "Jest matchers and utilities for testing React components.",
55
"main": "index.js",
66
"repository": {

packages/legacy-events/EventPluginHub.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,10 @@ export function getListener(inst: Fiber, registrationName: string) {
132132
*/
133133
function extractPluginEvents(
134134
topLevelType: TopLevelType,
135-
eventSystemFlags: EventSystemFlags,
136135
targetInst: null | Fiber,
137136
nativeEvent: AnyNativeEvent,
138137
nativeEventTarget: EventTarget,
138+
eventSystemFlags: EventSystemFlags,
139139
): Array<ReactSyntheticEvent> | ReactSyntheticEvent | null {
140140
let events = null;
141141
for (let i = 0; i < plugins.length; i++) {
@@ -144,10 +144,10 @@ function extractPluginEvents(
144144
if (possiblePlugin) {
145145
const extractedEvents = possiblePlugin.extractEvents(
146146
topLevelType,
147-
eventSystemFlags,
148147
targetInst,
149148
nativeEvent,
150149
nativeEventTarget,
150+
eventSystemFlags,
151151
);
152152
if (extractedEvents) {
153153
events = accumulateInto(events, extractedEvents);
@@ -159,17 +159,17 @@ function extractPluginEvents(
159159

160160
export function runExtractedPluginEventsInBatch(
161161
topLevelType: TopLevelType,
162-
eventSystemFlags: EventSystemFlags,
163162
targetInst: null | Fiber,
164163
nativeEvent: AnyNativeEvent,
165164
nativeEventTarget: EventTarget,
165+
eventSystemFlags: EventSystemFlags,
166166
) {
167167
const events = extractPluginEvents(
168168
topLevelType,
169-
eventSystemFlags,
170169
targetInst,
171170
nativeEvent,
172171
nativeEventTarget,
172+
eventSystemFlags,
173173
);
174174
runEventsInBatch(events);
175175
}

packages/legacy-events/PluginModuleType.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ export type PluginModule<NativeEvent> = {
2525
eventTypes: EventTypes,
2626
extractEvents: (
2727
topLevelType: TopLevelType,
28-
eventSystemFlags: EventSystemFlags,
2928
targetInst: null | Fiber,
3029
nativeTarget: NativeEvent,
3130
nativeEventTarget: EventTarget,
31+
eventSystemFlags: EventSystemFlags,
3232
) => ?ReactSyntheticEvent,
3333
tapMoveThreshold?: number,
3434
};

packages/legacy-events/ResponderEventPlugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,10 +504,10 @@ const ResponderEventPlugin = {
504504
*/
505505
extractEvents: function(
506506
topLevelType,
507-
eventSystemFlags,
508507
targetInst,
509508
nativeEvent,
510509
nativeEventTarget,
510+
eventSystemFlags,
511511
) {
512512
if (isStartish(topLevelType)) {
513513
trackedTouchCount += 1;

packages/legacy-events/__tests__/ResponderEventPlugin-test.internal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,10 +314,10 @@ const run = function(config, hierarchyConfig, nativeEventConfig) {
314314
// Trigger the event
315315
const extractedEvents = ResponderEventPlugin.extractEvents(
316316
nativeEventConfig.topLevelType,
317-
PLUGIN_EVENT_SYSTEM,
318317
nativeEventConfig.targetInst,
319318
nativeEventConfig.nativeEvent,
320319
nativeEventConfig.target,
320+
PLUGIN_EVENT_SYSTEM,
321321
);
322322

323323
// At this point the negotiation events have been dispatched as part of the

0 commit comments

Comments
 (0)