react-dom 16.10.0 → 16.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build-info.json +4 -4
- package/cjs/react-dom-server.browser.development.js +122 -177
- package/cjs/react-dom-server.browser.production.min.js +29 -29
- package/cjs/react-dom-server.node.development.js +116 -167
- package/cjs/react-dom-server.node.production.min.js +17 -17
- package/cjs/react-dom-test-utils.development.js +55 -91
- package/cjs/react-dom-test-utils.production.min.js +9 -9
- package/cjs/react-dom-unstable-fizz.browser.development.js +9 -5
- package/cjs/react-dom-unstable-fizz.browser.production.min.js +3 -3
- package/cjs/react-dom-unstable-fizz.node.development.js +23 -10
- package/cjs/react-dom-unstable-fizz.node.production.min.js +4 -3
- package/cjs/react-dom-unstable-flight-client.development.js +357 -0
- package/cjs/react-dom-unstable-flight-client.production.min.js +16 -0
- package/cjs/react-dom-unstable-flight-server.browser.development.js +392 -0
- package/cjs/react-dom-unstable-flight-server.browser.production.min.js +16 -0
- package/cjs/react-dom-unstable-flight-server.node.development.js +415 -0
- package/cjs/react-dom-unstable-flight-server.node.production.min.js +16 -0
- package/cjs/react-dom-unstable-native-dependencies.development.js +28 -48
- package/cjs/react-dom-unstable-native-dependencies.production.min.js +15 -15
- package/cjs/react-dom.development.js +1912 -2046
- package/cjs/react-dom.production.min.js +266 -269
- package/cjs/react-dom.profiling.min.js +252 -255
- package/package.json +8 -3
- package/umd/react-dom-server.browser.development.js +122 -177
- package/umd/react-dom-server.browser.production.min.js +36 -36
- package/umd/react-dom-test-utils.development.js +55 -91
- package/umd/react-dom-test-utils.production.min.js +9 -9
- package/umd/react-dom-unstable-fizz.browser.development.js +9 -5
- package/umd/react-dom-unstable-fizz.browser.production.min.js +3 -3
- package/umd/react-dom-unstable-flight-client.development.js +357 -0
- package/umd/react-dom-unstable-flight-client.production.min.js +14 -0
- package/umd/react-dom-unstable-flight-server.browser.development.js +390 -0
- package/umd/react-dom-unstable-flight-server.browser.production.min.js +14 -0
- package/umd/react-dom-unstable-native-dependencies.development.js +28 -48
- package/umd/react-dom-unstable-native-dependencies.production.min.js +22 -22
- package/umd/react-dom.development.js +1916 -2050
- package/umd/react-dom.production.min.js +230 -232
- package/umd/react-dom.profiling.min.js +237 -239
- package/unstable-flight-client.js +7 -0
- package/unstable-flight-server.browser.js +7 -0
- package/unstable-flight-server.js +3 -0
- package/unstable-flight-server.node.js +7 -0
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
/** @license React v16.12.0
|
|
2
|
+
* react-dom-unstable-flight-server.browser.development.js
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
'use strict';
|
|
11
|
+
|
|
12
|
+
(function (global, factory) {
|
|
13
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('react-dom/server')) :
|
|
14
|
+
typeof define === 'function' && define.amd ? define(['react-dom/server'], factory) :
|
|
15
|
+
(global.ReactFlightDOMServer = factory(global.ReactDOMServer));
|
|
16
|
+
}(this, (function (ReactDOMServer) { 'use strict';
|
|
17
|
+
|
|
18
|
+
function scheduleWork(callback) {
|
|
19
|
+
callback();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
function writeChunk(destination, buffer) {
|
|
24
|
+
destination.enqueue(buffer);
|
|
25
|
+
return destination.desiredSize > 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function close(destination) {
|
|
29
|
+
destination.close();
|
|
30
|
+
}
|
|
31
|
+
var textEncoder = new TextEncoder();
|
|
32
|
+
function convertStringToBuffer(content) {
|
|
33
|
+
return textEncoder.encode(content);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function renderHostChildrenToString(children) {
|
|
37
|
+
// TODO: This file is used to actually implement a server renderer
|
|
38
|
+
// so we can't actually reference the renderer here. Instead, we
|
|
39
|
+
// should replace this method with a reference to Fizz which
|
|
40
|
+
// then uses this file to implement the server renderer.
|
|
41
|
+
return ReactDOMServer.renderToStaticMarkup(children);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
45
|
+
// nor polyfill, then a plain number is used for performance.
|
|
46
|
+
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
47
|
+
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
// TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
|
|
54
|
+
// (unstable) APIs that have been removed. Can we remove the symbols?
|
|
55
|
+
|
|
56
|
+
/*
|
|
57
|
+
|
|
58
|
+
FLIGHT PROTOCOL GRAMMAR
|
|
59
|
+
|
|
60
|
+
Response
|
|
61
|
+
- JSONData RowSequence
|
|
62
|
+
- JSONData
|
|
63
|
+
|
|
64
|
+
RowSequence
|
|
65
|
+
- Row RowSequence
|
|
66
|
+
- Row
|
|
67
|
+
|
|
68
|
+
Row
|
|
69
|
+
- "J" RowID JSONData
|
|
70
|
+
- "H" RowID HTMLData
|
|
71
|
+
- "B" RowID BlobData
|
|
72
|
+
- "U" RowID URLData
|
|
73
|
+
- "E" RowID ErrorData
|
|
74
|
+
|
|
75
|
+
RowID
|
|
76
|
+
- HexDigits ":"
|
|
77
|
+
|
|
78
|
+
HexDigits
|
|
79
|
+
- HexDigit HexDigits
|
|
80
|
+
- HexDigit
|
|
81
|
+
|
|
82
|
+
HexDigit
|
|
83
|
+
- 0-F
|
|
84
|
+
|
|
85
|
+
URLData
|
|
86
|
+
- (UTF8 encoded URL) "\n"
|
|
87
|
+
|
|
88
|
+
ErrorData
|
|
89
|
+
- (UTF8 encoded JSON: {message: "...", stack: "..."}) "\n"
|
|
90
|
+
|
|
91
|
+
JSONData
|
|
92
|
+
- (UTF8 encoded JSON) "\n"
|
|
93
|
+
- String values that begin with $ are escaped with a "$" prefix.
|
|
94
|
+
- References to other rows are encoding as JSONReference strings.
|
|
95
|
+
|
|
96
|
+
JSONReference
|
|
97
|
+
- "$" HexDigits
|
|
98
|
+
|
|
99
|
+
HTMLData
|
|
100
|
+
- ByteSize (UTF8 encoded HTML)
|
|
101
|
+
|
|
102
|
+
BlobData
|
|
103
|
+
- ByteSize (Binary Data)
|
|
104
|
+
|
|
105
|
+
ByteSize
|
|
106
|
+
- (unsigned 32-bit integer)
|
|
107
|
+
*/
|
|
108
|
+
// TODO: Implement HTMLData, BlobData and URLData.
|
|
109
|
+
|
|
110
|
+
var stringify = JSON.stringify;
|
|
111
|
+
function createRequest(model, destination) {
|
|
112
|
+
var pingedSegments = [];
|
|
113
|
+
var request = {
|
|
114
|
+
destination: destination,
|
|
115
|
+
nextChunkId: 0,
|
|
116
|
+
pendingChunks: 0,
|
|
117
|
+
pingedSegments: pingedSegments,
|
|
118
|
+
completedJSONChunks: [],
|
|
119
|
+
completedErrorChunks: [],
|
|
120
|
+
flowing: false,
|
|
121
|
+
toJSON: function (key, value) {
|
|
122
|
+
return resolveModelToJSON(request, value);
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
request.pendingChunks++;
|
|
126
|
+
var rootSegment = createSegment(request, model);
|
|
127
|
+
pingedSegments.push(rootSegment);
|
|
128
|
+
return request;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function attemptResolveModelComponent(element) {
|
|
132
|
+
var type = element.type;
|
|
133
|
+
var props = element.props;
|
|
134
|
+
|
|
135
|
+
if (typeof type === 'function') {
|
|
136
|
+
// This is a nested view model.
|
|
137
|
+
return type(props);
|
|
138
|
+
} else if (typeof type === 'string') {
|
|
139
|
+
// This is a host element. E.g. HTML.
|
|
140
|
+
return renderHostChildrenToString(element);
|
|
141
|
+
} else {
|
|
142
|
+
throw new Error('Unsupported type.');
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function pingSegment(request, segment) {
|
|
147
|
+
var pingedSegments = request.pingedSegments;
|
|
148
|
+
pingedSegments.push(segment);
|
|
149
|
+
|
|
150
|
+
if (pingedSegments.length === 1) {
|
|
151
|
+
scheduleWork(function () {
|
|
152
|
+
return performWork(request);
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function createSegment(request, model) {
|
|
158
|
+
var id = request.nextChunkId++;
|
|
159
|
+
var segment = {
|
|
160
|
+
id: id,
|
|
161
|
+
model: model,
|
|
162
|
+
ping: function () {
|
|
163
|
+
return pingSegment(request, segment);
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
return segment;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function serializeIDRef(id) {
|
|
170
|
+
return '$' + id.toString(16);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
function serializeRowHeader(tag, id) {
|
|
174
|
+
return tag + id.toString(16) + ':';
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function escapeStringValue(value) {
|
|
178
|
+
if (value[0] === '$') {
|
|
179
|
+
// We need to escape $ prefixed strings since we use that to encode
|
|
180
|
+
// references to IDs.
|
|
181
|
+
return '$' + value;
|
|
182
|
+
} else {
|
|
183
|
+
return value;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
function resolveModelToJSON(request, value) {
|
|
188
|
+
if (typeof value === 'string') {
|
|
189
|
+
return escapeStringValue(value);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
while (typeof value === 'object' && value !== null && value.$$typeof === REACT_ELEMENT_TYPE) {
|
|
193
|
+
var element = value;
|
|
194
|
+
|
|
195
|
+
try {
|
|
196
|
+
value = attemptResolveModelComponent(element);
|
|
197
|
+
} catch (x) {
|
|
198
|
+
if (typeof x === 'object' && x !== null && typeof x.then === 'function') {
|
|
199
|
+
// Something suspended, we'll need to create a new segment and resolve it later.
|
|
200
|
+
request.pendingChunks++;
|
|
201
|
+
var newSegment = createSegment(request, element);
|
|
202
|
+
var ping = newSegment.ping;
|
|
203
|
+
x.then(ping, ping);
|
|
204
|
+
return serializeIDRef(newSegment.id);
|
|
205
|
+
} else {
|
|
206
|
+
request.pendingChunks++;
|
|
207
|
+
var errorId = request.nextChunkId++;
|
|
208
|
+
emitErrorChunk(request, errorId, x);
|
|
209
|
+
return serializeIDRef(errorId);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
return value;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
function emitErrorChunk(request, id, error) {
|
|
218
|
+
// TODO: We should not leak error messages to the client in prod.
|
|
219
|
+
// Give this an error code instead and log on the server.
|
|
220
|
+
// We can serialize the error in DEV as a convenience.
|
|
221
|
+
var message;
|
|
222
|
+
var stack = '';
|
|
223
|
+
|
|
224
|
+
try {
|
|
225
|
+
if (error instanceof Error) {
|
|
226
|
+
message = '' + error.message;
|
|
227
|
+
stack = '' + error.stack;
|
|
228
|
+
} else {
|
|
229
|
+
message = 'Error: ' + error;
|
|
230
|
+
}
|
|
231
|
+
} catch (x) {
|
|
232
|
+
message = 'An error occurred but serializing the error message failed.';
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
var errorInfo = {
|
|
236
|
+
message: message,
|
|
237
|
+
stack: stack
|
|
238
|
+
};
|
|
239
|
+
var row = serializeRowHeader('E', id) + stringify(errorInfo) + '\n';
|
|
240
|
+
request.completedErrorChunks.push(convertStringToBuffer(row));
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
function retrySegment(request, segment) {
|
|
244
|
+
var value = segment.model;
|
|
245
|
+
|
|
246
|
+
try {
|
|
247
|
+
while (typeof value === 'object' && value !== null && value.$$typeof === REACT_ELEMENT_TYPE) {
|
|
248
|
+
// If this is a nested model, there's no need to create another chunk,
|
|
249
|
+
// we can reuse the existing one and try again.
|
|
250
|
+
var element = value;
|
|
251
|
+
segment.model = element;
|
|
252
|
+
value = attemptResolveModelComponent(element);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
var json = stringify(value, request.toJSON);
|
|
256
|
+
var row;
|
|
257
|
+
var id = segment.id;
|
|
258
|
+
|
|
259
|
+
if (id === 0) {
|
|
260
|
+
row = json + '\n';
|
|
261
|
+
} else {
|
|
262
|
+
row = serializeRowHeader('J', id) + json + '\n';
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
request.completedJSONChunks.push(convertStringToBuffer(row));
|
|
266
|
+
} catch (x) {
|
|
267
|
+
if (typeof x === 'object' && x !== null && typeof x.then === 'function') {
|
|
268
|
+
// Something suspended again, let's pick it back up later.
|
|
269
|
+
var ping = segment.ping;
|
|
270
|
+
x.then(ping, ping);
|
|
271
|
+
return;
|
|
272
|
+
} else {
|
|
273
|
+
// This errored, we need to serialize this error to the
|
|
274
|
+
emitErrorChunk(request, segment.id, x);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
function performWork(request) {
|
|
280
|
+
var pingedSegments = request.pingedSegments;
|
|
281
|
+
request.pingedSegments = [];
|
|
282
|
+
|
|
283
|
+
for (var i = 0; i < pingedSegments.length; i++) {
|
|
284
|
+
var segment = pingedSegments[i];
|
|
285
|
+
retrySegment(request, segment);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
if (request.flowing) {
|
|
289
|
+
flushCompletedChunks(request);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
var reentrant = false;
|
|
294
|
+
|
|
295
|
+
function flushCompletedChunks(request) {
|
|
296
|
+
if (reentrant) {
|
|
297
|
+
return;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
reentrant = true;
|
|
301
|
+
var destination = request.destination;
|
|
302
|
+
try {
|
|
303
|
+
var jsonChunks = request.completedJSONChunks;
|
|
304
|
+
var i = 0;
|
|
305
|
+
|
|
306
|
+
for (; i < jsonChunks.length; i++) {
|
|
307
|
+
request.pendingChunks--;
|
|
308
|
+
var chunk = jsonChunks[i];
|
|
309
|
+
|
|
310
|
+
if (!writeChunk(destination, chunk)) {
|
|
311
|
+
request.flowing = false;
|
|
312
|
+
i++;
|
|
313
|
+
break;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
jsonChunks.splice(0, i);
|
|
318
|
+
var errorChunks = request.completedErrorChunks;
|
|
319
|
+
i = 0;
|
|
320
|
+
|
|
321
|
+
for (; i < errorChunks.length; i++) {
|
|
322
|
+
request.pendingChunks--;
|
|
323
|
+
var _chunk = errorChunks[i];
|
|
324
|
+
|
|
325
|
+
if (!writeChunk(destination, _chunk)) {
|
|
326
|
+
request.flowing = false;
|
|
327
|
+
i++;
|
|
328
|
+
break;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
errorChunks.splice(0, i);
|
|
333
|
+
} finally {
|
|
334
|
+
reentrant = false;
|
|
335
|
+
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
if (request.pendingChunks === 0) {
|
|
339
|
+
// We're done.
|
|
340
|
+
close(destination);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
function startWork(request) {
|
|
345
|
+
request.flowing = true;
|
|
346
|
+
scheduleWork(function () {
|
|
347
|
+
return performWork(request);
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
function startFlowing(request) {
|
|
351
|
+
request.flowing = true;
|
|
352
|
+
flushCompletedChunks(request);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
// This file intentionally does *not* have the Flow annotation.
|
|
356
|
+
// Don't add it. See `./inline-typed.js` for an explanation.
|
|
357
|
+
|
|
358
|
+
function renderToReadableStream(model) {
|
|
359
|
+
var request;
|
|
360
|
+
return new ReadableStream({
|
|
361
|
+
start: function (controller) {
|
|
362
|
+
request = createRequest(model, controller);
|
|
363
|
+
startWork(request);
|
|
364
|
+
},
|
|
365
|
+
pull: function (controller) {
|
|
366
|
+
startFlowing(request);
|
|
367
|
+
},
|
|
368
|
+
cancel: function (reason) {}
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
var ReactFlightDOMServerBrowser = {
|
|
373
|
+
renderToReadableStream: renderToReadableStream
|
|
374
|
+
};
|
|
375
|
+
|
|
376
|
+
var ReactFlightDOMServerBrowser$1 = Object.freeze({
|
|
377
|
+
default: ReactFlightDOMServerBrowser
|
|
378
|
+
});
|
|
379
|
+
|
|
380
|
+
var ReactFlightDOMServerBrowser$2 = ( ReactFlightDOMServerBrowser$1 && ReactFlightDOMServerBrowser ) || ReactFlightDOMServerBrowser$1;
|
|
381
|
+
|
|
382
|
+
// TODO: decide on the top-level export form.
|
|
383
|
+
// This is hacky but makes it work with both Rollup and Jest
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
var unstableFlightServer_browser = ReactFlightDOMServerBrowser$2.default || ReactFlightDOMServerBrowser$2;
|
|
387
|
+
|
|
388
|
+
return unstableFlightServer_browser;
|
|
389
|
+
|
|
390
|
+
})));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** @license React v16.12.0
|
|
2
|
+
* react-dom-unstable-flight-server.browser.production.min.js
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
'use strict';(function(k,g){"object"===typeof exports&&"undefined"!==typeof module?module.exports=g(require("react-dom/server")):"function"===typeof define&&define.amd?define(["react-dom/server"],g):k.ReactFlightDOMServer=g(k.ReactDOMServer)})(this,function(k){function g(a,b){var c=[],d={destination:b,nextChunkId:0,pendingChunks:0,pingedSegments:c,completedJSONChunks:[],completedErrorChunks:[],flowing:!1,toJSON:function(a,b){return z(d,b)}};d.pendingChunks++;a=p(d,a);c.push(a);return d}function q(a){var b=
|
|
10
|
+
a.type,c=a.props;if("function"===typeof b)return b(c);if("string"===typeof b)return k.renderToStaticMarkup(a);throw Error("Unsupported type.");}function p(a,b){var c={id:a.nextChunkId++,model:b,ping:function(){var b=a.pingedSegments;b.push(c);1===b.length&&r(a)}};return c}function z(a,b){if("string"===typeof b)return a="$"===b[0]?"$"+b:b,a;for(;"object"===typeof b&&null!==b&&b.$$typeof===t;){var c=b;try{b=q(c)}catch(d){if("object"===typeof d&&null!==d&&"function"===typeof d.then)return a.pendingChunks++,
|
|
11
|
+
a=p(a,c),b=a.ping,d.then(b,b),"$"+a.id.toString(16);a.pendingChunks++;b=a.nextChunkId++;u(a,b,d);return"$"+b.toString(16)}}return b}function u(a,b,c){var d="";try{if(c instanceof Error){var e=""+c.message;d=""+c.stack}else e="Error: "+c}catch(f){e="An error occurred but serializing the error message failed."}c={message:e,stack:d};b="E"+b.toString(16)+":"+v(c)+"\n";a.completedErrorChunks.push(w.encode(b))}function r(a){var b=a.pingedSegments;a.pingedSegments=[];for(var c=0;c<b.length;c++){var d=void 0,
|
|
12
|
+
e=a,f=b[c],l=f.model;try{for(;"object"===typeof l&&null!==l&&l.$$typeof===t;){var g=l;f.model=g;l=q(g)}var h=v(l,e.toJSON),k=f.id;d=0===k?h+"\n":"J"+k.toString(16)+":"+h+"\n";e.completedJSONChunks.push(w.encode(d))}catch(m){"object"===typeof m&&null!==m&&"function"===typeof m.then?(d=f.ping,m.then(d,d)):u(e,f.id,m)}}a.flowing&&x(a)}function x(a){if(!n){n=!0;var b=a.destination;try{for(var c=a.completedJSONChunks,d=0;d<c.length;d++){a.pendingChunks--;var e=b;e.enqueue(c[d]);if(!(0<e.desiredSize)){a.flowing=
|
|
13
|
+
!1;d++;break}}c.splice(0,d);var f=a.completedErrorChunks;for(d=0;d<f.length;d++)if(a.pendingChunks--,c=b,c.enqueue(f[d]),!(0<c.desiredSize)){a.flowing=!1;d++;break}f.splice(0,d)}finally{n=!1}0===a.pendingChunks&&b.close()}}var w=new TextEncoder,t="function"===typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103,v=JSON.stringify,n=!1,h={renderToReadableStream:function(a){var b;return new ReadableStream({start:function(c){c=b=g(a,c);c.flowing=!0;r(c)},pull:function(a){a=b;a.flowing=!0;x(a)},
|
|
14
|
+
cancel:function(a){}})}},y={default:h};h=y&&h||y;return h.default||h});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.
|
|
1
|
+
/** @license React v16.12.0
|
|
2
2
|
* react-dom-unstable-native-dependencies.development.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -16,16 +16,8 @@
|
|
|
16
16
|
}(this, (function (ReactDOM,React) { 'use strict';
|
|
17
17
|
|
|
18
18
|
// Do not require this module directly! Use normal `invariant` calls with
|
|
19
|
-
// template literal strings. The messages will be
|
|
20
|
-
// build
|
|
21
|
-
|
|
22
|
-
// Do not require this module directly! Use normal `invariant` calls with
|
|
23
|
-
// template literal strings. The messages will be converted to ReactError during
|
|
24
|
-
// build, and in production they will be minified.
|
|
25
|
-
function ReactError(error) {
|
|
26
|
-
error.name = 'Invariant Violation';
|
|
27
|
-
return error;
|
|
28
|
-
}
|
|
19
|
+
// template literal strings. The messages will be replaced with error codes
|
|
20
|
+
// during build.
|
|
29
21
|
|
|
30
22
|
/**
|
|
31
23
|
* Use invariant() to assert state which your program assumes to be true.
|
|
@@ -253,13 +245,11 @@ function executeDirectDispatch(event) {
|
|
|
253
245
|
var dispatchListener = event._dispatchListeners;
|
|
254
246
|
var dispatchInstance = event._dispatchInstances;
|
|
255
247
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
throw ReactError(Error("executeDirectDispatch(...): Invalid `event`."));
|
|
260
|
-
}
|
|
248
|
+
if (!!Array.isArray(dispatchListener)) {
|
|
249
|
+
{
|
|
250
|
+
throw Error("executeDirectDispatch(...): Invalid `event`.");
|
|
261
251
|
}
|
|
262
|
-
}
|
|
252
|
+
}
|
|
263
253
|
|
|
264
254
|
event.currentTarget = dispatchListener ? getNodeFromInstance$1(dispatchInstance) : null;
|
|
265
255
|
var res = dispatchListener ? dispatchListener(event) : null;
|
|
@@ -469,13 +459,11 @@ function traverseTwoPhase(inst, fn, arg) {
|
|
|
469
459
|
*/
|
|
470
460
|
|
|
471
461
|
function accumulateInto(current, next) {
|
|
472
|
-
(
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
throw ReactError(Error("accumulateInto(...): Accumulated items must not be null or undefined."));
|
|
476
|
-
}
|
|
462
|
+
if (!(next != null)) {
|
|
463
|
+
{
|
|
464
|
+
throw Error("accumulateInto(...): Accumulated items must not be null or undefined.");
|
|
477
465
|
}
|
|
478
|
-
}
|
|
466
|
+
}
|
|
479
467
|
|
|
480
468
|
if (current == null) {
|
|
481
469
|
return next;
|
|
@@ -599,13 +587,11 @@ function getListener(inst, registrationName) {
|
|
|
599
587
|
return null;
|
|
600
588
|
}
|
|
601
589
|
|
|
602
|
-
(function
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
throw ReactError(Error("Expected `" + registrationName + "` listener to be a function, instead got a value of `" + typeof listener + "` type."));
|
|
606
|
-
}
|
|
590
|
+
if (!(!listener || typeof listener === 'function')) {
|
|
591
|
+
{
|
|
592
|
+
throw Error("Expected `" + registrationName + "` listener to be a function, instead got a value of `" + typeof listener + "` type.");
|
|
607
593
|
}
|
|
608
|
-
}
|
|
594
|
+
}
|
|
609
595
|
|
|
610
596
|
return listener;
|
|
611
597
|
}
|
|
@@ -981,13 +967,11 @@ function getPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeInst) {
|
|
|
981
967
|
function releasePooledEvent(event) {
|
|
982
968
|
var EventConstructor = this;
|
|
983
969
|
|
|
984
|
-
(
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
throw ReactError(Error("Trying to release an event instance into a pool of a different type."));
|
|
988
|
-
}
|
|
970
|
+
if (!(event instanceof EventConstructor)) {
|
|
971
|
+
{
|
|
972
|
+
throw Error("Trying to release an event instance into a pool of a different type.");
|
|
989
973
|
}
|
|
990
|
-
}
|
|
974
|
+
}
|
|
991
975
|
|
|
992
976
|
event.destructor();
|
|
993
977
|
|
|
@@ -1099,13 +1083,11 @@ function resetTouchRecord(touchRecord, touch) {
|
|
|
1099
1083
|
function getTouchIdentifier(_ref) {
|
|
1100
1084
|
var identifier = _ref.identifier;
|
|
1101
1085
|
|
|
1102
|
-
(
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
throw ReactError(Error("Touch object is missing identifier."));
|
|
1106
|
-
}
|
|
1086
|
+
if (!(identifier != null)) {
|
|
1087
|
+
{
|
|
1088
|
+
throw Error("Touch object is missing identifier.");
|
|
1107
1089
|
}
|
|
1108
|
-
}
|
|
1090
|
+
}
|
|
1109
1091
|
|
|
1110
1092
|
{
|
|
1111
1093
|
!(identifier <= MAX_TOUCH_BANK) ? warningWithoutStack$1(false, 'Touch identifier %s is greater than maximum supported %s which causes ' + 'performance issues backfilling array locations for all of the indices.', identifier, MAX_TOUCH_BANK) : void 0;
|
|
@@ -1224,13 +1206,11 @@ var ResponderTouchHistoryStore = {
|
|
|
1224
1206
|
*/
|
|
1225
1207
|
|
|
1226
1208
|
function accumulate(current, next) {
|
|
1227
|
-
(
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
throw ReactError(Error("accumulate(...): Accumulated items must not be null or undefined."));
|
|
1231
|
-
}
|
|
1209
|
+
if (!(next != null)) {
|
|
1210
|
+
{
|
|
1211
|
+
throw Error("accumulate(...): Accumulated items must not be null or undefined.");
|
|
1232
1212
|
}
|
|
1233
|
-
}
|
|
1213
|
+
}
|
|
1234
1214
|
|
|
1235
1215
|
if (current == null) {
|
|
1236
1216
|
return next;
|
|
@@ -1678,7 +1658,7 @@ var ResponderEventPlugin = {
|
|
|
1678
1658
|
* `touchEnd`. On certain platforms, this means that a native scroll has
|
|
1679
1659
|
* assumed control and the original touch targets are destroyed.
|
|
1680
1660
|
*/
|
|
1681
|
-
extractEvents: function (topLevelType,
|
|
1661
|
+
extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {
|
|
1682
1662
|
if (isStartish(topLevelType)) {
|
|
1683
1663
|
trackedTouchCount += 1;
|
|
1684
1664
|
} else if (isEndish(topLevelType)) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** @license React v16.
|
|
1
|
+
/** @license React v16.12.0
|
|
2
2
|
* react-dom-unstable-native-dependencies.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
@@ -6,24 +6,24 @@
|
|
|
6
6
|
* This source code is licensed under the MIT license found in the
|
|
7
7
|
* LICENSE file in the root directory of this source tree.
|
|
8
8
|
*/
|
|
9
|
-
'use strict';(function(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
a.
|
|
14
|
-
|
|
15
|
-
a||"
|
|
16
|
-
|
|
17
|
-
"Touch Bank: %s",
|
|
18
|
-
JSON.stringify(
|
|
19
|
-
|
|
20
|
-
target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};
|
|
21
|
-
"mousedown"];var
|
|
22
|
-
0;a<
|
|
23
|
-
dependencies:["scroll"]},selectionChangeShouldSetResponder:{phasedRegistrationNames:{bubbled:"onSelectionChangeShouldSetResponder",captured:"onSelectionChangeShouldSetResponderCapture"},dependencies:["selectionchange"]},moveShouldSetResponder:{phasedRegistrationNames:{bubbled:"onMoveShouldSetResponder",captured:"onMoveShouldSetResponderCapture"},dependencies:
|
|
24
|
-
dependencies:
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
null)
|
|
29
|
-
a}}};
|
|
9
|
+
'use strict';(function(l,p){"object"===typeof exports&&"undefined"!==typeof module?module.exports=p(require("react-dom"),require("react")):"function"===typeof define&&define.amd?define(["react-dom","react"],p):l.ReactDOMUnstableNativeDependencies=p(l.ReactDOM,l.React)})(this,function(l,p){function x(a){for(var b="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=1;c<arguments.length;c++)b+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+a+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}
|
|
10
|
+
function M(a){var b=a._dispatchListeners,c=a._dispatchInstances;if(Array.isArray(b))throw Error(x(103));a.currentTarget=b?N(c):null;b=b?b(a):null;a.currentTarget=null;a._dispatchListeners=null;a._dispatchInstances=null;return b}function t(a){do a=a.return;while(a&&5!==a.tag);return a?a:null}function O(a,b,c){for(var f=[];a;)f.push(a),a=t(a);for(a=f.length;0<a--;)b(f[a],"captured",c);for(a=0;a<f.length;a++)b(f[a],"bubbled",c)}function C(a,b){if(null==b)throw Error(x(30));if(null==a)return b;if(Array.isArray(a)){if(Array.isArray(b))return a.push.apply(a,
|
|
11
|
+
b),a;a.push(b);return a}return Array.isArray(b)?[a].concat(b):[a,b]}function v(a,b,c){Array.isArray(a)?a.forEach(b,c):a&&b.call(c,a)}function P(a,b){var c=a.stateNode;if(!c)return null;var f=Q(c);if(!f)return null;c=f[b];a:switch(b){case "onClick":case "onClickCapture":case "onDoubleClick":case "onDoubleClickCapture":case "onMouseDown":case "onMouseDownCapture":case "onMouseMove":case "onMouseMoveCapture":case "onMouseUp":case "onMouseUpCapture":(f=!f.disabled)||(a=a.type,f=!("button"===a||"input"===
|
|
12
|
+
a||"select"===a||"textarea"===a));a=!f;break a;default:a=!1}if(a)return null;if(c&&"function"!==typeof c)throw Error(x(231,b,typeof c));return c}function R(a,b,c){if(b=P(a,c.dispatchConfig.phasedRegistrationNames[b]))c._dispatchListeners=C(c._dispatchListeners,b),c._dispatchInstances=C(c._dispatchInstances,a)}function Y(a){a&&a.dispatchConfig.phasedRegistrationNames&&O(a._targetInst,R,a)}function Z(a){if(a&&a.dispatchConfig.phasedRegistrationNames){var b=a._targetInst;b=b?t(b):null;O(b,R,a)}}function y(a){if(a&&
|
|
13
|
+
a.dispatchConfig.registrationName){var b=a._targetInst;if(b&&a&&a.dispatchConfig.registrationName){var c=P(b,a.dispatchConfig.registrationName);c&&(a._dispatchListeners=C(a._dispatchListeners,c),a._dispatchInstances=C(a._dispatchInstances,b))}}}function D(){return!0}function E(){return!1}function z(a,b,c,f){this.dispatchConfig=a;this._targetInst=b;this.nativeEvent=c;a=this.constructor.Interface;for(var d in a)a.hasOwnProperty(d)&&((b=a[d])?this[d]=b(c):"target"===d?this.target=f:this[d]=c[d]);this.isDefaultPrevented=
|
|
14
|
+
(null!=c.defaultPrevented?c.defaultPrevented:!1===c.returnValue)?D:E;this.isPropagationStopped=E;return this}function aa(a,b,c,f){if(this.eventPool.length){var d=this.eventPool.pop();this.call(d,a,b,c,f);return d}return new this(a,b,c,f)}function ba(a){if(!(a instanceof this))throw Error(x(279));a.destructor();10>this.eventPool.length&&this.eventPool.push(a)}function S(a){a.eventPool=[];a.getPooled=aa;a.release=ba}function A(a){return"touchstart"===a||"mousedown"===a}function F(a){return"touchmove"===
|
|
15
|
+
a||"mousemove"===a}function G(a){return"touchend"===a||"touchcancel"===a||"mouseup"===a}function h(a){return a.timeStamp||a.timestamp}function J(a){a=a.identifier;if(null==a)throw Error(x(138));return a}function ca(a){var b=J(a),c=q[b];c?(c.touchActive=!0,c.startPageX=a.pageX,c.startPageY=a.pageY,c.startTimeStamp=h(a),c.currentPageX=a.pageX,c.currentPageY=a.pageY,c.currentTimeStamp=h(a),c.previousPageX=a.pageX,c.previousPageY=a.pageY,c.previousTimeStamp=h(a)):(c={touchActive:!0,startPageX:a.pageX,
|
|
16
|
+
startPageY:a.pageY,startTimeStamp:h(a),currentPageX:a.pageX,currentPageY:a.pageY,currentTimeStamp:h(a),previousPageX:a.pageX,previousPageY:a.pageY,previousTimeStamp:h(a)},q[b]=c);r.mostRecentTimeStamp=h(a)}function da(a){var b=q[J(a)];b?(b.touchActive=!0,b.previousPageX=b.currentPageX,b.previousPageY=b.currentPageY,b.previousTimeStamp=b.currentTimeStamp,b.currentPageX=a.pageX,b.currentPageY=a.pageY,b.currentTimeStamp=h(a),r.mostRecentTimeStamp=h(a)):console.warn("Cannot record touch move without a touch start.\nTouch Move: %s\n",
|
|
17
|
+
"Touch Bank: %s",T(a),U())}function ea(a){var b=q[J(a)];b?(b.touchActive=!1,b.previousPageX=b.currentPageX,b.previousPageY=b.currentPageY,b.previousTimeStamp=b.currentTimeStamp,b.currentPageX=a.pageX,b.currentPageY=a.pageY,b.currentTimeStamp=h(a),r.mostRecentTimeStamp=h(a)):console.warn("Cannot record touch end without a touch start.\nTouch End: %s\n","Touch Bank: %s",T(a),U())}function T(a){return JSON.stringify({identifier:a.identifier,pageX:a.pageX,pageY:a.pageY,timestamp:h(a)})}function U(){var a=
|
|
18
|
+
JSON.stringify(q.slice(0,20));20<q.length&&(a+=" (original size: "+q.length+")");return a}function B(a,b){if(null==b)throw Error(x(334));return null==a?b:Array.isArray(a)?a.concat(b):Array.isArray(b)?[a].concat(b):[a,b]}var Q=null,V=null,N=null,K=p.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.assign;K(z.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():"unknown"!==typeof a.returnValue&&(a.returnValue=!1),this.isDefaultPrevented=
|
|
19
|
+
D)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():"unknown"!==typeof a.cancelBubble&&(a.cancelBubble=!0),this.isPropagationStopped=D)},persist:function(){this.isPersistent=D},isPersistent:E,destructor:function(){var a=this.constructor.Interface,b;for(b in a)this[b]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null;this.isPropagationStopped=this.isDefaultPrevented=E;this._dispatchInstances=this._dispatchListeners=null}});z.Interface={type:null,
|
|
20
|
+
target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};z.extend=function(a){function b(){return c.apply(this,arguments)}var c=this,f=function(){};f.prototype=c.prototype;f=new f;K(f,b.prototype);b.prototype=f;b.prototype.constructor=b;b.Interface=K({},c.Interface,a);b.extend=c.extend;S(b);return b};S(z);var w=z.extend({touchHistory:function(a){return null}});p=["touchstart",
|
|
21
|
+
"mousedown"];var W=["touchmove","mousemove"],X=["touchcancel","touchend","mouseup"],q=[],r={touchBank:q,numberActiveTouches:0,indexOfSingleActiveTouch:-1,mostRecentTimeStamp:0},u={recordTouchTrack:function(a,b){if(F(a))b.changedTouches.forEach(da);else if(A(a))b.changedTouches.forEach(ca),r.numberActiveTouches=b.touches.length,1===r.numberActiveTouches&&(r.indexOfSingleActiveTouch=b.touches[0].identifier);else if(G(a)&&(b.changedTouches.forEach(ea),r.numberActiveTouches=b.touches.length,1===r.numberActiveTouches))for(a=
|
|
22
|
+
0;a<q.length;a++)if(b=q[a],null!=b&&b.touchActive){r.indexOfSingleActiveTouch=a;break}},touchHistory:r},k=null,H=0,L=function(a,b){var c=k;k=a;if(null!==I.GlobalResponderHandler)I.GlobalResponderHandler.onChange(c,a,b)},m={startShouldSetResponder:{phasedRegistrationNames:{bubbled:"onStartShouldSetResponder",captured:"onStartShouldSetResponderCapture"},dependencies:p},scrollShouldSetResponder:{phasedRegistrationNames:{bubbled:"onScrollShouldSetResponder",captured:"onScrollShouldSetResponderCapture"},
|
|
23
|
+
dependencies:["scroll"]},selectionChangeShouldSetResponder:{phasedRegistrationNames:{bubbled:"onSelectionChangeShouldSetResponder",captured:"onSelectionChangeShouldSetResponderCapture"},dependencies:["selectionchange"]},moveShouldSetResponder:{phasedRegistrationNames:{bubbled:"onMoveShouldSetResponder",captured:"onMoveShouldSetResponderCapture"},dependencies:W},responderStart:{registrationName:"onResponderStart",dependencies:p},responderMove:{registrationName:"onResponderMove",dependencies:W},responderEnd:{registrationName:"onResponderEnd",
|
|
24
|
+
dependencies:X},responderRelease:{registrationName:"onResponderRelease",dependencies:X},responderTerminationRequest:{registrationName:"onResponderTerminationRequest",dependencies:[]},responderGrant:{registrationName:"onResponderGrant",dependencies:[]},responderReject:{registrationName:"onResponderReject",dependencies:[]},responderTerminate:{registrationName:"onResponderTerminate",dependencies:[]}},I={_getResponder:function(){return k},eventTypes:m,extractEvents:function(a,b,c,f,d){if(A(a))H+=1;else if(G(a))if(0<=
|
|
25
|
+
H)--H;else return console.warn("Ended a touch event which was not counted in `trackedTouchCount`."),null;u.recordTouchTrack(a,c);if(b&&("scroll"===a&&!c.responderIgnoreScroll||0<H&&"selectionchange"===a||A(a)||F(a))){d=A(a)?m.startShouldSetResponder:F(a)?m.moveShouldSetResponder:"selectionchange"===a?m.selectionChangeShouldSetResponder:m.scrollShouldSetResponder;if(k)b:{var e=k;for(var g=0,h=e;h;h=t(h))g++;h=0;for(var l=b;l;l=t(l))h++;for(;0<g-h;)e=t(e),g--;for(;0<h-g;)b=t(b),h--;for(;g--;){if(e===
|
|
26
|
+
b||e===b.alternate)break b;e=t(e);b=t(b)}e=null}else e=b;b=e===k;e=w.getPooled(d,e,c,f);e.touchHistory=u.touchHistory;b?v(e,Z):v(e,Y);b:{d=e._dispatchListeners;b=e._dispatchInstances;if(Array.isArray(d))for(g=0;g<d.length&&!e.isPropagationStopped();g++){if(d[g](e,b[g])){d=b[g];break b}}else if(d&&d(e,b)){d=b;break b}d=null}e._dispatchInstances=null;e._dispatchListeners=null;e.isPersistent()||e.constructor.release(e);if(d&&d!==k)if(e=w.getPooled(m.responderGrant,d,c,f),e.touchHistory=u.touchHistory,
|
|
27
|
+
v(e,y),b=!0===M(e),k)if(g=w.getPooled(m.responderTerminationRequest,k,c,f),g.touchHistory=u.touchHistory,v(g,y),h=!g._dispatchListeners||M(g),g.isPersistent()||g.constructor.release(g),h){g=w.getPooled(m.responderTerminate,k,c,f);g.touchHistory=u.touchHistory;v(g,y);var n=B(n,[e,g]);L(d,b)}else d=w.getPooled(m.responderReject,d,c,f),d.touchHistory=u.touchHistory,v(d,y),n=B(n,d);else n=B(n,e),L(d,b);else n=null}else n=null;d=k&&A(a);e=k&&F(a);b=k&&G(a);if(d=d?m.responderStart:e?m.responderMove:b?m.responderEnd:
|
|
28
|
+
null)d=w.getPooled(d,k,c,f),d.touchHistory=u.touchHistory,v(d,y),n=B(n,d);d=k&&"touchcancel"===a;if(a=k&&!d&&G(a))a:{if((a=c.touches)&&0!==a.length)for(e=0;e<a.length;e++)if(b=a[e].target,null!==b&&void 0!==b&&0!==b){g=V(b);b:{for(b=k;g;){if(b===g||b===g.alternate){b=!0;break b}g=t(g)}b=!1}if(b){a=!1;break a}}a=!0}if(a=d?m.responderTerminate:a?m.responderRelease:null)c=w.getPooled(a,k,c,f),c.touchHistory=u.touchHistory,v(c,y),n=B(n,c),L(null);return n},GlobalResponderHandler:null,injection:{injectGlobalResponderHandler:function(a){I.GlobalResponderHandler=
|
|
29
|
+
a}}};l=l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Events;p=l[3];(function(a,b,c){Q=a;V=b;N=c})(l[2],l[0],l[1]);return{ResponderEventPlugin:I,ResponderTouchHistoryStore:u,injectEventPluginsByName:p}});
|