Upgrade prettier (#26081)
The old version of prettier we were using didn't support the Flow syntax to access properties in a type using `SomeType['prop']`. This updates `prettier` and `rollup-plugin-prettier` to the latest versions. I added the prettier config `arrowParens: "avoid"` to reduce the diff size as the default has changed in Prettier 2.0. The largest amount of changes comes from function expressions now having a space. This doesn't have an option to preserve the old behavior, so we have to update this.
Jan Kassens committed
Jan 31, 2023 at 08:25 UTC
6b3083266686f62b29462d32de75c6e71f7ba3e3
421 files changed
+3448
-4261
.prettierrc.js
+2
-2
@@ -8,8 +8,8 @@ module.exports = {
8
jsxBracketSameLine: true,
9
trailingComma: 'es5',
10
printWidth: 80,
11
- parser: 'babel',
12
-
11
+ parser: 'flow',
12
+ arrowParens: 'avoid',
13
overrides: [
14
{
15
files: esNextPaths,
dangerfile.js
+4
-3
@@ -97,7 +97,7 @@ function row(result, baseSha, headSha) {
97
return rowArr.join(' | ');
98
}
99
100
-(async function() {
100
+(async function () {
101
// Use git locally to grab the commit which represents the place
102
// where the branches differ
103
@@ -241,8 +241,9 @@ Comparing: ${baseSha}...${headSha}
241
242
## Critical size changes
243
244
-Includes critical production bundles, as well as any change greater than ${CRITICAL_THRESHOLD *
245
- 100}%:
244
+Includes critical production bundles, as well as any change greater than ${
245
+ CRITICAL_THRESHOLD * 100
246
+ }%:
247
248
${header}
249
${criticalResults.join('\n')}
fixtures/attribute-behavior/src/App.js
+3
-2
@@ -902,8 +902,9 @@ class App extends React.Component {
902
903
let log = '';
904
for (let attribute of attributes) {
905
- log += `## \`${attribute.name}\` (on \`<${attribute.tagName ||
906
- 'div'}>\` inside \`<${attribute.containerTagName || 'div'}>\`)\n`;
905
+ log += `## \`${attribute.name}\` (on \`<${
906
+ attribute.tagName || 'div'
907
+ }>\` inside \`<${attribute.containerTagName || 'div'}>\`)\n`;
908
log += '| Test Case | Flags | Result |\n';
909
log += '| --- | --- | --- |\n';
910
fixtures/devtools/scheduling-profiler/run.js
+1
-1
@@ -39,7 +39,7 @@ function initServer() {
39
const host = 'localhost';
40
const port = 8000;
41
42
- const requestListener = function(request, response) {
42
+ const requestListener = function (request, response) {
43
let contents;
44
switch (request.url) {
45
case '/react.js':
fixtures/dom/public/renderer.js
+11
-11
@@ -4,7 +4,7 @@
4
5
'use strict';
6
7
-(function() {
7
+(function () {
8
var Fixture = null;
9
var output = document.getElementById('output');
10
var status = document.getElementById('status');
@@ -60,7 +60,7 @@
60
setStatus('Generating markup');
61
62
return Promise.resolve()
63
- .then(function() {
63
+ .then(function () {
64
const element = createElement(Fixture);
65
66
// Server rendering moved to a separate package along with ReactDOM
@@ -80,11 +80,11 @@
80
}
81
82
// Finally, React 0.4 and lower emits markup in a callback
83
- return new Promise(function(resolve) {
83
+ return new Promise(function (resolve) {
84
React.renderComponentToString(element, resolve);
85
});
86
})
87
- .then(function(string) {
87
+ .then(function (string) {
88
output.innerHTML = string;
89
setStatus('Markup only (No React)');
90
})
@@ -124,13 +124,13 @@
124
}
125
126
function loadScript(src) {
127
- return new Promise(function(resolve, reject) {
127
+ return new Promise(function (resolve, reject) {
128
var script = document.createElement('script');
129
script.async = true;
130
script.src = src;
131
132
script.onload = resolve;
133
- script.onerror = function(error) {
133
+ script.onerror = function (error) {
134
reject(new Error('Unable to load ' + src));
135
};
136
@@ -145,7 +145,7 @@
145
setStatus('Failed');
146
output.innerHTML = 'Please name your root component "Fixture"';
147
} else {
148
- prerender().then(function() {
148
+ prerender().then(function () {
149
if (getBooleanQueryParam('hydrate')) {
150
render();
151
}
@@ -161,14 +161,14 @@
161
162
window.onerror = handleError;
163
164
- reload.onclick = function() {
164
+ reload.onclick = function () {
165
window.location.reload();
166
};
167
168
hydrate.onclick = render;
169
170
loadScript(getQueryParam('reactPath'))
171
- .then(function() {
171
+ .then(function () {
172
if (needsReactDOM) {
173
return Promise.all([
174
loadScript(getQueryParam('reactDOMPath')),
@@ -176,12 +176,12 @@
176
]);
177
}
178
})
179
- .then(function() {
179
+ .then(function () {
180
if (failed) {
181
return;
182
}
183
184
- window.addEventListener('message', function(event) {
184
+ window.addEventListener('message', function (event) {
185
var data = JSON.parse(event.data);
186
187
switch (data.type) {
fixtures/dom/src/components/fixtures/error-handling/index.js
+2
-2
@@ -243,7 +243,7 @@ class TrySilenceFatalError extends React.Component {
243
244
function naiveMemoize(fn) {
245
let memoizedEntry;
246
- return function() {
246
+ return function () {
247
if (!memoizedEntry) {
248
memoizedEntry = {result: null};
249
memoizedEntry.result = fn();
@@ -251,7 +251,7 @@ function naiveMemoize(fn) {
251
return memoizedEntry.result;
252
};
253
}
254
-let memoizedFunction = naiveMemoize(function() {
254
+let memoizedFunction = naiveMemoize(function () {
255
throw new Error('Passed');
256
});
257
fixtures/dom/src/components/fixtures/hydration/Code.js
+1
-1
@@ -34,7 +34,7 @@ export class CodeEditor extends React.Component {
34
lineNumbers: true,
35
});
36
37
- this.editor.on('change', function(doc) {
37
+ this.editor.on('change', function (doc) {
38
onChange(doc.getValue());
39
});
40
}
fixtures/dom/src/components/fixtures/mouse-events/mouse-enter.js
+1
-1
@@ -6,7 +6,7 @@ const ReactDOM = window.ReactDOM;
6
const MouseEnter = () => {
7
const containerRef = React.useRef();
8
9
- React.useEffect(function() {
9
+ React.useEffect(function () {
10
const hostEl = containerRef.current;
11
ReactDOM.render(<MouseEnterDetect />, hostEl, () => {
12
ReactDOM.render(<MouseEnterDetect />, hostEl.childNodes[1]);
fixtures/dom/src/polyfills.js
+4
-4
@@ -8,7 +8,7 @@ import 'core-js/es6/map';
8
9
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
10
// MIT license
11
-(function() {
11
+(function () {
12
var lastTime = 0;
13
var vendors = ['ms', 'moz', 'webkit', 'o'];
14
for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
@@ -19,10 +19,10 @@ import 'core-js/es6/map';
19
}
20
21
if (!window.requestAnimationFrame)
22
- window.requestAnimationFrame = function(callback, element) {
22
+ window.requestAnimationFrame = function (callback, element) {
23
var currTime = new Date().getTime();
24
var timeToCall = Math.max(0, 16 - (currTime - lastTime));
25
- var id = window.setTimeout(function() {
25
+ var id = window.setTimeout(function () {
26
callback(currTime + timeToCall);
27
}, timeToCall);
28
lastTime = currTime + timeToCall;
@@ -30,7 +30,7 @@ import 'core-js/es6/map';
30
};
31
32
if (!window.cancelAnimationFrame)
33
- window.cancelAnimationFrame = function(id) {
33
+ window.cancelAnimationFrame = function (id) {
34
clearTimeout(id);
35
};
36
})();
fixtures/fiber-debugger/src/Fibers.js
+1
-1
@@ -29,7 +29,7 @@ function Graph(props) {
29
});
30
31
var edgeLabels = {};
32
- React.Children.forEach(props.children, function(child) {
32
+ React.Children.forEach(props.children, function (child) {
33
if (!child) {
34
return;
35
}
fixtures/fizz/server/server.js
+6
-6
@@ -30,28 +30,28 @@ const app = express();
30
app.use(compress());
31
app.get(
32
'/',
33
- handleErrors(async function(req, res) {
33
+ handleErrors(async function (req, res) {
34
await waitForWebpack();
35
renderToStream(req.url, res);
36
})
37
);
38
app.get(
39
'/string',
40
- handleErrors(async function(req, res) {
40
+ handleErrors(async function (req, res) {
41
await waitForWebpack();
42
renderToString(req.url, res);
43
})
44
);
45
app.get(
46
'/stream',
47
- handleErrors(async function(req, res) {
47
+ handleErrors(async function (req, res) {
48
await waitForWebpack();
49
renderToStream(req.url, res);
50
})
51
);
52
app.get(
53
'/buffer',
54
- handleErrors(async function(req, res) {
54
+ handleErrors(async function (req, res) {
55
await waitForWebpack();
56
renderToBuffer(req.url, res);
57
})
@@ -63,7 +63,7 @@ app
63
.listen(PORT, () => {
64
console.log(`Listening at ${PORT}...`);
65
})
66
- .on('error', function(error) {
66
+ .on('error', function (error) {
67
if (error.syscall !== 'listen') {
68
throw error;
69
}
@@ -84,7 +84,7 @@ app
84
});
85
86
function handleErrors(fn) {
87
- return async function(req, res, next) {
87
+ return async function (req, res, next) {
88
try {
89
return await fn(req, res);
90
} catch (x) {
fixtures/flight/config/webpack.config.js
+1
-1
@@ -91,7 +91,7 @@ const hasJsxRuntime = (() => {
91
92
// This is the production and development configuration.
93
// It is focused on developer experience, fast rebuilds, and a minimal bundle.
94
-module.exports = function(webpackEnv) {
94
+module.exports = function (webpackEnv) {
95
const isEnvDevelopment = webpackEnv === 'development';
96
const isEnvProduction = webpackEnv === 'production';
97
fixtures/flight/config/webpackDevServer.config.js
+1
-1
@@ -13,7 +13,7 @@ const sockHost = process.env.WDS_SOCKET_HOST;
13
const sockPath = process.env.WDS_SOCKET_PATH; // default: '/ws'
14
const sockPort = process.env.WDS_SOCKET_PORT;
15
16
-module.exports = function(proxy, allowedHost) {
16
+module.exports = function (proxy, allowedHost) {
17
const disableFirewall =
18
!proxy || process.env.DANGEROUSLY_DISABLE_HOST_CHECK === 'true';
19
return {
fixtures/flight/scripts/start.js
+3
-3
@@ -131,8 +131,8 @@ checkBrowsers(paths.appPath, isInteractive)
131
openBrowser(urls.localUrlForBrowser);
132
});
133
134
- ['SIGINT', 'SIGTERM'].forEach(function(sig) {
135
- process.on(sig, function() {
134
+ ['SIGINT', 'SIGTERM'].forEach(function (sig) {
135
+ process.on(sig, function () {
136
devServer.close();
137
process.exit();
138
});
@@ -140,7 +140,7 @@ checkBrowsers(paths.appPath, isInteractive)
140
141
if (process.env.CI !== 'true') {
142
// Gracefully exit when stdin ends
143
- process.stdin.on('end', function() {
143
+ process.stdin.on('end', function () {
144
devServer.close();
145
process.exit();
146
});
fixtures/flight/server/cli.server.js
+4
-4
@@ -10,7 +10,7 @@ babelRegister({
10
babelrc: false,
11
ignore: [
12
/\/(build|node_modules)\//,
13
- function(file) {
13
+ function (file) {
14
if ((path.dirname(file) + '/').startsWith(__dirname + '/')) {
15
// Ignore everything in this folder
16
// because it's a mix of CJS and ESM
@@ -28,11 +28,11 @@ const express = require('express');
28
const app = express();
29
30
// Application
31
-app.get('/', function(req, res) {
31
+app.get('/', function (req, res) {
32
require('./handler.server.js')(req, res);
33
});
34
35
-app.get('/todos', function(req, res) {
35
+app.get('/todos', function (req, res) {
36
res.setHeader('Access-Control-Allow-Origin', '*');
37
res.json([
38
{
@@ -50,7 +50,7 @@ app.listen(3001, () => {
50
console.log('Flight Server listening on port 3001...');
51
});
52
53
-app.on('error', function(error) {
53
+app.on('error', function (error) {
54
if (error.syscall !== 'listen') {
55
throw error;
56
}
fixtures/flight/server/handler.server.js
+1
-1
@@ -5,7 +5,7 @@ const {readFile} = require('fs');
5
const {resolve} = require('path');
6
const React = require('react');
7
8
-module.exports = function(req, res) {
8
+module.exports = function (req, res) {
9
// const m = require('../src/App.server.js');
10
import('../src/App.server.js').then(m => {
11
const dist = process.env.NODE_ENV === 'development' ? 'dist' : 'build';
fixtures/legacy-jsx-runtimes/react-14/react-14.test.js
+10
-22
@@ -257,10 +257,10 @@ it('does not warn for arrays of elements with keys', () => {
257
258
it('does not warn for iterable elements with keys', () => {
259
const iterable = {
260
- '@@iterator': function() {
260
+ '@@iterator': function () {
261
let i = 0;
262
return {
263
- next: function() {
263
+ next: function () {
264
const done = ++i > 2;
265
return {
266
value: done ? undefined : <Component key={'#' + i} />,
@@ -276,10 +276,10 @@ it('does not warn for iterable elements with keys', () => {
276
277
it('does not warn for numeric keys in entry iterable as a child', () => {
278
const iterable = {
279
- '@@iterator': function() {
279
+ '@@iterator': function () {
280
let i = 0;
281
return {
282
- next: function() {
282
+ next: function () {
283
const done = ++i > 2;
284
return {value: done ? undefined : [i, <Component />], done: done};
285
},
@@ -319,9 +319,7 @@ it('should give context for PropType errors in nested components.', () => {
319
return <MyComp color={123} />;
320
}
321
}
322
- expect(() =>
323
- ReactTestUtils.renderIntoDocument(<ParentComp />)
324
- ).toErrorDev(
322
+ expect(() => ReactTestUtils.renderIntoDocument(<ParentComp />)).toErrorDev(
323
'Warning: Failed prop type: ' +
324
'Invalid prop `color` of type `number` supplied to `MyComp`, ' +
325
'expected `string`.',
@@ -334,9 +332,7 @@ it('gives a helpful error when passing null, undefined, or boolean', () => {
332
const Null = null;
333
const True = true;
334
const Div = 'div';
337
- expect(
338
- () => void (<Undefined />)
339
- ).toErrorDev(
335
+ expect(() => void (<Undefined />)).toErrorDev(
336
'Warning: React.jsx: type is invalid -- expected a string ' +
337
'(for built-in components) or a class/function (for composite ' +
338
'components) but got: undefined. You likely forgot to export your ' +
@@ -347,9 +343,7 @@ it('gives a helpful error when passing null, undefined, or boolean', () => {
343
: ''),
344
{withoutStack: true}
345
);
350
- expect(
351
- () => void (<Null />)
352
- ).toErrorDev(
346
+ expect(() => void (<Null />)).toErrorDev(
347
'Warning: React.jsx: type is invalid -- expected a string ' +
348
'(for built-in components) or a class/function (for composite ' +
349
'components) but got: null.' +
@@ -358,9 +352,7 @@ it('gives a helpful error when passing null, undefined, or boolean', () => {
352
: ''),
353
{withoutStack: true}
354
);
361
- expect(
362
- () => void (<True />)
363
- ).toErrorDev(
355
+ expect(() => void (<True />)).toErrorDev(
356
'Warning: React.jsx: type is invalid -- expected a string ' +
357
'(for built-in components) or a class/function (for composite ' +
358
'components) but got: boolean.' +
@@ -721,9 +713,7 @@ it('should warn when `key` is being accessed on composite element', () => {
713
);
714
}
715
}
724
- expect(() =>
725
- ReactDOM.render(<Parent />, container)
726
- ).toErrorDev(
716
+ expect(() => ReactDOM.render(<Parent />, container)).toErrorDev(
717
'Child: `key` is not a prop. Trying to access it will result ' +
718
'in `undefined` being returned. If you need to access the same ' +
719
'value within the child component, you should pass it as a different ' +
@@ -748,9 +738,7 @@ it('should warn when `ref` is being accessed', () => {
738
);
739
}
740
}
751
- expect(() =>
752
- ReactDOM.render(<Parent />, container)
753
- ).toErrorDev(
741
+ expect(() => ReactDOM.render(<Parent />, container)).toErrorDev(
742
'Child: `ref` is not a prop. Trying to access it will result ' +
743
'in `undefined` being returned. If you need to access the same ' +
744
'value within the child component, you should pass it as a different ' +
fixtures/legacy-jsx-runtimes/react-15/react-15.test.js
+9
-19
@@ -254,10 +254,10 @@ it('does not warn for arrays of elements with keys', () => {
254
255
it('does not warn for iterable elements with keys', () => {
256
const iterable = {
257
- '@@iterator': function() {
257
+ '@@iterator': function () {
258
let i = 0;
259
return {
260
- next: function() {
260
+ next: function () {
261
const done = ++i > 2;
262
return {
263
value: done ? undefined : <Component key={'#' + i} />,
@@ -273,10 +273,10 @@ it('does not warn for iterable elements with keys', () => {
273
274
it('does not warn for numeric keys in entry iterable as a child', () => {
275
const iterable = {
276
- '@@iterator': function() {
276
+ '@@iterator': function () {
277
let i = 0;
278
return {
279
- next: function() {
279
+ next: function () {
280
const done = ++i > 2;
281
return {value: done ? undefined : [i, <Component />], done: done};
282
},
@@ -330,9 +330,7 @@ it('gives a helpful error when passing null, undefined, or boolean', () => {
330
const Null = null;
331
const True = true;
332
const Div = 'div';
333
- expect(
334
- () => void (<Undefined />)
335
- ).toErrorDev(
333
+ expect(() => void (<Undefined />)).toErrorDev(
334
'Warning: React.jsx: type is invalid -- expected a string ' +
335
'(for built-in components) or a class/function (for composite ' +
336
'components) but got: undefined. You likely forgot to export your ' +
@@ -343,9 +341,7 @@ it('gives a helpful error when passing null, undefined, or boolean', () => {
341
: ''),
342
{withoutStack: true}
343
);
346
- expect(
347
- () => void (<Null />)
348
- ).toErrorDev(
344
+ expect(() => void (<Null />)).toErrorDev(
345
'Warning: React.jsx: type is invalid -- expected a string ' +
346
'(for built-in components) or a class/function (for composite ' +
347
'components) but got: null.' +
@@ -354,9 +350,7 @@ it('gives a helpful error when passing null, undefined, or boolean', () => {
350
: ''),
351
{withoutStack: true}
352
);
357
- expect(
358
- () => void (<True />)
359
- ).toErrorDev(
353
+ expect(() => void (<True />)).toErrorDev(
354
'Warning: React.jsx: type is invalid -- expected a string ' +
355
'(for built-in components) or a class/function (for composite ' +
356
'components) but got: boolean.' +
@@ -716,9 +710,7 @@ it('should warn when `key` is being accessed on composite element', () => {
710
);
711
}
712
}
719
- expect(() =>
720
- ReactDOM.render(<Parent />, container)
721
- ).toErrorDev(
713
+ expect(() => ReactDOM.render(<Parent />, container)).toErrorDev(
714
'Child: `key` is not a prop. Trying to access it will result ' +
715
'in `undefined` being returned. If you need to access the same ' +
716
'value within the child component, you should pass it as a different ' +
@@ -743,9 +735,7 @@ it('should warn when `ref` is being accessed', () => {
735
);
736
}
737
}
746
- expect(() =>
747
- ReactDOM.render(<Parent />, container)
748
- ).toErrorDev(
738
+ expect(() => ReactDOM.render(<Parent />, container)).toErrorDev(
739
'Child: `ref` is not a prop. Trying to access it will result ' +
740
'in `undefined` being returned. If you need to access the same ' +
741
'value within the child component, you should pass it as a different ' +
fixtures/legacy-jsx-runtimes/react-16/react-16.test.js
+7
-13
@@ -254,10 +254,10 @@ it('does not warn for arrays of elements with keys', () => {
254
255
it('does not warn for iterable elements with keys', () => {
256
const iterable = {
257
- '@@iterator': function() {
257
+ '@@iterator': function () {
258
let i = 0;
259
return {
260
- next: function() {
260
+ next: function () {
261
const done = ++i > 2;
262
return {
263
value: done ? undefined : <Component key={'#' + i} />,
@@ -273,10 +273,10 @@ it('does not warn for iterable elements with keys', () => {
273
274
it('does not warn for numeric keys in entry iterable as a child', () => {
275
const iterable = {
276
- '@@iterator': function() {
276
+ '@@iterator': function () {
277
let i = 0;
278
return {
279
- next: function() {
279
+ next: function () {
280
const done = ++i > 2;
281
return {value: done ? undefined : [i, <Component />], done: done};
282
},
@@ -330,9 +330,7 @@ it('gives a helpful error when passing null, undefined, or boolean', () => {
330
const Null = null;
331
const True = true;
332
const Div = 'div';
333
- expect(
334
- () => void (<Undefined />)
335
- ).toErrorDev(
333
+ expect(() => void (<Undefined />)).toErrorDev(
334
'Warning: React.jsx: type is invalid -- expected a string ' +
335
'(for built-in components) or a class/function (for composite ' +
336
'components) but got: undefined. You likely forgot to export your ' +
@@ -343,9 +341,7 @@ it('gives a helpful error when passing null, undefined, or boolean', () => {
341
: ''),
342
{withoutStack: true}
343
);
346
- expect(
347
- () => void (<Null />)
348
- ).toErrorDev(
344
+ expect(() => void (<Null />)).toErrorDev(
345
'Warning: React.jsx: type is invalid -- expected a string ' +
346
'(for built-in components) or a class/function (for composite ' +
347
'components) but got: null.' +
@@ -354,9 +350,7 @@ it('gives a helpful error when passing null, undefined, or boolean', () => {
350
: ''),
351
{withoutStack: true}
352
);
357
- expect(
358
- () => void (<True />)
359
- ).toErrorDev(
353
+ expect(() => void (<True />)).toErrorDev(
354
'Warning: React.jsx: type is invalid -- expected a string ' +
355
'(for built-in components) or a class/function (for composite ' +
356
'components) but got: boolean.' +
fixtures/legacy-jsx-runtimes/react-17/react-17.test.js
+7
-13
@@ -254,10 +254,10 @@ it('does not warn for arrays of elements with keys', () => {
254
255
it('does not warn for iterable elements with keys', () => {
256
const iterable = {
257
- '@@iterator': function() {
257
+ '@@iterator': function () {
258
let i = 0;
259
return {
260
- next: function() {
260
+ next: function () {
261
const done = ++i > 2;
262
return {
263
value: done ? undefined : <Component key={'#' + i} />,
@@ -273,10 +273,10 @@ it('does not warn for iterable elements with keys', () => {
273
274
it('does not warn for numeric keys in entry iterable as a child', () => {
275
const iterable = {
276
- '@@iterator': function() {
276
+ '@@iterator': function () {
277
let i = 0;
278
return {
279
- next: function() {
279
+ next: function () {
280
const done = ++i > 2;
281
return {value: done ? undefined : [i, <Component />], done: done};
282
},
@@ -330,9 +330,7 @@ it('gives a helpful error when passing null, undefined, or boolean', () => {
330
const Null = null;
331
const True = true;
332
const Div = 'div';
333
- expect(
334
- () => void (<Undefined />)
335
- ).toErrorDev(
333
+ expect(() => void (<Undefined />)).toErrorDev(
334
'Warning: React.jsx: type is invalid -- expected a string ' +
335
'(for built-in components) or a class/function (for composite ' +
336
'components) but got: undefined. You likely forgot to export your ' +
@@ -343,9 +341,7 @@ it('gives a helpful error when passing null, undefined, or boolean', () => {
341
: ''),
342
{withoutStack: true}
343
);
346
- expect(
347
- () => void (<Null />)
348
- ).toErrorDev(
344
+ expect(() => void (<Null />)).toErrorDev(
345
'Warning: React.jsx: type is invalid -- expected a string ' +
346
'(for built-in components) or a class/function (for composite ' +
347
'components) but got: null.' +
@@ -354,9 +350,7 @@ it('gives a helpful error when passing null, undefined, or boolean', () => {
350
: ''),
351
{withoutStack: true}
352
);
357
- expect(
358
- () => void (<True />)
359
- ).toErrorDev(
353
+ expect(() => void (<True />)).toErrorDev(
354
'Warning: React.jsx: type is invalid -- expected a string ' +
355
'(for built-in components) or a class/function (for composite ' +
356
'components) but got: boolean.' +
fixtures/legacy-jsx-runtimes/setupTests.js
+1
-1
@@ -49,7 +49,7 @@ function normalizeCodeLocInfo(str) {
49
// at Component (/path/filename.js:123:45)
50
// React format:
51
// in Component (at filename.js:123)
52
- return str.replace(/\n +(?:at|in) ([\S]+)[^\n]*/g, function(m, name) {
52
+ return str.replace(/\n +(?:at|in) ([\S]+)[^\n]*/g, function (m, name) {
53
return '\n in ' + name + ' (at **)';
54
});
55
}
fixtures/nesting/src/modern/lazyLegacyRoot.js
+3
-2
@@ -19,8 +19,9 @@ export default function lazyLegacyRoot(getLegacyComponent) {
19
};
20
21
return function Wrapper(props) {
22
- const createLegacyRoot = readModule(rendererModule, () =>
23
- import('../legacy/createLegacyRoot')
22
+ const createLegacyRoot = readModule(
23
+ rendererModule,
24
+ () => import('../legacy/createLegacyRoot')
25
).default;
26
const Component = readModule(componentModule, getLegacyComponent).default;
27
const containerRef = useRef(null);
fixtures/packaging/rjs/dev/input.js
+1
-1
@@ -1,4 +1,4 @@
1
-require(['react', 'react-dom'], function(React, ReactDOM) {
1
+require(['react', 'react-dom'], function (React, ReactDOM) {
2
ReactDOM.render(
3
React.createElement('h1', null, 'Hello World!'),
4
document.getElementById('container')
fixtures/packaging/rjs/prod/input.js
+1
-1
@@ -1,4 +1,4 @@
1
-require(['react', 'react-dom'], function(React, ReactDOM) {
1
+require(['react', 'react-dom'], function (React, ReactDOM) {
2
ReactDOM.render(
3
React.createElement('h1', null, 'Hello World!'),
4
document.getElementById('container')
fixtures/packaging/systemjs-builder/dev/build.js
+2
-2
@@ -3,10 +3,10 @@ var Builder = require('systemjs-builder');
3
var builder = new Builder('/', './config.js');
4
builder
5
.buildStatic('./input.js', './output.js')
6
- .then(function() {
6
+ .then(function () {
7
console.log('Build complete');
8
})
9
- .catch(function(err) {
9
+ .catch(function (err) {
10
console.log('Build error');
11
console.log(err);
12
});
fixtures/packaging/systemjs-builder/prod/build.js
+2
-2
@@ -3,10 +3,10 @@ var Builder = require('systemjs-builder');
3
var builder = new Builder('/', './config.js');
4
builder
5
.buildStatic('./input.js', './output.js')
6
- .then(function() {
6
+ .then(function () {
7
console.log('Build complete');
8
})
9
- .catch(function(err) {
9
+ .catch(function (err) {
10
console.log('Build error');
11
console.log(err);
12
});
fixtures/ssr/server/index.js
+3
-3
@@ -14,7 +14,7 @@ const app = express();
14
15
// Application
16
if (process.env.NODE_ENV === 'development') {
17
- app.get('/', function(req, res) {
17
+ app.get('/', function (req, res) {
18
// In development mode we clear the module cache between each request to
19
// get automatic hot reloading.
20
for (var key in require.cache) {
@@ -25,7 +25,7 @@ if (process.env.NODE_ENV === 'development') {
25
});
26
} else {
27
const render = require('./render').default;
28
- app.get('/', function(req, res) {
28
+ app.get('/', function (req, res) {
29
render(req.url, res);
30
});
31
}
@@ -48,7 +48,7 @@ app.listen(3000, () => {
48
console.log('Listening on port 3000...');
49
});
50
51
-app.on('error', function(error) {
51
+app.on('error', function (error) {
52
if (error.syscall !== 'listen') {
53
throw error;
54
}
fixtures/ssr2/server/server.js
+3
-3
@@ -38,7 +38,7 @@ app.use((req, res, next) => {
38
app.use(compress());
39
app.get(
40
'/',
41
- handleErrors(async function(req, res) {
41
+ handleErrors(async function (req, res) {
42
await waitForWebpack();
43
render(req.url, res);
44
})
@@ -50,7 +50,7 @@ app
50
.listen(PORT, () => {
51
console.log(`Listening at ${PORT}...`);
52
})
53
- .on('error', function(error) {
53
+ .on('error', function (error) {
54
if (error.syscall !== 'listen') {
55
throw error;
56
}
@@ -71,7 +71,7 @@ app
71
});
72
73
function handleErrors(fn) {
74
- return async function(req, res, next) {
74
+ return async function (req, res, next) {
75
try {
76
return await fn(req, res);
77
} catch (x) {
fixtures/stacks/BabelClasses-compiled.js
+2
-2
@@ -29,7 +29,7 @@ function _inheritsLoose(subClass, superClass) {
29
30
// Compile this with Babel.
31
// babel --config-file ./babel.config.json BabelClasses.js --out-file BabelClasses-compiled.js --source-maps
32
-let BabelClass = /*#__PURE__*/ (function(_React$Component) {
32
+let BabelClass = /*#__PURE__*/ (function (_React$Component) {
33
_inheritsLoose(BabelClass, _React$Component);
34
35
function BabelClass() {
@@ -45,7 +45,7 @@ let BabelClass = /*#__PURE__*/ (function(_React$Component) {
45
return BabelClass;
46
})(React.Component);
47
48
-let BabelClassWithFields = /*#__PURE__*/ (function(_React$Component2) {
48
+let BabelClassWithFields = /*#__PURE__*/ (function (_React$Component2) {
49
_inheritsLoose(BabelClassWithFields, _React$Component2);
50
51
function BabelClassWithFields(...args) {
package.json
+2
-2
@@ -79,7 +79,7 @@
79
"mkdirp": "^0.5.1",
80
"ncp": "^2.0.0",
81
"pacote": "^10.3.0",
82
- "prettier": "1.19.1",
82
+ "prettier": "2.8.3",
83
"prop-types": "^15.6.2",
84
"random-seed": "^0.3.0",
85
"react-lifecycles-compat": "^3.0.4",
@@ -88,7 +88,7 @@
88
"rollup-plugin-babel": "^4.0.1",
89
"rollup-plugin-commonjs": "^9.3.4",
90
"rollup-plugin-node-resolve": "^2.1.1",
91
- "rollup-plugin-prettier": "^0.6.0",
91
+ "rollup-plugin-prettier": "^3.0.0",
92
"rollup-plugin-replace": "^2.2.0",
93
"rollup-plugin-strip-banner": "^0.2.0",
94
"semver": "^7.1.1",
packages/dom-event-testing-library/domEnvironment.js
+1
-1
@@ -13,7 +13,7 @@
13
* Change environment support for PointerEvent.
14
*/
15
16
-const emptyFunction = function() {};
16
+const emptyFunction = function () {};
17
18
export function hasPointerEvent() {
19
return global != null && global.PointerEvent != null;
packages/dom-event-testing-library/index.js
+1
-1
@@ -93,7 +93,7 @@ const createEventTarget = node => ({
93
* Utilities
94
*/
95
setBoundingClientRect({x, y, width, height}) {
96
- node.getBoundingClientRect = function() {
96
+ node.getBoundingClientRect = function () {
97
return {
98
width,
99
height,
packages/eslint-plugin-react-hooks/__tests__/ESLintRuleExhaustiveDeps-test.js
+25
-50
@@ -1525,8 +1525,7 @@ const tests = {
1525
'Either include it or remove the dependency array.',
1526
suggestions: [
1527
{
1528
- desc:
1529
- 'Update the dependencies array to be: [props.foo?.bar?.baz]',
1528
+ desc: 'Update the dependencies array to be: [props.foo?.bar?.baz]',
1529
output: normalizeIndent`
1530
function MyComponent(props) {
1531
useCallback(() => {
@@ -2662,8 +2661,7 @@ const tests = {
2661
'Either include them or remove the dependency array.',
2662
suggestions: [
2663
{
2665
- desc:
2666
- 'Update the dependencies array to be: [props.bar, props.foo]',
2664
+ desc: 'Update the dependencies array to be: [props.bar, props.foo]',
2665
output: normalizeIndent`
2666
function MyComponent(props) {
2667
const local = {};
@@ -2819,8 +2817,7 @@ const tests = {
2817
'Either include it or remove the dependency array.',
2818
suggestions: [
2819
{
2822
- desc:
2823
- 'Update the dependencies array to be: [color, props.foo.bar.baz]',
2820
+ desc: 'Update the dependencies array to be: [color, props.foo.bar.baz]',
2821
output: normalizeIndent`
2822
function MyComponent(props) {
2823
let color = {}
@@ -2884,8 +2881,7 @@ const tests = {
2881
'Either include them or remove the dependency array.',
2882
suggestions: [
2883
{
2887
- desc:
2888
- 'Update the dependencies array to be: [props.foo.bar.baz, props.foo.fizz.bizz]',
2884
+ desc: 'Update the dependencies array to be: [props.foo.bar.baz, props.foo.fizz.bizz]',
2885
output: normalizeIndent`
2886
function MyComponent(props) {
2887
const fn = useCallback(() => {
@@ -3095,8 +3091,7 @@ const tests = {
3091
'Either include them or remove the dependency array.',
3092
suggestions: [
3093
{
3098
- desc:
3099
- 'Update the dependencies array to be: [props.bar, props.foo]',
3094
+ desc: 'Update the dependencies array to be: [props.bar, props.foo]',
3095
output: normalizeIndent`
3096
function MyComponent(props) {
3097
useEffect(() => {
@@ -3127,8 +3122,7 @@ const tests = {
3122
// Don't alphabetize if it wasn't alphabetized in the first place.
3123
suggestions: [
3124
{
3130
- desc:
3131
- 'Update the dependencies array to be: [c, a, g, b, e, d, f]',
3125
+ desc: 'Update the dependencies array to be: [c, a, g, b, e, d, f]',
3126
output: normalizeIndent`
3127
function MyComponent(props) {
3128
let a, b, c, d, e, f, g;
@@ -3159,8 +3153,7 @@ const tests = {
3153
// Alphabetize if it was alphabetized.
3154
suggestions: [
3155
{
3162
- desc:
3163
- 'Update the dependencies array to be: [a, b, c, d, e, f, g]',
3156
+ desc: 'Update the dependencies array to be: [a, b, c, d, e, f, g]',
3157
output: normalizeIndent`
3158
function MyComponent(props) {
3159
let a, b, c, d, e, f, g;
@@ -3191,8 +3184,7 @@ const tests = {
3184
// Alphabetize if it was empty.
3185
suggestions: [
3186
{
3194
- desc:
3195
- 'Update the dependencies array to be: [a, b, c, d, e, f, g]',
3187
+ desc: 'Update the dependencies array to be: [a, b, c, d, e, f, g]',
3188
output: normalizeIndent`
3189
function MyComponent(props) {
3190
let a, b, c, d, e, f, g;
@@ -3224,8 +3216,7 @@ const tests = {
3216
'Either include them or remove the dependency array.',
3217
suggestions: [
3218
{
3227
- desc:
3228
- 'Update the dependencies array to be: [local, props.bar, props.foo]',
3219
+ desc: 'Update the dependencies array to be: [local, props.bar, props.foo]',
3220
output: normalizeIndent`
3221
function MyComponent(props) {
3222
const local = {};
@@ -3812,8 +3803,7 @@ const tests = {
3803
'Either include them or remove the dependency array.',
3804
suggestions: [
3805
{
3815
- desc:
3816
- 'Update the dependencies array to be: [props.color, props.someOtherRefs]',
3806
+ desc: 'Update the dependencies array to be: [props.color, props.someOtherRefs]',
3807
output: normalizeIndent`
3808
function MyComponent(props) {
3809
const ref1 = useRef();
@@ -3853,8 +3843,7 @@ const tests = {
3843
"because mutating them doesn't re-render the component.",
3844
suggestions: [
3845
{
3856
- desc:
3857
- 'Update the dependencies array to be: [props.someOtherRefs, props.color]',
3846
+ desc: 'Update the dependencies array to be: [props.someOtherRefs, props.color]',
3847
output: normalizeIndent`
3848
function MyComponent(props) {
3849
const ref1 = useRef();
@@ -3894,8 +3883,7 @@ const tests = {
3883
"because mutating them doesn't re-render the component.",
3884
suggestions: [
3885
{
3897
- desc:
3898
- 'Update the dependencies array to be: [props.someOtherRefs, props.color]',
3886
+ desc: 'Update the dependencies array to be: [props.someOtherRefs, props.color]',
3887
output: normalizeIndent`
3888
function MyComponent(props) {
3889
const ref1 = useRef();
@@ -4287,8 +4275,7 @@ const tests = {
4275
`props inside useEffect.`,
4276
suggestions: [
4277
{
4290
- desc:
4291
- 'Update the dependencies array to be: [skillsCount, props.isEditMode, props.toggleEditMode, props]',
4278
+ desc: 'Update the dependencies array to be: [skillsCount, props.isEditMode, props.toggleEditMode, props]',
4279
output: normalizeIndent`
4280
function MyComponent(props) {
4281
const [skillsCount] = useState();
@@ -4719,8 +4706,7 @@ const tests = {
4706
'Either include it or remove the dependency array.',
4707
suggestions: [
4708
{
4722
- desc:
4723
- 'Update the dependencies array to be: [local1, local3, local4]',
4709
+ desc: 'Update the dependencies array to be: [local1, local3, local4]',
4710
output: normalizeIndent`
4711
function MyComponent() {
4712
const local1 = 42;
@@ -5562,8 +5548,7 @@ const tests = {
5548
// the easy fix and you can't just move it into effect.
5549
suggestions: [
5550
{
5565
- desc:
5566
- "Wrap the definition of 'handleNext' in its own useCallback() Hook.",
5551
+ desc: "Wrap the definition of 'handleNext' in its own useCallback() Hook.",
5552
output: normalizeIndent`
5553
function MyComponent(props) {
5554
let [, setState] = useState();
@@ -5737,8 +5722,7 @@ const tests = {
5722
// because they are only referenced outside the effect.
5723
suggestions: [
5724
{
5740
- desc:
5741
- "Wrap the definition of 'handleNext2' in its own useCallback() Hook.",
5725
+ desc: "Wrap the definition of 'handleNext2' in its own useCallback() Hook.",
5726
output: normalizeIndent`
5727
function MyComponent(props) {
5728
function handleNext1() {
@@ -5787,8 +5771,7 @@ const tests = {
5771
// because they are only referenced outside the effect.
5772
suggestions: [
5773
{
5790
- desc:
5791
- "Wrap the definition of 'handleNext3' in its own useCallback() Hook.",
5774
+ desc: "Wrap the definition of 'handleNext3' in its own useCallback() Hook.",
5775
output: normalizeIndent`
5776
function MyComponent(props) {
5777
function handleNext1() {
@@ -5862,8 +5845,7 @@ const tests = {
5845
"definition of 'handleNext1' in its own useCallback() Hook.",
5846
suggestions: [
5847
{
5865
- desc:
5866
- "Wrap the definition of 'handleNext1' in its own useCallback() Hook.",
5848
+ desc: "Wrap the definition of 'handleNext1' in its own useCallback() Hook.",
5849
output: normalizeIndent`
5850
function MyComponent(props) {
5851
const handleNext1 = useCallback(() => {
@@ -5892,8 +5874,7 @@ const tests = {
5874
"definition of 'handleNext1' in its own useCallback() Hook.",
5875
suggestions: [
5876
{
5895
- desc:
5896
- "Wrap the definition of 'handleNext1' in its own useCallback() Hook.",
5877
+ desc: "Wrap the definition of 'handleNext1' in its own useCallback() Hook.",
5878
output: normalizeIndent`
5879
function MyComponent(props) {
5880
const handleNext1 = useCallback(() => {
@@ -5959,8 +5940,7 @@ const tests = {
5940
// it only wraps the first definition. But seems ok.
5941
suggestions: [
5942
{
5962
- desc:
5963
- "Wrap the definition of 'handleNext' in its own useCallback() Hook.",
5943
+ desc: "Wrap the definition of 'handleNext' in its own useCallback() Hook.",
5944
output: normalizeIndent`
5945
function MyComponent(props) {
5946
let handleNext = useCallback(() => {
@@ -6493,8 +6473,7 @@ const tests = {
6473
`find the parent component that defines it and wrap that definition in useCallback.`,
6474
suggestions: [
6475
{
6496
- desc:
6497
- 'Update the dependencies array to be: [fetchPodcasts, fetchPodcasts2, id]',
6476
+ desc: 'Update the dependencies array to be: [fetchPodcasts, fetchPodcasts2, id]',
6477
output: normalizeIndent`
6478
function Podcasts({ fetchPodcasts, fetchPodcasts2, id }) {
6479
let [podcasts, setPodcasts] = useState(null);
@@ -7135,8 +7114,7 @@ const tests = {
7114
'Either include them or remove the dependency array.',
7115
suggestions: [
7116
{
7138
- desc:
7139
- 'Update the dependencies array to be: [foo.bar, props.foo.bar]',
7117
+ desc: 'Update the dependencies array to be: [foo.bar, props.foo.bar]',
7118
output: normalizeIndent`
7119
function MyComponent(props) {
7120
let foo = {}
@@ -7845,8 +7823,7 @@ const testsTypescript = {
7823
'Either include them or remove the dependency array.',
7824
suggestions: [
7825
{
7848
- desc:
7849
- 'Update the dependencies array to be: [pizza.crust, pizza?.toppings]',
7826
+ desc: 'Update the dependencies array to be: [pizza.crust, pizza?.toppings]',
7827
output: normalizeIndent`
7828
function MyComponent() {
7829
const pizza = {};
@@ -7981,8 +7958,7 @@ const testsTypescript = {
7958
'Either include it or remove the dependency array.',
7959
suggestions: [
7960
{
7984
- desc:
7985
- 'Update the dependencies array to be: [props.upperViewHeight]',
7961
+ desc: 'Update the dependencies array to be: [props.upperViewHeight]',
7962
output: normalizeIndent`
7963
function Example(props) {
7964
useEffect(() => {
@@ -8013,8 +7989,7 @@ const testsTypescript = {
7989
'Either include it or remove the dependency array.',
7990
suggestions: [
7991
{
8016
- desc:
8017
- 'Update the dependencies array to be: [props?.upperViewHeight]',
7992
+ desc: 'Update the dependencies array to be: [props?.upperViewHeight]',
7993
output: normalizeIndent`
7994
function Example(props) {
7995
useEffect(() => {
packages/eslint-plugin-react-hooks/src/ExhaustiveDeps.js
+1
-1
@@ -76,7 +76,7 @@ export default {
76
const functionWithoutCapturedValueCache = new WeakMap();
77
const useEffectEventVariables = new WeakSet();
78
function memoizeWithWeakMap(fn, map) {
79
- return function(arg) {
79
+ return function (arg) {
80
if (map.has(arg)) {
81
// to verify cache hits:
82
// console.log(arg.name)
packages/eslint-plugin-react-hooks/src/RulesOfHooks.js
+2
-3
@@ -383,9 +383,8 @@ export default {
383
384
// This is a valid code path for React hooks if we are directly in a React
385
// function component or we are in a hook function.
386
- const isSomewhereInsideComponentOrHook = isInsideComponentOrHook(
387
- codePathNode,
388
- );
386
+ const isSomewhereInsideComponentOrHook =
387
+ isInsideComponentOrHook(codePathNode);
388
const isDirectlyInsideComponentOrHook = codePathFunctionName
389
? isComponentName(codePathFunctionName) ||
390
isHook(codePathFunctionName)
packages/react-art/src/ReactART.js
+1
-1
@@ -127,7 +127,7 @@ class Text extends React.Component {
127
// ref directly.
128
['height', 'width', 'x', 'y'].forEach(key => {
129
Object.defineProperty(this, key, {
130
- get: function() {
130
+ get: function () {
131
return this._text ? this._text[key] : undefined;
132
},
133
});
packages/react-art/src/__tests__/ReactART-test.js
+1
-1
@@ -59,7 +59,7 @@ function testDOMNodeStructure(domNode, expectedStructure) {
59
}
60
}
61
if (expectedStructure.children) {
62
- expectedStructure.children.forEach(function(subTree, index) {
62
+ expectedStructure.children.forEach(function (subTree, index) {
63
testDOMNodeStructure(domNode.childNodes[index], subTree);
64
});
65
}
packages/react-client/src/ReactFlightClient.js
+1
-1
@@ -104,7 +104,7 @@ function Chunk(status: any, value: any, reason: any, response: Response) {
104
// We subclass Promise.prototype so that we get other methods like .catch
105
Chunk.prototype = (Object.create(Promise.prototype): any);
106
// TODO: This doesn't return a new Promise chain unlike the real .then
107
-Chunk.prototype.then = function<T>(
107
+Chunk.prototype.then = function <T>(
108
this: SomeChunk<T>,
109
resolve: (value: T) => mixed,
110
reject: (reason: mixed) => mixed,
packages/react-client/src/ReactFlightClientStream.js
+1
-1
@@ -123,7 +123,7 @@ export function processBinaryChunk(
123
124
function createFromJSONCallback(response: Response) {
125
// $FlowFixMe[missing-this-annot]
126
- return function(key: string, value: JSONValue) {
126
+ return function (key: string, value: JSONValue) {
127
if (typeof value === 'string') {
128
// We can't use .bind here because we need the "this" value.
129
return parseModelString(response, this, key, value);
packages/react-client/src/__tests__/ReactFlight-test.js
+3
-3
@@ -93,7 +93,7 @@ describe('ReactFlight', () => {
93
94
function clientReference(value) {
95
return Object.defineProperties(
96
- function() {
96
+ function () {
97
throw new Error('Cannot call a client function from the server.');
98
},
99
{
@@ -378,7 +378,7 @@ describe('ReactFlight', () => {
378
379
function EventHandlerProp() {
380
return (
381
- <div className="foo" onClick={function() {}}>
381
+ <div className="foo" onClick={function () {}}>
382
Test
383
</div>
384
);
@@ -397,7 +397,7 @@ describe('ReactFlight', () => {
397
398
function EventHandlerPropClient() {
399
return (
400
- <Client className="foo" onClick={function() {}}>
400
+ <Client className="foo" onClick={function () {}}>
401
Test
402
</Client>
403
);
packages/react-debug-tools/src/__tests__/ReactHooksInspectionIntegration-test.js
+4
-6
@@ -58,10 +58,8 @@ describe('ReactHooksInspectionIntegration', () => {
58
},
59
]);
60
61
- const {
62
- onMouseDown: setStateA,
63
- onMouseUp: setStateB,
64
- } = renderer.root.findByType('div').props;
61
+ const {onMouseDown: setStateA, onMouseUp: setStateB} =
62
+ renderer.root.findByType('div').props;
63
64
act(() => setStateA('Hi'));
65
@@ -469,8 +467,8 @@ describe('ReactHooksInspectionIntegration', () => {
467
});
468
469
it('should inspect forwardRef', () => {
472
- const obj = function() {};
473
- const Foo = React.forwardRef(function(props, ref) {
470
+ const obj = function () {};
471
+ const Foo = React.forwardRef(function (props, ref) {
472
React.useImperativeHandle(ref, () => obj);
473
return <div />;
474
});
packages/react-devtools-core/src/backend.js
+3
-2
@@ -42,7 +42,8 @@ installHook(window);
42
43
const hook: ?DevToolsHook = window.__REACT_DEVTOOLS_GLOBAL_HOOK__;
44
45
-let savedComponentFilters: Array<ComponentFilter> = getDefaultComponentFilters();
45
+let savedComponentFilters: Array<ComponentFilter> =
46
+ getDefaultComponentFilters();
47
48
function debug(methodName: string, ...args: Array<mixed>) {
49
if (__DEBUG__) {
@@ -114,7 +115,7 @@ export function connectToDevTools(options: ?ConnectOptions) {
115
ws.onclose = handleClose;
116
ws.onerror = handleFailed;
117
ws.onmessage = handleMessage;
117
- ws.onopen = function() {
118
+ ws.onopen = function () {
119
bridge = new Bridge({
120
listen(fn) {
121
messageListeners.push(fn);
packages/react-devtools-core/src/cachedSettings.js
+2
-1
@@ -33,7 +33,8 @@ function initializeConsolePatchSettings(
33
if (devToolsSettingsManager.getConsolePatchSettings == null) {
34
return;
35
}
36
- const consolePatchSettingsString = devToolsSettingsManager.getConsolePatchSettings();
36
+ const consolePatchSettingsString =
37
+ devToolsSettingsManager.getConsolePatchSettings();
38
if (consolePatchSettingsString == null) {
39
return;
40
}
packages/react-devtools-core/src/editor.js
+2
-2
@@ -186,9 +186,9 @@ export function launchEditor(
186
} else {
187
childProcess = spawn(editor, args, {stdio: 'inherit'});
188
}
189
- childProcess.on('error', function() {});
189
+ childProcess.on('error', function () {});
190
// $FlowFixMe[incompatible-use] found when upgrading Flow
191
- childProcess.on('exit', function(errorCode) {
191
+ childProcess.on('exit', function (errorCode) {
192
childProcess = null;
193
});
194
}
packages/react-devtools-core/src/standalone.js
+2
-2
@@ -283,7 +283,7 @@ function connectToSocket(socket: WebSocket): {close(): void} {
283
initialize(socket);
284
285
return {
286
- close: function() {
286
+ close: function () {
287
onDisconnected();
288
},
289
};
@@ -390,7 +390,7 @@ function startServer(
390
});
391
392
return {
393
- close: function() {
393
+ close: function () {
394
connected = null;
395
onDisconnected();
396
if (startServerTimeoutID !== null) {
packages/react-devtools-extensions/deploy.js
+1
-4
@@ -27,10 +27,7 @@ const main = async buildId => {
27
const json = JSON.parse(file);
28
const alias = json.alias[0];
29
30
- const commit = execSync('git rev-parse HEAD')
31
- .toString()
32
- .trim()
33
- .substr(0, 7);
30
+ const commit = execSync('git rev-parse HEAD').toString().trim().substr(0, 7);
31
32
let date = new Date();
33
date = `${date.toLocaleDateString()} – ${date.toLocaleTimeString()}`;
packages/react-devtools-extensions/popups/shared.js
+4
-4
@@ -2,14 +2,14 @@
2
3
'use strict';
4
5
-document.addEventListener('DOMContentLoaded', function() {
5
+document.addEventListener('DOMContentLoaded', function () {
6
// Make links work
7
const links = document.getElementsByTagName('a');
8
for (let i = 0; i < links.length; i++) {
9
- (function() {
9
+ (function () {
10
const ln = links[i];
11
const location = ln.href;
12
- ln.onclick = function() {
12
+ ln.onclick = function () {
13
chrome.tabs.create({active: true, url: location});
14
return false;
15
};
@@ -19,7 +19,7 @@ document.addEventListener('DOMContentLoaded', function() {
19
// Work around https://bugs.chromium.org/p/chromium/issues/detail?id=428044
20
document.body.style.opacity = 0;
21
document.body.style.transition = 'opacity ease-out .4s';
22
- requestAnimationFrame(function() {
22
+ requestAnimationFrame(function () {
23
document.body.style.opacity = 1;
24
});
25
});
packages/react-devtools-extensions/src/backend.js
+2
-2
@@ -51,8 +51,8 @@ function setup(hook: any) {
51
const Agent = require('react-devtools-shared/src/backend/agent').default;
52
const Bridge = require('react-devtools-shared/src/bridge').default;
53
const {initBackend} = require('react-devtools-shared/src/backend');
54
- const setupNativeStyleEditor = require('react-devtools-shared/src/backend/NativeStyleEditor/setupNativeStyleEditor')
55
- .default;
54
+ const setupNativeStyleEditor =
55
+ require('react-devtools-shared/src/backend/NativeStyleEditor/setupNativeStyleEditor').default;
56
57
const bridge = new Bridge({
58
listen(fn) {
packages/react-devtools-extensions/src/background.js
+2
-2
@@ -30,7 +30,7 @@ if (!IS_FIREFOX) {
30
]);
31
}
32
33
-chrome.runtime.onConnect.addListener(function(port) {
33
+chrome.runtime.onConnect.addListener(function (port) {
34
let tab = null;
35
let name = null;
36
if (isNumeric(port.name)) {
@@ -61,7 +61,7 @@ function isNumeric(str: string): boolean {
61
62
function installProxy(tabId: number) {
63
if (IS_FIREFOX) {
64
- chrome.tabs.executeScript(tabId, {file: '/build/proxy.js'}, function() {});
64
+ chrome.tabs.executeScript(tabId, {file: '/build/proxy.js'}, function () {});
65
} else {
66
chrome.scripting.executeScript({
67
target: {tabId: tabId},
packages/react-devtools-extensions/src/contentScripts/installHook.js
+12
-11
@@ -5,17 +5,18 @@ if (!window.hasOwnProperty('__REACT_DEVTOOLS_GLOBAL_HOOK__')) {
5
installHook(window);
6
7
// detect react
8
- window.__REACT_DEVTOOLS_GLOBAL_HOOK__.on('renderer', function({
9
- reactBuildType,
10
- }) {
11
- window.postMessage(
12
- {
13
- source: 'react-devtools-detector',
14
- reactBuildType,
15
- },
16
- '*',
17
- );
18
- });
8
+ window.__REACT_DEVTOOLS_GLOBAL_HOOK__.on(
9
+ 'renderer',
10
+ function ({reactBuildType}) {
11
+ window.postMessage(
12
+ {
13
+ source: 'react-devtools-detector',
14
+ reactBuildType,
15
+ },
16
+ '*',
17
+ );
18
+ },
19
+ );
20
21
// save native values
22
window.__REACT_DEVTOOLS_GLOBAL_HOOK__.nativeObjectCreate = Object.create;
packages/react-devtools-extensions/src/contentScripts/prepareInjection.js
+3
-3
@@ -8,7 +8,7 @@ import {IS_FIREFOX} from '../utils';
8
function injectScriptSync(src) {
9
let code = '';
10
const request = new XMLHttpRequest();
11
- request.addEventListener('load', function() {
11
+ request.addEventListener('load', function () {
12
code = this.responseText;
13
});
14
request.open('GET', src, false);
@@ -26,7 +26,7 @@ function injectScriptSync(src) {
26
function injectScriptAsync(src) {
27
const script = document.createElement('script');
28
script.src = src;
29
- script.onload = function() {
29
+ script.onload = function () {
30
script.remove();
31
};
32
nullthrows(document.documentElement).appendChild(script);
@@ -105,7 +105,7 @@ window.addEventListener('message', function onMessage({data, source}) {
105
// while navigating the history to a document that has not been destroyed yet,
106
// replay the last detection result if the content script is active and the
107
// document has been hidden and shown again.
108
-window.addEventListener('pageshow', function({target}) {
108
+window.addEventListener('pageshow', function ({target}) {
109
if (!lastDetectionResult || target !== window.document) {
110
return;
111
}
packages/react-devtools-extensions/src/main.js
+5
-5
@@ -39,10 +39,10 @@ if (isChrome || isEdge) {
39
// The polyfill is based on https://gist.github.com/jalbam/5fe05443270fa6d8136238ec72accbc0
40
const FRAME_TIME = 16;
41
let lastTime = 0;
42
- window.requestAnimationFrame = function(callback, element) {
42
+ window.requestAnimationFrame = function (callback, element) {
43
const now = window.performance.now();
44
const nextTime = Math.max(lastTime + FRAME_TIME, now);
45
- return setTimeout(function() {
45
+ return setTimeout(function () {
46
callback((lastTime = nextTime));
47
}, nextTime - now);
48
};
@@ -91,7 +91,7 @@ function createPanelIfReactLoaded() {
91
92
chrome.devtools.inspectedWindow.eval(
93
'window.__REACT_DEVTOOLS_GLOBAL_HOOK__ && window.__REACT_DEVTOOLS_GLOBAL_HOOK__.renderers.size > 0',
94
- function(pageHasReact, error) {
94
+ function (pageHasReact, error) {
95
if (!pageHasReact || panelCreated) {
96
return;
97
}
@@ -199,7 +199,7 @@ function createPanelIfReactLoaded() {
199
// Otherwise the Store may miss important initial tree op codes.
200
chrome.devtools.inspectedWindow.eval(
201
`window.postMessage({ source: 'react-devtools-inject-backend' }, '*');`,
202
- function(response, evalError) {
202
+ function (response, evalError) {
203
if (evalError) {
204
console.error(evalError);
205
}
@@ -553,7 +553,7 @@ chrome.devtools.network.onNavigated.addListener(checkPageForReact);
553
554
// Check to see if React has loaded once per second in case React is added
555
// after page load
556
-const loadCheckInterval = setInterval(function() {
556
+const loadCheckInterval = setInterval(function () {
557
createPanelIfReactLoaded();
558
}, 1000);
559
packages/react-devtools-inline/__tests__/__e2e__/components.test.js
+6
-12
@@ -61,10 +61,8 @@ test.describe('Components', () => {
61
// Then read the inspected values.
62
const [propName, propValue, sourceText] = await page.evaluate(
63
isEditable => {
64
- const {
65
- createTestNameSelector,
66
- findAllNodes,
67
- } = window.REACT_DOM_DEVTOOLS;
64
+ const {createTestNameSelector, findAllNodes} =
65
+ window.REACT_DOM_DEVTOOLS;
66
const container = document.getElementById('devtools');
67
68
// Get name of first prop
@@ -150,10 +148,8 @@ test.describe('Components', () => {
148
// Make sure the expected hook names are parsed and displayed eventually.
149
await page.waitForFunction(
150
hookNames => {
153
- const {
154
- createTestNameSelector,
155
- findAllNodes,
156
- } = window.REACT_DOM_DEVTOOLS;
151
+ const {createTestNameSelector, findAllNodes} =
152
+ window.REACT_DOM_DEVTOOLS;
153
const container = document.getElementById('devtools');
154
155
const hooksTree = findAllNodes(container, [
@@ -181,10 +177,8 @@ test.describe('Components', () => {
177
test('should allow searching for component by name', async () => {
178
async function getComponentSearchResultsCount() {
179
return await page.evaluate(() => {
184
- const {
185
- createTestNameSelector,
186
- findAllNodes,
187
- } = window.REACT_DOM_DEVTOOLS;
180
+ const {createTestNameSelector, findAllNodes} =
181
+ window.REACT_DOM_DEVTOOLS;
182
const container = document.getElementById('devtools');
183
184
const element = findAllNodes(container, [
packages/react-devtools-inline/__tests__/__e2e__/devtools-utils.js
+6
-14
@@ -16,11 +16,8 @@ async function clickButton(page, buttonTestName) {
16
17
async function getElementCount(page, displayName) {
18
return await page.evaluate(listItemText => {
19
- const {
20
- createTestNameSelector,
21
- createTextSelector,
22
- findAllNodes,
23
- } = window.REACT_DOM_DEVTOOLS;
19
+ const {createTestNameSelector, createTextSelector, findAllNodes} =
20
+ window.REACT_DOM_DEVTOOLS;
21
const container = document.getElementById('devtools');
22
const rows = findAllNodes(container, [
23
createTestNameSelector('ComponentTreeListItem'),
@@ -32,11 +29,8 @@ async function getElementCount(page, displayName) {
29
30
async function selectElement(page, displayName, waitForOwnersText) {
31
await page.evaluate(listItemText => {
35
- const {
36
- createTestNameSelector,
37
- createTextSelector,
38
- findAllNodes,
39
- } = window.REACT_DOM_DEVTOOLS;
32
+ const {createTestNameSelector, createTextSelector, findAllNodes} =
33
+ window.REACT_DOM_DEVTOOLS;
34
const container = document.getElementById('devtools');
35
36
const listItem = findAllNodes(container, [
@@ -50,10 +44,8 @@ async function selectElement(page, displayName, waitForOwnersText) {
44
// Wait for selected element's props to load.
45
await page.waitForFunction(
46
({titleText, ownersListText}) => {
53
- const {
54
- createTestNameSelector,
55
- findAllNodes,
56
- } = window.REACT_DOM_DEVTOOLS;
47
+ const {createTestNameSelector, findAllNodes} =
48
+ window.REACT_DOM_DEVTOOLS;
49
const container = document.getElementById('devtools');
50
51
const title = findAllNodes(container, [
packages/react-devtools-inline/__tests__/__e2e__/profiler.test.js
+2
-4
@@ -27,10 +27,8 @@ test.describe('Profiler', () => {
27
runOnlyForReactRange('>=16.5');
28
async function getSnapshotSelectorText() {
29
return await page.evaluate(() => {
30
- const {
31
- createTestNameSelector,
32
- findAllNodes,
33
- } = window.REACT_DOM_DEVTOOLS;
30
+ const {createTestNameSelector, findAllNodes} =
31
+ window.REACT_DOM_DEVTOOLS;
32
const container = document.getElementById('devtools');
33
34
const input = findAllNodes(container, [
packages/react-devtools-inline/src/backend.js
+12
-6
@@ -24,11 +24,15 @@ function startActivation(contentWindow: any, bridge: BackendBridge) {
24
hideConsoleLogsInStrictMode,
25
} = data;
26
27
- contentWindow.__REACT_DEVTOOLS_APPEND_COMPONENT_STACK__ = appendComponentStack;
28
- contentWindow.__REACT_DEVTOOLS_BREAK_ON_CONSOLE_ERRORS__ = breakOnConsoleErrors;
27
+ contentWindow.__REACT_DEVTOOLS_APPEND_COMPONENT_STACK__ =
28
+ appendComponentStack;
29
+ contentWindow.__REACT_DEVTOOLS_BREAK_ON_CONSOLE_ERRORS__ =
30
+ breakOnConsoleErrors;
31
contentWindow.__REACT_DEVTOOLS_COMPONENT_FILTERS__ = componentFilters;
30
- contentWindow.__REACT_DEVTOOLS_SHOW_INLINE_WARNINGS_AND_ERRORS__ = showInlineWarningsAndErrors;
31
- contentWindow.__REACT_DEVTOOLS_HIDE_CONSOLE_LOGS_IN_STRICT_MODE__ = hideConsoleLogsInStrictMode;
32
+ contentWindow.__REACT_DEVTOOLS_SHOW_INLINE_WARNINGS_AND_ERRORS__ =
33
+ showInlineWarningsAndErrors;
34
+ contentWindow.__REACT_DEVTOOLS_HIDE_CONSOLE_LOGS_IN_STRICT_MODE__ =
35
+ hideConsoleLogsInStrictMode;
36
37
// TRICKY
38
// The backend entry point may be required in the context of an iframe or the parent window.
@@ -40,8 +44,10 @@ function startActivation(contentWindow: any, bridge: BackendBridge) {
44
window.__REACT_DEVTOOLS_APPEND_COMPONENT_STACK__ = appendComponentStack;
45
window.__REACT_DEVTOOLS_BREAK_ON_CONSOLE_ERRORS__ = breakOnConsoleErrors;
46
window.__REACT_DEVTOOLS_COMPONENT_FILTERS__ = componentFilters;
43
- window.__REACT_DEVTOOLS_SHOW_INLINE_WARNINGS_AND_ERRORS__ = showInlineWarningsAndErrors;
44
- window.__REACT_DEVTOOLS_HIDE_CONSOLE_LOGS_IN_STRICT_MODE__ = hideConsoleLogsInStrictMode;
47
+ window.__REACT_DEVTOOLS_SHOW_INLINE_WARNINGS_AND_ERRORS__ =
48
+ showInlineWarningsAndErrors;
49
+ window.__REACT_DEVTOOLS_HIDE_CONSOLE_LOGS_IN_STRICT_MODE__ =
50
+ hideConsoleLogsInStrictMode;
51
}
52
53
finishActivation(contentWindow, bridge);
packages/react-devtools-shared/src/__tests__/TimelineProfiler-test.js
+2
-2
@@ -112,8 +112,8 @@ describe('Timeline profiler', () => {
112
}
113
114
beforeEach(() => {
115
- setPerformanceMock = require('react-devtools-shared/src/backend/profilingHooks')
116
- .setPerformanceMock_ONLY_FOR_TESTING;
115
+ setPerformanceMock =
116
+ require('react-devtools-shared/src/backend/profilingHooks').setPerformanceMock_ONLY_FOR_TESTING;
117
setPerformanceMock(createUserTimingPolyfill());
118
});
119
packages/react-devtools-shared/src/__tests__/__serializers__/dehydratedValueSerializer.js
+2
-3
@@ -11,9 +11,8 @@
11
export function test(maybeDehydratedValue) {
12
const {meta} = require('react-devtools-shared/src/hydration');
13
14
- const hasOwnProperty = Object.prototype.hasOwnProperty.bind(
15
- maybeDehydratedValue,
16
- );
14
+ const hasOwnProperty =
15
+ Object.prototype.hasOwnProperty.bind(maybeDehydratedValue);
16
return (
17
maybeDehydratedValue !== null &&
18
typeof maybeDehydratedValue === 'object' &&
packages/react-devtools-shared/src/__tests__/console-test.js
+1
-1
@@ -430,7 +430,7 @@ describe('console', () => {
430
it('should be resilient to prepareStackTrace', () => {
431
global.__REACT_DEVTOOLS_APPEND_COMPONENT_STACK__ = true;
432
433
- Error.prepareStackTrace = function(error, callsites) {
433
+ Error.prepareStackTrace = function (error, callsites) {
434
const stack = ['An error occurred:', error.message];
435
for (let i = 0; i < callsites.length; i++) {
436
const callsite = callsites[i];
packages/react-devtools-shared/src/__tests__/inspectedElement-test.js
+18
-16
@@ -59,18 +59,18 @@ describe('InspectedElement', () => {
59
TestRenderer = utils.requireTestRenderer();
60
TestRendererAct = require('jest-react').act;
61
62
- BridgeContext = require('react-devtools-shared/src/devtools/views/context')
63
- .BridgeContext;
64
- InspectedElementContext = require('react-devtools-shared/src/devtools/views/Components/InspectedElementContext')
65
- .InspectedElementContext;
66
- InspectedElementContextController = require('react-devtools-shared/src/devtools/views/Components/InspectedElementContext')
67
- .InspectedElementContextController;
68
- SettingsContextController = require('react-devtools-shared/src/devtools/views/Settings/SettingsContext')
69
- .SettingsContextController;
70
- StoreContext = require('react-devtools-shared/src/devtools/views/context')
71
- .StoreContext;
72
- TreeContextController = require('react-devtools-shared/src/devtools/views/Components/TreeContext')
73
- .TreeContextController;
62
+ BridgeContext =
63
+ require('react-devtools-shared/src/devtools/views/context').BridgeContext;
64
+ InspectedElementContext =
65
+ require('react-devtools-shared/src/devtools/views/Components/InspectedElementContext').InspectedElementContext;
66
+ InspectedElementContextController =
67
+ require('react-devtools-shared/src/devtools/views/Components/InspectedElementContext').InspectedElementContextController;
68
+ SettingsContextController =
69
+ require('react-devtools-shared/src/devtools/views/Settings/SettingsContext').SettingsContextController;
70
+ StoreContext =
71
+ require('react-devtools-shared/src/devtools/views/context').StoreContext;
72
+ TreeContextController =
73
+ require('react-devtools-shared/src/devtools/views/Components/TreeContext').TreeContextController;
74
75
// Used by inspectElementAtIndex() helper function
76
utils.act(() => {
@@ -616,8 +616,8 @@ describe('InspectedElement', () => {
616
const instance = new Class();
617
618
const proxyInstance = new Proxy(() => {}, {
619
- get: function(_, name) {
620
- return function() {
619
+ get: function (_, name) {
620
+ return function () {
621
return null;
622
};
623
},
@@ -1777,7 +1777,8 @@ describe('InspectedElement', () => {
1777
),
1778
);
1779
1780
- let copyPath: CopyInspectedElementPath = ((null: any): CopyInspectedElementPath);
1780
+ let copyPath: CopyInspectedElementPath =
1781
+ ((null: any): CopyInspectedElementPath);
1782
1783
const id = ((store.getElementIDAtIndex(0): any): number);
1784
await inspectElementAtIndex(0, () => {
@@ -1864,7 +1865,8 @@ describe('InspectedElement', () => {
1865
1866
const id = ((store.getElementIDAtIndex(0): any): number);
1867
1867
- let copyPath: CopyInspectedElementPath = ((null: any): CopyInspectedElementPath);
1868
+ let copyPath: CopyInspectedElementPath =
1869
+ ((null: any): CopyInspectedElementPath);
1870
1871
await inspectElementAtIndex(0, () => {
1872
copyPath = (path: Array<string | number>) => {
packages/react-devtools-shared/src/__tests__/ownersListContext-test.js
+10
-10
@@ -39,16 +39,16 @@ describe('OwnersListContext', () => {
39
React = require('react');
40
TestRenderer = utils.requireTestRenderer();
41
42
- BridgeContext = require('react-devtools-shared/src/devtools/views/context')
43
- .BridgeContext;
44
- OwnersListContext = require('react-devtools-shared/src/devtools/views/Components/OwnersListContext')
45
- .OwnersListContext;
46
- OwnersListContextController = require('react-devtools-shared/src/devtools/views/Components/OwnersListContext')
47
- .OwnersListContextController;
48
- StoreContext = require('react-devtools-shared/src/devtools/views/context')
49
- .StoreContext;
50
- TreeContextController = require('react-devtools-shared/src/devtools/views/Components/TreeContext')
51
- .TreeContextController;
42
+ BridgeContext =
43
+ require('react-devtools-shared/src/devtools/views/context').BridgeContext;
44
+ OwnersListContext =
45
+ require('react-devtools-shared/src/devtools/views/Components/OwnersListContext').OwnersListContext;
46
+ OwnersListContextController =
47
+ require('react-devtools-shared/src/devtools/views/Components/OwnersListContext').OwnersListContextController;
48
+ StoreContext =
49
+ require('react-devtools-shared/src/devtools/views/context').StoreContext;
50
+ TreeContextController =
51
+ require('react-devtools-shared/src/devtools/views/Components/TreeContext').TreeContextController;
52
});
53
54
const Contexts = ({children, defaultOwnerID = null}) => (
packages/react-devtools-shared/src/__tests__/preprocessData-test.js
+12
-17
@@ -82,8 +82,8 @@ describe('Timeline profiler', () => {
82
ReactDOMClient = require('react-dom/client');
83
Scheduler = require('scheduler');
84
85
- setPerformanceMock = require('react-devtools-shared/src/backend/profilingHooks')
86
- .setPerformanceMock_ONLY_FOR_TESTING;
85
+ setPerformanceMock =
86
+ require('react-devtools-shared/src/backend/profilingHooks').setPerformanceMock_ONLY_FOR_TESTING;
87
setPerformanceMock(createUserTimingPolyfill());
88
89
const store = global.store;
@@ -105,8 +105,8 @@ describe('Timeline profiler', () => {
105
let getLanesFromTransportDecimalBitmask;
106
107
beforeEach(() => {
108
- getLanesFromTransportDecimalBitmask = require('react-devtools-timeline/src/import-worker/preprocessData')
109
- .getLanesFromTransportDecimalBitmask;
108
+ getLanesFromTransportDecimalBitmask =
109
+ require('react-devtools-timeline/src/import-worker/preprocessData').getLanesFromTransportDecimalBitmask;
110
});
111
112
// @reactVersion >= 18.0
@@ -115,11 +115,7 @@ describe('Timeline profiler', () => {
115
expect(getLanesFromTransportDecimalBitmask('512')).toEqual([9]);
116
expect(getLanesFromTransportDecimalBitmask('3')).toEqual([0, 1]);
117
expect(getLanesFromTransportDecimalBitmask('1234')).toEqual([
118
- 1,
119
- 4,
120
- 6,
121
- 7,
122
- 10,
118
+ 1, 4, 6, 7, 10,
119
]); // 2 + 16 + 64 + 128 + 1024
120
expect(
121
getLanesFromTransportDecimalBitmask('1073741824'), // 0b1000000000000000000000000000000
@@ -139,8 +135,8 @@ describe('Timeline profiler', () => {
135
136
// @reactVersion >= 18.0
137
it('should ignore lanes outside REACT_TOTAL_NUM_LANES', () => {
142
- const REACT_TOTAL_NUM_LANES = require('react-devtools-timeline/src/constants')
143
- .REACT_TOTAL_NUM_LANES;
138
+ const REACT_TOTAL_NUM_LANES =
139
+ require('react-devtools-timeline/src/constants').REACT_TOTAL_NUM_LANES;
140
141
// Sanity check; this test may need to be updated when the no. of fiber lanes are changed.
142
expect(REACT_TOTAL_NUM_LANES).toBe(31);
@@ -157,8 +153,8 @@ describe('Timeline profiler', () => {
153
let preprocessData;
154
155
beforeEach(() => {
160
- preprocessData = require('react-devtools-timeline/src/import-worker/preprocessData')
161
- .default;
156
+ preprocessData =
157
+ require('react-devtools-timeline/src/import-worker/preprocessData').default;
158
});
159
160
// These should be dynamic to mimic a real profile,
@@ -177,8 +173,8 @@ describe('Timeline profiler', () => {
173
}
174
175
function createProfilerVersionEntry() {
180
- const SCHEDULING_PROFILER_VERSION = require('react-devtools-timeline/src/constants')
181
- .SCHEDULING_PROFILER_VERSION;
176
+ const SCHEDULING_PROFILER_VERSION =
177
+ require('react-devtools-timeline/src/constants').SCHEDULING_PROFILER_VERSION;
178
return createUserTimingEntry({
179
cat: 'blink.user_timing',
180
name: '--profiler-version-' + SCHEDULING_PROFILER_VERSION,
@@ -195,8 +191,7 @@ describe('Timeline profiler', () => {
191
function createLaneLabelsEntry() {
192
return createUserTimingEntry({
193
cat: 'blink.user_timing',
198
- name:
199
- '--react-lane-labels-Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen',
194
+ name: '--react-lane-labels-Sync,InputContinuousHydration,InputContinuous,DefaultHydration,Default,TransitionHydration,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Transition,Retry,Retry,Retry,Retry,Retry,SelectiveHydration,IdleHydration,Idle,Offscreen',
195
});
196
}
197
packages/react-devtools-shared/src/__tests__/profilerContext-test.js
+14
-14
@@ -45,20 +45,20 @@ describe('ProfilerContext', () => {
45
ReactDOM = require('react-dom');
46
TestRenderer = utils.requireTestRenderer();
47
48
- BridgeContext = require('react-devtools-shared/src/devtools/views/context')
49
- .BridgeContext;
50
- ProfilerContext = require('react-devtools-shared/src/devtools/views/Profiler/ProfilerContext')
51
- .ProfilerContext;
52
- ProfilerContextController = require('react-devtools-shared/src/devtools/views/Profiler/ProfilerContext')
53
- .ProfilerContextController;
54
- StoreContext = require('react-devtools-shared/src/devtools/views/context')
55
- .StoreContext;
56
- TreeContextController = require('react-devtools-shared/src/devtools/views/Components/TreeContext')
57
- .TreeContextController;
58
- TreeDispatcherContext = require('react-devtools-shared/src/devtools/views/Components/TreeContext')
59
- .TreeDispatcherContext;
60
- TreeStateContext = require('react-devtools-shared/src/devtools/views/Components/TreeContext')
61
- .TreeStateContext;
48
+ BridgeContext =
49
+ require('react-devtools-shared/src/devtools/views/context').BridgeContext;
50
+ ProfilerContext =
51
+ require('react-devtools-shared/src/devtools/views/Profiler/ProfilerContext').ProfilerContext;
52
+ ProfilerContextController =
53
+ require('react-devtools-shared/src/devtools/views/Profiler/ProfilerContext').ProfilerContextController;
54
+ StoreContext =
55
+ require('react-devtools-shared/src/devtools/views/context').StoreContext;
56
+ TreeContextController =
57
+ require('react-devtools-shared/src/devtools/views/Components/TreeContext').TreeContextController;
58
+ TreeDispatcherContext =
59
+ require('react-devtools-shared/src/devtools/views/Components/TreeContext').TreeDispatcherContext;
60
+ TreeStateContext =
61
+ require('react-devtools-shared/src/devtools/views/Components/TreeContext').TreeStateContext;
62
});
63
64
const Contexts = ({
packages/react-devtools-shared/src/__tests__/profilingCache-test.js
+16
-10
@@ -182,14 +182,14 @@ describe('ProfilingCache', () => {
182
183
const rootID = store.roots[0];
184
185
- const prevCommitData = store.profilerStore.getDataForRoot(rootID)
186
- .commitData;
185
+ const prevCommitData =
186
+ store.profilerStore.getDataForRoot(rootID).commitData;
187
expect(prevCommitData).toHaveLength(4);
188
189
utils.exportImportHelper(bridge, store);
190
191
- const nextCommitData = store.profilerStore.getDataForRoot(rootID)
192
- .commitData;
191
+ const nextCommitData =
192
+ store.profilerStore.getDataForRoot(rootID).commitData;
193
expect(nextCommitData).toHaveLength(4);
194
nextCommitData.forEach((commitData, index) => {
195
expect(commitData).toEqual(prevCommitData[index]);
@@ -1094,8 +1094,10 @@ describe('ProfilingCache', () => {
1094
utils.act(() => setChildUnmounted(true));
1095
utils.act(() => store.profilerStore.stopProfiling());
1096
1097
- const updaters = store.profilerStore.getCommitData(store.roots[0], 0)
1098
- .updaters;
1097
+ const updaters = store.profilerStore.getCommitData(
1098
+ store.roots[0],
1099
+ 0,
1100
+ ).updaters;
1101
expect(updaters.length).toEqual(1);
1102
expect(updaters[0].displayName).toEqual('App');
1103
});
@@ -1129,8 +1131,10 @@ describe('ProfilingCache', () => {
1131
utils.act(() => setChildUnmounted(true));
1132
utils.act(() => store.profilerStore.stopProfiling());
1133
1132
- const updaters = store.profilerStore.getCommitData(store.roots[0], 0)
1133
- .updaters;
1134
+ const updaters = store.profilerStore.getCommitData(
1135
+ store.roots[0],
1136
+ 0,
1137
+ ).updaters;
1138
expect(updaters.length).toEqual(1);
1139
expect(updaters[0].displayName).toEqual('App');
1140
});
@@ -1159,8 +1163,10 @@ describe('ProfilingCache', () => {
1163
utils.act(() => setChildUnmounted(true));
1164
utils.act(() => store.profilerStore.stopProfiling());
1165
1162
- const updaters = store.profilerStore.getCommitData(store.roots[0], 0)
1163
- .updaters;
1166
+ const updaters = store.profilerStore.getCommitData(
1167
+ store.roots[0],
1168
+ 0,
1169
+ ).updaters;
1170
expect(updaters.length).toEqual(1);
1171
expect(updaters[0].displayName).toEqual('App');
1172
});
packages/react-devtools-shared/src/__tests__/store-test.js
+4
-6
@@ -1444,9 +1444,8 @@ describe('Store', () => {
1444
<MyComponent2 />
1445
));
1446
const MyComponent3 = (props, ref) => null;
1447
- const ForwardRefComponentWithCustomDisplayName = React.forwardRef(
1448
- MyComponent3,
1449
- );
1447
+ const ForwardRefComponentWithCustomDisplayName =
1448
+ React.forwardRef(MyComponent3);
1449
ForwardRefComponentWithCustomDisplayName.displayName = 'Custom';
1450
const MyComponent4 = (props, ref) => null;
1451
const MemoComponent = React.memo(MyComponent4);
@@ -1467,9 +1466,8 @@ describe('Store', () => {
1466
);
1467
MemoizedFakeHigherOrderComponentWithDisplayNameOverride.displayName =
1468
'memoRefOverride';
1470
- const ForwardRefFakeHigherOrderComponentWithDisplayNameOverride = React.forwardRef(
1471
- FakeHigherOrderComponent,
1472
- );
1469
+ const ForwardRefFakeHigherOrderComponentWithDisplayNameOverride =
1470
+ React.forwardRef(FakeHigherOrderComponent);
1471
ForwardRefFakeHigherOrderComponentWithDisplayNameOverride.displayName =
1472
'forwardRefOverride';
1473
packages/react-devtools-shared/src/__tests__/treeContext-test.js
+4
-4
@@ -47,10 +47,10 @@ describe('TreeListContext', () => {
47
ReactDOM = require('react-dom');
48
TestRenderer = utils.requireTestRenderer();
49
50
- BridgeContext = require('react-devtools-shared/src/devtools/views/context')
51
- .BridgeContext;
52
- StoreContext = require('react-devtools-shared/src/devtools/views/context')
53
- .StoreContext;
50
+ BridgeContext =
51
+ require('react-devtools-shared/src/devtools/views/context').BridgeContext;
52
+ StoreContext =
53
+ require('react-devtools-shared/src/devtools/views/context').StoreContext;
54
TreeContext = require('react-devtools-shared/src/devtools/views/Components/TreeContext');
55
});
56
packages/react-devtools-shared/src/__tests__/utils-test.js
+3
-3
@@ -190,9 +190,9 @@ describe('utils', () => {
190
191
// The last letter isn't gray here but I think it's not a big
192
// deal, since there is a string substituion but it's incorrect
193
- expect(
194
- formatWithStyles(['%s %s', 'a', 'b', 'c'], 'color: gray'),
195
- ).toEqual(['%c%s %s', 'color: gray', 'a', 'b', 'c']);
193
+ expect(formatWithStyles(['%s %s', 'a', 'b', 'c'], 'color: gray')).toEqual(
194
+ ['%c%s %s', 'color: gray', 'a', 'b', 'c'],
195
+ );
196
});
197
198
// @reactVersion >= 16.0
packages/react-devtools-shared/src/__tests__/utils.js
+3
-2
@@ -203,7 +203,8 @@ export function exportImportHelper(bridge: FrontendBridge, store: Store): void {
203
204
expect(profilerStore.profilingData).not.toBeNull();
205
206
- const profilingDataFrontendInitial = ((profilerStore.profilingData: any): ProfilingDataFrontend);
206
+ const profilingDataFrontendInitial =
207
+ ((profilerStore.profilingData: any): ProfilingDataFrontend);
208
expect(profilingDataFrontendInitial.imported).toBe(false);
209
210
const profilingDataExport = prepareProfilingDataExport(
@@ -301,7 +302,7 @@ export function normalizeCodeLocInfo(str) {
302
// at Component (/path/filename.js:123:45)
303
// React format:
304
// in Component (at filename.js:123)
304
- return str.replace(/\n +(?:at|in) ([\S]+)[^\n]*/g, function(m, name) {
305
+ return str.replace(/\n +(?:at|in) ([\S]+)[^\n]*/g, function (m, name) {
306
return '\n in ' + name + ' (at **)';
307
});
308
}
packages/react-devtools-shared/src/backend/DevToolsComponentStackFrame.js
+2
-2
@@ -95,12 +95,12 @@ export function describeNativeComponentFrame(
95
// This should throw.
96
if (construct) {
97
// Something should be setting the props in the constructor.
98
- const Fake = function() {
98
+ const Fake = function () {
99
throw Error();
100
};
101
// $FlowFixMe
102
Object.defineProperty(Fake.prototype, 'props', {
103
- set: function() {
103
+ set: function () {
104
// We use a throwing setter instead of frozen or non-writable props
105
// because that won't throw in a non-strict mode function.
106
throw Error();
packages/react-devtools-shared/src/backend/agent.js
+44
-48
@@ -569,20 +569,19 @@ export default class Agent extends EventEmitter<{
569
}
570
};
571
572
- reloadAndProfile: (
573
- recordChangeDescriptions: boolean,
574
- ) => void = recordChangeDescriptions => {
575
- sessionStorageSetItem(SESSION_STORAGE_RELOAD_AND_PROFILE_KEY, 'true');
576
- sessionStorageSetItem(
577
- SESSION_STORAGE_RECORD_CHANGE_DESCRIPTIONS_KEY,
578
- recordChangeDescriptions ? 'true' : 'false',
579
- );
572
+ reloadAndProfile: (recordChangeDescriptions: boolean) => void =
573
+ recordChangeDescriptions => {
574
+ sessionStorageSetItem(SESSION_STORAGE_RELOAD_AND_PROFILE_KEY, 'true');
575
+ sessionStorageSetItem(
576
+ SESSION_STORAGE_RECORD_CHANGE_DESCRIPTIONS_KEY,
577
+ recordChangeDescriptions ? 'true' : 'false',
578
+ );
579
581
- // This code path should only be hit if the shell has explicitly told the Store that it supports profiling.
582
- // In that case, the shell must also listen for this specific message to know when it needs to reload the app.
583
- // The agent can't do this in a way that is renderer agnostic.
584
- this._bridge.send('reloadAppForProfiling');
585
- };
580
+ // This code path should only be hit if the shell has explicitly told the Store that it supports profiling.
581
+ // In that case, the shell must also listen for this specific message to know when it needs to reload the app.
582
+ // The agent can't do this in a way that is renderer agnostic.
583
+ this._bridge.send('reloadAppForProfiling');
584
+ };
585
586
renamePath: RenamePathParams => void = ({
587
hookID,
@@ -628,20 +627,19 @@ export default class Agent extends EventEmitter<{
627
}
628
}
629
631
- setTraceUpdatesEnabled: (
632
- traceUpdatesEnabled: boolean,
633
- ) => void = traceUpdatesEnabled => {
634
- this._traceUpdatesEnabled = traceUpdatesEnabled;
630
+ setTraceUpdatesEnabled: (traceUpdatesEnabled: boolean) => void =
631
+ traceUpdatesEnabled => {
632
+ this._traceUpdatesEnabled = traceUpdatesEnabled;
633
636
- setTraceUpdatesEnabled(traceUpdatesEnabled);
634
+ setTraceUpdatesEnabled(traceUpdatesEnabled);
635
638
- for (const rendererID in this._rendererInterfaces) {
639
- const renderer = ((this._rendererInterfaces[
640
- (rendererID: any)
641
- ]: any): RendererInterface);
642
- renderer.setTraceUpdatesEnabled(traceUpdatesEnabled);
643
- }
644
- };
636
+ for (const rendererID in this._rendererInterfaces) {
637
+ const renderer = ((this._rendererInterfaces[
638
+ (rendererID: any)
639
+ ]: any): RendererInterface);
640
+ renderer.setTraceUpdatesEnabled(traceUpdatesEnabled);
641
+ }
642
+ };
643
644
syncSelectionFromNativeElementsPanel: () => void = () => {
645
const target = window.__REACT_DEVTOOLS_GLOBAL_HOOK__.$0;
@@ -656,19 +654,18 @@ export default class Agent extends EventEmitter<{
654
this.emit('shutdown');
655
};
656
659
- startProfiling: (
660
- recordChangeDescriptions: boolean,
661
- ) => void = recordChangeDescriptions => {
662
- this._recordChangeDescriptions = recordChangeDescriptions;
663
- this._isProfiling = true;
664
- for (const rendererID in this._rendererInterfaces) {
665
- const renderer = ((this._rendererInterfaces[
666
- (rendererID: any)
667
- ]: any): RendererInterface);
668
- renderer.startProfiling(recordChangeDescriptions);
669
- }
670
- this._bridge.send('profilingStatus', this._isProfiling);
671
- };
657
+ startProfiling: (recordChangeDescriptions: boolean) => void =
658
+ recordChangeDescriptions => {
659
+ this._recordChangeDescriptions = recordChangeDescriptions;
660
+ this._isProfiling = true;
661
+ for (const rendererID in this._rendererInterfaces) {
662
+ const renderer = ((this._rendererInterfaces[
663
+ (rendererID: any)
664
+ ]: any): RendererInterface);
665
+ renderer.startProfiling(recordChangeDescriptions);
666
+ }
667
+ this._bridge.send('profilingStatus', this._isProfiling);
668
+ };
669
670
stopProfiling: () => void = () => {
671
this._isProfiling = false;
@@ -726,16 +723,15 @@ export default class Agent extends EventEmitter<{
723
});
724
};
725
729
- updateComponentFilters: (
730
- componentFilters: Array<ComponentFilter>,
731
- ) => void = componentFilters => {
732
- for (const rendererID in this._rendererInterfaces) {
733
- const renderer = ((this._rendererInterfaces[
734
- (rendererID: any)
735
- ]: any): RendererInterface);
736
- renderer.updateComponentFilters(componentFilters);
737
- }
738
- };
726
+ updateComponentFilters: (componentFilters: Array<ComponentFilter>) => void =
727
+ componentFilters => {
728
+ for (const rendererID in this._rendererInterfaces) {
729
+ const renderer = ((this._rendererInterfaces[
730
+ (rendererID: any)
731
+ ]: any): RendererInterface);
732
+ renderer.updateComponentFilters(componentFilters);
733
+ }
734
+ };
735
736
viewAttributeSource: CopyElementParams => void = ({id, path, rendererID}) => {
737
const renderer = this._rendererInterfaces[rendererID];
packages/react-devtools-shared/src/backend/console.js
+4
-2
@@ -354,8 +354,10 @@ export function patchForStrictMode() {
354
}
355
};
356
357
- overrideMethod.__REACT_DEVTOOLS_STRICT_MODE_ORIGINAL_METHOD__ = originalMethod;
358
- originalMethod.__REACT_DEVTOOLS_STRICT_MODE_OVERRIDE_METHOD__ = overrideMethod;
357
+ overrideMethod.__REACT_DEVTOOLS_STRICT_MODE_ORIGINAL_METHOD__ =
358
+ originalMethod;
359
+ originalMethod.__REACT_DEVTOOLS_STRICT_MODE_OVERRIDE_METHOD__ =
360
+ overrideMethod;
361
362
targetConsole[method] = overrideMethod;
363
} catch (error) {}
packages/react-devtools-shared/src/backend/legacy/renderer.js
+11
-15
@@ -137,16 +137,13 @@ export function attach(
137
global: Object,
138
): RendererInterface {
139
const idToInternalInstanceMap: Map<number, InternalInstance> = new Map();
140
- const internalInstanceToIDMap: WeakMap<
141
- InternalInstance,
142
- number,
143
- > = new WeakMap();
144
- const internalInstanceToRootIDMap: WeakMap<
145
- InternalInstance,
146
- number,
147
- > = new WeakMap();
148
-
149
- let getInternalIDForNative: GetFiberIDForNative = ((null: any): GetFiberIDForNative);
140
+ const internalInstanceToIDMap: WeakMap<InternalInstance, number> =
141
+ new WeakMap();
142
+ const internalInstanceToRootIDMap: WeakMap<InternalInstance, number> =
143
+ new WeakMap();
144
+
145
+ let getInternalIDForNative: GetFiberIDForNative =
146
+ ((null: any): GetFiberIDForNative);
147
let findNativeNodeForInternalID: (id: number) => ?NativeType;
148
let getFiberForNative = (node: NativeType) => {
149
// Not implemented.
@@ -155,9 +152,8 @@ export function attach(
152
153
if (renderer.ComponentTree) {
154
getInternalIDForNative = (node, findNearestUnfilteredAncestor) => {
158
- const internalInstance = renderer.ComponentTree.getClosestInstanceFromNode(
159
- node,
160
- );
155
+ const internalInstance =
156
+ renderer.ComponentTree.getClosestInstanceFromNode(node);
157
return internalInstanceToIDMap.get(internalInstance) || null;
158
};
159
findNativeNodeForInternalID = (id: number) => {
@@ -510,8 +506,8 @@ export function attach(
506
const operations = new Array(
507
// Identify which renderer this update is coming from.
508
2 + // [rendererID, rootFiberID]
513
- // How big is the string table?
514
- 1 + // [stringTableLength]
509
+ // How big is the string table?
510
+ 1 + // [stringTableLength]
511
// Then goes the actual string table.
512
pendingStringTableLength +
513
// All unmounts are batched in a single message.
packages/react-devtools-shared/src/backend/legacy/utils.js
+1
-1
@@ -12,7 +12,7 @@ import type {InternalInstance} from './renderer';
12
export function decorate(object: Object, attr: string, fn: Function): Function {
13
const old = object[attr];
14
// $FlowFixMe[missing-this-annot] webpack config needs to be updated to allow `this` type annotations
15
- object[attr] = function(instance: InternalInstance) {
15
+ object[attr] = function (instance: InternalInstance) {
16
return fn.call(this, old, arguments);
17
};
18
return old;
packages/react-devtools-shared/src/backend/profilingHooks.js
+4
-6
@@ -54,11 +54,11 @@ if (supportsUserTiming) {
54
const CHECK_V3_MARK = '__v3';
55
const markOptions = ({}: {startTime?: number});
56
Object.defineProperty(markOptions, 'startTime', {
57
- get: function() {
57
+ get: function () {
58
supportsUserTimingV3 = true;
59
return 0;
60
},
61
- set: function() {},
61
+ set: function () {},
62
});
63
64
try {
@@ -237,10 +237,8 @@ export function createProfilingHooks({
237
currentReactMeasuresStack.push(reactMeasure);
238
239
if (currentTimelineData) {
240
- const {
241
- batchUIDToMeasuresMap,
242
- laneToReactMeasureMap,
243
- } = currentTimelineData;
240
+ const {batchUIDToMeasuresMap, laneToReactMeasureMap} =
241
+ currentTimelineData;
242
243
let reactMeasures = batchUIDToMeasuresMap.get(currentBatchUID);
244
if (reactMeasures != null) {
packages/react-devtools-shared/src/backend/renderer.js
+18
-23
@@ -154,9 +154,7 @@ const getCurrentTime =
154
? () => performance.now()
155
: () => Date.now();
156
157
-export function getInternalReactConstants(
158
- version: string,
159
-): {
157
+export function getInternalReactConstants(version: string): {
158
getDisplayNameForFiber: getDisplayNameForFiberType,
159
getTypeSymbol: getTypeSymbolType,
160
ReactPriorityLevels: ReactPriorityLevelsType,
@@ -843,12 +841,7 @@ export function attach(
841
'color: purple;',
842
'color: black;',
843
);
846
- console.log(
847
- new Error().stack
848
- .split('\n')
849
- .slice(1)
850
- .join('\n'),
851
- );
844
+ console.log(new Error().stack.split('\n').slice(1).join('\n'));
845
console.groupEnd();
846
}
847
};
@@ -1800,8 +1793,8 @@ export function attach(
1793
const operations = new Array(
1794
// Identify which renderer this update is coming from.
1795
2 + // [rendererID, rootFiberID]
1803
- // How big is the string table?
1804
- 1 + // [stringTableLength]
1796
+ // How big is the string table?
1797
+ 1 + // [stringTableLength]
1798
// Then goes the actual string table.
1799
pendingStringTableLength +
1800
// All unmounts are batched in a single message.
@@ -2072,9 +2065,8 @@ export function attach(
2065
2066
// If we have the tree selection from previous reload, try to match this Fiber.
2067
// Also remember whether to do the same for siblings.
2075
- const mightSiblingsBeOnTrackedPath = updateTrackedPathStateBeforeMount(
2076
- fiber,
2077
- );
2068
+ const mightSiblingsBeOnTrackedPath =
2069
+ updateTrackedPathStateBeforeMount(fiber);
2070
2071
const shouldIncludeInTree = !shouldFilterFiber(fiber);
2072
if (shouldIncludeInTree) {
@@ -2232,7 +2224,8 @@ export function attach(
2224
// Note that we should do this for any fiber we performed work on, regardless of its actualDuration value.
2225
// In some cases actualDuration might be 0 for fibers we worked on (particularly if we're using Date.now)
2226
// In other cases (e.g. Memo) actualDuration might be greater than 0 even if we "bailed out".
2235
- const metadata = ((currentCommitProfilingMetadata: any): CommitProfilingData);
2227
+ const metadata =
2228
+ ((currentCommitProfilingMetadata: any): CommitProfilingData);
2229
metadata.durations.push(id, actualDuration, selfDuration);
2230
metadata.maxActualDuration = Math.max(
2231
metadata.maxActualDuration,
@@ -2633,13 +2626,13 @@ export function attach(
2626
function handlePostCommitFiberRoot(root: any) {
2627
if (isProfiling && rootSupportsProfiling(root)) {
2628
if (currentCommitProfilingMetadata !== null) {
2636
- const {effectDuration, passiveEffectDuration} = getEffectDurations(
2637
- root,
2638
- );
2629
+ const {effectDuration, passiveEffectDuration} =
2630
+ getEffectDurations(root);
2631
// $FlowFixMe[incompatible-use] found when upgrading Flow
2632
currentCommitProfilingMetadata.effectDuration = effectDuration;
2633
// $FlowFixMe[incompatible-use] found when upgrading Flow
2642
- currentCommitProfilingMetadata.passiveEffectDuration = passiveEffectDuration;
2634
+ currentCommitProfilingMetadata.passiveEffectDuration =
2635
+ passiveEffectDuration;
2636
}
2637
}
2638
}
@@ -2719,9 +2712,10 @@ export function attach(
2712
2713
if (isProfiling && isProfilingSupported) {
2714
if (!shouldBailoutWithPendingOperations()) {
2722
- const commitProfilingMetadata = ((rootToCommitProfilingMetadataMap: any): CommitProfilingMetadataMap).get(
2723
- currentRootID,
2724
- );
2715
+ const commitProfilingMetadata =
2716
+ ((rootToCommitProfilingMetadataMap: any): CommitProfilingMetadataMap).get(
2717
+ currentRootID,
2718
+ );
2719
2720
if (commitProfilingMetadata != null) {
2721
commitProfilingMetadata.push(
@@ -3964,7 +3958,8 @@ export function attach(
3958
let isProfiling: boolean = false;
3959
let profilingStartTime: number = 0;
3960
let recordChangeDescriptions: boolean = false;
3967
- let rootToCommitProfilingMetadataMap: CommitProfilingMetadataMap | null = null;
3961
+ let rootToCommitProfilingMetadataMap: CommitProfilingMetadataMap | null =
3962
+ null;
3963
3964
function getProfilingData(): ProfilingDataBackend {
3965
const dataForRoots: Array<ProfilingDataForRootBackend> = [];
packages/react-devtools-shared/src/backend/utils.js
+4
-3
@@ -119,9 +119,10 @@ export function copyWithSet(
119
return updated;
120
}
121
122
-export function getEffectDurations(
123
- root: Object,
124
-): {effectDuration: any | null, passiveEffectDuration: any | null} {
122
+export function getEffectDurations(root: Object): {
123
+ effectDuration: any | null,
124
+ passiveEffectDuration: any | null,
125
+} {
126
// Profiling durations are only available for certain builds.
127
// If available, they'll be stored on the HostRoot.
128
let effectDuration = null;
packages/react-devtools-shared/src/backend/views/Highlighter/Overlay.js
+2
-3
@@ -233,9 +233,8 @@ export default class Overlay {
233
name = elements[0].nodeName.toLowerCase();
234
235
const node = elements[0];
236
- const rendererInterface = this.agent.getBestMatchingRendererInterface(
237
- node,
238
- );
236
+ const rendererInterface =
237
+ this.agent.getBestMatchingRendererInterface(node);
238
if (rendererInterface) {
239
const id = rendererInterface.getFiberIDForNative(node, true);
240
if (id) {
packages/react-devtools-shared/src/backend/views/Highlighter/index.js
+1
-1
@@ -56,7 +56,7 @@ export default function setupHighlighter(
56
function stopInspectingNative() {
57
hideOverlay(agent);
58
removeListenersOnWindow(window);
59
- iframesListeningTo.forEach(function(frame) {
59
+ iframesListeningTo.forEach(function (frame) {
60
try {
61
removeListenersOnWindow(frame.contentWindow);
62
} catch (error) {
packages/react-devtools-shared/src/backend/views/utils.js
+1
-3
@@ -108,9 +108,7 @@ export function getNestedBoundingClientRect(
108
}
109
}
110
111
-export function getElementDimensions(
112
- domElement: Element,
113
-): {
111
+export function getElementDimensions(domElement: Element): {
112
borderBottom: number,
113
borderLeft: number,
114
borderRight: number,
packages/react-devtools-shared/src/bridge.js
+2
-2
@@ -340,9 +340,9 @@ class Bridge<
340
341
// Disable the API inherited from EventEmitter that can add more listeners and send more messages.
342
// $FlowFixMe This property is not writable.
343
- this.addListener = function() {};
343
+ this.addListener = function () {};
344
// $FlowFixMe This property is not writable.
345
- this.emit = function() {};
345
+ this.emit = function () {};
346
// NOTE: There's also EventEmitter API like `on` and `prependListener` that we didn't add to our Flow type of EventEmitter.
347
348
// Unsubscribe this bridge incoming message listeners to be sure, and so they don't have to do that.
packages/react-devtools-shared/src/devtools/ContextMenu/ContextMenu.js
+2
-3
@@ -54,9 +54,8 @@ type Props = {
54
};
55
56
export default function ContextMenu({children, id}: Props): React.Node {
57
- const {hideMenu, registerMenu} = useContext<RegistryContextType>(
58
- RegistryContext,
59
- );
57
+ const {hideMenu, registerMenu} =
58
+ useContext<RegistryContextType>(RegistryContext);
59
60
const [state, setState] = useState(HIDDEN_STATE);
61
packages/react-devtools-shared/src/devtools/ContextMenu/Contexts.js
+3
-4
@@ -83,10 +83,9 @@ export type RegistryContextType = {
83
registerMenu: typeof registerMenu,
84
};
85
86
-export const RegistryContext: ReactContext<RegistryContextType> = createContext<RegistryContextType>(
87
- {
86
+export const RegistryContext: ReactContext<RegistryContextType> =
87
+ createContext<RegistryContextType>({
88
hideMenu,
89
showMenu,
90
registerMenu,
91
- },
92
-);
91
+ });
packages/react-devtools-shared/src/devtools/ProfilerStore.js
+24
-25
@@ -249,37 +249,36 @@ export default class ProfilerStore extends EventEmitter<{
249
}
250
};
251
252
- onBridgeProfilingData: (
253
- dataBackend: ProfilingDataBackend,
254
- ) => void = dataBackend => {
255
- if (this._isProfiling) {
256
- // This should never happen, but if it does- ignore previous profiling data.
257
- return;
258
- }
252
+ onBridgeProfilingData: (dataBackend: ProfilingDataBackend) => void =
253
+ dataBackend => {
254
+ if (this._isProfiling) {
255
+ // This should never happen, but if it does- ignore previous profiling data.
256
+ return;
257
+ }
258
260
- const {rendererID} = dataBackend;
259
+ const {rendererID} = dataBackend;
260
262
- if (!this._rendererQueue.has(rendererID)) {
263
- throw Error(
264
- `Unexpected profiling data update from renderer "${rendererID}"`,
265
- );
266
- }
261
+ if (!this._rendererQueue.has(rendererID)) {
262
+ throw Error(
263
+ `Unexpected profiling data update from renderer "${rendererID}"`,
264
+ );
265
+ }
266
268
- this._dataBackends.push(dataBackend);
269
- this._rendererQueue.delete(rendererID);
267
+ this._dataBackends.push(dataBackend);
268
+ this._rendererQueue.delete(rendererID);
269
271
- if (this._rendererQueue.size === 0) {
272
- this._dataFrontend = prepareProfilingDataFrontendFromBackendAndStore(
273
- this._dataBackends,
274
- this._inProgressOperationsByRootID,
275
- this._initialSnapshotsByRootID,
276
- );
270
+ if (this._rendererQueue.size === 0) {
271
+ this._dataFrontend = prepareProfilingDataFrontendFromBackendAndStore(
272
+ this._dataBackends,
273
+ this._inProgressOperationsByRootID,
274
+ this._initialSnapshotsByRootID,
275
+ );
276
278
- this._dataBackends.splice(0);
277
+ this._dataBackends.splice(0);
278
280
- this.emit('isProcessingData');
281
- }
282
- };
279
+ this.emit('isProcessingData');
280
+ }
281
+ };
282
283
onBridgeShutdown: () => void = () => {
284
this._bridge.removeListener('operations', this.onBridgeOperations);
packages/react-devtools-shared/src/devtools/store.js
+23
-27
@@ -117,10 +117,8 @@ export default class Store extends EventEmitter<{
117
_componentFilters: Array<ComponentFilter>;
118
119
// Map of ID to number of recorded error and warning message IDs.
120
- _errorsAndWarnings: Map<
121
- number,
122
- {errorCount: number, warningCount: number},
123
- > = new Map();
120
+ _errorsAndWarnings: Map<number, {errorCount: number, warningCount: number}> =
121
+ new Map();
122
123
// At least one of the injected renderers contains (DEV only) owner metadata.
124
_hasOwnerMetadata: boolean = false;
@@ -584,9 +582,10 @@ export default class Store extends EventEmitter<{
582
}
583
}
584
587
- getErrorAndWarningCountForElementID(
588
- id: number,
589
- ): {errorCount: number, warningCount: number} {
585
+ getErrorAndWarningCountForElementID(id: number): {
586
+ errorCount: number,
587
+ warningCount: number,
588
+ } {
589
return this._errorsAndWarnings.get(id) || {errorCount: 0, warningCount: 0};
590
}
591
@@ -1029,10 +1028,8 @@ export default class Store extends EventEmitter<{
1028
): any): Element);
1029
parentElement.children.push(id);
1030
1032
- const [
1033
- displayNameWithoutHOCs,
1034
- hocDisplayNames,
1035
- ] = separateDisplayNameAndHOCs(displayName, type);
1031
+ const [displayNameWithoutHOCs, hocDisplayNames] =
1032
+ separateDisplayNameAndHOCs(displayName, type);
1033
1034
const element: Element = {
1035
children: [],
@@ -1280,8 +1277,8 @@ export default class Store extends EventEmitter<{
1277
1278
if (haveRootsChanged) {
1279
const prevRootSupportsProfiling = this._rootSupportsBasicProfiling;
1283
- const prevRootSupportsTimelineProfiling = this
1284
- ._rootSupportsTimelineProfiling;
1280
+ const prevRootSupportsTimelineProfiling =
1281
+ this._rootSupportsTimelineProfiling;
1282
1283
this._hasOwnerMetadata = false;
1284
this._rootSupportsBasicProfiling = false;
@@ -1399,22 +1396,21 @@ export default class Store extends EventEmitter<{
1396
this.emit('backendVersion');
1397
};
1398
1402
- onBridgeProtocol: (
1403
- bridgeProtocol: BridgeProtocol,
1404
- ) => void = bridgeProtocol => {
1405
- if (this._onBridgeProtocolTimeoutID !== null) {
1406
- clearTimeout(this._onBridgeProtocolTimeoutID);
1407
- this._onBridgeProtocolTimeoutID = null;
1408
- }
1399
+ onBridgeProtocol: (bridgeProtocol: BridgeProtocol) => void =
1400
+ bridgeProtocol => {
1401
+ if (this._onBridgeProtocolTimeoutID !== null) {
1402
+ clearTimeout(this._onBridgeProtocolTimeoutID);
1403
+ this._onBridgeProtocolTimeoutID = null;
1404
+ }
1405
1410
- this._bridgeProtocol = bridgeProtocol;
1406
+ this._bridgeProtocol = bridgeProtocol;
1407
1412
- if (bridgeProtocol.version !== currentBridgeProtocol.version) {
1413
- // Technically newer versions of the frontend can, at least for now,
1414
- // gracefully handle older versions of the backend protocol.
1415
- // So for now we don't need to display the unsupported dialog.
1416
- }
1417
- };
1408
+ if (bridgeProtocol.version !== currentBridgeProtocol.version) {
1409
+ // Technically newer versions of the frontend can, at least for now,
1410
+ // gracefully handle older versions of the backend protocol.
1411
+ // So for now we don't need to display the unsupported dialog.
1412
+ }
1413
+ };
1414
1415
onBridgeProtocolTimeout: () => void = () => {
1416
this._onBridgeProtocolTimeoutID = null;
packages/react-devtools-shared/src/devtools/utils.js
+5
-6
@@ -40,8 +40,9 @@ export function printElement(
40
suffix = ` (${element.isCollapsed ? 1 : element.weight})`;
41
}
42
43
- return `${' '.repeat(element.depth + 1)}${prefix} <${element.displayName ||
44
- 'null'}${key}>${hocs}${suffix}`;
43
+ return `${' '.repeat(element.depth + 1)}${prefix} <${
44
+ element.displayName || 'null'
45
+ }${key}>${hocs}${suffix}`;
46
}
47
48
export function printOwnersList(
@@ -70,10 +71,8 @@ export function printStore(
71
}
72
73
function printErrorsAndWarnings(element: Element): string {
73
- const {
74
- errorCount,
75
- warningCount,
76
- } = store.getErrorAndWarningCountForElementID(element.id);
74
+ const {errorCount, warningCount} =
75
+ store.getErrorAndWarningCountForElementID(element.id);
76
if (errorCount === 0 && warningCount === 0) {
77
return '';
78
}
packages/react-devtools-shared/src/devtools/views/Components/Element.js
+2
-3
@@ -34,9 +34,8 @@ type Props = {
34
35
export default function Element({data, index, style}: Props): React.Node {
36
const store = useContext(StoreContext);
37
- const {ownerFlatTree, ownerID, selectedElementID} = useContext(
38
- TreeStateContext,
39
- );
37
+ const {ownerFlatTree, ownerID, selectedElementID} =
38
+ useContext(TreeStateContext);
39
const dispatch = useContext(TreeDispatcherContext);
40
const {showInlineWarningsAndErrors} = React.useContext(SettingsContext);
41
packages/react-devtools-shared/src/devtools/views/Components/FetchFileWithCachingContext.js
+2
-3
@@ -14,9 +14,8 @@ import {createContext} from 'react';
14
export type FetchFileWithCaching = (url: string) => Promise<string>;
15
export type Context = FetchFileWithCaching | null;
16
17
-const FetchFileWithCachingContext: ReactContext<Context> = createContext<Context>(
18
- null,
19
-);
17
+const FetchFileWithCachingContext: ReactContext<Context> =
18
+ createContext<Context>(null);
19
FetchFileWithCachingContext.displayName = 'FetchFileWithCachingContext';
20
21
export default FetchFileWithCachingContext;
packages/react-devtools-shared/src/devtools/views/Components/HookNamesModuleLoaderContext.js
+4
-4
@@ -14,13 +14,13 @@ import type {Thenable} from 'shared/ReactTypes';
14
import {createContext} from 'react';
15
import typeof * as ParseHookNamesModule from 'react-devtools-shared/src/hooks/parseHookNames';
16
17
-export type HookNamesModuleLoaderFunction = () => Thenable<ParseHookNamesModule>;
17
+export type HookNamesModuleLoaderFunction =
18
+ () => Thenable<ParseHookNamesModule>;
19
export type Context = HookNamesModuleLoaderFunction | null;
20
21
// TODO (Webpack 5) Hopefully we can remove this context entirely once the Webpack 5 upgrade is completed.
21
-const HookNamesModuleLoaderContext: ReactContext<Context> = createContext<Context>(
22
- null,
23
-);
22
+const HookNamesModuleLoaderContext: ReactContext<Context> =
23
+ createContext<Context>(null);
24
HookNamesModuleLoaderContext.displayName = 'HookNamesModuleLoaderContext';
25
26
export default HookNamesModuleLoaderContext;
packages/react-devtools-shared/src/devtools/views/Components/InspectedElement.js
+2
-6
@@ -48,12 +48,8 @@ export default function InspectedElementWrapper(_: Props): React.Node {
48
} = useContext(OptionsContext);
49
const {dispatch: modalDialogDispatch} = useContext(ModalDialogContext);
50
51
- const {
52
- hookNames,
53
- inspectedElement,
54
- parseHookNames,
55
- toggleParseHookNames,
56
- } = useContext(InspectedElementContext);
51
+ const {hookNames, inspectedElement, parseHookNames, toggleParseHookNames} =
52
+ useContext(InspectedElementContext);
53
54
const element =
55
inspectedElementID !== null
packages/react-devtools-shared/src/devtools/views/Components/InspectedElementContext.js
+11
-13
@@ -57,9 +57,8 @@ type Context = {
57
toggleParseHookNames: ToggleParseHookNames,
58
};
59
60
-export const InspectedElementContext: ReactContext<Context> = createContext<Context>(
61
- ((null: any): Context),
62
-);
60
+export const InspectedElementContext: ReactContext<Context> =
61
+ createContext<Context>(((null: any): Context));
62
63
const POLL_INTERVAL = 1000;
64
@@ -134,10 +133,8 @@ export function InspectedElementContextController({
133
if (parseHookNames || alreadyLoadedHookNames) {
134
const hookNamesModule = loadModule(hookNamesModuleLoader);
135
if (hookNamesModule !== null) {
137
- const {
138
- parseHookNames: loadHookNamesFunction,
139
- purgeCachedMetadata,
140
- } = hookNamesModule;
136
+ const {parseHookNames: loadHookNamesFunction, purgeCachedMetadata} =
137
+ hookNamesModule;
138
139
purgeCachedMetadataRef.current = purgeCachedMetadata;
140
@@ -159,12 +156,13 @@ export function InspectedElementContextController({
156
}
157
}
158
162
- const toggleParseHookNames: ToggleParseHookNames = useCallback<ToggleParseHookNames>(() => {
163
- startTransition(() => {
164
- setParseHookNames(value => !value);
165
- refresh();
166
- });
167
- }, [setParseHookNames]);
159
+ const toggleParseHookNames: ToggleParseHookNames =
160
+ useCallback<ToggleParseHookNames>(() => {
161
+ startTransition(() => {
162
+ setParseHookNames(value => !value);
163
+ refresh();
164
+ });
165
+ }, [setParseHookNames]);
166
167
const inspectPaths: InspectPathFunction = useCallback<InspectPathFunction>(
168
(path: Path) => {
packages/react-devtools-shared/src/devtools/views/Components/InspectedElementErrorsAndWarningsTree.js
+4
-8
@@ -40,10 +40,8 @@ export default function InspectedElementErrorsAndWarningsTree({
40
}: Props): React.Node {
41
const refresh = useCacheRefresh();
42
43
- const [
44
- isErrorsTransitionPending,
45
- startClearErrorsTransition,
46
- ] = useTransition();
43
+ const [isErrorsTransitionPending, startClearErrorsTransition] =
44
+ useTransition();
45
const clearErrorsForInspectedElement = () => {
46
const {id} = inspectedElement;
47
const rendererID = store.getRendererIDForElement(id);
@@ -59,10 +57,8 @@ export default function InspectedElementErrorsAndWarningsTree({
57
}
58
};
59
62
- const [
63
- isWarningsTransitionPending,
64
- startClearWarningsTransition,
65
- ] = useTransition();
60
+ const [isWarningsTransitionPending, startClearWarningsTransition] =
61
+ useTransition();
62
const clearWarningsForInspectedElement = () => {
63
const {id} = inspectedElement;
64
const rendererID = store.getRendererIDForElement(id);
packages/react-devtools-shared/src/devtools/views/Components/InspectedElementHooksTree.js
+4
-8
@@ -59,9 +59,8 @@ export function InspectedElementHooksTree({
59
60
// Changing parseHookNames is done in a transition, because it suspends.
61
// This value is done outside of the transition, so the UI toggle feels responsive.
62
- const [parseHookNamesOptimistic, setParseHookNamesOptimistic] = useState(
63
- parseHookNames,
64
- );
62
+ const [parseHookNamesOptimistic, setParseHookNamesOptimistic] =
63
+ useState(parseHookNames);
64
const handleChange = () => {
65
setParseHookNamesOptimistic(!parseHookNames);
66
toggleParseHookNames();
@@ -168,11 +167,8 @@ function HookView({
167
inspectedElement,
168
path,
169
}: HookViewProps) {
171
- const {
172
- canEditHooks,
173
- canEditHooksAndDeletePaths,
174
- canEditHooksAndRenamePaths,
175
- } = inspectedElement;
170
+ const {canEditHooks, canEditHooksAndDeletePaths, canEditHooksAndRenamePaths} =
171
+ inspectedElement;
172
const {id: hookID, isStateEditable, subHooks, value} = hook;
173
174
const isReadOnly = hookID == null || !isStateEditable;
packages/react-devtools-shared/src/devtools/views/Components/InspectedElementView.js
+4
-11
@@ -61,13 +61,8 @@ export default function InspectedElementView({
61
toggleParseHookNames,
62
}: Props): React.Node {
63
const {id} = element;
64
- const {
65
- owners,
66
- rendererPackageName,
67
- rendererVersion,
68
- rootType,
69
- source,
70
- } = inspectedElement;
64
+ const {owners, rendererPackageName, rendererVersion, rootType, source} =
65
+ inspectedElement;
66
67
const bridge = useContext(BridgeContext);
68
const store = useContext(StoreContext);
@@ -297,10 +292,8 @@ function OwnerView({
292
type,
293
}: OwnerViewProps) {
294
const dispatch = useContext(TreeDispatcherContext);
300
- const {
301
- highlightNativeElement,
302
- clearHighlightNativeElement,
303
- } = useHighlightNativeElement();
295
+ const {highlightNativeElement, clearHighlightNativeElement} =
296
+ useHighlightNativeElement();
297
298
const handleClick = useCallback(() => {
299
logEvent({
packages/react-devtools-shared/src/devtools/views/Components/NativeStyleEditor/context.js
+25
-30
@@ -55,33 +55,30 @@ type InProgressRequest = {
55
};
56
57
const inProgressRequests: WeakMap<Element, InProgressRequest> = new WeakMap();
58
-const resource: Resource<
59
- Element,
60
- Element,
61
- StyleAndLayoutFrontend,
62
-> = createResource(
63
- (element: Element) => {
64
- const request = inProgressRequests.get(element);
65
- if (request != null) {
66
- return request.promise;
67
- }
58
+const resource: Resource<Element, Element, StyleAndLayoutFrontend> =
59
+ createResource(
60
+ (element: Element) => {
61
+ const request = inProgressRequests.get(element);
62
+ if (request != null) {
63
+ return request.promise;
64
+ }
65
69
- let resolveFn:
70
- | ResolveFn
71
- | ((
72
- result: Promise<StyleAndLayoutFrontend> | StyleAndLayoutFrontend,
73
- ) => void) = ((null: any): ResolveFn);
74
- const promise = new Promise(resolve => {
75
- resolveFn = resolve;
76
- });
77
-
78
- inProgressRequests.set(element, {promise, resolveFn});
79
-
80
- return promise;
81
- },
82
- (element: Element) => element,
83
- {useWeakMap: true},
84
-);
66
+ let resolveFn:
67
+ | ResolveFn
68
+ | ((
69
+ result: Promise<StyleAndLayoutFrontend> | StyleAndLayoutFrontend,
70
+ ) => void) = ((null: any): ResolveFn);
71
+ const promise = new Promise(resolve => {
72
+ resolveFn = resolve;
73
+ });
74
+
75
+ inProgressRequests.set(element, {promise, resolveFn});
76
+
77
+ return promise;
78
+ },
79
+ (element: Element) => element,
80
+ {useWeakMap: true},
81
+ );
82
83
type Props = {
84
children: React$Node,
@@ -108,10 +105,8 @@ function NativeStyleContextController({children}: Props): React.Node {
105
// would itself be blocked by the same render that suspends (waiting for the data).
106
const {selectedElementID} = useContext<StateContext>(TreeStateContext);
107
111
- const [
112
- currentStyleAndLayout,
113
- setCurrentStyleAndLayout,
114
- ] = useState<StyleAndLayoutFrontend | null>(null);
108
+ const [currentStyleAndLayout, setCurrentStyleAndLayout] =
109
+ useState<StyleAndLayoutFrontend | null>(null);
110
111
// This effect handler invalidates the suspense cache and schedules rendering updates with React.
112
useEffect(() => {
packages/react-devtools-shared/src/devtools/views/Components/OwnersListContext.js
+2
-4
@@ -102,10 +102,8 @@ function OwnersListContextController({children}: Props): React.Node {
102
ownersList.owners === null
103
? null
104
: ownersList.owners.map(owner => {
105
- const [
106
- displayNameWithoutHOCs,
107
- hocDisplayNames,
108
- ] = separateDisplayNameAndHOCs(owner.displayName, owner.type);
105
+ const [displayNameWithoutHOCs, hocDisplayNames] =
106
+ separateDisplayNameAndHOCs(owner.displayName, owner.type);
107
108
return {
109
...owner,
packages/react-devtools-shared/src/devtools/views/Components/Tree.js
+4
-7
@@ -64,13 +64,10 @@ export default function Tree(props: Props): React.Node {
64
const bridge = useContext(BridgeContext);
65
const store = useContext(StoreContext);
66
const {hideSettings} = useContext(OptionsContext);
67
- const [isNavigatingWithKeyboard, setIsNavigatingWithKeyboard] = useState(
68
- false,
69
- );
70
- const {
71
- highlightNativeElement,
72
- clearHighlightNativeElement,
73
- } = useHighlightNativeElement();
67
+ const [isNavigatingWithKeyboard, setIsNavigatingWithKeyboard] =
68
+ useState(false);
69
+ const {highlightNativeElement, clearHighlightNativeElement} =
70
+ useHighlightNativeElement();
71
const treeRef = useRef<HTMLDivElement | null>(null);
72
const focusTargetRef = useRef<HTMLDivElement | null>(null);
73
packages/react-devtools-shared/src/devtools/views/Components/TreeContext.js
+55
-56
@@ -150,14 +150,12 @@ type Action =
150
151
export type DispatcherContext = (action: Action) => void;
152
153
-const TreeStateContext: ReactContext<StateContext> = createContext<StateContext>(
154
- ((null: any): StateContext),
155
-);
153
+const TreeStateContext: ReactContext<StateContext> =
154
+ createContext<StateContext>(((null: any): StateContext));
155
TreeStateContext.displayName = 'TreeStateContext';
156
158
-const TreeDispatcherContext: ReactContext<DispatcherContext> = createContext<DispatcherContext>(
159
- ((null: any): DispatcherContext),
160
-);
157
+const TreeDispatcherContext: ReactContext<DispatcherContext> =
158
+ createContext<DispatcherContext>(((null: any): DispatcherContext));
159
TreeDispatcherContext.displayName = 'TreeDispatcherContext';
160
161
type State = {
@@ -379,7 +377,8 @@ function reduceTreeState(store: Store, state: State, action: Action): State {
377
}
378
break;
379
case 'SELECT_PREVIOUS_ELEMENT_WITH_ERROR_OR_WARNING_IN_TREE': {
382
- const elementIndicesWithErrorsOrWarnings = store.getElementsWithErrorsAndWarnings();
380
+ const elementIndicesWithErrorsOrWarnings =
381
+ store.getElementsWithErrorsAndWarnings();
382
if (elementIndicesWithErrorsOrWarnings.length === 0) {
383
return state;
384
}
@@ -420,7 +419,8 @@ function reduceTreeState(store: Store, state: State, action: Action): State {
419
break;
420
}
421
case 'SELECT_NEXT_ELEMENT_WITH_ERROR_OR_WARNING_IN_TREE': {
423
- const elementIndicesWithErrorsOrWarnings = store.getElementsWithErrorsAndWarnings();
422
+ const elementIndicesWithErrorsOrWarnings =
423
+ store.getElementsWithErrorsAndWarnings();
424
if (elementIndicesWithErrorsOrWarnings.length === 0) {
425
return state;
426
}
@@ -522,10 +522,8 @@ function reduceSearchState(store: Store, state: State, action: Action): State {
522
break;
523
case 'HANDLE_STORE_MUTATION':
524
if (searchText !== '') {
525
- const [
526
- addedElementIDs,
527
- removedElementIDs,
528
- ] = (action: ACTION_HANDLE_STORE_MUTATION).payload;
525
+ const [addedElementIDs, removedElementIDs] =
526
+ (action: ACTION_HANDLE_STORE_MUTATION).payload;
527
528
removedElementIDs.forEach((parentID, id) => {
529
// Prune this item from the search results.
@@ -847,51 +845,52 @@ function TreeContextController({
845
// The store is mutable, but the Store itself is global and lives for the lifetime of the DevTools,
846
// so it's okay for the reducer to have an empty dependencies array.
847
const reducer = useMemo(
850
- () => (state: State, action: Action): State => {
851
- const {type} = action;
852
- switch (type) {
853
- case 'GO_TO_NEXT_SEARCH_RESULT':
854
- case 'GO_TO_PREVIOUS_SEARCH_RESULT':
855
- case 'HANDLE_STORE_MUTATION':
856
- case 'RESET_OWNER_STACK':
857
- case 'SELECT_ELEMENT_AT_INDEX':
858
- case 'SELECT_ELEMENT_BY_ID':
859
- case 'SELECT_CHILD_ELEMENT_IN_TREE':
860
- case 'SELECT_NEXT_ELEMENT_IN_TREE':
861
- case 'SELECT_NEXT_ELEMENT_WITH_ERROR_OR_WARNING_IN_TREE':
862
- case 'SELECT_NEXT_SIBLING_IN_TREE':
863
- case 'SELECT_OWNER_LIST_NEXT_ELEMENT_IN_TREE':
864
- case 'SELECT_OWNER_LIST_PREVIOUS_ELEMENT_IN_TREE':
865
- case 'SELECT_PARENT_ELEMENT_IN_TREE':
866
- case 'SELECT_PREVIOUS_ELEMENT_IN_TREE':
867
- case 'SELECT_PREVIOUS_ELEMENT_WITH_ERROR_OR_WARNING_IN_TREE':
868
- case 'SELECT_PREVIOUS_SIBLING_IN_TREE':
869
- case 'SELECT_OWNER':
870
- case 'UPDATE_INSPECTED_ELEMENT_ID':
871
- case 'SET_SEARCH_TEXT':
872
- state = reduceTreeState(store, state, action);
873
- state = reduceSearchState(store, state, action);
874
- state = reduceOwnersState(store, state, action);
875
- state = reduceSuspenseState(store, state, action);
876
-
877
- // If the selected ID is in a collapsed subtree, reset the selected index to null.
878
- // We'll know the correct index after the layout effect will toggle the tree,
879
- // and the store tree is mutated to account for that.
880
- if (
881
- state.selectedElementID !== null &&
882
- store.isInsideCollapsedSubTree(state.selectedElementID)
883
- ) {
884
- return {
885
- ...state,
886
- selectedElementIndex: null,
887
- };
888
- }
848
+ () =>
849
+ (state: State, action: Action): State => {
850
+ const {type} = action;
851
+ switch (type) {
852
+ case 'GO_TO_NEXT_SEARCH_RESULT':
853
+ case 'GO_TO_PREVIOUS_SEARCH_RESULT':
854
+ case 'HANDLE_STORE_MUTATION':
855
+ case 'RESET_OWNER_STACK':
856
+ case 'SELECT_ELEMENT_AT_INDEX':
857
+ case 'SELECT_ELEMENT_BY_ID':
858
+ case 'SELECT_CHILD_ELEMENT_IN_TREE':
859
+ case 'SELECT_NEXT_ELEMENT_IN_TREE':
860
+ case 'SELECT_NEXT_ELEMENT_WITH_ERROR_OR_WARNING_IN_TREE':
861
+ case 'SELECT_NEXT_SIBLING_IN_TREE':
862
+ case 'SELECT_OWNER_LIST_NEXT_ELEMENT_IN_TREE':
863
+ case 'SELECT_OWNER_LIST_PREVIOUS_ELEMENT_IN_TREE':
864
+ case 'SELECT_PARENT_ELEMENT_IN_TREE':
865
+ case 'SELECT_PREVIOUS_ELEMENT_IN_TREE':
866
+ case 'SELECT_PREVIOUS_ELEMENT_WITH_ERROR_OR_WARNING_IN_TREE':
867
+ case 'SELECT_PREVIOUS_SIBLING_IN_TREE':
868
+ case 'SELECT_OWNER':
869
+ case 'UPDATE_INSPECTED_ELEMENT_ID':
870
+ case 'SET_SEARCH_TEXT':
871
+ state = reduceTreeState(store, state, action);
872
+ state = reduceSearchState(store, state, action);
873
+ state = reduceOwnersState(store, state, action);
874
+ state = reduceSuspenseState(store, state, action);
875
+
876
+ // If the selected ID is in a collapsed subtree, reset the selected index to null.
877
+ // We'll know the correct index after the layout effect will toggle the tree,
878
+ // and the store tree is mutated to account for that.
879
+ if (
880
+ state.selectedElementID !== null &&
881
+ store.isInsideCollapsedSubTree(state.selectedElementID)
882
+ ) {
883
+ return {
884
+ ...state,
885
+ selectedElementIndex: null,
886
+ };
887
+ }
888
890
- return state;
891
- default:
892
- throw new Error(`Unrecognized action "${type}"`);
893
- }
894
- },
889
+ return state;
890
+ default:
891
+ throw new Error(`Unrecognized action "${type}"`);
892
+ }
893
+ },
894
[store],
895
);
896
packages/react-devtools-shared/src/devtools/views/ErrorBoundary/ErrorBoundary.js
+2
-7
@@ -56,9 +56,7 @@ const InitialState: State = {
56
export default class ErrorBoundary extends Component<Props, State> {
57
state: State = InitialState;
58
59
- static getDerivedStateFromError(
60
- error: any,
61
- ): {
59
+ static getDerivedStateFromError(error: any): {
60
callStack: string | null,
61
errorMessage: string | null,
62
hasError: boolean,
@@ -84,10 +82,7 @@ export default class ErrorBoundary extends Component<Props, State> {
82
typeof error === 'object' &&
83
error !== null &&
84
typeof error.stack === 'string'
87
- ? error.stack
88
- .split('\n')
89
- .slice(1)
90
- .join('\n')
85
+ ? error.stack.split('\n').slice(1).join('\n')
86
: null;
87
88
return {
packages/react-devtools-shared/src/devtools/views/ErrorBoundary/cache.js
+2
-1
@@ -93,7 +93,8 @@ export function findGitHubIssue(errorMessage: string): GitHubIssue | null {
93
}
94
95
if (maybeItem) {
96
- const resolvedRecord = ((newRecord: any): ResolvedRecord<GitHubIssue>);
96
+ const resolvedRecord =
97
+ ((newRecord: any): ResolvedRecord<GitHubIssue>);
98
resolvedRecord.status = Resolved;
99
resolvedRecord.value = maybeItem;
100
} else {
packages/react-devtools-shared/src/devtools/views/ModalDialog.js
+2
-3
@@ -56,9 +56,8 @@ type ModalDialogContextType = {
56
dispatch: Dispatch,
57
};
58
59
-const ModalDialogContext: ReactContext<ModalDialogContextType> = createContext<ModalDialogContextType>(
60
- ((null: any): ModalDialogContextType),
61
-);
59
+const ModalDialogContext: ReactContext<ModalDialogContextType> =
60
+ createContext<ModalDialogContextType>(((null: any): ModalDialogContextType));
61
ModalDialogContext.displayName = 'ModalDialogContext';
62
63
function dialogReducer(state: State, action: Action) {
packages/react-devtools-shared/src/devtools/views/Profiler/CommitFlamegraph.js
+6
-11
@@ -40,9 +40,8 @@ export type ItemData = {
40
41
export default function CommitFlamegraphAutoSizer(_: {}): React.Node {
42
const {profilerStore} = useContext(StoreContext);
43
- const {rootID, selectedCommitIndex, selectFiber} = useContext(
44
- ProfilerContext,
45
- );
43
+ const {rootID, selectedCommitIndex, selectFiber} =
44
+ useContext(ProfilerContext);
45
const {profilingCache} = profilerStore;
46
47
const deselectCurrentFiber = useCallback(
@@ -98,16 +97,12 @@ type Props = {
97
};
98
99
function CommitFlamegraph({chartData, commitTree, height, width}: Props) {
101
- const [
102
- hoveredFiberData,
103
- setHoveredFiberData,
104
- ] = useState<TooltipFiberData | null>(null);
100
+ const [hoveredFiberData, setHoveredFiberData] =
101
+ useState<TooltipFiberData | null>(null);
102
const {lineHeight} = useContext(SettingsContext);
103
const {selectFiber, selectedFiberID} = useContext(ProfilerContext);
107
- const {
108
- highlightNativeElement,
109
- clearHighlightNativeElement,
110
- } = useHighlightNativeElement();
104
+ const {highlightNativeElement, clearHighlightNativeElement} =
105
+ useHighlightNativeElement();
106
107
const selectedChartNodeIndex = useMemo<number>(() => {
108
if (selectedFiberID === null) {
packages/react-devtools-shared/src/devtools/views/Profiler/CommitRanked.js
+6
-11
@@ -40,9 +40,8 @@ export type ItemData = {
40
41
export default function CommitRankedAutoSizer(_: {}): React.Node {
42
const {profilerStore} = useContext(StoreContext);
43
- const {rootID, selectedCommitIndex, selectFiber} = useContext(
44
- ProfilerContext,
45
- );
43
+ const {rootID, selectedCommitIndex, selectFiber} =
44
+ useContext(ProfilerContext);
45
const {profilingCache} = profilerStore;
46
47
const deselectCurrentFiber = useCallback(
@@ -96,16 +95,12 @@ type Props = {
95
};
96
97
function CommitRanked({chartData, commitTree, height, width}: Props) {
99
- const [
100
- hoveredFiberData,
101
- setHoveredFiberData,
102
- ] = useState<TooltipFiberData | null>(null);
98
+ const [hoveredFiberData, setHoveredFiberData] =
99
+ useState<TooltipFiberData | null>(null);
100
const {lineHeight} = useContext(SettingsContext);
101
const {selectedFiberID, selectFiber} = useContext(ProfilerContext);
105
- const {
106
- highlightNativeElement,
107
- clearHighlightNativeElement,
108
- } = useHighlightNativeElement();
102
+ const {highlightNativeElement, clearHighlightNativeElement} =
103
+ useHighlightNativeElement();
104
105
const selectedFiberIndex = useMemo(
106
() => getNodeIndex(chartData, selectedFiberID),
packages/react-devtools-shared/src/devtools/views/Profiler/FlamegraphChartBuilder.js
+2
-7
@@ -71,13 +71,8 @@ export function getChartData({
71
throw Error(`Could not find node with id "${id}" in commit tree`);
72
}
73
74
- const {
75
- children,
76
- displayName,
77
- hocDisplayNames,
78
- key,
79
- treeBaseDuration,
80
- } = node;
74
+ const {children, displayName, hocDisplayNames, key, treeBaseDuration} =
75
+ node;
76
77
const actualDuration = fiberActualDurations.get(id) || 0;
78
const selfDuration = fiberSelfDurations.get(id) || 0;
packages/react-devtools-shared/src/devtools/views/Profiler/HoveredFiberInfo.js
+2
-4
@@ -44,10 +44,8 @@ export default function HoveredFiberInfo({fiberData}: Props): React.Node {
44
for (i = 0; i < commitIndices.length; i++) {
45
const commitIndex = commitIndices[i];
46
if (selectedCommitIndex === commitIndex) {
47
- const {
48
- fiberActualDurations,
49
- fiberSelfDurations,
50
- } = profilerStore.getCommitData(((rootID: any): number), commitIndex);
47
+ const {fiberActualDurations, fiberSelfDurations} =
48
+ profilerStore.getCommitData(((rootID: any): number), commitIndex);
49
const actualDuration = fiberActualDurations.get(id) || 0;
50
const selfDuration = fiberSelfDurations.get(id) || 0;
51
packages/react-devtools-shared/src/devtools/views/Profiler/Profiler.js
+2
-3
@@ -50,9 +50,8 @@ function Profiler(_: {}) {
50
supportsProfiling,
51
} = useContext(ProfilerContext);
52
53
- const {file: timelineTraceEventData, searchInputContainerRef} = useContext(
54
- TimelineContext,
55
- );
53
+ const {file: timelineTraceEventData, searchInputContainerRef} =
54
+ useContext(TimelineContext);
55
56
const {supportsTimeline} = useContext(StoreContext);
57
packages/react-devtools-shared/src/devtools/views/Profiler/ProfilerContext.js
+10
-14
@@ -125,10 +125,8 @@ function ProfilerContextController({children}: Props): React.Node {
125
supportsProfiling,
126
} = useSubscription<StoreProfilingState>(subscription);
127
128
- const [
129
- prevProfilingData,
130
- setPrevProfilingData,
131
- ] = useState<ProfilingDataFrontend | null>(null);
128
+ const [prevProfilingData, setPrevProfilingData] =
129
+ useState<ProfilingDataFrontend | null>(null);
130
const [rootID, setRootID] = useState<number | null>(null);
131
const [selectedFiberID, selectFiberID] = useState<number | null>(null);
132
const [selectedFiberName, selectFiberName] = useState<string | null>(null);
@@ -179,9 +177,8 @@ function ProfilerContextController({children}: Props): React.Node {
177
if (rootID === null || !dataForRoots.has(rootID)) {
178
let selectedElementRootID = null;
179
if (selectedElementID !== null) {
182
- selectedElementRootID = store.getRootIDForElement(
183
- selectedElementID,
184
- );
180
+ selectedElementRootID =
181
+ store.getRootIDForElement(selectedElementID);
182
}
183
if (
184
selectedElementRootID !== null &&
@@ -196,10 +193,8 @@ function ProfilerContextController({children}: Props): React.Node {
193
});
194
}
195
199
- const [
200
- isCommitFilterEnabled,
201
- setIsCommitFilterEnabled,
202
- ] = useLocalStorage<boolean>('React::DevTools::isCommitFilterEnabled', false);
196
+ const [isCommitFilterEnabled, setIsCommitFilterEnabled] =
197
+ useLocalStorage<boolean>('React::DevTools::isCommitFilterEnabled', false);
198
const [minCommitDuration, setMinCommitDuration] = useLocalStorage<number>(
199
'minCommitDuration',
200
0,
@@ -228,9 +223,10 @@ function ProfilerContextController({children}: Props): React.Node {
223
});
224
store.profilerStore.startProfiling();
225
}, [store, selectedTabID]);
231
- const stopProfiling = useCallback(() => store.profilerStore.stopProfiling(), [
232
- store,
233
- ]);
226
+ const stopProfiling = useCallback(
227
+ () => store.profilerStore.stopProfiling(),
228
+ [store],
229
+ );
230
231
if (isProfiling) {
232
batchedUpdates(() => {
packages/react-devtools-shared/src/devtools/views/Profiler/ProfilingImportExportButtons.js
+2
-3
@@ -96,9 +96,8 @@ export default function ProfilingImportExportButtons(): React.Node {
96
97
try {
98
const profilingDataExport = ((json: any): ProfilingDataExport);
99
- profilerStore.profilingData = prepareProfilingDataFrontendFromExport(
100
- profilingDataExport,
101
- );
99
+ profilerStore.profilingData =
100
+ prepareProfilingDataFrontendFromExport(profilingDataExport);
101
} catch (error) {
102
modalDialogDispatch({
103
id: 'ProfilingImportExportButtons',
packages/react-devtools-shared/src/devtools/views/Profiler/RecordToggle.js
+2
-3
@@ -20,9 +20,8 @@ export type Props = {
20
};
21
22
export default function RecordToggle({disabled}: Props): React.Node {
23
- const {isProfiling, startProfiling, stopProfiling} = useContext(
24
- ProfilerContext,
25
- );
23
+ const {isProfiling, startProfiling, stopProfiling} =
24
+ useContext(ProfilerContext);
25
26
let className = styles.InactiveRecordToggle;
27
if (disabled) {
packages/react-devtools-shared/src/devtools/views/Profiler/ReloadAndProfileButton.js
+2
-4
@@ -44,10 +44,8 @@ export default function ReloadAndProfileButton({
44
}),
45
[store],
46
);
47
- const {
48
- recordChangeDescriptions,
49
- supportsReloadAndProfile,
50
- } = useSubscription<SubscriptionData>(subscription);
47
+ const {recordChangeDescriptions, supportsReloadAndProfile} =
48
+ useSubscription<SubscriptionData>(subscription);
49
50
const reloadAndProfile = useCallback(() => {
51
// TODO If we want to support reload-and-profile for e.g. React Native,
packages/react-devtools-shared/src/devtools/views/Profiler/WhatChanged.js
+2
-8
@@ -63,14 +63,8 @@ export default function WhatChanged({fiberID}: Props): React.Node {
63
return null;
64
}
65
66
- const {
67
- context,
68
- didHooksChange,
69
- hooks,
70
- isFirstMount,
71
- props,
72
- state,
73
- } = changeDescription;
66
+ const {context, didHooksChange, hooks, isFirstMount, props, state} =
67
+ changeDescription;
68
69
if (isFirstMount) {
70
return (
packages/react-devtools-shared/src/devtools/views/Profiler/utils.js
+59
-59
@@ -250,53 +250,54 @@ export function prepareProfilingDataFrontendFromExport(
250
export function prepareProfilingDataExport(
251
profilingDataFrontend: ProfilingDataFrontend,
252
): ProfilingDataExport {
253
- const timelineData: Array<TimelineDataExport> = profilingDataFrontend.timelineData.map(
254
- ({
255
- batchUIDToMeasuresMap,
256
- componentMeasures,
257
- duration,
258
- flamechart,
259
- internalModuleSourceToRanges,
260
- laneToLabelMap,
261
- laneToReactMeasureMap,
262
- nativeEvents,
263
- networkMeasures,
264
- otherUserTimingMarks,
265
- reactVersion,
266
- schedulingEvents,
267
- snapshots,
268
- snapshotHeight,
269
- startTime,
270
- suspenseEvents,
271
- thrownErrors,
272
- }) => ({
273
- // Most of the data is safe to serialize as-is,
274
- // but we need to convert the Maps to nested Arrays.
275
- batchUIDToMeasuresKeyValueArray: Array.from(
276
- batchUIDToMeasuresMap.entries(),
277
- ),
278
- componentMeasures: componentMeasures,
279
- duration,
280
- flamechart,
281
- internalModuleSourceToRanges: Array.from(
282
- internalModuleSourceToRanges.entries(),
283
- ),
284
- laneToLabelKeyValueArray: Array.from(laneToLabelMap.entries()),
285
- laneToReactMeasureKeyValueArray: Array.from(
286
- laneToReactMeasureMap.entries(),
287
- ),
288
- nativeEvents,
289
- networkMeasures,
290
- otherUserTimingMarks,
291
- reactVersion,
292
- schedulingEvents,
293
- snapshots,
294
- snapshotHeight,
295
- startTime,
296
- suspenseEvents,
297
- thrownErrors,
298
- }),
299
- );
253
+ const timelineData: Array<TimelineDataExport> =
254
+ profilingDataFrontend.timelineData.map(
255
+ ({
256
+ batchUIDToMeasuresMap,
257
+ componentMeasures,
258
+ duration,
259
+ flamechart,
260
+ internalModuleSourceToRanges,
261
+ laneToLabelMap,
262
+ laneToReactMeasureMap,
263
+ nativeEvents,
264
+ networkMeasures,
265
+ otherUserTimingMarks,
266
+ reactVersion,
267
+ schedulingEvents,
268
+ snapshots,
269
+ snapshotHeight,
270
+ startTime,
271
+ suspenseEvents,
272
+ thrownErrors,
273
+ }) => ({
274
+ // Most of the data is safe to serialize as-is,
275
+ // but we need to convert the Maps to nested Arrays.
276
+ batchUIDToMeasuresKeyValueArray: Array.from(
277
+ batchUIDToMeasuresMap.entries(),
278
+ ),
279
+ componentMeasures: componentMeasures,
280
+ duration,
281
+ flamechart,
282
+ internalModuleSourceToRanges: Array.from(
283
+ internalModuleSourceToRanges.entries(),
284
+ ),
285
+ laneToLabelKeyValueArray: Array.from(laneToLabelMap.entries()),
286
+ laneToReactMeasureKeyValueArray: Array.from(
287
+ laneToReactMeasureMap.entries(),
288
+ ),
289
+ nativeEvents,
290
+ networkMeasures,
291
+ otherUserTimingMarks,
292
+ reactVersion,
293
+ schedulingEvents,
294
+ snapshots,
295
+ snapshotHeight,
296
+ startTime,
297
+ suspenseEvents,
298
+ thrownErrors,
299
+ }),
300
+ );
301
302
const dataForRoots: Array<ProfilingDataForRootExport> = [];
303
profilingDataFrontend.dataForRoots.forEach(
@@ -373,15 +374,14 @@ export const formatPercentage = (percentage: number): number =>
374
export const formatTime = (timestamp: number): number =>
375
Math.round(Math.round(timestamp) / 100) / 10;
376
376
-export const scale = (
377
- minValue: number,
378
- maxValue: number,
379
- minRange: number,
380
- maxRange: number,
381
-): ((value: number, fallbackValue: number) => number) => (
382
- value: number,
383
- fallbackValue: number,
384
-) =>
385
- maxValue - minValue === 0
386
- ? fallbackValue
387
- : ((value - minValue) / (maxValue - minValue)) * (maxRange - minRange);
377
+export const scale =
378
+ (
379
+ minValue: number,
380
+ maxValue: number,
381
+ minRange: number,
382
+ maxRange: number,
383
+ ): ((value: number, fallbackValue: number) => number) =>
384
+ (value: number, fallbackValue: number) =>
385
+ maxValue - minValue === 0
386
+ ? fallbackValue
387
+ : ((value - minValue) / (maxValue - minValue)) * (maxRange - minRange);
packages/react-devtools-shared/src/devtools/views/Settings/SettingsContext.js
+30
-42
@@ -107,56 +107,44 @@ function SettingsContextController({
107
}: Props): React.Node {
108
const bridge = useContext(BridgeContext);
109
110
- const [
111
- displayDensity,
112
- setDisplayDensity,
113
- ] = useLocalStorageWithLog<DisplayDensity>(
114
- 'React::DevTools::displayDensity',
115
- 'compact',
116
- );
110
+ const [displayDensity, setDisplayDensity] =
111
+ useLocalStorageWithLog<DisplayDensity>(
112
+ 'React::DevTools::displayDensity',
113
+ 'compact',
114
+ );
115
const [theme, setTheme] = useLocalStorageWithLog<Theme>(
116
LOCAL_STORAGE_BROWSER_THEME,
117
'auto',
118
);
121
- const [
122
- appendComponentStack,
123
- setAppendComponentStack,
124
- ] = useLocalStorageWithLog<boolean>(
125
- LOCAL_STORAGE_SHOULD_APPEND_COMPONENT_STACK_KEY,
126
- true,
127
- );
128
- const [
129
- breakOnConsoleErrors,
130
- setBreakOnConsoleErrors,
131
- ] = useLocalStorageWithLog<boolean>(
132
- LOCAL_STORAGE_SHOULD_BREAK_ON_CONSOLE_ERRORS,
133
- false,
134
- );
119
+ const [appendComponentStack, setAppendComponentStack] =
120
+ useLocalStorageWithLog<boolean>(
121
+ LOCAL_STORAGE_SHOULD_APPEND_COMPONENT_STACK_KEY,
122
+ true,
123
+ );
124
+ const [breakOnConsoleErrors, setBreakOnConsoleErrors] =
125
+ useLocalStorageWithLog<boolean>(
126
+ LOCAL_STORAGE_SHOULD_BREAK_ON_CONSOLE_ERRORS,
127
+ false,
128
+ );
129
const [parseHookNames, setParseHookNames] = useLocalStorageWithLog<boolean>(
130
LOCAL_STORAGE_PARSE_HOOK_NAMES_KEY,
131
false,
132
);
139
- const [
140
- hideConsoleLogsInStrictMode,
141
- setHideConsoleLogsInStrictMode,
142
- ] = useLocalStorageWithLog<boolean>(
143
- LOCAL_STORAGE_HIDE_CONSOLE_LOGS_IN_STRICT_MODE,
144
- false,
145
- );
146
- const [
147
- showInlineWarningsAndErrors,
148
- setShowInlineWarningsAndErrors,
149
- ] = useLocalStorageWithLog<boolean>(
150
- LOCAL_STORAGE_SHOW_INLINE_WARNINGS_AND_ERRORS_KEY,
151
- true,
152
- );
153
- const [
154
- traceUpdatesEnabled,
155
- setTraceUpdatesEnabled,
156
- ] = useLocalStorageWithLog<boolean>(
157
- LOCAL_STORAGE_TRACE_UPDATES_ENABLED_KEY,
158
- false,
159
- );
133
+ const [hideConsoleLogsInStrictMode, setHideConsoleLogsInStrictMode] =
134
+ useLocalStorageWithLog<boolean>(
135
+ LOCAL_STORAGE_HIDE_CONSOLE_LOGS_IN_STRICT_MODE,
136
+ false,
137
+ );
138
+ const [showInlineWarningsAndErrors, setShowInlineWarningsAndErrors] =
139
+ useLocalStorageWithLog<boolean>(
140
+ LOCAL_STORAGE_SHOW_INLINE_WARNINGS_AND_ERRORS_KEY,
141
+ true,
142
+ );
143
+ const [traceUpdatesEnabled, setTraceUpdatesEnabled] =
144
+ useLocalStorageWithLog<boolean>(
145
+ LOCAL_STORAGE_TRACE_UPDATES_ENABLED_KEY,
146
+ false,
147
+ );
148
149
const documentElements = useMemo<DocumentElements>(() => {
150
const array: Array<HTMLElement> = [
packages/react-devtools-shared/src/devtools/views/Settings/SettingsModal.js
+4
-3
@@ -59,9 +59,10 @@ export default function SettingsModal(_: {}): React.Node {
59
60
function SettingsModalImpl(_: {}) {
61
const {setIsModalShowing} = useContext(SettingsModalContext);
62
- const dismissModal = useCallback(() => setIsModalShowing(false), [
63
- setIsModalShowing,
64
- ]);
62
+ const dismissModal = useCallback(
63
+ () => setIsModalShowing(false),
64
+ [setIsModalShowing],
65
+ );
66
67
const [selectedTabID, selectTab] = useLocalStorage<TabID>(
68
'React::DevTools::selectedSettingsTabID',
packages/react-devtools-shared/src/devtools/views/Settings/SettingsModalContext.js
+4
-4
@@ -33,10 +33,10 @@ function SettingsModalContextController({
33
}): React.Node {
34
const [isModalShowing, setIsModalShowing] = useState<boolean>(false);
35
36
- const value = useMemo(() => ({isModalShowing, setIsModalShowing}), [
37
- isModalShowing,
38
- setIsModalShowing,
39
- ]);
36
+ const value = useMemo(
37
+ () => ({isModalShowing, setIsModalShowing}),
38
+ [isModalShowing, setIsModalShowing],
39
+ );
40
41
return (
42
<SettingsModalContext.Provider value={value}>
packages/react-devtools-shared/src/devtools/views/Settings/SettingsModalContextToggle.js
+4
-3
@@ -20,9 +20,10 @@ export default function SettingsModalContextToggle(): React.Node {
20
const store = useContext(StoreContext);
21
const {profilerStore} = store;
22
23
- const showFilterModal = useCallback(() => setIsModalShowing(true), [
24
- setIsModalShowing,
25
- ]);
23
+ const showFilterModal = useCallback(
24
+ () => setIsModalShowing(true),
25
+ [setIsModalShowing],
26
+ );
27
28
// Updating preferences while profiling is in progress could break things (e.g. filtering)
29
// Explicitly disallow it for now.
packages/react-devtools-shared/src/devtools/views/Toggle.js
+4
-4
@@ -42,10 +42,10 @@ export default function Toggle({
42
defaultClassName = styles.ToggleOff;
43
}
44
45
- const handleClick = useCallback(() => onChange(!isChecked), [
46
- isChecked,
47
- onChange,
48
- ]);
45
+ const handleClick = useCallback(
46
+ () => onChange(!isChecked),
47
+ [isChecked, onChange],
48
+ );
49
50
let toggle = (
51
<button
packages/react-devtools-shared/src/devtools/views/context.js
+8
-11
@@ -14,9 +14,8 @@ import Store from '../store';
14
import type {ViewAttributeSource} from 'react-devtools-shared/src/devtools/views/DevTools';
15
import type {FrontendBridge} from 'react-devtools-shared/src/bridge';
16
17
-export const BridgeContext: ReactContext<FrontendBridge> = createContext<FrontendBridge>(
18
- ((null: any): FrontendBridge),
19
-);
17
+export const BridgeContext: ReactContext<FrontendBridge> =
18
+ createContext<FrontendBridge>(((null: any): FrontendBridge));
19
BridgeContext.displayName = 'BridgeContext';
20
21
export const StoreContext: ReactContext<Store> = createContext<Store>(
@@ -29,12 +28,11 @@ export type ContextMenuContextType = {
28
viewAttributeSourceFunction: ViewAttributeSource | null,
29
};
30
32
-export const ContextMenuContext: ReactContext<ContextMenuContextType> = createContext<ContextMenuContextType>(
33
- {
31
+export const ContextMenuContext: ReactContext<ContextMenuContextType> =
32
+ createContext<ContextMenuContextType>({
33
isEnabledForInspectedElement: false,
34
viewAttributeSourceFunction: null,
36
- },
37
-);
35
+ });
36
ContextMenuContext.displayName = 'ContextMenuContext';
37
38
export type OptionsContextType = {
@@ -46,13 +44,12 @@ export type OptionsContextType = {
44
hideViewSourceAction: boolean,
45
};
46
49
-export const OptionsContext: ReactContext<OptionsContextType> = createContext<OptionsContextType>(
50
- {
47
+export const OptionsContext: ReactContext<OptionsContextType> =
48
+ createContext<OptionsContextType>({
49
readOnly: false,
50
hideSettings: false,
51
hideToggleErrorAction: false,
52
hideToggleSuspenseAction: false,
53
hideLogAction: false,
54
hideViewSourceAction: false,
57
- },
58
-);
55
+ });
packages/react-devtools-shared/src/dynamicImportCache.js
+2
-4
@@ -40,10 +40,8 @@ type ModuleLoaderFunction = () => Thenable<Module>;
40
// This is intentionally a module-level Map, rather than a React-managed one.
41
// Otherwise, refreshing the inspected element cache would also clear this cache.
42
// Modules are static anyway.
43
-const moduleLoaderFunctionToModuleMap: Map<
44
- ModuleLoaderFunction,
45
- Module,
46
-> = new Map();
43
+const moduleLoaderFunctionToModuleMap: Map<ModuleLoaderFunction, Module> =
44
+ new Map();
45
46
function readRecord<T>(record: Record<T>): ResolvedRecord<T> | RejectedRecord {
47
if (record.status === Resolved) {
packages/react-devtools-shared/src/hook.js
+7
-4
@@ -166,7 +166,7 @@ export function installHook(target: any): DevToolsHook | null {
166
167
// Bonus: throw an exception hoping that it gets picked up by a reporting system.
168
// Not synchronously so that it doesn't break the calling code.
169
- setTimeout(function() {
169
+ setTimeout(function () {
170
throw new Error(
171
'React is running in production mode, but dead code ' +
172
'elimination has not been applied. Read how to correctly ' +
@@ -303,8 +303,10 @@ export function installHook(target: any): DevToolsHook | null {
303
}
304
};
305
306
- overrideMethod.__REACT_DEVTOOLS_STRICT_MODE_ORIGINAL_METHOD__ = originalMethod;
307
- originalMethod.__REACT_DEVTOOLS_STRICT_MODE_OVERRIDE_METHOD__ = overrideMethod;
306
+ overrideMethod.__REACT_DEVTOOLS_STRICT_MODE_ORIGINAL_METHOD__ =
307
+ originalMethod;
308
+ originalMethod.__REACT_DEVTOOLS_STRICT_MODE_OVERRIDE_METHOD__ =
309
+ overrideMethod;
310
311
targetConsole[method] = overrideMethod;
312
} catch (error) {}
@@ -555,7 +557,8 @@ export function installHook(target: any): DevToolsHook | null {
557
};
558
559
if (__TEST__) {
558
- hook.dangerous_setTargetConsoleForTesting = dangerous_setTargetConsoleForTesting;
560
+ hook.dangerous_setTargetConsoleForTesting =
561
+ dangerous_setTargetConsoleForTesting;
562
}
563
564
Object.defineProperty(
packages/react-devtools-shared/src/hookNamesCache.js
+2
-1
@@ -143,7 +143,8 @@ export function loadHookNames(
143
}
144
145
if (hookNames) {
146
- const resolvedRecord = ((newRecord: any): ResolvedRecord<HookNames>);
146
+ const resolvedRecord =
147
+ ((newRecord: any): ResolvedRecord<HookNames>);
148
resolvedRecord.status = Resolved;
149
resolvedRecord.value = hookNames;
150
} else {
packages/react-devtools-shared/src/hooks/__tests__/parseHookNames-test.js
+24
-24
@@ -56,16 +56,16 @@ describe('parseHookNames', () => {
56
57
fetchMock = initFetchMock();
58
59
- inspectHooks = require('react-debug-tools/src/ReactDebugHooks')
60
- .inspectHooks;
59
+ inspectHooks =
60
+ require('react-debug-tools/src/ReactDebugHooks').inspectHooks;
61
62
// Jest can't run the workerized version of this module.
63
const {
64
flattenHooksList,
65
loadSourceAndMetadata,
66
} = require('../parseHookNames/loadSourceAndMetadata');
67
- const parseSourceAndMetadata = require('../parseHookNames/parseSourceAndMetadata')
68
- .parseSourceAndMetadata;
67
+ const parseSourceAndMetadata =
68
+ require('../parseHookNames/parseSourceAndMetadata').parseSourceAndMetadata;
69
parseHookNames = async hooksTree => {
70
const hooksList = flattenHooksList(hooksTree);
71
@@ -105,22 +105,22 @@ describe('parseHookNames', () => {
105
}
106
107
it('should parse names for useState()', async () => {
108
- const Component = require('./__source__/__untransformed__/ComponentWithUseState')
109
- .Component;
108
+ const Component =
109
+ require('./__source__/__untransformed__/ComponentWithUseState').Component;
110
const hookNames = await getHookNamesForComponent(Component);
111
expectHookNamesToEqual(hookNames, ['foo', 'bar', 'baz', null]);
112
});
113
114
it('should parse names for useReducer()', async () => {
115
- const Component = require('./__source__/__untransformed__/ComponentWithUseReducer')
116
- .Component;
115
+ const Component =
116
+ require('./__source__/__untransformed__/ComponentWithUseReducer').Component;
117
const hookNames = await getHookNamesForComponent(Component);
118
expectHookNamesToEqual(hookNames, ['foo', 'bar', 'baz']);
119
});
120
121
it('should skip loading source files for unnamed hooks like useEffect', async () => {
122
- const Component = require('./__source__/__untransformed__/ComponentWithUseEffect')
123
- .Component;
122
+ const Component =
123
+ require('./__source__/__untransformed__/ComponentWithUseEffect').Component;
124
125
// Since this component contains only unnamed hooks, the source code should not even be loaded.
126
fetchMock.mockIf(/.+$/, request => {
@@ -132,8 +132,8 @@ describe('parseHookNames', () => {
132
});
133
134
it('should skip loading source files for unnamed hooks like useEffect (alternate)', async () => {
135
- const Component = require('./__source__/__untransformed__/ComponentWithExternalUseEffect')
136
- .Component;
135
+ const Component =
136
+ require('./__source__/__untransformed__/ComponentWithExternalUseEffect').Component;
137
138
fetchMock.mockIf(/.+$/, request => {
139
// Since the custom hook contains only unnamed hooks, the source code should not be loaded.
@@ -148,8 +148,8 @@ describe('parseHookNames', () => {
148
});
149
150
it('should parse names for custom hooks', async () => {
151
- const Component = require('./__source__/__untransformed__/ComponentWithNamedCustomHooks')
152
- .Component;
151
+ const Component =
152
+ require('./__source__/__untransformed__/ComponentWithNamedCustomHooks').Component;
153
const hookNames = await getHookNamesForComponent(Component);
154
expectHookNamesToEqual(hookNames, [
155
'foo',
@@ -159,15 +159,15 @@ describe('parseHookNames', () => {
159
});
160
161
it('should parse names for code using hooks indirectly', async () => {
162
- const Component = require('./__source__/__untransformed__/ComponentUsingHooksIndirectly')
163
- .Component;
162
+ const Component =
163
+ require('./__source__/__untransformed__/ComponentUsingHooksIndirectly').Component;
164
const hookNames = await getHookNamesForComponent(Component);
165
expectHookNamesToEqual(hookNames, ['count', 'darkMode', 'isDarkMode']);
166
});
167
168
it('should parse names for code using nested hooks', async () => {
169
- const Component = require('./__source__/__untransformed__/ComponentWithNestedHooks')
170
- .Component;
169
+ const Component =
170
+ require('./__source__/__untransformed__/ComponentWithNestedHooks').Component;
171
let InnerComponent;
172
const hookNames = await getHookNamesForComponent(Component, {
173
callback: innerComponent => {
@@ -180,8 +180,8 @@ describe('parseHookNames', () => {
180
});
181
182
it('should return null for custom hooks without explicit names', async () => {
183
- const Component = require('./__source__/__untransformed__/ComponentWithUnnamedCustomHooks')
184
- .Component;
183
+ const Component =
184
+ require('./__source__/__untransformed__/ComponentWithUnnamedCustomHooks').Component;
185
const hookNames = await getHookNamesForComponent(Component);
186
expectHookNamesToEqual(hookNames, [
187
null, // Custom hooks can have names, but this one does not even return a value.
@@ -923,8 +923,8 @@ describe('parseHookNames worker', () => {
923
};
924
});
925
926
- inspectHooks = require('react-debug-tools/src/ReactDebugHooks')
927
- .inspectHooks;
926
+ inspectHooks =
927
+ require('react-debug-tools/src/ReactDebugHooks').inspectHooks;
928
parseHookNames = require('../parseHookNames').parseHookNames;
929
});
930
@@ -935,8 +935,8 @@ describe('parseHookNames worker', () => {
935
}
936
937
it('should use worker', async () => {
938
- const Component = require('./__source__/__untransformed__/ComponentWithUseState')
939
- .Component;
938
+ const Component =
939
+ require('./__source__/__untransformed__/ComponentWithUseState').Component;
940
941
window.Worker = true;
942
packages/react-devtools-shared/src/hooks/astUtils.js
+4
-3
@@ -244,9 +244,10 @@ function getHookNameFromNode(
244
// const flagState = useState(true); -> later referenced as
245
// const flag = flagState[0];
246
// const setFlag = flagState[1];
247
- nodesAssociatedWithReactHookASTNode = nodesAssociatedWithReactHookASTNode.filter(
248
- hookPath => filterMemberWithHookVariableName(hookPath),
249
- );
247
+ nodesAssociatedWithReactHookASTNode =
248
+ nodesAssociatedWithReactHookASTNode.filter(hookPath =>
249
+ filterMemberWithHookVariableName(hookPath),
250
+ );
251
252
if (nodesAssociatedWithReactHookASTNode.length !== 1) {
253
// Something went wrong, only a single desirable hook should remain here
packages/react-devtools-shared/src/hooks/parseHookNames/index.js
+2
-1
@@ -17,7 +17,8 @@ import WorkerizedParseSourceAndMetadata from './parseSourceAndMetadata.worker';
17
import typeof * as ParseSourceAndMetadataModule from './parseSourceAndMetadata';
18
import {flattenHooksList, loadSourceAndMetadata} from './loadSourceAndMetadata';
19
20
-const workerizedParseHookNames: ParseSourceAndMetadataModule = WorkerizedParseSourceAndMetadata();
20
+const workerizedParseHookNames: ParseSourceAndMetadataModule =
21
+ WorkerizedParseSourceAndMetadata();
22
23
export function parseSourceAndMetadata(
24
hooksList: Array<HooksNode>,
packages/react-devtools-shared/src/hooks/parseHookNames/loadSourceAndMetadata.js
+4
-2
@@ -149,7 +149,8 @@ function extractAndLoadSourceMapJSON(
149
const setterPromises = [];
150
locationKeyToHookSourceAndMetadata.forEach(hookSourceAndMetadata => {
151
const sourceMapRegex = / ?sourceMappingURL=([^\s'"]+)/gm;
152
- const runtimeSourceCode = ((hookSourceAndMetadata.runtimeSourceCode: any): string);
152
+ const runtimeSourceCode =
153
+ ((hookSourceAndMetadata.runtimeSourceCode: any): string);
154
155
// TODO (named hooks) Search for our custom metadata first.
156
// If it's found, we should use it rather than source maps.
@@ -415,7 +416,8 @@ function initializeHookSourceAndMetadata(
416
hooksList: Array<HooksNode>,
417
): LocationKeyToHookSourceAndMetadata {
418
// Create map of unique source locations (file names plus line and column numbers) to metadata about hooks.
418
- const locationKeyToHookSourceAndMetadata: LocationKeyToHookSourceAndMetadata = new Map();
419
+ const locationKeyToHookSourceAndMetadata: LocationKeyToHookSourceAndMetadata =
420
+ new Map();
421
for (let i = 0; i < hooksList.length; i++) {
422
const hook = hooksList[i];
423
packages/react-devtools-shared/src/hooks/parseHookNames/parseSourceAndMetadata.js
+31
-35
@@ -64,29 +64,28 @@ type CachedRuntimeCodeMetadata = {
64
sourceMapConsumer: SourceMapConsumerType | null,
65
};
66
67
-const runtimeURLToMetadataCache: LRUCache<
68
- string,
69
- CachedRuntimeCodeMetadata,
70
-> = new LRU({max: 50});
67
+const runtimeURLToMetadataCache: LRUCache<string, CachedRuntimeCodeMetadata> =
68
+ new LRU({max: 50});
69
70
type CachedSourceCodeMetadata = {
71
originalSourceAST: AST,
72
originalSourceCode: string,
73
};
74
77
-const originalURLToMetadataCache: LRUCache<
78
- string,
79
- CachedSourceCodeMetadata,
80
-> = new LRU({
81
- max: 50,
82
- dispose: (originalSourceURL: string, metadata: CachedSourceCodeMetadata) => {
83
- if (__DEBUG__) {
84
- console.log(
85
- `originalURLToMetadataCache.dispose() Evicting cached metadata for "${originalSourceURL}"`,
86
- );
87
- }
88
- },
89
-});
75
+const originalURLToMetadataCache: LRUCache<string, CachedSourceCodeMetadata> =
76
+ new LRU({
77
+ max: 50,
78
+ dispose: (
79
+ originalSourceURL: string,
80
+ metadata: CachedSourceCodeMetadata,
81
+ ) => {
82
+ if (__DEBUG__) {
83
+ console.log(
84
+ `originalURLToMetadataCache.dispose() Evicting cached metadata for "${originalSourceURL}"`,
85
+ );
86
+ }
87
+ },
88
+ });
89
90
export async function parseSourceAndMetadata(
91
hooksList: HooksList,
@@ -196,7 +195,8 @@ function initializeHookParsedMetadata(
195
locationKeyToHookSourceAndMetadata: LocationKeyToHookSourceAndMetadata,
196
) {
197
// Create map of unique source locations (file names plus line and column numbers) to metadata about hooks.
199
- const locationKeyToHookParsedMetadata: LocationKeyToHookParsedMetadata = new Map();
198
+ const locationKeyToHookParsedMetadata: LocationKeyToHookParsedMetadata =
199
+ new Map();
200
locationKeyToHookSourceAndMetadata.forEach(
201
(hookSourceAndMetadata, locationKey) => {
202
const hookParsedMetadata: HookParsedMetadata = {
@@ -222,9 +222,8 @@ function parseSourceAST(
222
): void {
223
locationKeyToHookSourceAndMetadata.forEach(
224
(hookSourceAndMetadata, locationKey) => {
225
- const hookParsedMetadata = locationKeyToHookParsedMetadata.get(
226
- locationKey,
227
- );
225
+ const hookParsedMetadata =
226
+ locationKeyToHookParsedMetadata.get(locationKey);
227
if (hookParsedMetadata == null) {
228
throw Error(`Expected to find HookParsedMetadata for "${locationKey}"`);
229
}
@@ -250,7 +249,8 @@ function parseSourceAST(
249
}
250
251
const {metadataConsumer, sourceMapConsumer} = hookParsedMetadata;
253
- const runtimeSourceCode = ((hookSourceAndMetadata.runtimeSourceCode: any): string);
252
+ const runtimeSourceCode =
253
+ ((hookSourceAndMetadata.runtimeSourceCode: any): string);
254
let hasHookMap = false;
255
let originalSourceURL;
256
let originalSourceCode;
@@ -268,15 +268,11 @@ function parseSourceAST(
268
// Namespace them?
269
originalSourceURL = hookSourceAndMetadata.runtimeSourceURL;
270
} else {
271
- const {
272
- column,
273
- line,
274
- sourceContent,
275
- sourceURL,
276
- } = sourceMapConsumer.originalPositionFor({
277
- columnNumber,
278
- lineNumber,
279
- });
271
+ const {column, line, sourceContent, sourceURL} =
272
+ sourceMapConsumer.originalPositionFor({
273
+ columnNumber,
274
+ lineNumber,
275
+ });
276
277
originalSourceColumnNumber = column;
278
originalSourceLineNumber = line;
@@ -287,7 +283,8 @@ function parseSourceAST(
283
hookParsedMetadata.originalSourceCode = originalSourceCode;
284
hookParsedMetadata.originalSourceURL = originalSourceURL;
285
hookParsedMetadata.originalSourceLineNumber = originalSourceLineNumber;
290
- hookParsedMetadata.originalSourceColumnNumber = originalSourceColumnNumber;
286
+ hookParsedMetadata.originalSourceColumnNumber =
287
+ originalSourceColumnNumber;
288
289
if (
290
metadataConsumer != null &&
@@ -381,9 +378,8 @@ function parseSourceMaps(
378
) {
379
locationKeyToHookSourceAndMetadata.forEach(
380
(hookSourceAndMetadata, locationKey) => {
384
- const hookParsedMetadata = locationKeyToHookParsedMetadata.get(
385
- locationKey,
386
- );
381
+ const hookParsedMetadata =
382
+ locationKeyToHookParsedMetadata.get(locationKey);
383
if (hookParsedMetadata == null) {
384
throw Error(`Expected to find HookParsedMetadata for "${locationKey}"`);
385
}
packages/react-devtools-shared/src/inspectedElementCache.js
+2
-1
@@ -132,7 +132,8 @@ export function inspectElement(
132
InspectedElementFrontend,
133
InspectedElementResponseType,
134
]) => {
135
- const resolvedRecord = ((newRecord: any): ResolvedRecord<InspectedElementFrontend>);
135
+ const resolvedRecord =
136
+ ((newRecord: any): ResolvedRecord<InspectedElementFrontend>);
137
resolvedRecord.status = Resolved;
138
resolvedRecord.value = inspectedElement;
139
packages/react-devtools-shared/src/inspectedElementMutableSource.js
+4
-6
@@ -39,12 +39,10 @@ import UnknownHookError from 'react-devtools-shared/src/errors/UnknownHookError'
39
// This doens't work properly though when component filters are changed,
40
// because this will cause the Store to dump all roots and re-initialize the tree (recreating the Element objects).
41
// So instead we key on Element ID (which is stable in this case) and use an LRU for eviction.
42
-const inspectedElementCache: LRUCache<
43
- number,
44
- InspectedElementFrontend,
45
-> = new LRU({
46
- max: 25,
47
-});
42
+const inspectedElementCache: LRUCache<number, InspectedElementFrontend> =
43
+ new LRU({
44
+ max: 25,
45
+ });
46
47
type Path = Array<string | number>;
48
packages/react-devtools-shared/src/registerDevToolsEventLogger.js
+1
-1
@@ -82,7 +82,7 @@ export function registerDevToolsEventLogger(
82
83
const iframe = document.createElement('iframe');
84
iframe.src = loggingUrl;
85
- iframe.onload = function(...args) {
85
+ iframe.onload = function (...args) {
86
handleLoggingIFrameLoaded(iframe);
87
};
88
body.appendChild(iframe);
packages/react-devtools-shell/src/app/EditableProps/index.js
+8
-6
@@ -39,9 +39,10 @@ type StatefulFunctionProps = {name: string};
39
function StatefulFunction({name}: StatefulFunctionProps) {
40
const [count, updateCount] = useState(0);
41
const debouncedCount = useDebounce(count, 1000);
42
- const handleUpdateCountClick = useCallback(() => updateCount(count + 1), [
43
- count,
44
- ]);
42
+ const handleUpdateCountClick = useCallback(
43
+ () => updateCount(count + 1),
44
+ [count],
45
+ );
46
47
const [data, dispatch] = useReducer(reducer, initialData);
48
const handleUpdateReducerClick = useCallback(
@@ -109,9 +110,10 @@ const ForwardRef = forwardRef<{name: string}, HTMLUListElement>(
110
({name}, ref) => {
111
const [count, updateCount] = useState(0);
112
const debouncedCount = useDebounce(count, 1000);
112
- const handleUpdateCountClick = useCallback(() => updateCount(count + 1), [
113
- count,
114
- ]);
113
+ const handleUpdateCountClick = useCallback(
114
+ () => updateCount(count + 1),
115
+ [count],
116
+ );
117
return (
118
<ul ref={ref}>
119
<li>Name: {name}</li>
packages/react-devtools-shell/src/app/Iframe/index.js
+1
-1
@@ -25,7 +25,7 @@ function Frame(props) {
25
26
const ref = React.useRef();
27
28
- React.useLayoutEffect(function() {
28
+ React.useLayoutEffect(function () {
29
const iframe = ref.current;
30
31
if (iframe) {
packages/react-devtools-shell/src/app/devtools.js
+1
-1
@@ -38,7 +38,7 @@ let isTestAppMounted = true;
38
const mountButton = ((document.getElementById(
39
'mountButton',
40
): any): HTMLButtonElement);
41
-mountButton.addEventListener('click', function() {
41
+mountButton.addEventListener('click', function () {
42
if (isTestAppMounted) {
43
if (typeof window.unmountTestApp === 'function') {
44
window.unmountTestApp();
packages/react-devtools-shell/src/perf-regression/apps/LargeSubtree.js
+3
-3
@@ -24,9 +24,9 @@ export default function LargeSubtree(): React.Node {
24
window.requestAnimationFrame(() => {
25
const afterRenderTime = performance.now();
26
console.log(
27
- `Time spent on ${
28
- showList ? 'unmounting' : 'mounting'
29
- } the subtree: ${afterRenderTime - startTime}ms`,
27
+ `Time spent on ${showList ? 'unmounting' : 'mounting'} the subtree: ${
28
+ afterRenderTime - startTime
29
+ }ms`,
30
);
31
});
32
};
packages/react-devtools-timeline/src/CanvasPage.js
+3
-3
@@ -794,9 +794,9 @@ function AutoSizedCanvas({
794
<ContextMenuItem
795
onClick={() =>
796
copy(
797
- `line ${flamechartStackFrame.locationLine ??
798
- ''}, column ${flamechartStackFrame.locationColumn ??
799
- ''}`,
797
+ `line ${
798
+ flamechartStackFrame.locationLine ?? ''
799
+ }, column ${flamechartStackFrame.locationColumn ?? ''}`,
800
)
801
}
802
title="Copy location">
packages/react-devtools-timeline/src/Timeline.js
+2
-7
@@ -33,13 +33,8 @@ import {TimelineSearchContextController} from './TimelineSearchContext';
33
import styles from './Timeline.css';
34
35
export function Timeline(_: {}): React.Node {
36
- const {
37
- file,
38
- inMemoryTimelineData,
39
- isTimelineSupported,
40
- setFile,
41
- viewState,
42
- } = useContext(TimelineContext);
36
+ const {file, inMemoryTimelineData, isTimelineSupported, setFile, viewState} =
37
+ useContext(TimelineContext);
38
const {didRecordCommits, isProfiling} = useContext(ProfilerContext);
39
40
const ref = useRef(null);
packages/react-devtools-timeline/src/TimelineContext.js
+4
-2
@@ -82,8 +82,10 @@ function TimelineContextController({children}: Props): React.Node {
82
83
// Recreate view state any time new profiling data is imported.
84
const viewState = useMemo<ViewState>(() => {
85
- const horizontalScrollStateChangeCallbacks: Set<HorizontalScrollStateChangeCallback> = new Set();
86
- const searchRegExpStateChangeCallbacks: Set<SearchRegExpStateChangeCallback> = new Set();
85
+ const horizontalScrollStateChangeCallbacks: Set<HorizontalScrollStateChangeCallback> =
86
+ new Set();
87
+ const searchRegExpStateChangeCallbacks: Set<SearchRegExpStateChangeCallback> =
88
+ new Set();
89
90
const horizontalScrollState = {
91
offset: 0,
packages/react-devtools-timeline/src/content-views/ComponentMeasuresView.js
+2
-7
@@ -92,13 +92,8 @@ export class ComponentMeasuresView extends View {
92
showHoverHighlight: boolean,
93
): boolean {
94
const {frame} = this;
95
- const {
96
- componentName,
97
- duration,
98
- timestamp,
99
- type,
100
- warning,
101
- } = componentMeasure;
95
+ const {componentName, duration, timestamp, type, warning} =
96
+ componentMeasure;
97
98
const xStart = timestampToPosition(timestamp, scaleFactor, frame);
99
const xStop = timestampToPosition(timestamp + duration, scaleFactor, frame);
packages/react-devtools-timeline/src/content-views/ReactMeasuresView.js
+2
-7
@@ -203,13 +203,8 @@ export class ReactMeasuresView extends View {
203
}
204
205
draw(context: CanvasRenderingContext2D): void {
206
- const {
207
- frame,
208
- _hoveredMeasure,
209
- _lanesToRender,
210
- _profilerData,
211
- visibleArea,
212
- } = this;
206
+ const {frame, _hoveredMeasure, _lanesToRender, _profilerData, visibleArea} =
207
+ this;
208
209
context.fillStyle = COLORS.PRIORITY_BACKGROUND;
210
context.fillRect(
packages/react-devtools-timeline/src/content-views/constants.js
+1
-12
@@ -27,18 +27,7 @@ export const TEXT_PADDING = 3;
27
export const SNAPSHOT_SCRUBBER_SIZE = 3;
28
29
export const INTERVAL_TIMES = [
30
- 1,
31
- 2,
32
- 5,
33
- 10,
34
- 20,
35
- 50,
36
- 100,
37
- 200,
38
- 500,
39
- 1000,
40
- 2000,
41
- 5000,
30
+ 1, 2, 5, 10, 20, 50, 100, 200, 500, 1000, 2000, 5000,
31
];
32
export const MIN_INTERVAL_SIZE_PX = 70;
33
packages/react-devtools-timeline/src/import-worker/preprocessData.js
+19
-15
@@ -552,13 +552,9 @@ function processTimelineEvent(
552
type: 'thrown-error',
553
});
554
} else if (name.startsWith('--suspense-suspend-')) {
555
- const [
556
- id,
557
- componentName,
558
- phase,
559
- laneBitmaskString,
560
- promiseName,
561
- ] = name.substr(19).split('-');
555
+ const [id, componentName, phase, laneBitmaskString, promiseName] = name
556
+ .substr(19)
557
+ .split('-');
558
const lanes = getLanesFromTransportDecimalBitmask(laneBitmaskString);
559
560
const availableDepths = new Array(
@@ -978,14 +974,22 @@ function preprocessFlamechart(rawData: TimelineEvent[]): Flamechart {
974
});
975
976
const flamechart: Flamechart = speedscopeFlamechart.getLayers().map(layer =>
981
- layer.map(({start, end, node: {frame: {name, file, line, col}}}) => ({
982
- name,
983
- timestamp: start / 1000,
984
- duration: (end - start) / 1000,
985
- scriptUrl: file,
986
- locationLine: line,
987
- locationColumn: col,
988
- })),
977
+ layer.map(
978
+ ({
979
+ start,
980
+ end,
981
+ node: {
982
+ frame: {name, file, line, col},
983
+ },
984
+ }) => ({
985
+ name,
986
+ timestamp: start / 1000,
987
+ duration: (end - start) / 1000,
988
+ scriptUrl: file,
989
+ locationLine: line,
990
+ locationColumn: col,
991
+ }),
992
+ ),
993
);
994
995
return flamechart;
packages/react-devtools-timeline/src/timelineCache.js
+2
-1
@@ -79,7 +79,8 @@ export function importFile(file: File): TimelineData | Error {
79
importFileWorker(file).then(data => {
80
switch (data.status) {
81
case 'SUCCESS':
82
- const resolvedRecord = ((newRecord: any): ResolvedRecord<TimelineData>);
82
+ const resolvedRecord =
83
+ ((newRecord: any): ResolvedRecord<TimelineData>);
84
resolvedRecord.status = Resolved;
85
resolvedRecord.value = data.processedData;
86
break;
packages/react-devtools-timeline/src/utils/useSmartTooltip.js
+6
-6
@@ -44,9 +44,9 @@ export default function useSmartTooltip({
44
// mouse cursor or finally aligned with the window's top edge.
45
if (mouseY - TOOLTIP_OFFSET_TOP - element.offsetHeight > 0) {
46
// We position the tooltip above the mouse cursor if it fits there.
47
- element.style.top = `${mouseY -
48
- element.offsetHeight -
49
- TOOLTIP_OFFSET_TOP}px`;
47
+ element.style.top = `${
48
+ mouseY - element.offsetHeight - TOOLTIP_OFFSET_TOP
49
+ }px`;
50
} else {
51
// Otherwise we align the tooltip with the window's top edge.
52
element.style.top = '0px';
@@ -64,9 +64,9 @@ export default function useSmartTooltip({
64
if (mouseX - TOOLTIP_OFFSET_TOP - element.offsetWidth > 0) {
65
// We position the tooltip at the left of the mouse cursor if it fits
66
// there.
67
- element.style.left = `${mouseX -
68
- element.offsetWidth -
69
- TOOLTIP_OFFSET_TOP}px`;
67
+ element.style.left = `${
68
+ mouseX - element.offsetWidth - TOOLTIP_OFFSET_TOP
69
+ }px`;
70
} else {
71
// Otherwise, align the tooltip with the window's left edge.
72
element.style.left = '0px';
packages/react-devtools/app.js
+4
-4
@@ -16,11 +16,11 @@ const projectRoots = argv._;
16
17
let mainWindow = null;
18
19
-app.on('window-all-closed', function() {
19
+app.on('window-all-closed', function () {
20
app.quit();
21
});
22
23
-app.on('ready', function() {
23
+app.on('ready', function () {
24
// Create the browser window.
25
mainWindow = new BrowserWindow({
26
width: 800,
@@ -41,7 +41,7 @@ app.on('ready', function() {
41
42
// https://stackoverflow.com/questions/32402327/
43
// $FlowFixMe[incompatible-use] found when upgrading Flow
44
- mainWindow.webContents.on('new-window', function(event, url) {
44
+ mainWindow.webContents.on('new-window', function (event, url) {
45
event.preventDefault();
46
require('electron').shell.openExternal(url);
47
});
@@ -59,7 +59,7 @@ app.on('ready', function() {
59
60
// Emitted when the window is closed.
61
// $FlowFixMe[incompatible-use] found when upgrading Flow
62
- mainWindow.on('closed', function() {
62
+ mainWindow.on('closed', function () {
63
mainWindow = null;
64
});
65
});
packages/react-dom-bindings/src/client/ReactDOMComponent.js
+12
-15
@@ -115,7 +115,7 @@ if (__DEV__) {
115
webview: true,
116
};
117
118
- validatePropertiesInDevelopment = function(type: string, props: any) {
118
+ validatePropertiesInDevelopment = function (type: string, props: any) {
119
validateARIAProperties(type, props);
120
validateInputProperties(type, props);
121
validateUnknownProperties(type, props, {
@@ -134,7 +134,7 @@ if (__DEV__) {
134
// See https://github.com/facebook/react/issues/11807
135
canDiffStyleForHydrationWarning = canUseDOM && !document.documentMode;
136
137
- warnForPropDifference = function(
137
+ warnForPropDifference = function (
138
propName: string,
139
serverValue: mixed,
140
clientValue: mixed,
@@ -142,12 +142,10 @@ if (__DEV__) {
142
if (didWarnInvalidHydration) {
143
return;
144
}
145
- const normalizedClientValue = normalizeMarkupForTextOrAttribute(
146
- clientValue,
147
- );
148
- const normalizedServerValue = normalizeMarkupForTextOrAttribute(
149
- serverValue,
150
- );
145
+ const normalizedClientValue =
146
+ normalizeMarkupForTextOrAttribute(clientValue);
147
+ const normalizedServerValue =
148
+ normalizeMarkupForTextOrAttribute(serverValue);
149
if (normalizedServerValue === normalizedClientValue) {
150
return;
151
}
@@ -160,19 +158,19 @@ if (__DEV__) {
158
);
159
};
160
163
- warnForExtraAttributes = function(attributeNames: Set<string>) {
161
+ warnForExtraAttributes = function (attributeNames: Set<string>) {
162
if (didWarnInvalidHydration) {
163
return;
164
}
165
didWarnInvalidHydration = true;
166
const names = [];
169
- attributeNames.forEach(function(name) {
167
+ attributeNames.forEach(function (name) {
168
names.push(name);
169
});
170
console.error('Extra attributes from the server: %s', names);
171
};
172
175
- warnForInvalidEventListener = function(
173
+ warnForInvalidEventListener = function (
174
registrationName: string,
175
listener: any,
176
) {
@@ -196,7 +194,7 @@ if (__DEV__) {
194
195
// Parse the HTML and read it back to normalize the HTML string so that it
196
// can be used for comparison.
199
- normalizeHTML = function(parent: Element, html: string) {
197
+ normalizeHTML = function (parent: Element, html: string) {
198
// We could have created a separate document here to avoid
199
// re-initializing custom elements if they exist. But this breaks
200
// how <noscript> is being handled. So we use the same document.
@@ -387,9 +385,8 @@ export function createElement(
385
386
// We create tags in the namespace of their parent container, except HTML
387
// tags get no namespace.
390
- const ownerDocument: Document = getOwnerDocumentFromRootContainer(
391
- rootContainerElement,
392
- );
388
+ const ownerDocument: Document =
389
+ getOwnerDocumentFromRootContainer(rootContainerElement);
390
let domElement: Element;
391
let namespaceURI = parentNamespace;
392
if (namespaceURI === HTML_NAMESPACE) {
packages/react-dom-bindings/src/client/ReactDOMComponentTree.js
+1
-3
@@ -39,9 +39,7 @@ import {
39
enableHostSingletons,
40
} from 'shared/ReactFeatureFlags';
41
42
-const randomKey = Math.random()
43
- .toString(36)
44
- .slice(2);
42
+const randomKey = Math.random().toString(36).slice(2);
43
const internalInstanceKey = '__reactFiber$' + randomKey;
44
const internalPropsKey = '__reactProps$' + randomKey;
45
const internalContainerInstanceKey = '__reactContainer$' + randomKey;
packages/react-dom-bindings/src/client/ReactDOMFloatClient.js
+17
-33
@@ -509,18 +509,11 @@ export function getResource(
509
}
510
case 'meta': {
511
let matcher, propertyString, parentResource;
512
- const {
513
- charSet,
514
- content,
515
- httpEquiv,
516
- name,
517
- itemProp,
518
- property,
519
- } = pendingProps;
512
+ const {charSet, content, httpEquiv, name, itemProp, property} =
513
+ pendingProps;
514
const headRoot: Document = getDocumentFromRoot(resourceRoot);
521
- const {head: headResources, lastStructuredMeta} = getResourcesFromRoot(
522
- headRoot,
523
- );
515
+ const {head: headResources, lastStructuredMeta} =
516
+ getResourcesFromRoot(headRoot);
517
if (typeof charSet === 'string') {
518
matcher = 'meta[charset]';
519
} else if (typeof content === 'string') {
@@ -538,10 +531,7 @@ export function getResource(
531
content,
532
)}"]`;
533
541
- const parentPropertyPath = property
542
- .split(':')
543
- .slice(0, -1)
544
- .join(':');
534
+ const parentPropertyPath = property.split(':').slice(0, -1).join(':');
535
parentResource = lastStructuredMeta.get(parentPropertyPath);
536
if (parentResource) {
537
// When using parentResource the matcher is not functional for locating
@@ -900,9 +890,8 @@ function createStyleResource(
890
}
891
}
892
903
- const limitedEscapedHref = escapeSelectorAttributeValueInsideDoubleQuotes(
904
- href,
905
- );
893
+ const limitedEscapedHref =
894
+ escapeSelectorAttributeValueInsideDoubleQuotes(href);
895
const existingEl = root.querySelector(
896
`link[rel="stylesheet"][href="${limitedEscapedHref}"]`,
897
);
@@ -1074,9 +1063,8 @@ function createPreloadResource(
1063
href: string,
1064
props: PreloadProps,
1065
): PreloadResource {
1077
- const limitedEscapedHref = escapeSelectorAttributeValueInsideDoubleQuotes(
1078
- href,
1079
- );
1066
+ const limitedEscapedHref =
1067
+ escapeSelectorAttributeValueInsideDoubleQuotes(href);
1068
let element: null | Instance | HTMLElement = ownerDocument.querySelector(
1069
`link[rel="preload"][href="${limitedEscapedHref}"]`,
1070
);
@@ -1178,23 +1166,19 @@ function acquireHeadResource(resource: HeadResource): Instance {
1166
}
1167
case 'link': {
1168
const linkProps: LinkProps = (props: any);
1181
- const limitedEscapedRel = escapeSelectorAttributeValueInsideDoubleQuotes(
1182
- linkProps.rel,
1183
- );
1184
- const limitedEscapedHref = escapeSelectorAttributeValueInsideDoubleQuotes(
1185
- linkProps.href,
1186
- );
1169
+ const limitedEscapedRel =
1170
+ escapeSelectorAttributeValueInsideDoubleQuotes(linkProps.rel);
1171
+ const limitedEscapedHref =
1172
+ escapeSelectorAttributeValueInsideDoubleQuotes(linkProps.href);
1173
let selector = `link[rel="${limitedEscapedRel}"][href="${limitedEscapedHref}"]`;
1174
if (typeof linkProps.sizes === 'string') {
1189
- const limitedEscapedSizes = escapeSelectorAttributeValueInsideDoubleQuotes(
1190
- linkProps.sizes,
1191
- );
1175
+ const limitedEscapedSizes =
1176
+ escapeSelectorAttributeValueInsideDoubleQuotes(linkProps.sizes);
1177
selector += `[sizes="${limitedEscapedSizes}"]`;
1178
}
1179
if (typeof linkProps.media === 'string') {
1195
- const limitedEscapedMedia = escapeSelectorAttributeValueInsideDoubleQuotes(
1196
- linkProps.media,
1197
- );
1180
+ const limitedEscapedMedia =
1181
+ escapeSelectorAttributeValueInsideDoubleQuotes(linkProps.media);
1182
selector += `[media="${limitedEscapedMedia}"]`;
1183
}
1184
const existingEl = root.querySelector(selector);
packages/react-dom-bindings/src/client/ReactDOMHostConfig.js
+3
-6
@@ -439,10 +439,7 @@ export const scheduleMicrotask: any =
439
? queueMicrotask
440
: typeof localPromise !== 'undefined'
441
? callback =>
442
- localPromise
443
- .resolve(null)
444
- .then(callback)
445
- .catch(handleErrorInNextTick)
442
+ localPromise.resolve(null).then(callback).catch(handleErrorInNextTick)
443
: scheduleTimeout; // TODO: Determine the best fallback here.
444
445
function handleErrorInNextTick(error: any) {
@@ -1576,8 +1573,8 @@ export function isHostResourceType(
1573
if (__DEV__) {
1574
const hostContextDev: HostContextDev = (hostContext: any);
1575
// We can only render resources when we are not within the host container context
1579
- outsideHostContainerContext = !hostContextDev.ancestorInfo
1580
- .containerTagInScope;
1576
+ outsideHostContainerContext =
1577
+ !hostContextDev.ancestorInfo.containerTagInScope;
1578
namespace = hostContextDev.namespace;
1579
} else {
1580
const hostContextProd: HostContextProd = (hostContext: any);
packages/react-dom-bindings/src/client/ReactDOMOption.js
+1
-1
@@ -23,7 +23,7 @@ export function validateProps(element: Element, props: Object) {
23
// If a value is not provided, then the children must be simple.
24
if (props.value == null) {
25
if (typeof props.children === 'object' && props.children !== null) {
26
- Children.forEach(props.children, function(child) {
26
+ Children.forEach(props.children, function (child) {
27
if (child == null) {
28
return;
29
}
packages/react-dom-bindings/src/client/createMicrosoftUnsafeLocalFunction.js
+3
-3
@@ -10,10 +10,10 @@
10
/**
11
* Create a function which has 'unsafe' privileges (required by windows8 apps)
12
*/
13
-const createMicrosoftUnsafeLocalFunction = function(func) {
13
+const createMicrosoftUnsafeLocalFunction = function (func) {
14
if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) {
15
- return function(arg0, arg1, arg2, arg3) {
16
- MSApp.execUnsafeLocalFunction(function() {
15
+ return function (arg0, arg1, arg2, arg3) {
16
+ MSApp.execUnsafeLocalFunction(function () {
17
return func(arg0, arg1, arg2, arg3);
18
});
19
};
packages/react-dom-bindings/src/client/inputValueTracking.js
+2
-2
@@ -79,12 +79,12 @@ function trackValueOnNode(node: any): ?ValueTracker {
79
Object.defineProperty(node, valueField, {
80
configurable: true,
81
// $FlowFixMe[missing-this-annot]
82
- get: function() {
82
+ get: function () {
83
return get.call(this);
84
},
85
// $FlowFixMe[missing-local-annot]
86
// $FlowFixMe[missing-this-annot]
87
- set: function(value) {
87
+ set: function (value) {
88
if (__DEV__) {
89
checkFormFieldValueStringCoercion(value);
90
}
packages/react-dom-bindings/src/client/setInnerHTML.js
+1
-1
@@ -24,7 +24,7 @@ let reusableSVGContainer;
24
const setInnerHTML: (
25
node: Element,
26
html: {valueOf(): {toString(): string, ...}, ...},
27
-) => void = createMicrosoftUnsafeLocalFunction(function(
27
+) => void = createMicrosoftUnsafeLocalFunction(function (
28
node: Element,
29
html: {valueOf(): {toString(): string, ...}, ...},
30
): void {
packages/react-dom-bindings/src/client/setTextContent.js
+1
-1
@@ -18,7 +18,7 @@ import {TEXT_NODE} from '../shared/HTMLNodeType';
18
* @param {string} text
19
* @internal
20
*/
21
-const setTextContent = function(node: Element, text: string): void {
21
+const setTextContent = function (node: Element, text: string): void {
22
if (text) {
23
const firstChild = node.firstChild;
24
packages/react-dom-bindings/src/client/validateDOMNesting.js
+4
-4
@@ -179,7 +179,7 @@ if (__DEV__) {
179
containerTagInScope: null,
180
};
181
182
- updatedAncestorInfoDev = function(oldInfo: ?AncestorInfoDev, tag: string) {
182
+ updatedAncestorInfoDev = function (oldInfo: ?AncestorInfoDev, tag: string) {
183
const ancestorInfo = {...(oldInfo || emptyAncestorInfoDev)};
184
const info = {tag};
185
@@ -239,7 +239,7 @@ if (__DEV__) {
239
/**
240
* Returns whether
241
*/
242
- const isTagValidWithParent = function(
242
+ const isTagValidWithParent = function (
243
tag: string,
244
parentTag: ?string,
245
): boolean {
@@ -367,7 +367,7 @@ if (__DEV__) {
367
/**
368
* Returns whether
369
*/
370
- const findInvalidAncestorForTag = function(
370
+ const findInvalidAncestorForTag = function (
371
tag: string,
372
ancestorInfo: AncestorInfoDev,
373
): ?Info {
@@ -436,7 +436,7 @@ if (__DEV__) {
436
437
const didWarn: {[string]: boolean} = {};
438
439
- validateDOMNesting = function(
439
+ validateDOMNesting = function (
440
childTag: ?string,
441
childText: ?string,
442
ancestorInfo: AncestorInfoDev,
packages/react-dom-bindings/src/events/DOMEventNames.js
+8
-12
@@ -109,15 +109,11 @@ export type DOMEventName =
109
| 'waiting'
110
| 'wheel';
111
112
-export const ANIMATION_END: DOMEventName = getVendorPrefixedEventName(
113
- 'animationend',
114
-);
115
-export const ANIMATION_ITERATION: DOMEventName = getVendorPrefixedEventName(
116
- 'animationiteration',
117
-);
118
-export const ANIMATION_START: DOMEventName = getVendorPrefixedEventName(
119
- 'animationstart',
120
-);
121
-export const TRANSITION_END: DOMEventName = getVendorPrefixedEventName(
122
- 'transitionend',
123
-);
112
+export const ANIMATION_END: DOMEventName =
113
+ getVendorPrefixedEventName('animationend');
114
+export const ANIMATION_ITERATION: DOMEventName =
115
+ getVendorPrefixedEventName('animationiteration');
116
+export const ANIMATION_START: DOMEventName =
117
+ getVendorPrefixedEventName('animationstart');
118
+export const TRANSITION_END: DOMEventName =
119
+ getVendorPrefixedEventName('transitionend');
packages/react-dom-bindings/src/events/DOMEventProperties.js
+2
-4
@@ -19,10 +19,8 @@ import {
19
20
import {enableCreateEventHandleAPI} from 'shared/ReactFeatureFlags';
21
22
-export const topLevelEventsToReactNames: Map<
23
- DOMEventName,
24
- string | null,
25
-> = new Map();
22
+export const topLevelEventsToReactNames: Map<DOMEventName, string | null> =
23
+ new Map();
24
25
// NOTE: Capitalization is important in this list!
26
//
packages/react-dom-bindings/src/events/DOMPluginEventSystem.js
+6
-12
@@ -378,11 +378,7 @@ export function listenToNativeEventForNonManagedEventTarget(
378
}
379
}
380
381
-const listeningMarker =
382
- '_reactListening' +
383
- Math.random()
384
- .toString(36)
385
- .slice(2);
381
+const listeningMarker = '_reactListening' + Math.random().toString(36).slice(2);
382
383
export function listenToAllSupportedEvents(rootContainerElement: EventTarget) {
384
if (!(rootContainerElement: any)[listeningMarker]) {
@@ -463,7 +459,7 @@ function addTrappedEventListener(
459
if (enableLegacyFBSupport && isDeferredListenerForLegacyFBSupport) {
460
const originalListener = listener;
461
// $FlowFixMe[missing-this-annot]
466
- listener = function(...p) {
462
+ listener = function (...p) {
463
removeEventListener(
464
targetContainer,
465
domEventName,
@@ -692,9 +688,8 @@ export function accumulateSinglePhaseListeners(
688
689
// createEventHandle listeners
690
if (enableCreateEventHandleAPI) {
695
- const eventHandlerListeners = getEventHandlerListeners(
696
- lastHostComponent,
697
- );
691
+ const eventHandlerListeners =
692
+ getEventHandlerListeners(lastHostComponent);
693
if (eventHandlerListeners !== null) {
694
eventHandlerListeners.forEach(entry => {
695
if (
@@ -731,9 +726,8 @@ export function accumulateSinglePhaseListeners(
726
) {
727
// Scopes
728
const reactScopeInstance = stateNode;
734
- const eventHandlerListeners = getEventHandlerListeners(
735
- reactScopeInstance,
736
- );
729
+ const eventHandlerListeners =
730
+ getEventHandlerListeners(reactScopeInstance);
731
if (eventHandlerListeners !== null) {
732
eventHandlerListeners.forEach(entry => {
733
if (
packages/react-dom-bindings/src/events/ReactDOMUpdateBatching.js
+3
-3
@@ -17,13 +17,13 @@ import {
17
// scheduled work and instead do synchronous work.
18
19
// Defaults
20
-let batchedUpdatesImpl = function(fn, bookkeeping) {
20
+let batchedUpdatesImpl = function (fn, bookkeeping) {
21
return fn(bookkeeping);
22
};
23
-let discreteUpdatesImpl = function(fn, a, b, c, d) {
23
+let discreteUpdatesImpl = function (fn, a, b, c, d) {
24
return fn(a, b, c, d);
25
};
26
-let flushSyncImpl = function() {};
26
+let flushSyncImpl = function () {};
27
28
let isInsideEventHandler = false;
29
packages/react-dom-bindings/src/events/SyntheticEvent.js
+23
-29
@@ -85,7 +85,7 @@ function createSyntheticEvent(Interface: EventInterfaceType) {
85
// $FlowFixMe[prop-missing] found when upgrading Flow
86
assign(SyntheticBaseEvent.prototype, {
87
// $FlowFixMe[missing-this-annot]
88
- preventDefault: function() {
88
+ preventDefault: function () {
89
this.defaultPrevented = true;
90
const event = this.nativeEvent;
91
if (!event) {
@@ -102,7 +102,7 @@ function createSyntheticEvent(Interface: EventInterfaceType) {
102
},
103
104
// $FlowFixMe[missing-this-annot]
105
- stopPropagation: function() {
105
+ stopPropagation: function () {
106
const event = this.nativeEvent;
107
if (!event) {
108
return;
@@ -128,7 +128,7 @@ function createSyntheticEvent(Interface: EventInterfaceType) {
128
* them back into the pool. This allows a way to hold onto a reference that
129
* won't be added back into the pool.
130
*/
131
- persist: function() {
131
+ persist: function () {
132
// Modern event system doesn't use pooling.
133
},
134
@@ -150,7 +150,7 @@ const EventInterface = {
150
eventPhase: 0,
151
bubbles: 0,
152
cancelable: 0,
153
- timeStamp: function(event: {[propName: string]: mixed}) {
153
+ timeStamp: function (event: {[propName: string]: mixed}) {
154
return event.timeStamp || Date.now();
155
},
156
defaultPrevented: 0,
@@ -163,9 +163,8 @@ const UIEventInterface: EventInterfaceType = {
163
view: 0,
164
detail: 0,
165
};
166
-export const SyntheticUIEvent: $FlowFixMe = createSyntheticEvent(
167
- UIEventInterface,
168
-);
166
+export const SyntheticUIEvent: $FlowFixMe =
167
+ createSyntheticEvent(UIEventInterface);
168
169
let lastMovementX;
170
let lastMovementY;
@@ -205,7 +204,7 @@ const MouseEventInterface: EventInterfaceType = {
204
getModifierState: getEventModifierState,
205
button: 0,
206
buttons: 0,
208
- relatedTarget: function(event) {
207
+ relatedTarget: function (event) {
208
if (event.relatedTarget === undefined)
209
return event.fromElement === event.srcElement
210
? event.toElement
@@ -213,14 +212,14 @@ const MouseEventInterface: EventInterfaceType = {
212
213
return event.relatedTarget;
214
},
216
- movementX: function(event) {
215
+ movementX: function (event) {
216
if ('movementX' in event) {
217
return event.movementX;
218
}
219
updateMouseMovementPolyfillState(event);
220
return lastMovementX;
221
},
223
- movementY: function(event) {
222
+ movementY: function (event) {
223
if ('movementY' in event) {
224
return event.movementY;
225
}
@@ -230,9 +229,8 @@ const MouseEventInterface: EventInterfaceType = {
229
return lastMovementY;
230
},
231
};
233
-export const SyntheticMouseEvent: $FlowFixMe = createSyntheticEvent(
234
- MouseEventInterface,
235
-);
232
+export const SyntheticMouseEvent: $FlowFixMe =
233
+ createSyntheticEvent(MouseEventInterface);
234
235
/**
236
* @interface DragEvent
@@ -242,9 +240,8 @@ const DragEventInterface: EventInterfaceType = {
240
...MouseEventInterface,
241
dataTransfer: 0,
242
};
245
-export const SyntheticDragEvent: $FlowFixMe = createSyntheticEvent(
246
- DragEventInterface,
247
-);
243
+export const SyntheticDragEvent: $FlowFixMe =
244
+ createSyntheticEvent(DragEventInterface);
245
246
/**
247
* @interface FocusEvent
@@ -254,9 +251,8 @@ const FocusEventInterface: EventInterfaceType = {
251
...UIEventInterface,
252
relatedTarget: 0,
253
};
257
-export const SyntheticFocusEvent: $FlowFixMe = createSyntheticEvent(
258
- FocusEventInterface,
259
-);
254
+export const SyntheticFocusEvent: $FlowFixMe =
255
+ createSyntheticEvent(FocusEventInterface);
256
257
/**
258
* @interface Event
@@ -279,7 +275,7 @@ export const SyntheticAnimationEvent: $FlowFixMe = createSyntheticEvent(
275
*/
276
const ClipboardEventInterface: EventInterfaceType = {
277
...EventInterface,
282
- clipboardData: function(event) {
278
+ clipboardData: function (event) {
279
return 'clipboardData' in event
280
? event.clipboardData
281
: window.clipboardData;
@@ -458,7 +454,7 @@ const KeyboardEventInterface = {
454
locale: 0,
455
getModifierState: getEventModifierState,
456
// Legacy Interface
461
- charCode: function(event: {[propName: string]: mixed}) {
457
+ charCode: function (event: {[propName: string]: mixed}) {
458
// `charCode` is the result of a KeyPress event and represents the value of
459
// the actual printable character.
460
@@ -472,7 +468,7 @@ const KeyboardEventInterface = {
468
}
469
return 0;
470
},
475
- keyCode: function(event: {[propName: string]: mixed}) {
471
+ keyCode: function (event: {[propName: string]: mixed}) {
472
// `keyCode` is the result of a KeyDown/Up event and represents the value of
473
// physical keyboard key.
474
@@ -485,7 +481,7 @@ const KeyboardEventInterface = {
481
}
482
return 0;
483
},
488
- which: function(event: {[propName: string]: mixed}) {
484
+ which: function (event: {[propName: string]: mixed}) {
485
// `which` is an alias for either `keyCode` or `charCode` depending on the
486
// type of the event.
487
if (event.type === 'keypress') {
@@ -540,9 +536,8 @@ const TouchEventInterface = {
536
shiftKey: 0,
537
getModifierState: getEventModifierState,
538
};
543
-export const SyntheticTouchEvent: $FlowFixMe = createSyntheticEvent(
544
- TouchEventInterface,
545
-);
539
+export const SyntheticTouchEvent: $FlowFixMe =
540
+ createSyntheticEvent(TouchEventInterface);
541
542
/**
543
* @interface Event
@@ -595,6 +590,5 @@ const WheelEventInterface = {
590
// ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.
591
deltaMode: 0,
592
};
598
-export const SyntheticWheelEvent: $FlowFixMe = createSyntheticEvent(
599
- WheelEventInterface,
600
-);
593
+export const SyntheticWheelEvent: $FlowFixMe =
594
+ createSyntheticEvent(WheelEventInterface);
packages/react-dom-bindings/src/events/checkPassiveEvents.js
+1
-1
@@ -19,7 +19,7 @@ if (canUseDOM) {
19
passive?: void,
20
} = {};
21
Object.defineProperty(options, 'passive', {
22
- get: function() {
22
+ get: function () {
23
passiveBrowserEventsSupported = true;
24
},
25
});
packages/react-dom-bindings/src/server/ReactDOMFloatServer.js
+1
-4
@@ -697,10 +697,7 @@ export function resourcesFromElement(type: string, props: Props): boolean {
697
const {property} = props;
698
key = 'property::' + property + contentKey;
699
propertyPath = property;
700
- const parentPath = property
701
- .split(':')
702
- .slice(0, -1)
703
- .join(':');
700
+ const parentPath = property.split(':').slice(0, -1).join(':');
701
const parentResource = resources.structuredMetaKeys.get(parentPath);
702
if (parentResource) {
703
key = parentResource.key + '::child::' + key;
packages/react-dom-bindings/src/server/ReactDOMServerExternalRuntime.js
+2
-2
@@ -75,11 +75,11 @@ function installFizzInstrObserver(target /*: Node */) {
75
76
function handleNode(node_ /*: Node */) {
77
// $FlowFixMe[incompatible-cast]
78
- if (node_.nodeType !== 1 || !(node_ /*: HTMLElement*/).dataset) {
78
+ if (node_.nodeType !== 1 || !(node_ /*: HTMLElement */).dataset) {
79
return;
80
}
81
// $FlowFixMe[incompatible-cast]
82
- const node = (node_ /*: HTMLElement*/);
82
+ const node = (node_ /*: HTMLElement */);
83
const dataset = node.dataset;
84
if (dataset['rxi'] != null) {
85
clientRenderBoundary(
packages/react-dom-bindings/src/server/ReactDOMServerFormatConfig.js
+17
-25
@@ -867,7 +867,7 @@ function flattenOptionChildren(children: mixed): string {
867
let content = '';
868
// Flatten children and warn if they aren't strings or numbers;
869
// invalid types are ignored.
870
- Children.forEach((children: any), function(child) {
870
+ Children.forEach((children: any), function (child) {
871
if (child == null) {
872
return;
873
}
@@ -2151,29 +2151,22 @@ const startPendingSuspenseBoundary1 = stringToPrecomputedChunk(
2151
'<!--$?--><template id="',
2152
);
2153
const startPendingSuspenseBoundary2 = stringToPrecomputedChunk('"></template>');
2154
-const startClientRenderedSuspenseBoundary = stringToPrecomputedChunk(
2155
- '<!--$!-->',
2156
-);
2154
+const startClientRenderedSuspenseBoundary =
2155
+ stringToPrecomputedChunk('<!--$!-->');
2156
const endSuspenseBoundary = stringToPrecomputedChunk('<!--/$-->');
2157
2159
-const clientRenderedSuspenseBoundaryError1 = stringToPrecomputedChunk(
2160
- '<template',
2161
-);
2162
-const clientRenderedSuspenseBoundaryErrorAttrInterstitial = stringToPrecomputedChunk(
2163
- '"',
2164
-);
2165
-const clientRenderedSuspenseBoundaryError1A = stringToPrecomputedChunk(
2166
- ' data-dgst="',
2167
-);
2168
-const clientRenderedSuspenseBoundaryError1B = stringToPrecomputedChunk(
2169
- ' data-msg="',
2170
-);
2171
-const clientRenderedSuspenseBoundaryError1C = stringToPrecomputedChunk(
2172
- ' data-stck="',
2173
-);
2174
-const clientRenderedSuspenseBoundaryError2 = stringToPrecomputedChunk(
2175
- '></template>',
2176
-);
2158
+const clientRenderedSuspenseBoundaryError1 =
2159
+ stringToPrecomputedChunk('<template');
2160
+const clientRenderedSuspenseBoundaryErrorAttrInterstitial =
2161
+ stringToPrecomputedChunk('"');
2162
+const clientRenderedSuspenseBoundaryError1A =
2163
+ stringToPrecomputedChunk(' data-dgst="');
2164
+const clientRenderedSuspenseBoundaryError1B =
2165
+ stringToPrecomputedChunk(' data-msg="');
2166
+const clientRenderedSuspenseBoundaryError1C =
2167
+ stringToPrecomputedChunk(' data-stck="');
2168
+const clientRenderedSuspenseBoundaryError2 =
2169
+ stringToPrecomputedChunk('></template>');
2170
2171
export function pushStartCompletedSuspenseBoundary(
2172
target: Array<Chunk | PrecomputedChunk>,
@@ -2472,9 +2465,8 @@ const completeBoundaryWithStylesScript1FullBoth = stringToPrecomputedChunk(
2465
const completeBoundaryWithStylesScript1FullPartial = stringToPrecomputedChunk(
2466
styleInsertionFunction + ';$RR("',
2467
);
2475
-const completeBoundaryWithStylesScript1Partial = stringToPrecomputedChunk(
2476
- '$RR("',
2477
-);
2468
+const completeBoundaryWithStylesScript1Partial =
2469
+ stringToPrecomputedChunk('$RR("');
2470
const completeBoundaryScript2 = stringToPrecomputedChunk('","');
2471
const completeBoundaryScript3a = stringToPrecomputedChunk('",');
2472
const completeBoundaryScript3b = stringToPrecomputedChunk('"');
packages/react-dom-bindings/src/shared/CSSProperty.js
+2
-2
@@ -74,8 +74,8 @@ const prefixes = ['Webkit', 'ms', 'Moz', 'O'];
74
75
// Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an
76
// infinite loop, because it iterates over the newly added props too.
77
-Object.keys(isUnitlessNumber).forEach(function(prop) {
78
- prefixes.forEach(function(prefix) {
77
+Object.keys(isUnitlessNumber).forEach(function (prop) {
78
+ prefixes.forEach(function (prefix) {
79
isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];
80
});
81
});
packages/react-dom-bindings/src/shared/ReactDOMUnknownPropertyHook.js
+4
-6
@@ -25,7 +25,7 @@ if (__DEV__) {
25
const rARIA = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');
26
const rARIACamel = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');
27
28
- validateProperty = function(tagName, name, value, eventRegistry) {
28
+ validateProperty = function (tagName, name, value, eventRegistry) {
29
if (hasOwnProperty.call(warnedProperties, name) && warnedProperties[name]) {
30
return true;
31
}
@@ -43,10 +43,8 @@ if (__DEV__) {
43
44
// We can't rely on the event system being injected on the server.
45
if (eventRegistry != null) {
46
- const {
47
- registrationNameDependencies,
48
- possibleRegistrationNames,
49
- } = eventRegistry;
46
+ const {registrationNameDependencies, possibleRegistrationNames} =
47
+ eventRegistry;
48
if (registrationNameDependencies.hasOwnProperty(name)) {
49
return true;
50
}
@@ -239,7 +237,7 @@ if (__DEV__) {
237
};
238
}
239
242
-const warnUnknownProperties = function(type, props, eventRegistry) {
240
+const warnUnknownProperties = function (type, props, eventRegistry) {
241
if (__DEV__) {
242
const unknownProps = [];
243
for (const key in props) {
packages/react-dom-bindings/src/shared/sanitizeURL.js
+2
-1
@@ -19,7 +19,8 @@ import {disableJavaScriptURLs} from 'shared/ReactFeatureFlags';
19
// https://infra.spec.whatwg.org/#c0-control-or-space
20
21
/* eslint-disable max-len */
22
-const isJavaScriptProtocol = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i;
22
+const isJavaScriptProtocol =
23
+ /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i;
24
25
let didWarn = false;
26
packages/react-dom-bindings/src/shared/warnValidStyle.js
+8
-8
@@ -21,13 +21,13 @@ if (__DEV__) {
21
let warnedForNaNValue = false;
22
let warnedForInfinityValue = false;
23
24
- const camelize = function(string) {
25
- return string.replace(hyphenPattern, function(_, character) {
24
+ const camelize = function (string) {
25
+ return string.replace(hyphenPattern, function (_, character) {
26
return character.toUpperCase();
27
});
28
};
29
30
- const warnHyphenatedStyleName = function(name) {
30
+ const warnHyphenatedStyleName = function (name) {
31
if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
32
return;
33
}
@@ -43,7 +43,7 @@ if (__DEV__) {
43
);
44
};
45
46
- const warnBadVendoredStyleName = function(name) {
46
+ const warnBadVendoredStyleName = function (name) {
47
if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {
48
return;
49
}
@@ -56,7 +56,7 @@ if (__DEV__) {
56
);
57
};
58
59
- const warnStyleValueWithSemicolon = function(name, value) {
59
+ const warnStyleValueWithSemicolon = function (name, value) {
60
if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {
61
return;
62
}
@@ -70,7 +70,7 @@ if (__DEV__) {
70
);
71
};
72
73
- const warnStyleValueIsNaN = function(name, value) {
73
+ const warnStyleValueIsNaN = function (name, value) {
74
if (warnedForNaNValue) {
75
return;
76
}
@@ -82,7 +82,7 @@ if (__DEV__) {
82
);
83
};
84
85
- const warnStyleValueIsInfinity = function(name, value) {
85
+ const warnStyleValueIsInfinity = function (name, value) {
86
if (warnedForInfinityValue) {
87
return;
88
}
@@ -94,7 +94,7 @@ if (__DEV__) {
94
);
95
};
96
97
- warnValidStyle = function(name, value) {
97
+ warnValidStyle = function (name, value) {
98
if (name.indexOf('-') > -1) {
99
warnHyphenatedStyleName(name);
100
} else if (badVendoredStyleNamePattern.test(name)) {
packages/react-dom/npm/client.js
+2
-2
@@ -6,7 +6,7 @@ if (process.env.NODE_ENV === 'production') {
6
exports.hydrateRoot = m.hydrateRoot;
7
} else {
8
var i = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
9
- exports.createRoot = function(c, o) {
9
+ exports.createRoot = function (c, o) {
10
i.usingClientEntryPoint = true;
11
try {
12
return m.createRoot(c, o);
@@ -14,7 +14,7 @@ if (process.env.NODE_ENV === 'production') {
14
i.usingClientEntryPoint = false;
15
}
16
};
17
- exports.hydrateRoot = function(c, h, o) {
17
+ exports.hydrateRoot = function (c, h, o) {
18
i.usingClientEntryPoint = true;
19
try {
20
return m.hydrateRoot(c, h, o);
packages/react-dom/src/__tests__/DOMPropertyOperations-test.js
+10
-10
@@ -84,7 +84,7 @@ describe('DOMPropertyOperations', () => {
84
// Browsers default to this behavior, but some test environments do not.
85
// This ensures that we have consistent behavior.
86
const obj = {
87
- toString: function() {
87
+ toString: function () {
88
return 'css-class';
89
},
90
};
@@ -152,7 +152,7 @@ describe('DOMPropertyOperations', () => {
152
expect(container.firstChild.hasAttribute('hidden')).toBe(false);
153
});
154
155
- it('should always assign the value attribute for non-inputs', function() {
155
+ it('should always assign the value attribute for non-inputs', function () {
156
const container = document.createElement('div');
157
ReactDOM.render(<progress />, container);
158
spyOnDevAndProd(container.firstChild, 'setAttribute');
@@ -1041,10 +1041,10 @@ describe('DOMPropertyOperations', () => {
1041
const customelement = container.querySelector('my-custom-element');
1042
// Install a setter to activate the `in` heuristic
1043
Object.defineProperty(customelement, 'oncustomevent', {
1044
- set: function(x) {
1044
+ set: function (x) {
1045
this._oncustomevent = x;
1046
},
1047
- get: function() {
1047
+ get: function () {
1048
return this._oncustomevent;
1049
},
1050
});
@@ -1095,10 +1095,10 @@ describe('DOMPropertyOperations', () => {
1095
1096
// Install a setter to activate the `in` heuristic
1097
Object.defineProperty(customElement, 'foo', {
1098
- set: function(x) {
1098
+ set: function (x) {
1099
this._foo = x;
1100
},
1101
- get: function() {
1101
+ get: function () {
1102
return this._foo;
1103
},
1104
});
@@ -1116,10 +1116,10 @@ describe('DOMPropertyOperations', () => {
1116
1117
// Install a setter to activate the `in` heuristic
1118
Object.defineProperty(customElement, 'foo', {
1119
- set: function(x) {
1119
+ set: function (x) {
1120
this._foo = x;
1121
},
1122
- get: function() {
1122
+ get: function () {
1123
return this._foo;
1124
},
1125
});
@@ -1149,7 +1149,7 @@ describe('DOMPropertyOperations', () => {
1149
it('should not remove attributes for special properties', () => {
1150
const container = document.createElement('div');
1151
ReactDOM.render(
1152
- <input type="text" value="foo" onChange={function() {}} />,
1152
+ <input type="text" value="foo" onChange={function () {}} />,
1153
container,
1154
);
1155
if (disableInputAttributeSyncing) {
@@ -1160,7 +1160,7 @@ describe('DOMPropertyOperations', () => {
1160
expect(container.firstChild.value).toBe('foo');
1161
expect(() =>
1162
ReactDOM.render(
1163
- <input type="text" onChange={function() {}} />,
1163
+ <input type="text" onChange={function () {}} />,
1164
container,
1165
),
1166
).toErrorDev(
packages/react-dom/src/__tests__/ReactBrowserEventEmitter-test.js
+13
-13
@@ -14,14 +14,14 @@ let ReactDOM;
14
let ReactTestUtils;
15
16
let idCallOrder;
17
-const recordID = function(id) {
17
+const recordID = function (id) {
18
idCallOrder.push(id);
19
};
20
-const recordIDAndStopPropagation = function(id, event) {
20
+const recordIDAndStopPropagation = function (id, event) {
21
recordID(id);
22
event.stopPropagation();
23
};
24
-const recordIDAndReturnFalse = function(id, event) {
24
+const recordIDAndReturnFalse = function (id, event) {
25
recordID(id);
26
return false;
27
};
@@ -82,7 +82,7 @@ describe('ReactBrowserEventEmitter', () => {
82
83
renderTree();
84
85
- putListener = function(node, eventName, listener) {
85
+ putListener = function (node, eventName, listener) {
86
switch (node) {
87
case CHILD:
88
CHILD_PROPS[eventName] = listener;
@@ -100,7 +100,7 @@ describe('ReactBrowserEventEmitter', () => {
100
// Rerender with new event listeners
101
renderTree();
102
};
103
- deleteAllListeners = function(node) {
103
+ deleteAllListeners = function (node) {
104
switch (node) {
105
case CHILD:
106
CHILD_PROPS = {};
@@ -159,12 +159,12 @@ describe('ReactBrowserEventEmitter', () => {
159
160
it('should continue bubbling if an error is thrown', () => {
161
putListener(CHILD, ON_CLICK_KEY, recordID.bind(null, CHILD));
162
- putListener(PARENT, ON_CLICK_KEY, function() {
162
+ putListener(PARENT, ON_CLICK_KEY, function () {
163
recordID(PARENT);
164
throw new Error('Handler interrupted');
165
});
166
putListener(GRANDPARENT, ON_CLICK_KEY, recordID.bind(null, GRANDPARENT));
167
- expect(function() {
167
+ expect(function () {
168
ReactTestUtils.Simulate.click(CHILD);
169
}).toThrow();
170
expect(idCallOrder.length).toBe(3);
@@ -174,15 +174,15 @@ describe('ReactBrowserEventEmitter', () => {
174
});
175
176
it('should set currentTarget', () => {
177
- putListener(CHILD, ON_CLICK_KEY, function(event) {
177
+ putListener(CHILD, ON_CLICK_KEY, function (event) {
178
recordID(CHILD);
179
expect(event.currentTarget).toBe(CHILD);
180
});
181
- putListener(PARENT, ON_CLICK_KEY, function(event) {
181
+ putListener(PARENT, ON_CLICK_KEY, function (event) {
182
recordID(PARENT);
183
expect(event.currentTarget).toBe(PARENT);
184
});
185
- putListener(GRANDPARENT, ON_CLICK_KEY, function(event) {
185
+ putListener(GRANDPARENT, ON_CLICK_KEY, function (event) {
186
recordID(GRANDPARENT);
187
expect(event.currentTarget).toBe(GRANDPARENT);
188
});
@@ -210,7 +210,7 @@ describe('ReactBrowserEventEmitter', () => {
210
it('should support overriding .isPropagationStopped()', () => {
211
// Ew. See D4504876.
212
putListener(CHILD, ON_CLICK_KEY, recordID.bind(null, CHILD));
213
- putListener(PARENT, ON_CLICK_KEY, function(e) {
213
+ putListener(PARENT, ON_CLICK_KEY, function (e) {
214
recordID(PARENT, e);
215
// This stops React bubbling but avoids touching the native event
216
e.isPropagationStopped = () => true;
@@ -257,7 +257,7 @@ describe('ReactBrowserEventEmitter', () => {
257
258
it('should invoke handlers that were removed while bubbling', () => {
259
const handleParentClick = jest.fn();
260
- const handleChildClick = function(event) {
260
+ const handleChildClick = function (event) {
261
deleteAllListeners(PARENT);
262
};
263
putListener(CHILD, ON_CLICK_KEY, handleChildClick);
@@ -268,7 +268,7 @@ describe('ReactBrowserEventEmitter', () => {
268
269
it('should not invoke newly inserted handlers while bubbling', () => {
270
const handleParentClick = jest.fn();
271
- const handleChildClick = function(event) {
271
+ const handleChildClick = function (event) {
272
putListener(PARENT, ON_CLICK_KEY, handleParentClick);
273
};
274
putListener(CHILD, ON_CLICK_KEY, handleChildClick);
packages/react-dom/src/__tests__/ReactChildReconciler-test.js
+1
-1
@@ -25,7 +25,7 @@ describe('ReactChildReconciler', () => {
25
26
function createIterable(array) {
27
return {
28
- '@@iterator': function() {
28
+ '@@iterator': function () {
29
let i = 0;
30
return {
31
next() {
packages/react-dom/src/__tests__/ReactComponent-test.js
+3
-3
@@ -27,18 +27,18 @@ describe('ReactComponent', () => {
27
it('should throw on invalid render targets', () => {
28
const container = document.createElement('div');
29
// jQuery objects are basically arrays; people often pass them in by mistake
30
- expect(function() {
30
+ expect(function () {
31
ReactDOM.render(<div />, [container]);
32
}).toThrowError(/Target container is not a DOM element./);
33
34
- expect(function() {
34
+ expect(function () {
35
ReactDOM.render(<div />, null);
36
}).toThrowError(/Target container is not a DOM element./);
37
});
38
39
it('should throw when supplying a string ref outside of render method', () => {
40
let instance = <div ref="badDiv" />;
41
- expect(function() {
41
+ expect(function () {
42
instance = ReactTestUtils.renderIntoDocument(instance);
43
}).toThrow();
44
});
packages/react-dom/src/__tests__/ReactComponentLifeCycle-test.js
+13
-15
@@ -14,7 +14,7 @@ let ReactDOM;
14
let ReactTestUtils;
15
let PropTypes;
16
17
-const clone = function(o) {
17
+const clone = function (o) {
18
return JSON.parse(JSON.stringify(o));
19
};
20
@@ -176,7 +176,7 @@ describe('ReactComponentLifeCycle', () => {
176
}
177
178
let instance = <StatefulComponent />;
179
- expect(function() {
179
+ expect(function () {
180
instance = ReactTestUtils.renderIntoDocument(instance);
181
}).toThrow();
182
});
@@ -193,7 +193,7 @@ describe('ReactComponentLifeCycle', () => {
193
}
194
195
let instance = <StatefulComponent />;
196
- expect(function() {
196
+ expect(function () {
197
instance = ReactTestUtils.renderIntoDocument(instance);
198
}).not.toThrow();
199
});
@@ -349,9 +349,8 @@ describe('ReactComponentLifeCycle', () => {
349
hasWillUnmountCompleted: false,
350
};
351
this._testJournal.returnedFromGetInitialState = clone(initState);
352
- this._testJournal.lifeCycleAtStartOfGetInitialState = getLifeCycleState(
353
- this,
354
- );
352
+ this._testJournal.lifeCycleAtStartOfGetInitialState =
353
+ getLifeCycleState(this);
354
this.state = initState;
355
}
356
@@ -383,9 +382,8 @@ describe('ReactComponentLifeCycle', () => {
382
383
componentWillUnmount() {
384
this._testJournal.stateAtStartOfWillUnmount = clone(this.state);
386
- this._testJournal.lifeCycleAtStartOfWillUnmount = getLifeCycleState(
387
- this,
388
- );
385
+ this._testJournal.lifeCycleAtStartOfWillUnmount =
386
+ getLifeCycleState(this);
387
this.state.hasWillUnmountCompleted = true;
388
}
389
}
@@ -524,8 +522,8 @@ describe('ReactComponentLifeCycle', () => {
522
523
it('should call nested legacy lifecycle methods in the right order', () => {
524
let log;
527
- const logger = function(msg) {
528
- return function() {
525
+ const logger = function (msg) {
526
+ return function () {
527
// return true for shouldComponentUpdate
528
log.push(msg);
529
return true;
@@ -599,8 +597,8 @@ describe('ReactComponentLifeCycle', () => {
597
598
it('should call nested new lifecycle methods in the right order', () => {
599
let log;
602
- const logger = function(msg) {
603
- return function() {
600
+ const logger = function (msg) {
601
+ return function () {
602
// return true for shouldComponentUpdate
603
log.push(msg);
604
return true;
@@ -986,7 +984,7 @@ describe('ReactComponentLifeCycle', () => {
984
});
985
986
if (!require('shared/ReactFeatureFlags').disableModulePatternComponents) {
989
- it('calls effects on module-pattern component', function() {
987
+ it('calls effects on module-pattern component', function () {
988
const log = [];
989
990
function Parent() {
@@ -1371,7 +1369,7 @@ describe('ReactComponentLifeCycle', () => {
1369
ReactDOM.render(<MyComponent />, div);
1370
});
1371
1374
- it('warns about deprecated unsafe lifecycles', function() {
1372
+ it('warns about deprecated unsafe lifecycles', function () {
1373
class MyComponent extends React.Component {
1374
componentWillMount() {}
1375
componentWillReceiveProps() {}
packages/react-dom/src/__tests__/ReactCompositeComponent-test.js
+9
-8
@@ -64,8 +64,9 @@ describe('ReactCompositeComponent', () => {
64
jest.resetModules();
65
React = require('react');
66
ReactDOM = require('react-dom');
67
- ReactCurrentOwner = require('react')
68
- .__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner;
67
+ ReactCurrentOwner =
68
+ require('react').__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
69
+ .ReactCurrentOwner;
70
ReactTestUtils = require('react-dom/test-utils');
71
PropTypes = require('prop-types');
72
@@ -378,7 +379,7 @@ describe('ReactCompositeComponent', () => {
379
380
componentWillUnmount() {
381
expect(() => {
381
- this.setState({value: 2}, function() {
382
+ this.setState({value: 2}, function () {
383
cbCalled = true;
384
});
385
}).not.toThrow();
@@ -874,7 +875,7 @@ describe('ReactCompositeComponent', () => {
875
expect(childInstance).toBeNull();
876
877
expect(parentInstance.state.flag).toBe(false);
877
- ReactDOM.unstable_batchedUpdates(function() {
878
+ ReactDOM.unstable_batchedUpdates(function () {
879
parentInstance.setState({flag: true});
880
});
881
expect(parentInstance.state.flag).toBe(true);
@@ -1271,10 +1272,10 @@ describe('ReactCompositeComponent', () => {
1272
});
1273
1274
it('should support objects with prototypes as state', () => {
1274
- const NotActuallyImmutable = function(str) {
1275
+ const NotActuallyImmutable = function (str) {
1276
this.str = str;
1277
};
1277
- NotActuallyImmutable.prototype.amIImmutable = function() {
1278
+ NotActuallyImmutable.prototype.amIImmutable = function () {
1279
return true;
1280
};
1281
class Moo extends React.Component {
@@ -1304,7 +1305,7 @@ describe('ReactCompositeComponent', () => {
1305
1306
// When more than one state update is enqueued, we have the same behavior
1307
const fifthState = new NotActuallyImmutable('fifth');
1307
- ReactDOM.unstable_batchedUpdates(function() {
1308
+ ReactDOM.unstable_batchedUpdates(function () {
1309
moo.setState({str: 'fourth'});
1310
moo._replaceState(fifthState);
1311
});
@@ -1312,7 +1313,7 @@ describe('ReactCompositeComponent', () => {
1313
1314
// When more than one state update is enqueued, we have the same behavior
1315
const sixthState = new NotActuallyImmutable('sixth');
1315
- ReactDOM.unstable_batchedUpdates(function() {
1316
+ ReactDOM.unstable_batchedUpdates(function () {
1317
moo._replaceState(sixthState);
1318
moo.setState({str: 'seventh'});
1319
});
packages/react-dom/src/__tests__/ReactCompositeComponentDOMMinimalism-test.js
+1
-1
@@ -43,7 +43,7 @@ describe('ReactCompositeComponentDOMMinimalism', () => {
43
}
44
};
45
46
- expectSingleChildlessDiv = function(instance) {
46
+ expectSingleChildlessDiv = function (instance) {
47
const el = ReactDOM.findDOMNode(instance);
48
expect(el.tagName).toBe('DIV');
49
expect(el.children.length).toBe(0);
packages/react-dom/src/__tests__/ReactCompositeComponentNestedState-test.js
+3
-3
@@ -24,7 +24,7 @@ describe('ReactCompositeComponentNestedState-state', () => {
24
25
handleColor = color => {
26
this.props.logger('parent-handleColor', this.state.color);
27
- this.setState({color: color}, function() {
27
+ this.setState({color: color}, function () {
28
this.props.logger('parent-after-setState', this.state.color);
29
});
30
};
@@ -52,7 +52,7 @@ describe('ReactCompositeComponentNestedState-state', () => {
52
this.props.logger('handleHue', this.state.hue, this.props.color);
53
this.props.onSelectColor(color);
54
this.setState(
55
- function(state, props) {
55
+ function (state, props) {
56
this.props.logger(
57
'setState-this',
58
this.state.hue,
@@ -61,7 +61,7 @@ describe('ReactCompositeComponentNestedState-state', () => {
61
this.props.logger('setState-args', state.hue, props.color);
62
return {hue: shade + ' ' + props.color};
63
},
64
- function() {
64
+ function () {
65
this.props.logger(
66
'after-setState',
67
this.state.hue,
packages/react-dom/src/__tests__/ReactCompositeComponentState-test.js
+8
-8
@@ -48,14 +48,14 @@ describe('ReactCompositeComponent-state', () => {
48
49
UNSAFE_componentWillMount() {
50
this.peekAtState('componentWillMount-start');
51
- this.setState(function(state) {
51
+ this.setState(function (state) {
52
this.peekAtState('before-setState-sunrise', state);
53
});
54
this.setState(
55
{color: 'sunrise'},
56
this.peekAtCallback('setState-sunrise'),
57
);
58
- this.setState(function(state) {
58
+ this.setState(function (state) {
59
this.peekAtState('after-setState-sunrise', state);
60
});
61
this.peekAtState('componentWillMount-after-sunrise');
@@ -63,7 +63,7 @@ describe('ReactCompositeComponent-state', () => {
63
{color: 'orange'},
64
this.peekAtCallback('setState-orange'),
65
);
66
- this.setState(function(state) {
66
+ this.setState(function (state) {
67
this.peekAtState('after-setState-orange', state);
68
});
69
this.peekAtState('componentWillMount-end');
@@ -81,18 +81,18 @@ describe('ReactCompositeComponent-state', () => {
81
UNSAFE_componentWillReceiveProps(newProps) {
82
this.peekAtState('componentWillReceiveProps-start');
83
if (newProps.nextColor) {
84
- this.setState(function(state) {
84
+ this.setState(function (state) {
85
this.peekAtState('before-setState-receiveProps', state);
86
return {color: newProps.nextColor};
87
});
88
// No longer a public API, but we can test that it works internally by
89
// reaching into the updater.
90
this.updater.enqueueReplaceState(this, {color: undefined});
91
- this.setState(function(state) {
91
+ this.setState(function (state) {
92
this.peekAtState('before-setState-again-receiveProps', state);
93
return {color: newProps.nextColor};
94
}, this.peekAtCallback('setState-receiveProps'));
95
- this.setState(function(state) {
95
+ this.setState(function (state) {
96
this.peekAtState('after-setState-receiveProps', state);
97
});
98
}
@@ -310,7 +310,7 @@ describe('ReactCompositeComponent-state', () => {
310
}).not.toThrow();
311
});
312
313
- it('should update state when called from child cWRP', function() {
313
+ it('should update state when called from child cWRP', function () {
314
const log = [];
315
class Parent extends React.Component {
316
state = {value: 'one'};
@@ -350,7 +350,7 @@ describe('ReactCompositeComponent-state', () => {
350
]);
351
});
352
353
- it('should merge state when sCU returns false', function() {
353
+ it('should merge state when sCU returns false', function () {
354
const log = [];
355
class Test extends React.Component {
356
state = {a: 0};
packages/react-dom/src/__tests__/ReactDOM-test.js
+6
-6
@@ -23,7 +23,7 @@ describe('ReactDOM', () => {
23
ReactTestUtils = require('react-dom/test-utils');
24
});
25
26
- it('should bubble onSubmit', function() {
26
+ it('should bubble onSubmit', function () {
27
const container = document.createElement('div');
28
29
let count = 0;
@@ -266,7 +266,7 @@ describe('ReactDOM', () => {
266
const div = container.firstChild;
267
['appendChild', 'insertBefore'].forEach(name => {
268
const mutator = div[name];
269
- div[name] = function() {
269
+ div[name] = function () {
270
if (input) {
271
input.blur();
272
expect(document.activeElement.tagName).toBe('BODY');
@@ -298,7 +298,7 @@ describe('ReactDOM', () => {
298
// This test needs to determine that focus is called after mount.
299
// Can't check document.activeElement because PhantomJS is too permissive;
300
// It doesn't require element to be in the DOM to be focused.
301
- HTMLElement.prototype.focus = function() {
301
+ HTMLElement.prototype.focus = function () {
302
focusedElement = this;
303
inputFocusedAfterMount = !!this.parentNode;
304
};
@@ -369,9 +369,9 @@ describe('ReactDOM', () => {
369
it('should not crash with devtools installed', () => {
370
try {
371
global.__REACT_DEVTOOLS_GLOBAL_HOOK__ = {
372
- inject: function() {},
373
- onCommitFiberRoot: function() {},
374
- onCommitFiberUnmount: function() {},
372
+ inject: function () {},
373
+ onCommitFiberRoot: function () {},
374
+ onCommitFiberUnmount: function () {},
375
supportsFiber: true,
376
};
377
jest.resetModules();
packages/react-dom/src/__tests__/ReactDOMComponent-test.js
+55
-55
@@ -204,21 +204,21 @@ describe('ReactDOMComponent', () => {
204
it('should warn for unknown function event handlers', () => {
205
const container = document.createElement('div');
206
expect(() =>
207
- ReactDOM.render(<div onUnknown={function() {}} />, container),
207
+ ReactDOM.render(<div onUnknown={function () {}} />, container),
208
).toErrorDev(
209
'Warning: Unknown event handler property `onUnknown`. It will be ignored.\n in div (at **)',
210
);
211
expect(container.firstChild.hasAttribute('onUnknown')).toBe(false);
212
expect(container.firstChild.onUnknown).toBe(undefined);
213
expect(() =>
214
- ReactDOM.render(<div onunknown={function() {}} />, container),
214
+ ReactDOM.render(<div onunknown={function () {}} />, container),
215
).toErrorDev(
216
'Warning: Unknown event handler property `onunknown`. It will be ignored.\n in div (at **)',
217
);
218
expect(container.firstChild.hasAttribute('onunknown')).toBe(false);
219
expect(container.firstChild.onunknown).toBe(undefined);
220
expect(() =>
221
- ReactDOM.render(<div on-unknown={function() {}} />, container),
221
+ ReactDOM.render(<div on-unknown={function () {}} />, container),
222
).toErrorDev(
223
'Warning: Unknown event handler property `on-unknown`. It will be ignored.\n in div (at **)',
224
);
@@ -1027,7 +1027,7 @@ describe('ReactDOMComponent', () => {
1027
const nodeValueSetter = jest.fn();
1028
1029
const oldSetAttribute = node.setAttribute.bind(node);
1030
- node.setAttribute = function(key, value) {
1030
+ node.setAttribute = function (key, value) {
1031
oldSetAttribute(key, value);
1032
nodeValueSetter(key, value);
1033
};
@@ -1059,10 +1059,10 @@ describe('ReactDOMComponent', () => {
1059
let nodeValue = true;
1060
const nodeValueSetter = jest.fn();
1061
Object.defineProperty(node, 'checked', {
1062
- get: function() {
1062
+ get: function () {
1063
return nodeValue;
1064
},
1065
- set: nodeValueSetter.mockImplementation(function(newValue) {
1065
+ set: nodeValueSetter.mockImplementation(function (newValue) {
1066
nodeValue = newValue;
1067
}),
1068
});
@@ -1089,7 +1089,7 @@ describe('ReactDOMComponent', () => {
1089
it('should warn about non-string "is" attribute', () => {
1090
const container = document.createElement('div');
1091
expect(() =>
1092
- ReactDOM.render(<button is={function() {}} />, container),
1092
+ ReactDOM.render(<button is={function () {}} />, container),
1093
).toErrorDev(
1094
'Received a `function` for a string attribute `is`. If this is expected, cast ' +
1095
'the value to a string.',
@@ -1213,7 +1213,7 @@ describe('ReactDOMComponent', () => {
1213
let mountComponent;
1214
1215
beforeEach(() => {
1216
- mountComponent = function(props) {
1216
+ mountComponent = function (props) {
1217
const container = document.createElement('div');
1218
ReactDOM.render(<div {...props} />, container);
1219
};
@@ -1291,7 +1291,7 @@ describe('ReactDOMComponent', () => {
1291
let realToString;
1292
try {
1293
realToString = Object.prototype.toString;
1294
- const wrappedToString = function() {
1294
+ const wrappedToString = function () {
1295
// Emulate browser behavior which is missing in jsdom
1296
if (this instanceof window.HTMLUnknownElement) {
1297
return '[object HTMLUnknownElement]';
@@ -1358,7 +1358,7 @@ describe('ReactDOMComponent', () => {
1358
1359
expect(returnedValue).toContain('</menuitem>');
1360
1361
- expect(function() {
1361
+ expect(function () {
1362
expect(() => {
1363
ReactDOM.render(
1364
<menu>
@@ -1374,7 +1374,7 @@ describe('ReactDOMComponent', () => {
1374
});
1375
1376
it('should validate against multiple children props', () => {
1377
- expect(function() {
1377
+ expect(function () {
1378
mountComponent({children: '', dangerouslySetInnerHTML: ''});
1379
}).toThrowError(
1380
'Can only set one of `children` or `props.dangerouslySetInnerHTML`.',
@@ -1394,7 +1394,7 @@ describe('ReactDOMComponent', () => {
1394
});
1395
1396
it('should validate use of dangerouslySetInnerHTML', () => {
1397
- expect(function() {
1397
+ expect(function () {
1398
mountComponent({dangerouslySetInnerHTML: '<span>Hi Jim!</span>'});
1399
}).toThrowError(
1400
'`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. ' +
@@ -1403,7 +1403,7 @@ describe('ReactDOMComponent', () => {
1403
});
1404
1405
it('should validate use of dangerouslySetInnerHTML', () => {
1406
- expect(function() {
1406
+ expect(function () {
1407
mountComponent({dangerouslySetInnerHTML: {foo: 'bar'}});
1408
}).toThrowError(
1409
'`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. ' +
@@ -1412,7 +1412,7 @@ describe('ReactDOMComponent', () => {
1412
});
1413
1414
it('should allow {__html: null}', () => {
1415
- expect(function() {
1415
+ expect(function () {
1416
mountComponent({dangerouslySetInnerHTML: {__html: null}});
1417
}).not.toThrow();
1418
});
@@ -1437,7 +1437,7 @@ describe('ReactDOMComponent', () => {
1437
});
1438
1439
it('should validate against invalid styles', () => {
1440
- expect(function() {
1440
+ expect(function () {
1441
mountComponent({style: 'display: none'});
1442
}).toThrowError(
1443
'The `style` prop expects a mapping from style properties to values, ' +
@@ -1548,7 +1548,7 @@ describe('ReactDOMComponent', () => {
1548
it('should warn against children for void elements', () => {
1549
ReactDOM.render(<input />, container);
1550
1551
- expect(function() {
1551
+ expect(function () {
1552
ReactDOM.render(<input>children</input>, container);
1553
}).toThrowError(
1554
'input is a void element tag and must neither have `children` nor use ' +
@@ -1559,7 +1559,7 @@ describe('ReactDOMComponent', () => {
1559
it('should warn against dangerouslySetInnerHTML for void elements', () => {
1560
ReactDOM.render(<input />, container);
1561
1562
- expect(function() {
1562
+ expect(function () {
1563
ReactDOM.render(
1564
<input dangerouslySetInnerHTML={{__html: 'content'}} />,
1565
container,
@@ -1573,7 +1573,7 @@ describe('ReactDOMComponent', () => {
1573
it('should validate against multiple children props', () => {
1574
ReactDOM.render(<div />, container);
1575
1576
- expect(function() {
1576
+ expect(function () {
1577
ReactDOM.render(
1578
<div children="" dangerouslySetInnerHTML={{__html: ''}} />,
1579
container,
@@ -1597,7 +1597,7 @@ describe('ReactDOMComponent', () => {
1597
it('should validate against invalid styles', () => {
1598
ReactDOM.render(<div />, container);
1599
1600
- expect(function() {
1600
+ expect(function () {
1601
ReactDOM.render(<div style={1} />, container);
1602
}).toThrowError(
1603
'The `style` prop expects a mapping from style properties to values, ' +
@@ -2305,8 +2305,8 @@ describe('ReactDOMComponent', () => {
2305
});
2306
});
2307
2308
- describe('Attributes with aliases', function() {
2309
- it('sets aliased attributes on HTML attributes', function() {
2308
+ describe('Attributes with aliases', function () {
2309
+ it('sets aliased attributes on HTML attributes', function () {
2310
let el;
2311
expect(() => {
2312
el = ReactTestUtils.renderIntoDocument(<div class="test" />);
@@ -2317,7 +2317,7 @@ describe('ReactDOMComponent', () => {
2317
expect(el.className).toBe('test');
2318
});
2319
2320
- it('sets incorrectly cased aliased attributes on HTML attributes with a warning', function() {
2320
+ it('sets incorrectly cased aliased attributes on HTML attributes with a warning', function () {
2321
let el;
2322
expect(() => {
2323
el = ReactTestUtils.renderIntoDocument(<div cLASS="test" />);
@@ -2328,7 +2328,7 @@ describe('ReactDOMComponent', () => {
2328
expect(el.className).toBe('test');
2329
});
2330
2331
- it('sets aliased attributes on SVG elements with a warning', function() {
2331
+ it('sets aliased attributes on SVG elements with a warning', function () {
2332
let el;
2333
expect(() => {
2334
el = ReactTestUtils.renderIntoDocument(
@@ -2344,7 +2344,7 @@ describe('ReactDOMComponent', () => {
2344
expect(text.hasAttribute('arabic-form')).toBe(true);
2345
});
2346
2347
- it('sets aliased attributes on custom elements', function() {
2347
+ it('sets aliased attributes on custom elements', function () {
2348
const el = ReactTestUtils.renderIntoDocument(
2349
<div is="custom-element" class="test" />,
2350
);
@@ -2352,7 +2352,7 @@ describe('ReactDOMComponent', () => {
2352
expect(el.getAttribute('class')).toBe('test');
2353
});
2354
2355
- it('aliased attributes on custom elements with bad casing', function() {
2355
+ it('aliased attributes on custom elements with bad casing', function () {
2356
const el = ReactTestUtils.renderIntoDocument(
2357
<div is="custom-element" claSS="test" />,
2358
);
@@ -2360,7 +2360,7 @@ describe('ReactDOMComponent', () => {
2360
expect(el.getAttribute('class')).toBe('test');
2361
});
2362
2363
- it('updates aliased attributes on custom elements', function() {
2363
+ it('updates aliased attributes on custom elements', function () {
2364
const container = document.createElement('div');
2365
ReactDOM.render(<div is="custom-element" class="foo" />, container);
2366
ReactDOM.render(<div is="custom-element" class="bar" />, container);
@@ -2369,14 +2369,14 @@ describe('ReactDOMComponent', () => {
2369
});
2370
});
2371
2372
- describe('Custom attributes', function() {
2373
- it('allows assignment of custom attributes with string values', function() {
2372
+ describe('Custom attributes', function () {
2373
+ it('allows assignment of custom attributes with string values', function () {
2374
const el = ReactTestUtils.renderIntoDocument(<div whatever="30" />);
2375
2376
expect(el.getAttribute('whatever')).toBe('30');
2377
});
2378
2379
- it('removes custom attributes', function() {
2379
+ it('removes custom attributes', function () {
2380
const container = document.createElement('div');
2381
ReactDOM.render(<div whatever="30" />, container);
2382
@@ -2387,7 +2387,7 @@ describe('ReactDOMComponent', () => {
2387
expect(container.firstChild.hasAttribute('whatever')).toBe(false);
2388
});
2389
2390
- it('does not assign a boolean custom attributes as a string', function() {
2390
+ it('does not assign a boolean custom attributes as a string', function () {
2391
let el;
2392
expect(() => {
2393
el = ReactTestUtils.renderIntoDocument(<div whatever={true} />);
@@ -2400,7 +2400,7 @@ describe('ReactDOMComponent', () => {
2400
expect(el.hasAttribute('whatever')).toBe(false);
2401
});
2402
2403
- it('does not assign an implicit boolean custom attributes', function() {
2403
+ it('does not assign an implicit boolean custom attributes', function () {
2404
let el;
2405
expect(() => {
2406
// eslint-disable-next-line react/jsx-boolean-value
@@ -2414,13 +2414,13 @@ describe('ReactDOMComponent', () => {
2414
expect(el.hasAttribute('whatever')).toBe(false);
2415
});
2416
2417
- it('assigns a numeric custom attributes as a string', function() {
2417
+ it('assigns a numeric custom attributes as a string', function () {
2418
const el = ReactTestUtils.renderIntoDocument(<div whatever={3} />);
2419
2420
expect(el.getAttribute('whatever')).toBe('3');
2421
});
2422
2423
- it('will not assign a function custom attributes', function() {
2423
+ it('will not assign a function custom attributes', function () {
2424
let el;
2425
expect(() => {
2426
el = ReactTestUtils.renderIntoDocument(<div whatever={() => {}} />);
@@ -2429,12 +2429,12 @@ describe('ReactDOMComponent', () => {
2429
expect(el.hasAttribute('whatever')).toBe(false);
2430
});
2431
2432
- it('will assign an object custom attributes', function() {
2432
+ it('will assign an object custom attributes', function () {
2433
const el = ReactTestUtils.renderIntoDocument(<div whatever={{}} />);
2434
expect(el.getAttribute('whatever')).toBe('[object Object]');
2435
});
2436
2437
- it('allows Temporal-like objects as HTML (they are not coerced to strings first)', function() {
2437
+ it('allows Temporal-like objects as HTML (they are not coerced to strings first)', function () {
2438
class TemporalLike {
2439
valueOf() {
2440
// Throwing here is the behavior of ECMAScript "Temporal" date/time API.
@@ -2456,7 +2456,7 @@ describe('ReactDOMComponent', () => {
2456
expect(container.firstChild.innerHTML).toEqual('2020-01-01');
2457
});
2458
2459
- it('allows cased data attributes', function() {
2459
+ it('allows cased data attributes', function () {
2460
let el;
2461
expect(() => {
2462
el = ReactTestUtils.renderIntoDocument(<div data-fooBar="true" />);
@@ -2471,7 +2471,7 @@ describe('ReactDOMComponent', () => {
2471
expect(el.getAttribute('data-foobar')).toBe('true');
2472
});
2473
2474
- it('allows cased custom attributes', function() {
2474
+ it('allows cased custom attributes', function () {
2475
let el;
2476
expect(() => {
2477
el = ReactTestUtils.renderIntoDocument(<div fooBar="true" />);
@@ -2486,7 +2486,7 @@ describe('ReactDOMComponent', () => {
2486
expect(el.getAttribute('foobar')).toBe('true');
2487
});
2488
2489
- it('warns on NaN attributes', function() {
2489
+ it('warns on NaN attributes', function () {
2490
let el;
2491
expect(() => {
2492
el = ReactTestUtils.renderIntoDocument(<div whatever={NaN} />);
@@ -2498,7 +2498,7 @@ describe('ReactDOMComponent', () => {
2498
expect(el.getAttribute('whatever')).toBe('NaN');
2499
});
2500
2501
- it('removes a property when it becomes invalid', function() {
2501
+ it('removes a property when it becomes invalid', function () {
2502
const container = document.createElement('div');
2503
ReactDOM.render(<div whatever={0} />, container);
2504
expect(() =>
@@ -2508,7 +2508,7 @@ describe('ReactDOMComponent', () => {
2508
expect(el.hasAttribute('whatever')).toBe(false);
2509
});
2510
2511
- it('warns on bad casing of known HTML attributes', function() {
2511
+ it('warns on bad casing of known HTML attributes', function () {
2512
let el;
2513
expect(() => {
2514
el = ReactTestUtils.renderIntoDocument(<div SiZe="30" />);
@@ -2520,8 +2520,8 @@ describe('ReactDOMComponent', () => {
2520
});
2521
});
2522
2523
- describe('Object stringification', function() {
2524
- it('allows objects on known properties', function() {
2523
+ describe('Object stringification', function () {
2524
+ it('allows objects on known properties', function () {
2525
const el = ReactTestUtils.renderIntoDocument(<div acceptCharset={{}} />);
2526
expect(el.getAttribute('accept-charset')).toBe('[object Object]');
2527
});
@@ -2564,7 +2564,7 @@ describe('ReactDOMComponent', () => {
2564
);
2565
});
2566
2567
- it('allows objects that inherit a custom toString method', function() {
2567
+ it('allows objects that inherit a custom toString method', function () {
2568
const parent = {toString: () => 'hello.jpg'};
2569
const child = Object.create(parent);
2570
const el = ReactTestUtils.renderIntoDocument(<img src={child} />);
@@ -2572,7 +2572,7 @@ describe('ReactDOMComponent', () => {
2572
expect(el.src).toBe('http://localhost/hello.jpg');
2573
});
2574
2575
- it('assigns ajaxify (an important internal FB attribute)', function() {
2575
+ it('assigns ajaxify (an important internal FB attribute)', function () {
2576
const options = {toString: () => 'ajaxy'};
2577
const el = ReactTestUtils.renderIntoDocument(<div ajaxify={options} />);
2578
@@ -2580,8 +2580,8 @@ describe('ReactDOMComponent', () => {
2580
});
2581
});
2582
2583
- describe('String boolean attributes', function() {
2584
- it('does not assign string boolean attributes for custom attributes', function() {
2583
+ describe('String boolean attributes', function () {
2584
+ it('does not assign string boolean attributes for custom attributes', function () {
2585
let el;
2586
expect(() => {
2587
el = ReactTestUtils.renderIntoDocument(<div whatever={true} />);
@@ -2594,19 +2594,19 @@ describe('ReactDOMComponent', () => {
2594
expect(el.hasAttribute('whatever')).toBe(false);
2595
});
2596
2597
- it('stringifies the boolean true for allowed attributes', function() {
2597
+ it('stringifies the boolean true for allowed attributes', function () {
2598
const el = ReactTestUtils.renderIntoDocument(<div spellCheck={true} />);
2599
2600
expect(el.getAttribute('spellCheck')).toBe('true');
2601
});
2602
2603
- it('stringifies the boolean false for allowed attributes', function() {
2603
+ it('stringifies the boolean false for allowed attributes', function () {
2604
const el = ReactTestUtils.renderIntoDocument(<div spellCheck={false} />);
2605
2606
expect(el.getAttribute('spellCheck')).toBe('false');
2607
});
2608
2609
- it('stringifies implicit booleans for allowed attributes', function() {
2609
+ it('stringifies implicit booleans for allowed attributes', function () {
2610
// eslint-disable-next-line react/jsx-boolean-value
2611
const el = ReactTestUtils.renderIntoDocument(<div spellCheck />);
2612
@@ -2614,8 +2614,8 @@ describe('ReactDOMComponent', () => {
2614
});
2615
});
2616
2617
- describe('Boolean attributes', function() {
2618
- it('warns on the ambiguous string value "false"', function() {
2617
+ describe('Boolean attributes', function () {
2618
+ it('warns on the ambiguous string value "false"', function () {
2619
let el;
2620
expect(() => {
2621
el = ReactTestUtils.renderIntoDocument(<div hidden="false" />);
@@ -2628,7 +2628,7 @@ describe('ReactDOMComponent', () => {
2628
expect(el.getAttribute('hidden')).toBe('');
2629
});
2630
2631
- it('warns on the potentially-ambiguous string value "true"', function() {
2631
+ it('warns on the potentially-ambiguous string value "true"', function () {
2632
let el;
2633
expect(() => {
2634
el = ReactTestUtils.renderIntoDocument(<div hidden="true" />);
@@ -2642,8 +2642,8 @@ describe('ReactDOMComponent', () => {
2642
});
2643
});
2644
2645
- describe('Hyphenated SVG elements', function() {
2646
- it('the font-face element is not a custom element', function() {
2645
+ describe('Hyphenated SVG elements', function () {
2646
+ it('the font-face element is not a custom element', function () {
2647
let el;
2648
expect(() => {
2649
el = ReactTestUtils.renderIntoDocument(
@@ -2660,7 +2660,7 @@ describe('ReactDOMComponent', () => {
2660
);
2661
});
2662
2663
- it('the font-face element does not allow unknown boolean values', function() {
2663
+ it('the font-face element does not allow unknown boolean values', function () {
2664
let el;
2665
expect(() => {
2666
el = ReactTestUtils.renderIntoDocument(
packages/react-dom/src/__tests__/ReactDOMComponentTree-test.js
+2
-6
@@ -190,9 +190,7 @@ describe('ReactDOMComponentTree', () => {
190
it('finds instance of node that is attempted to be unmounted', () => {
191
const component = <div />;
192
const node = ReactDOM.render(<div>{component}</div>, container);
193
- expect(() =>
194
- ReactDOM.unmountComponentAtNode(node),
195
- ).toErrorDev(
193
+ expect(() => ReactDOM.unmountComponentAtNode(node)).toErrorDev(
194
"unmountComponentAtNode(): The node you're attempting to unmount " +
195
'was rendered by React and is not a top-level container. You may ' +
196
'have accidentally passed in a React root node instead of its ' +
@@ -209,9 +207,7 @@ describe('ReactDOMComponentTree', () => {
207
);
208
const anotherComponent = <div />;
209
const instance = ReactDOM.render(component, container);
212
- expect(() =>
213
- ReactDOM.render(anotherComponent, instance),
214
- ).toErrorDev(
210
+ expect(() => ReactDOM.render(anotherComponent, instance)).toErrorDev(
211
'render(...): Replacing React-rendered children with a new root ' +
212
'component. If you intended to update the children of this node, ' +
213
'you should instead have the existing children update their state ' +
packages/react-dom/src/__tests__/ReactDOMConsoleErrorReporting-test.js
+1
-1
@@ -37,7 +37,7 @@ describe('ReactDOMConsoleErrorReporting', () => {
37
return this.props.children;
38
}
39
};
40
- NoError = function() {
40
+ NoError = function () {
41
return <h1>OK</h1>;
42
};
43
container = document.createElement('div');
packages/react-dom/src/__tests__/ReactDOMEventListener-test.js
+3
-3
@@ -401,7 +401,7 @@ describe('ReactDOMEventListener', () => {
401
402
const originalDocAddEventListener = document.addEventListener;
403
const originalRootAddEventListener = container.addEventListener;
404
- document.addEventListener = function(type) {
404
+ document.addEventListener = function (type) {
405
switch (type) {
406
case 'selectionchange':
407
break;
@@ -411,7 +411,7 @@ describe('ReactDOMEventListener', () => {
411
);
412
}
413
};
414
- container.addEventListener = function(type, fn, options) {
414
+ container.addEventListener = function (type, fn, options) {
415
if (options && (options === true || options.capture)) {
416
return;
417
}
@@ -981,7 +981,7 @@ describe('ReactDOMEventListener', () => {
981
const log = [];
982
983
const originalDocAddEventListener = document.addEventListener;
984
- document.addEventListener = function(type, fn, options) {
984
+ document.addEventListener = function (type, fn, options) {
985
switch (type) {
986
case 'selectionchange':
987
log.push(options);
packages/react-dom/src/__tests__/ReactDOMEventPropagation-test.js
+1
-1
@@ -14,7 +14,7 @@ describe('ReactDOMEventListener', () => {
14
let container;
15
16
beforeEach(() => {
17
- window.TextEvent = function() {};
17
+ window.TextEvent = function () {};
18
jest.resetModules();
19
React = require('react');
20
jest.isolateModules(() => {
packages/react-dom/src/__tests__/ReactDOMFiber-test.js
+4
-8
@@ -206,11 +206,11 @@ describe('ReactDOMFiber', () => {
206
const expectHTML = {ref: el => htmlEls.push(el)};
207
const expectMath = {ref: el => mathEls.push(el)};
208
209
- const usePortal = function(tree) {
209
+ const usePortal = function (tree) {
210
return ReactDOM.createPortal(tree, document.createElement('div'));
211
};
212
213
- const assertNamespacesMatch = function(tree) {
213
+ const assertNamespacesMatch = function (tree) {
214
const testContainer = document.createElement('div');
215
svgEls = [];
216
htmlEls = [];
@@ -1213,9 +1213,7 @@ describe('ReactDOMFiber', () => {
1213
expect(container.innerHTML).toBe('<div>bar</div>');
1214
// then we mess with the DOM before an update
1215
container.innerHTML = '<div>MEOW.</div>';
1216
- expect(() =>
1217
- ReactDOM.render(<div>baz</div>, container),
1218
- ).toErrorDev(
1216
+ expect(() => ReactDOM.render(<div>baz</div>, container)).toErrorDev(
1217
'render(...): ' +
1218
'It looks like the React-rendered content of this container was ' +
1219
'removed without using React. This is not supported and will ' +
@@ -1232,9 +1230,7 @@ describe('ReactDOMFiber', () => {
1230
expect(container.innerHTML).toBe('<div>bar</div>');
1231
// then we mess with the DOM before an update
1232
container.innerHTML = '';
1235
- expect(() =>
1236
- ReactDOM.render(<div>baz</div>, container),
1237
- ).toErrorDev(
1233
+ expect(() => ReactDOM.render(<div>baz</div>, container)).toErrorDev(
1234
'render(...): ' +
1235
'It looks like the React-rendered content of this container was ' +
1236
'removed without using React. This is not supported and will ' +
packages/react-dom/src/__tests__/ReactDOMFizzServer-test.js
+5
-5
@@ -66,8 +66,8 @@ describe('ReactDOMFizzServer', () => {
66
);
67
}
68
useSyncExternalStore = React.useSyncExternalStore;
69
- useSyncExternalStoreWithSelector = require('use-sync-external-store/with-selector')
70
- .useSyncExternalStoreWithSelector;
69
+ useSyncExternalStoreWithSelector =
70
+ require('use-sync-external-store/with-selector').useSyncExternalStoreWithSelector;
71
72
textCache = new Map();
73
@@ -519,7 +519,7 @@ describe('ReactDOMFizzServer', () => {
519
520
let bootstrapped = false;
521
const errors = [];
522
- window.__INIT__ = function() {
522
+ window.__INIT__ = function () {
523
bootstrapped = true;
524
// Attempt to hydrate the content.
525
ReactDOMClient.hydrateRoot(container, <App isClient={true} />, {
@@ -904,7 +904,7 @@ describe('ReactDOMFizzServer', () => {
904
}
905
906
let bootstrapped = false;
907
- window.__INIT__ = function() {
907
+ window.__INIT__ = function () {
908
bootstrapped = true;
909
// Attempt to hydrate the content.
910
ReactDOMClient.hydrateRoot(container, <App />);
@@ -1512,7 +1512,7 @@ describe('ReactDOMFizzServer', () => {
1512
function normalizeCodeLocInfo(str) {
1513
return (
1514
str &&
1515
- str.replace(/\n +(?:at|in) ([\S]+)[^\n]*/g, function(m, name) {
1515
+ str.replace(/\n +(?:at|in) ([\S]+)[^\n]*/g, function (m, name) {
1516
return '\n in ' + name + ' (at **)';
1517
})
1518
);
packages/react-dom/src/__tests__/ReactDOMFizzServerBrowser-test.js
+2
-1
@@ -10,7 +10,8 @@
10
'use strict';
11
12
// Polyfills for test environment
13
-global.ReadableStream = require('web-streams-polyfill/ponyfill/es6').ReadableStream;
13
+global.ReadableStream =
14
+ require('web-streams-polyfill/ponyfill/es6').ReadableStream;
15
global.TextEncoder = require('util').TextEncoder;
16
17
let React;
packages/react-dom/src/__tests__/ReactDOMFizzStaticBrowser-test.js
+2
-1
@@ -10,7 +10,8 @@
10
'use strict';
11
12
// Polyfills for test environment
13
-global.ReadableStream = require('web-streams-polyfill/ponyfill/es6').ReadableStream;
13
+global.ReadableStream =
14
+ require('web-streams-polyfill/ponyfill/es6').ReadableStream;
15
global.TextEncoder = require('util').TextEncoder;
16
17
let React;
packages/react-dom/src/__tests__/ReactDOMFloat-test.js
+1
-1
@@ -79,7 +79,7 @@ describe('ReactDOMFloat', () => {
79
function normalizeCodeLocInfo(str) {
80
return (
81
typeof str === 'string' &&
82
- str.replace(/\n +(?:at|in) ([\S]+)[^\n]*/g, function(m, name) {
82
+ str.replace(/\n +(?:at|in) ([\S]+)[^\n]*/g, function (m, name) {
83
return '\n in ' + name + ' (at **)';
84
})
85
);
packages/react-dom/src/__tests__/ReactDOMHydrationDiff-test.js
+1
-1
@@ -38,7 +38,7 @@ describe('ReactDOMServerHydration', () => {
38
function normalizeCodeLocInfo(str) {
39
return (
40
typeof str === 'string' &&
41
- str.replace(/\n +(?:at|in) ([\S]+)[^\n]*/g, function(m, name) {
41
+ str.replace(/\n +(?:at|in) ([\S]+)[^\n]*/g, function (m, name) {
42
return '\n in ' + name + ' (at **)';
43
})
44
);
packages/react-dom/src/__tests__/ReactDOMImageLoad-test.internal.js
+7
-7
@@ -192,7 +192,7 @@ describe('ReactDOMImageLoad', () => {
192
);
193
});
194
195
- it('captures the load event if it happens before commit phase and replays it between layout and passive effects', async function() {
195
+ it('captures the load event if it happens before commit phase and replays it between layout and passive effects', async function () {
196
const container = document.createElement('div');
197
const root = ReactDOMClient.createRoot(container);
198
@@ -232,7 +232,7 @@ describe('ReactDOMImageLoad', () => {
232
expect(onLoadSpy).toHaveBeenCalled();
233
});
234
235
- it('captures the load event if it happens after commit phase and replays it', async function() {
235
+ it('captures the load event if it happens after commit phase and replays it', async function () {
236
const container = document.createElement('div');
237
const root = ReactDOMClient.createRoot(container);
238
@@ -262,7 +262,7 @@ describe('ReactDOMImageLoad', () => {
262
expect(onLoadSpy).toHaveBeenCalledTimes(1);
263
});
264
265
- it('it replays the last load event when more than one fire before the end of the layout phase completes', async function() {
265
+ it('it replays the last load event when more than one fire before the end of the layout phase completes', async function () {
266
const container = document.createElement('div');
267
const root = ReactDOMClient.createRoot(container);
268
@@ -313,7 +313,7 @@ describe('ReactDOMImageLoad', () => {
313
expect(onLoadSpy).toHaveBeenCalledTimes(1);
314
});
315
316
- it('replays load events that happen in passive phase after the passive phase.', async function() {
316
+ it('replays load events that happen in passive phase after the passive phase.', async function () {
317
const container = document.createElement('div');
318
const root = ReactDOMClient.createRoot(container);
319
@@ -339,7 +339,7 @@ describe('ReactDOMImageLoad', () => {
339
expect(onLoadSpy).toHaveBeenCalledTimes(1);
340
});
341
342
- it('captures and suppresses the load event if it happens before passive effects and a cascading update causes the img to be removed', async function() {
342
+ it('captures and suppresses the load event if it happens before passive effects and a cascading update causes the img to be removed', async function () {
343
const container = document.createElement('div');
344
const root = ReactDOMClient.createRoot(container);
345
@@ -388,7 +388,7 @@ describe('ReactDOMImageLoad', () => {
388
expect(onLoadSpy).not.toHaveBeenCalled();
389
});
390
391
- it('captures and suppresses the load event if it happens before passive effects and a cascading update causes the img to be removed, alternate', async function() {
391
+ it('captures and suppresses the load event if it happens before passive effects and a cascading update causes the img to be removed, alternate', async function () {
392
const container = document.createElement('div');
393
const root = ReactDOMClient.createRoot(container);
394
@@ -517,7 +517,7 @@ describe('ReactDOMImageLoad', () => {
517
// expect(onLoadSpy).toHaveBeenCalledTimes(1);
518
// });
519
520
- it('correctly replays the last img load even when a yield + update causes the host element to change', async function() {
520
+ it('correctly replays the last img load even when a yield + update causes the host element to change', async function () {
521
let externalSetSrc = null;
522
let externalSetSrcAlt = null;
523
packages/react-dom/src/__tests__/ReactDOMInput-test.js
+46
-46
@@ -333,26 +333,26 @@ describe('ReactDOMInput', () => {
333
expect(node.value).toEqual('0');
334
});
335
336
- it('updates the value on radio buttons from "" to 0', function() {
336
+ it('updates the value on radio buttons from "" to 0', function () {
337
ReactDOM.render(
338
- <input type="radio" value="" onChange={function() {}} />,
338
+ <input type="radio" value="" onChange={function () {}} />,
339
container,
340
);
341
ReactDOM.render(
342
- <input type="radio" value={0} onChange={function() {}} />,
342
+ <input type="radio" value={0} onChange={function () {}} />,
343
container,
344
);
345
expect(container.firstChild.value).toBe('0');
346
expect(container.firstChild.getAttribute('value')).toBe('0');
347
});
348
349
- it('updates the value on checkboxes from "" to 0', function() {
349
+ it('updates the value on checkboxes from "" to 0', function () {
350
ReactDOM.render(
351
- <input type="checkbox" value="" onChange={function() {}} />,
351
+ <input type="checkbox" value="" onChange={function () {}} />,
352
container,
353
);
354
ReactDOM.render(
355
- <input type="checkbox" value={0} onChange={function() {}} />,
355
+ <input type="checkbox" value={0} onChange={function () {}} />,
356
container,
357
);
358
expect(container.firstChild.value).toBe('0');
@@ -533,7 +533,7 @@ describe('ReactDOMInput', () => {
533
534
it('should display "foobar" for `defaultValue` of `objToString`', () => {
535
const objToString = {
536
- toString: function() {
536
+ toString: function () {
537
return 'foobar';
538
},
539
};
@@ -680,7 +680,7 @@ describe('ReactDOMInput', () => {
680
expect(node.value).toBe('foo');
681
682
const objToString = {
683
- toString: function() {
683
+ toString: function () {
684
return 'foobar';
685
},
686
};
@@ -698,10 +698,10 @@ describe('ReactDOMInput', () => {
698
let nodeValue = 'a';
699
const nodeValueSetter = jest.fn();
700
Object.defineProperty(node, 'value', {
701
- get: function() {
701
+ get: function () {
702
return nodeValue;
703
},
704
- set: nodeValueSetter.mockImplementation(function(newValue) {
704
+ set: nodeValueSetter.mockImplementation(function (newValue) {
705
nodeValue = newValue;
706
}),
707
});
@@ -720,10 +720,10 @@ describe('ReactDOMInput', () => {
720
let nodeValue = '0';
721
const nodeValueSetter = jest.fn();
722
Object.defineProperty(node, 'value', {
723
- get: function() {
723
+ get: function () {
724
return nodeValue;
725
},
726
- set: nodeValueSetter.mockImplementation(function(newValue) {
726
+ set: nodeValueSetter.mockImplementation(function (newValue) {
727
nodeValue = newValue;
728
}),
729
});
@@ -739,10 +739,10 @@ describe('ReactDOMInput', () => {
739
let nodeValue = 'true';
740
const nodeValueSetter = jest.fn();
741
Object.defineProperty(node, 'value', {
742
- get: function() {
742
+ get: function () {
743
return nodeValue;
744
},
745
- set: nodeValueSetter.mockImplementation(function(newValue) {
745
+ set: nodeValueSetter.mockImplementation(function (newValue) {
746
nodeValue = newValue;
747
}),
748
});
@@ -788,7 +788,7 @@ describe('ReactDOMInput', () => {
788
}
789
});
790
791
- it('should properly transition from an empty value to 0', function() {
791
+ it('should properly transition from an empty value to 0', function () {
792
ReactDOM.render(
793
<input type="text" value="" onChange={emptyFunction} />,
794
container,
@@ -808,7 +808,7 @@ describe('ReactDOMInput', () => {
808
}
809
});
810
811
- it('should properly transition from 0 to an empty value', function() {
811
+ it('should properly transition from 0 to an empty value', function () {
812
ReactDOM.render(
813
<input type="text" value={0} onChange={emptyFunction} />,
814
container,
@@ -824,7 +824,7 @@ describe('ReactDOMInput', () => {
824
expect(node.defaultValue).toBe('');
825
});
826
827
- it('should properly transition a text input from 0 to an empty 0.0', function() {
827
+ it('should properly transition a text input from 0 to an empty 0.0', function () {
828
ReactDOM.render(
829
<input type="text" value={0} onChange={emptyFunction} />,
830
container,
@@ -844,7 +844,7 @@ describe('ReactDOMInput', () => {
844
}
845
});
846
847
- it('should properly transition a number input from "" to 0', function() {
847
+ it('should properly transition a number input from "" to 0', function () {
848
ReactDOM.render(
849
<input type="number" value="" onChange={emptyFunction} />,
850
container,
@@ -864,7 +864,7 @@ describe('ReactDOMInput', () => {
864
}
865
});
866
867
- it('should properly transition a number input from "" to "0"', function() {
867
+ it('should properly transition a number input from "" to "0"', function () {
868
ReactDOM.render(
869
<input type="number" value="" onChange={emptyFunction} />,
870
container,
@@ -886,7 +886,7 @@ describe('ReactDOMInput', () => {
886
887
it('should have the correct target value', () => {
888
let handled = false;
889
- const handler = function(event) {
889
+ const handler = function (event) {
890
expect(event.target.nodeName).toBe('INPUT');
891
handled = true;
892
};
@@ -1286,7 +1286,7 @@ describe('ReactDOMInput', () => {
1286
1287
it('should have a this value of undefined if bind is not used', () => {
1288
expect.assertions(1);
1289
- const unboundInputOnChange = function() {
1289
+ const unboundInputOnChange = function () {
1290
expect(this).toBe(undefined);
1291
};
1292
@@ -1670,21 +1670,21 @@ describe('ReactDOMInput', () => {
1670
it('sets type, step, min, max before value always', () => {
1671
const log = [];
1672
const originalCreateElement = document.createElement;
1673
- spyOnDevAndProd(document, 'createElement').and.callFake(function(type) {
1673
+ spyOnDevAndProd(document, 'createElement').and.callFake(function (type) {
1674
const el = originalCreateElement.apply(this, arguments);
1675
let value = '';
1676
1677
if (type === 'input') {
1678
Object.defineProperty(el, 'value', {
1679
- get: function() {
1679
+ get: function () {
1680
return value;
1681
},
1682
- set: function(val) {
1682
+ set: function (val) {
1683
value = String(val);
1684
log.push('set property value');
1685
},
1686
});
1687
- spyOnDevAndProd(el, 'setAttribute').and.callFake(function(name) {
1687
+ spyOnDevAndProd(el, 'setAttribute').and.callFake(function (name) {
1688
log.push('set attribute ' + name);
1689
});
1690
}
@@ -1743,7 +1743,7 @@ describe('ReactDOMInput', () => {
1743
1744
const log = [];
1745
const originalCreateElement = document.createElement;
1746
- spyOnDevAndProd(document, 'createElement').and.callFake(function(type) {
1746
+ spyOnDevAndProd(document, 'createElement').and.callFake(function (type) {
1747
const el = originalCreateElement.apply(this, arguments);
1748
const getDefaultValue = Object.getOwnPropertyDescriptor(
1749
HTMLInputElement.prototype,
@@ -1763,24 +1763,24 @@ describe('ReactDOMInput', () => {
1763
).set;
1764
if (type === 'input') {
1765
Object.defineProperty(el, 'defaultValue', {
1766
- get: function() {
1766
+ get: function () {
1767
return getDefaultValue.call(this);
1768
},
1769
- set: function(val) {
1769
+ set: function (val) {
1770
log.push(`node.defaultValue = ${strify(val)}`);
1771
setDefaultValue.call(this, val);
1772
},
1773
});
1774
Object.defineProperty(el, 'value', {
1775
- get: function() {
1775
+ get: function () {
1776
return getValue.call(this);
1777
},
1778
- set: function(val) {
1778
+ set: function (val) {
1779
log.push(`node.value = ${strify(val)}`);
1780
setValue.call(this, val);
1781
},
1782
});
1783
- spyOnDevAndProd(el, 'setAttribute').and.callFake(function(name, val) {
1783
+ spyOnDevAndProd(el, 'setAttribute').and.callFake(function (name, val) {
1784
log.push(`node.setAttribute(${strify(name)}, ${strify(val)})`);
1785
});
1786
}
@@ -1808,7 +1808,7 @@ describe('ReactDOMInput', () => {
1808
}
1809
});
1810
1811
- describe('assigning the value attribute on controlled inputs', function() {
1811
+ describe('assigning the value attribute on controlled inputs', function () {
1812
function getTestInput() {
1813
return class extends React.Component {
1814
state = {
@@ -1826,7 +1826,7 @@ describe('ReactDOMInput', () => {
1826
};
1827
}
1828
1829
- it('always sets the attribute when values change on text inputs', function() {
1829
+ it('always sets the attribute when values change on text inputs', function () {
1830
const Input = getTestInput();
1831
const stub = ReactDOM.render(<Input type="text" />, container);
1832
const node = ReactDOM.findDOMNode(stub);
@@ -2030,8 +2030,8 @@ describe('ReactDOMInput', () => {
2030
});
2031
});
2032
2033
- describe('When given a Symbol value', function() {
2034
- it('treats initial Symbol value as an empty string', function() {
2033
+ describe('When given a Symbol value', function () {
2034
+ it('treats initial Symbol value as an empty string', function () {
2035
expect(() =>
2036
ReactDOM.render(
2037
<input value={Symbol('foobar')} onChange={() => {}} />,
@@ -2048,7 +2048,7 @@ describe('ReactDOMInput', () => {
2048
}
2049
});
2050
2051
- it('treats updated Symbol value as an empty string', function() {
2051
+ it('treats updated Symbol value as an empty string', function () {
2052
ReactDOM.render(<input value="foo" onChange={() => {}} />, container);
2053
expect(() =>
2054
ReactDOM.render(
@@ -2066,7 +2066,7 @@ describe('ReactDOMInput', () => {
2066
}
2067
});
2068
2069
- it('treats initial Symbol defaultValue as an empty string', function() {
2069
+ it('treats initial Symbol defaultValue as an empty string', function () {
2070
ReactDOM.render(<input defaultValue={Symbol('foobar')} />, container);
2071
const node = container.firstChild;
2072
@@ -2075,7 +2075,7 @@ describe('ReactDOMInput', () => {
2075
// TODO: we should warn here.
2076
});
2077
2078
- it('treats updated Symbol defaultValue as an empty string', function() {
2078
+ it('treats updated Symbol defaultValue as an empty string', function () {
2079
ReactDOM.render(<input defaultValue="foo" />, container);
2080
ReactDOM.render(<input defaultValue={Symbol('foobar')} />, container);
2081
const node = container.firstChild;
@@ -2090,8 +2090,8 @@ describe('ReactDOMInput', () => {
2090
});
2091
});
2092
2093
- describe('When given a function value', function() {
2094
- it('treats initial function value as an empty string', function() {
2093
+ describe('When given a function value', function () {
2094
+ it('treats initial function value as an empty string', function () {
2095
expect(() =>
2096
ReactDOM.render(
2097
<input value={() => {}} onChange={() => {}} />,
@@ -2108,7 +2108,7 @@ describe('ReactDOMInput', () => {
2108
}
2109
});
2110
2111
- it('treats updated function value as an empty string', function() {
2111
+ it('treats updated function value as an empty string', function () {
2112
ReactDOM.render(<input value="foo" onChange={() => {}} />, container);
2113
expect(() =>
2114
ReactDOM.render(
@@ -2126,7 +2126,7 @@ describe('ReactDOMInput', () => {
2126
}
2127
});
2128
2129
- it('treats initial function defaultValue as an empty string', function() {
2129
+ it('treats initial function defaultValue as an empty string', function () {
2130
ReactDOM.render(<input defaultValue={() => {}} />, container);
2131
const node = container.firstChild;
2132
@@ -2135,7 +2135,7 @@ describe('ReactDOMInput', () => {
2135
// TODO: we should warn here.
2136
});
2137
2138
- it('treats updated function defaultValue as an empty string', function() {
2138
+ it('treats updated function defaultValue as an empty string', function () {
2139
ReactDOM.render(<input defaultValue="foo" />, container);
2140
ReactDOM.render(<input defaultValue={() => {}} />, container);
2141
const node = container.firstChild;
@@ -2151,12 +2151,12 @@ describe('ReactDOMInput', () => {
2151
});
2152
});
2153
2154
- describe('checked inputs without a value property', function() {
2154
+ describe('checked inputs without a value property', function () {
2155
// In absence of a value, radio and checkboxes report a value of "on".
2156
// Between 16 and 16.2, we assigned a node's value to it's current
2157
// value in order to "dettach" it from defaultValue. This had the unfortunate
2158
// side-effect of assigning value="on" to radio and checkboxes
2159
- it('does not add "on" in absence of value on a checkbox', function() {
2159
+ it('does not add "on" in absence of value on a checkbox', function () {
2160
ReactDOM.render(
2161
<input type="checkbox" defaultChecked={true} />,
2162
container,
@@ -2167,7 +2167,7 @@ describe('ReactDOMInput', () => {
2167
expect(node.hasAttribute('value')).toBe(false);
2168
});
2169
2170
- it('does not add "on" in absence of value on a radio', function() {
2170
+ it('does not add "on" in absence of value on a radio', function () {
2171
ReactDOM.render(<input type="radio" defaultChecked={true} />, container);
2172
const node = container.firstChild;
2173
packages/react-dom/src/__tests__/ReactDOMInvalidARIAHook-test.js
+1
-1
@@ -19,7 +19,7 @@ describe('ReactDOMInvalidARIAHook', () => {
19
React = require('react');
20
ReactTestUtils = require('react-dom/test-utils');
21
22
- mountComponent = function(props) {
22
+ mountComponent = function (props) {
23
ReactTestUtils.renderIntoDocument(<div {...props} />);
24
};
25
});
packages/react-dom/src/__tests__/ReactDOMRoot-test.js
+3
-9
@@ -62,9 +62,7 @@ describe('ReactDOMRoot', () => {
62
it('warns if a callback parameter is provided to render', () => {
63
const callback = jest.fn();
64
const root = ReactDOMClient.createRoot(container);
65
- expect(() =>
66
- root.render(<div>Hi</div>, callback),
67
- ).toErrorDev(
65
+ expect(() => root.render(<div>Hi</div>, callback)).toErrorDev(
66
'render(...): does not support the second callback argument. ' +
67
'To execute a side effect after rendering, declare it in a component body with useEffect().',
68
{withoutStack: true},
@@ -108,9 +106,7 @@ describe('ReactDOMRoot', () => {
106
const callback = jest.fn();
107
const root = ReactDOMClient.createRoot(container);
108
root.render(<div>Hi</div>);
111
- expect(() =>
112
- root.unmount(callback),
113
- ).toErrorDev(
109
+ expect(() => root.unmount(callback)).toErrorDev(
110
'unmount(...): does not support a callback argument. ' +
111
'To execute a side effect after rendering, declare it in a component body with useEffect().',
112
{withoutStack: true},
@@ -490,9 +486,7 @@ describe('ReactDOMRoot', () => {
486
});
487
488
it('warn if no children passed to hydrateRoot', async () => {
493
- expect(() =>
494
- ReactDOMClient.hydrateRoot(container),
495
- ).toErrorDev(
489
+ expect(() => ReactDOMClient.hydrateRoot(container)).toErrorDev(
490
'Must provide initial children as second argument to hydrateRoot.',
491
{withoutStack: true},
492
);
packages/react-dom/src/__tests__/ReactDOMSafariMicrotaskBug-test.js
+2
-2
@@ -24,10 +24,10 @@ describe('ReactDOMSafariMicrotaskBug-test', () => {
24
// In reality, the sync flush happens when an iframe is added to the page.
25
// https://github.com/facebook/react/issues/22459
26
let queue = [];
27
- window.queueMicrotask = function(cb) {
27
+ window.queueMicrotask = function (cb) {
28
queue.push(cb);
29
};
30
- flushMicrotasksPrematurely = function() {
30
+ flushMicrotasksPrematurely = function () {
31
while (queue.length > 0) {
32
const prevQueue = queue;
33
queue = [];
packages/react-dom/src/__tests__/ReactDOMSelect-test.js
+2
-2
@@ -15,7 +15,7 @@ describe('ReactDOMSelect', () => {
15
let ReactDOMServer;
16
let ReactTestUtils;
17
18
- const noop = function() {};
18
+ const noop = function () {};
19
20
beforeEach(() => {
21
jest.resetModules();
@@ -269,7 +269,7 @@ describe('ReactDOMSelect', () => {
269
it('should allow setting `value` with `objectToString`', () => {
270
const objectToString = {
271
animal: 'giraffe',
272
- toString: function() {
272
+ toString: function () {
273
return this.animal;
274
},
275
};
packages/react-dom/src/__tests__/ReactDOMServerIntegrationAttributes-test.js
+19
-23
@@ -33,20 +33,16 @@ function initModules() {
33
};
34
}
35
36
-const {
37
- resetModules,
38
- itRenders,
39
- clientCleanRender,
40
- clientRenderOnServerString,
41
-} = ReactDOMServerIntegrationUtils(initModules);
36
+const {resetModules, itRenders, clientCleanRender, clientRenderOnServerString} =
37
+ ReactDOMServerIntegrationUtils(initModules);
38
39
describe('ReactDOMServerIntegration', () => {
40
beforeEach(() => {
41
resetModules();
42
});
43
48
- describe('property to attribute mapping', function() {
49
- describe('string properties', function() {
44
+ describe('property to attribute mapping', function () {
45
+ describe('string properties', function () {
46
itRenders('simple numbers', async render => {
47
const e = await render(<div width={30} />);
48
expect(e.getAttribute('width')).toBe('30');
@@ -73,7 +69,7 @@ describe('ReactDOMServerIntegration', () => {
69
});
70
71
itRenders('no string prop with function value', async render => {
76
- const e = await render(<div width={function() {}} />, 1);
72
+ const e = await render(<div width={function () {}} />, 1);
73
expect(e.hasAttribute('width')).toBe(false);
74
});
75
@@ -83,7 +79,7 @@ describe('ReactDOMServerIntegration', () => {
79
});
80
});
81
86
- describe('boolean properties', function() {
82
+ describe('boolean properties', function () {
83
itRenders('boolean prop with true value', async render => {
84
const e = await render(<div hidden={true} />);
85
expect(e.getAttribute('hidden')).toBe('');
@@ -143,7 +139,7 @@ describe('ReactDOMServerIntegration', () => {
139
});
140
141
itRenders('no boolean prop with function value', async render => {
146
- const e = await render(<div hidden={function() {}} />, 1);
142
+ const e = await render(<div hidden={function () {}} />, 1);
143
expect(e.hasAttribute('hidden')).toBe(false);
144
});
145
@@ -153,7 +149,7 @@ describe('ReactDOMServerIntegration', () => {
149
});
150
});
151
156
- describe('download property (combined boolean/string attribute)', function() {
152
+ describe('download property (combined boolean/string attribute)', function () {
153
itRenders('download prop with true value', async render => {
154
const e = await render(<a download={true} />);
155
expect(e.getAttribute('download')).toBe('');
@@ -195,7 +191,7 @@ describe('ReactDOMServerIntegration', () => {
191
});
192
193
itRenders('no download prop with function value', async render => {
198
- const e = await render(<div download={function() {}} />, 1);
194
+ const e = await render(<div download={function () {}} />, 1);
195
expect(e.hasAttribute('download')).toBe(false);
196
});
197
@@ -205,7 +201,7 @@ describe('ReactDOMServerIntegration', () => {
201
});
202
});
203
208
- describe('className property', function() {
204
+ describe('className property', function () {
205
itRenders('className prop with string value', async render => {
206
const e = await render(<div className="myClassName" />);
207
expect(e.getAttribute('class')).toBe('myClassName');
@@ -254,7 +250,7 @@ describe('ReactDOMServerIntegration', () => {
250
);
251
});
252
257
- describe('htmlFor property', function() {
253
+ describe('htmlFor property', function () {
254
itRenders('htmlFor with string value', async render => {
255
const e = await render(<div htmlFor="myFor" />);
256
expect(e.getAttribute('for')).toBe('myFor');
@@ -287,7 +283,7 @@ describe('ReactDOMServerIntegration', () => {
283
});
284
});
285
290
- describe('numeric properties', function() {
286
+ describe('numeric properties', function () {
287
itRenders(
288
'positive numeric property with positive value',
289
async render => {
@@ -310,7 +306,7 @@ describe('ReactDOMServerIntegration', () => {
306
);
307
308
itRenders('no numeric prop with function value', async render => {
313
- const e = await render(<ol start={function() {}} />, 1);
309
+ const e = await render(<ol start={function () {}} />, 1);
310
expect(e.hasAttribute('start')).toBe(false);
311
});
312
@@ -322,7 +318,7 @@ describe('ReactDOMServerIntegration', () => {
318
itRenders(
319
'no positive numeric prop with function value',
320
async render => {
325
- const e = await render(<input size={function() {}} />, 1);
321
+ const e = await render(<input size={function () {}} />, 1);
322
expect(e.hasAttribute('size')).toBe(false);
323
},
324
);
@@ -333,7 +329,7 @@ describe('ReactDOMServerIntegration', () => {
329
});
330
});
331
336
- describe('props with special meaning in React', function() {
332
+ describe('props with special meaning in React', function () {
333
itRenders('no ref attribute', async render => {
334
class RefComponent extends React.Component {
335
render() {
@@ -372,7 +368,7 @@ describe('ReactDOMServerIntegration', () => {
368
});
369
});
370
375
- describe('inline styles', function() {
371
+ describe('inline styles', function () {
372
itRenders('simple styles', async render => {
373
const e = await render(<div style={{color: 'red', width: '30px'}} />);
374
expect(e.style.color).toBe('red');
@@ -469,7 +465,7 @@ describe('ReactDOMServerIntegration', () => {
465
});
466
});
467
472
- describe('aria attributes', function() {
468
+ describe('aria attributes', function () {
469
itRenders('simple strings', async render => {
470
const e = await render(<div aria-label="hello" />);
471
expect(e.getAttribute('aria-label')).toBe('hello');
@@ -493,7 +489,7 @@ describe('ReactDOMServerIntegration', () => {
489
});
490
});
491
496
- describe('cased attributes', function() {
492
+ describe('cased attributes', function () {
493
itRenders(
494
'badly cased aliased HTML attribute with a warning',
495
async render => {
@@ -551,7 +547,7 @@ describe('ReactDOMServerIntegration', () => {
547
);
548
});
549
554
- describe('unknown attributes', function() {
550
+ describe('unknown attributes', function () {
551
itRenders('unknown attributes', async render => {
552
const e = await render(<div foo="bar" />);
553
expect(e.getAttribute('foo')).toBe('bar');
packages/react-dom/src/__tests__/ReactDOMServerIntegrationBasic-test.js
+3
-3
@@ -41,7 +41,7 @@ describe('ReactDOMServerIntegration', () => {
41
resetModules();
42
});
43
44
- describe('basic rendering', function() {
44
+ describe('basic rendering', function () {
45
itRenders('a blank div', async render => {
46
const e = await render(<div />);
47
expect(e.tagName).toBe('DIV');
@@ -115,10 +115,10 @@ describe('ReactDOMServerIntegration', () => {
115
116
itRenders('an iterable', async render => {
117
const threeDivIterable = {
118
- '@@iterator': function() {
118
+ '@@iterator': function () {
119
let i = 0;
120
return {
121
- next: function() {
121
+ next: function () {
122
if (i++ < 3) {
123
return {value: <div key={i} />, done: false};
124
} else {
packages/react-dom/src/__tests__/ReactDOMServerIntegrationClassContextType-test.js
+1
-1
@@ -39,7 +39,7 @@ describe('ReactDOMServerIntegration', () => {
39
resetModules();
40
});
41
42
- describe('class contextType', function() {
42
+ describe('class contextType', function () {
43
let PurpleContext, RedContext, Context;
44
beforeEach(() => {
45
Context = React.createContext('none');
packages/react-dom/src/__tests__/ReactDOMServerIntegrationElements-test.js
+14
-14
@@ -48,7 +48,7 @@ describe('ReactDOMServerIntegration', () => {
48
resetModules();
49
});
50
51
- describe('elements and children', function() {
51
+ describe('elements and children', function () {
52
function expectNode(node, type, value) {
53
expect(node).not.toBe(null);
54
expect(node.nodeType).toBe(type);
@@ -59,7 +59,7 @@ describe('ReactDOMServerIntegration', () => {
59
expectNode(node, TEXT_NODE_TYPE, text);
60
}
61
62
- describe('text children', function() {
62
+ describe('text children', function () {
63
itRenders('a div with text', async render => {
64
const e = await render(<div>Text</div>);
65
expect(e.tagName).toBe('DIV');
@@ -265,7 +265,7 @@ describe('ReactDOMServerIntegration', () => {
265
});
266
});
267
268
- describe('number children', function() {
268
+ describe('number children', function () {
269
itRenders('a number as single child', async render => {
270
const e = await render(<div>{3}</div>);
271
expect(e.textContent).toBe('3');
@@ -302,7 +302,7 @@ describe('ReactDOMServerIntegration', () => {
302
});
303
});
304
305
- describe('null, false, and undefined children', function() {
305
+ describe('null, false, and undefined children', function () {
306
itRenders('null single child as blank', async render => {
307
const e = await render(<div>{null}</div>);
308
expect(e.childNodes.length).toBe(0);
@@ -365,7 +365,7 @@ describe('ReactDOMServerIntegration', () => {
365
});
366
});
367
368
- describe('elements with implicit namespaces', function() {
368
+ describe('elements with implicit namespaces', function () {
369
itRenders('an svg element', async render => {
370
const e = await render(<svg />);
371
expect(e.childNodes.length).toBe(0);
@@ -580,7 +580,7 @@ describe('ReactDOMServerIntegration', () => {
580
}
581
});
582
583
- describe('newline-eating elements', function() {
583
+ describe('newline-eating elements', function () {
584
itRenders(
585
'a newline-eating tag with content not starting with \\n',
586
async render => {
@@ -601,7 +601,7 @@ describe('ReactDOMServerIntegration', () => {
601
});
602
});
603
604
- describe('different component implementations', function() {
604
+ describe('different component implementations', function () {
605
function checkFooDiv(e) {
606
expect(e.childNodes.length).toBe(1);
607
expectNode(e.firstChild, TEXT_NODE_TYPE, 'foo');
@@ -627,7 +627,7 @@ describe('ReactDOMServerIntegration', () => {
627
async render => {
628
const FactoryComponent = () => {
629
return {
630
- render: function() {
630
+ render: function () {
631
return <div>foo</div>;
632
},
633
};
@@ -640,7 +640,7 @@ describe('ReactDOMServerIntegration', () => {
640
itRenders('factory components', async render => {
641
const FactoryComponent = () => {
642
return {
643
- render: function() {
643
+ render: function () {
644
return <div>foo</div>;
645
},
646
};
@@ -650,7 +650,7 @@ describe('ReactDOMServerIntegration', () => {
650
}
651
});
652
653
- describe('component hierarchies', function() {
653
+ describe('component hierarchies', function () {
654
itRenders('single child hierarchies of components', async render => {
655
const Component = props => <div>{props.children}</div>;
656
let e = await render(
@@ -791,7 +791,7 @@ describe('ReactDOMServerIntegration', () => {
791
});
792
});
793
794
- describe('escaping >, <, and &', function() {
794
+ describe('escaping >, <, and &', function () {
795
itRenders('>,<, and & as single child', async render => {
796
const e = await render(<div>{'<span>Text"</span>'}</div>);
797
expect(e.childNodes.length).toBe(1);
@@ -902,7 +902,7 @@ describe('ReactDOMServerIntegration', () => {
902
);
903
});
904
905
- describe('components that render nullish', function() {
905
+ describe('components that render nullish', function () {
906
itRenders('a function returning null', async render => {
907
const NullComponent = () => null;
908
await render(<NullComponent />);
@@ -932,7 +932,7 @@ describe('ReactDOMServerIntegration', () => {
932
});
933
});
934
935
- describe('components that throw errors', function() {
935
+ describe('components that throw errors', function () {
936
itThrowsWhenRendering(
937
'a function returning an object',
938
async render => {
@@ -976,7 +976,7 @@ describe('ReactDOMServerIntegration', () => {
976
);
977
});
978
979
- describe('badly-typed elements', function() {
979
+ describe('badly-typed elements', function () {
980
itThrowsWhenRendering(
981
'object',
982
async render => {
packages/react-dom/src/__tests__/ReactDOMServerIntegrationHooks-test.js
+2
-6
@@ -72,12 +72,8 @@ function initModules() {
72
};
73
}
74
75
-const {
76
- resetModules,
77
- itRenders,
78
- itThrowsWhenRendering,
79
- serverRender,
80
-} = ReactDOMServerIntegrationUtils(initModules);
75
+const {resetModules, itRenders, itThrowsWhenRendering, serverRender} =
76
+ ReactDOMServerIntegrationUtils(initModules);
77
78
describe('ReactDOMServerHooks', () => {
79
beforeEach(() => {
packages/react-dom/src/__tests__/ReactDOMServerIntegrationLegacyContext-test.js
+3
-6
@@ -34,18 +34,15 @@ function initModules() {
34
};
35
}
36
37
-const {
38
- resetModules,
39
- itRenders,
40
- itThrowsWhenRendering,
41
-} = ReactDOMServerIntegrationUtils(initModules);
37
+const {resetModules, itRenders, itThrowsWhenRendering} =
38
+ ReactDOMServerIntegrationUtils(initModules);
39
40
describe('ReactDOMServerIntegration', () => {
41
beforeEach(() => {
42
resetModules();
43
});
44
48
- describe('legacy context', function() {
45
+ describe('legacy context', function () {
46
let PurpleContext, RedContext;
47
beforeEach(() => {
48
class Parent extends React.Component {
packages/react-dom/src/__tests__/ReactDOMServerIntegrationNewContext-test.js
+1
-1
@@ -39,7 +39,7 @@ describe('ReactDOMServerIntegration', () => {
39
resetModules();
40
});
41
42
- describe('context', function() {
42
+ describe('context', function () {
43
let Context, PurpleContextProvider, RedContextProvider, Consumer;
44
beforeEach(() => {
45
Context = React.createContext('none');
packages/react-dom/src/__tests__/ReactDOMServerIntegrationReconnecting-test.js
+8
-11
@@ -33,18 +33,15 @@ function initModules() {
33
};
34
}
35
36
-const {
37
- resetModules,
38
- expectMarkupMismatch,
39
- expectMarkupMatch,
40
-} = ReactDOMServerIntegrationUtils(initModules);
36
+const {resetModules, expectMarkupMismatch, expectMarkupMatch} =
37
+ ReactDOMServerIntegrationUtils(initModules);
38
39
describe('ReactDOMServerIntegration', () => {
40
beforeEach(() => {
41
resetModules();
42
});
43
47
- describe('reconnecting to server markup', function() {
44
+ describe('reconnecting to server markup', function () {
45
let EmptyComponent;
46
beforeEach(() => {
47
EmptyComponent = class extends React.Component {
@@ -54,8 +51,8 @@ describe('ReactDOMServerIntegration', () => {
51
};
52
});
53
57
- describe('elements', function() {
58
- describe('reconnecting different component implementations', function() {
54
+ describe('elements', function () {
55
+ describe('reconnecting different component implementations', function () {
56
let ES6ClassComponent, PureComponent, bareElement;
57
beforeEach(() => {
58
// try each type of component on client and server.
@@ -165,7 +162,7 @@ describe('ReactDOMServerIntegration', () => {
162
));
163
});
164
168
- describe('inline styles', function() {
165
+ describe('inline styles', function () {
166
it('should error reconnecting missing style attribute', () =>
167
expectMarkupMismatch(<div style={{width: '1px'}} />, <div />));
168
@@ -215,7 +212,7 @@ describe('ReactDOMServerIntegration', () => {
212
));
213
});
214
218
- describe('text nodes', function() {
215
+ describe('text nodes', function () {
216
it('should error reconnecting different text', () =>
217
expectMarkupMismatch(<div>Text</div>, <div>Other Text</div>));
218
@@ -259,7 +256,7 @@ describe('ReactDOMServerIntegration', () => {
256
));
257
});
258
262
- describe('element trees and children', function() {
259
+ describe('element trees and children', function () {
260
it('should error reconnecting missing children', () =>
261
expectMarkupMismatch(
262
<div>
packages/react-dom/src/__tests__/ReactDOMServerIntegrationRefs-test.js
+1
-1
@@ -44,7 +44,7 @@ describe('ReactDOMServerIntegration', () => {
44
resetModules();
45
});
46
47
- describe('refs', function() {
47
+ describe('refs', function () {
48
it('should not run ref code on server', async () => {
49
let refCount = 0;
50
class RefsComponent extends React.Component {
packages/react-dom/src/__tests__/ReactDOMServerIntegrationSelect-test.js
+2
-5
@@ -32,11 +32,8 @@ function initModules() {
32
};
33
}
34
35
-const {
36
- resetModules,
37
- itRenders,
38
- itThrowsWhenRendering,
39
-} = ReactDOMServerIntegrationUtils(initModules);
35
+const {resetModules, itRenders, itThrowsWhenRendering} =
36
+ ReactDOMServerIntegrationUtils(initModules);
37
38
describe('ReactDOMServerIntegrationSelect', () => {
39
let options;
packages/react-dom/src/__tests__/ReactDOMServerIntegrationUserInteraction-test.js
+4
-8
@@ -32,12 +32,8 @@ function initModules() {
32
};
33
}
34
35
-const {
36
- resetModules,
37
- itClientRenders,
38
- renderIntoDom,
39
- serverRender,
40
-} = ReactDOMServerIntegrationUtils(initModules);
35
+const {resetModules, itClientRenders, renderIntoDom, serverRender} =
36
+ ReactDOMServerIntegrationUtils(initModules);
37
38
describe('ReactDOMServerIntegrationUserInteraction', () => {
39
let ControlledInput, ControlledTextArea, ControlledCheckbox, ControlledSelect;
@@ -138,7 +134,7 @@ describe('ReactDOMServerIntegrationUserInteraction', () => {
134
};
135
});
136
141
- describe('user interaction with controlled inputs', function() {
137
+ describe('user interaction with controlled inputs', function () {
138
itClientRenders('a controlled text input', async render => {
139
const setUntrackedValue = Object.getOwnPropertyDescriptor(
140
HTMLInputElement.prototype,
@@ -248,7 +244,7 @@ describe('ReactDOMServerIntegrationUserInteraction', () => {
244
});
245
});
246
251
- describe('user interaction with inputs before client render', function() {
247
+ describe('user interaction with inputs before client render', function () {
248
// renders the element and changes the value **before** the client
249
// code has a chance to render; this simulates what happens when a
250
// user starts to interact with a server-rendered form before
packages/react-dom/src/__tests__/ReactDOMServerPartialHydration-test.internal.js
+1
-1
@@ -23,7 +23,7 @@ let IdleEventPriority;
23
24
function normalizeCodeLocInfo(strOrErr) {
25
if (strOrErr && strOrErr.replace) {
26
- return strOrErr.replace(/\n +(?:at|in) ([\S]+)[^\n]*/g, function(m, name) {
26
+ return strOrErr.replace(/\n +(?:at|in) ([\S]+)[^\n]*/g, function (m, name) {
27
return '\n in ' + name + ' (at **)';
28
});
29
}
packages/react-dom/src/__tests__/ReactDOMServerSelectiveHydration-test.internal.js
+5
-5
@@ -138,8 +138,8 @@ describe('ReactDOMServerSelectiveHydration', () => {
138
Suspense = React.Suspense;
139
140
IdleEventPriority = require('react-reconciler/constants').IdleEventPriority;
141
- ContinuousEventPriority = require('react-reconciler/constants')
142
- .ContinuousEventPriority;
141
+ ContinuousEventPriority =
142
+ require('react-reconciler/constants').ContinuousEventPriority;
143
});
144
145
it('hydrates the target boundary synchronously during a click', async () => {
@@ -1460,7 +1460,7 @@ describe('ReactDOMServerSelectiveHydration', () => {
1460
Scheduler.unstable_yieldValue(text);
1461
return <span>{text}</span>;
1462
}
1463
- const ChildWithBoundary = React.memo(function({text}) {
1463
+ const ChildWithBoundary = React.memo(function ({text}) {
1464
return (
1465
<Suspense fallback="Loading...">
1466
<Child text={text} />
@@ -1904,7 +1904,7 @@ describe('ReactDOMServerSelectiveHydration', () => {
1904
Scheduler.unstable_yieldValue(text);
1905
return <span>{text}</span>;
1906
}
1907
- const ChildWithBoundary = React.memo(function({text}) {
1907
+ const ChildWithBoundary = React.memo(function ({text}) {
1908
return (
1909
<Suspense fallback="Loading...">
1910
<Child text={text} />
@@ -1971,7 +1971,7 @@ describe('ReactDOMServerSelectiveHydration', () => {
1971
Scheduler.unstable_yieldValue(text);
1972
return <span>{text}</span>;
1973
}
1974
- const ChildWithBoundary = React.memo(function({text}) {
1974
+ const ChildWithBoundary = React.memo(function ({text}) {
1975
return (
1976
<Suspense fallback="Loading...">
1977
<Child text={text} />
packages/react-dom/src/__tests__/ReactDOMServerSuspense-test.internal.js
+2
-5
@@ -41,11 +41,8 @@ function initModules() {
41
};
42
}
43
44
-const {
45
- itThrowsWhenRendering,
46
- resetModules,
47
- serverRender,
48
-} = ReactDOMServerIntegrationUtils(initModules);
44
+const {itThrowsWhenRendering, resetModules, serverRender} =
45
+ ReactDOMServerIntegrationUtils(initModules);
46
47
describe('ReactDOMServerSuspense', () => {
48
beforeEach(() => {
packages/react-dom/src/__tests__/ReactDOMTestSelectors-test.js
+2
-2
@@ -558,7 +558,7 @@ No matching component was found for:
558
// Stub out getBoundingClientRect for the specified target.
559
// This API is required by the test selectors but it isn't implemented by jsdom.
560
function setBoundingClientRect(target, {x, y, width, height}) {
561
- target.getBoundingClientRect = function() {
561
+ target.getBoundingClientRect = function () {
562
return {
563
width,
564
height,
@@ -1134,7 +1134,7 @@ No matching component was found for:
1134
// Stub out getBoundingClientRect for the specified target.
1135
// This API is required by the test selectors but it isn't implemented by jsdom.
1136
function setBoundingClientRect(target, {x, y, width, height}) {
1137
- target.getBoundingClientRect = function() {
1137
+ target.getBoundingClientRect = function () {
1138
return {
1139
width,
1140
height,
packages/react-dom/src/__tests__/ReactDOMTextarea-test.js
+11
-11
@@ -29,7 +29,7 @@ describe('ReactDOMTextarea', () => {
29
ReactDOMServer = require('react-dom/server');
30
ReactTestUtils = require('react-dom/test-utils');
31
32
- renderTextarea = function(component, container) {
32
+ renderTextarea = function (component, container) {
33
if (!container) {
34
container = document.createElement('div');
35
}
@@ -74,7 +74,7 @@ describe('ReactDOMTextarea', () => {
74
75
it('should display "foobar" for `defaultValue` of `objToString`', () => {
76
const objToString = {
77
- toString: function() {
77
+ toString: function () {
78
return 'foobar';
79
},
80
};
@@ -133,15 +133,15 @@ describe('ReactDOMTextarea', () => {
133
134
let counter = 0;
135
const originalCreateElement = document.createElement;
136
- spyOnDevAndProd(document, 'createElement').and.callFake(function(type) {
136
+ spyOnDevAndProd(document, 'createElement').and.callFake(function (type) {
137
const el = originalCreateElement.apply(this, arguments);
138
let value = '';
139
if (type === 'textarea') {
140
Object.defineProperty(el, 'value', {
141
- get: function() {
141
+ get: function () {
142
return value;
143
},
144
- set: function(val) {
144
+ set: function (val) {
145
value = String(val);
146
counter++;
147
},
@@ -164,7 +164,7 @@ describe('ReactDOMTextarea', () => {
164
});
165
166
it('should render value for SSR', () => {
167
- const element = <textarea value="1" onChange={function() {}} />;
167
+ const element = <textarea value="1" onChange={function () {}} />;
168
const markup = ReactDOMServer.renderToString(element);
169
const div = document.createElement('div');
170
div.innerHTML = markup;
@@ -208,7 +208,7 @@ describe('ReactDOMTextarea', () => {
208
expect(node.value).toBe('giraffe');
209
210
const objToString = {
211
- toString: function() {
211
+ toString: function () {
212
return 'foo';
213
},
214
};
@@ -281,10 +281,10 @@ describe('ReactDOMTextarea', () => {
281
let nodeValue = 'a';
282
const nodeValueSetter = jest.fn();
283
Object.defineProperty(node, 'value', {
284
- get: function() {
284
+ get: function () {
285
return nodeValue;
286
},
287
- set: nodeValueSetter.mockImplementation(function(newValue) {
287
+ set: nodeValueSetter.mockImplementation(function (newValue) {
288
nodeValue = newValue;
289
}),
290
});
@@ -460,7 +460,7 @@ describe('ReactDOMTextarea', () => {
460
if (ReactFeatureFlags.disableTextareaChildren) {
461
it('should ignore objects as children', () => {
462
const obj = {
463
- toString: function() {
463
+ toString: function () {
464
return 'sharkswithlasers';
465
},
466
};
@@ -477,7 +477,7 @@ describe('ReactDOMTextarea', () => {
477
if (!ReactFeatureFlags.disableTextareaChildren) {
478
it('should allow objects as children', () => {
479
const obj = {
480
- toString: function() {
480
+ toString: function () {
481
return 'sharkswithlasers';
482
},
483
};
packages/react-dom/src/__tests__/ReactEmptyComponent-test.js
+6
-6
@@ -53,7 +53,7 @@ describe('ReactEmptyComponent', () => {
53
}
54
}
55
56
- expect(function() {
56
+ expect(function () {
57
ReactTestUtils.renderIntoDocument(<Component />);
58
}).not.toThrowError();
59
});
@@ -158,10 +158,10 @@ describe('ReactEmptyComponent', () => {
158
/>
159
);
160
161
- expect(function() {
161
+ expect(function () {
162
ReactTestUtils.renderIntoDocument(instance1);
163
}).not.toThrow();
164
- expect(function() {
164
+ expect(function () {
165
ReactTestUtils.renderIntoDocument(instance2);
166
}).not.toThrow();
167
@@ -201,10 +201,10 @@ describe('ReactEmptyComponent', () => {
201
<TogglingComponent firstComponent={Child} secondComponent={'div'} />
202
);
203
204
- expect(function() {
204
+ expect(function () {
205
ReactTestUtils.renderIntoDocument(instance1);
206
}).not.toThrow();
207
- expect(function() {
207
+ expect(function () {
208
ReactTestUtils.renderIntoDocument(instance2);
209
}).not.toThrow();
210
@@ -308,7 +308,7 @@ describe('ReactEmptyComponent', () => {
308
}
309
}
310
311
- expect(function() {
311
+ expect(function () {
312
ReactTestUtils.renderIntoDocument(<Parent />);
313
}).not.toThrow();
314
});
packages/react-dom/src/__tests__/ReactErrorBoundaries-test.internal.js
+1
-1
@@ -2460,7 +2460,7 @@ describe('ReactErrorBoundaries', () => {
2460
throw evilError;
2461
};
2462
Object.defineProperty(Throws, 'displayName', {
2463
- get: function() {
2463
+ get: function () {
2464
throw new Error('gotta catch em all');
2465
},
2466
});
packages/react-dom/src/__tests__/ReactErrorLoggingRecovery-test.js
+1
-1
@@ -58,7 +58,7 @@ describe('ReactErrorLoggingRecovery', () => {
58
console.error = originalConsoleError;
59
});
60
61
- it('should recover from errors in console.error', function() {
61
+ it('should recover from errors in console.error', function () {
62
const div = document.createElement('div');
63
let didCatch = false;
64
try {
packages/react-dom/src/__tests__/ReactFunctionComponent-test.js
+6
-6
@@ -102,7 +102,7 @@ describe('ReactFunctionComponent', () => {
102
function FunctionComponentWithChildContext() {
103
return null;
104
}
105
- FunctionComponentWithChildContext.getDerivedStateFromProps = function() {};
105
+ FunctionComponentWithChildContext.getDerivedStateFromProps = function () {};
106
107
const container = document.createElement('div');
108
@@ -138,7 +138,7 @@ describe('ReactFunctionComponent', () => {
138
139
it('should not throw when stateless component returns undefined', () => {
140
function NotAComponent() {}
141
- expect(function() {
141
+ expect(function () {
142
ReactTestUtils.renderIntoDocument(
143
<div>
144
<NotAComponent />
@@ -152,7 +152,7 @@ describe('ReactFunctionComponent', () => {
152
return <div ref="me" />;
153
}
154
155
- expect(function() {
155
+ expect(function () {
156
ReactTestUtils.renderIntoDocument(<Child test="test" />);
157
}).toThrowError(
158
__DEV__
@@ -323,7 +323,7 @@ describe('ReactFunctionComponent', () => {
323
};
324
}
325
render() {
326
- return <Child ref={function() {}} />;
326
+ return <Child ref={function () {}} />;
327
}
328
}
329
@@ -401,7 +401,7 @@ describe('ReactFunctionComponent', () => {
401
});
402
403
it('should work with arrow functions', () => {
404
- let Child = function() {
404
+ let Child = function () {
405
return <div />;
406
};
407
// Will create a new bound function without a prototype, much like a native
@@ -412,7 +412,7 @@ describe('ReactFunctionComponent', () => {
412
});
413
414
it('should allow simple functions to return null', () => {
415
- const Child = function() {
415
+ const Child = function () {
416
return null;
417
};
418
expect(() => ReactTestUtils.renderIntoDocument(<Child />)).not.toThrow();
packages/react-dom/src/__tests__/ReactIdentity-test.js
+4
-4
@@ -141,7 +141,7 @@ describe('ReactIdentity', () => {
141
}
142
}
143
144
- expect(function() {
144
+ expect(function () {
145
ReactTestUtils.renderIntoDocument(<TestContainer />);
146
}).not.toThrow();
147
});
@@ -176,7 +176,7 @@ describe('ReactIdentity', () => {
176
}
177
}
178
179
- expect(function() {
179
+ expect(function () {
180
ReactTestUtils.renderIntoDocument(<TestContainer />);
181
}).not.toThrow();
182
});
@@ -204,7 +204,7 @@ describe('ReactIdentity', () => {
204
}
205
}
206
207
- expect(function() {
207
+ expect(function () {
208
ReactTestUtils.renderIntoDocument(<TestContainer />);
209
}).not.toThrow();
210
});
@@ -259,7 +259,7 @@ describe('ReactIdentity', () => {
259
</div>
260
);
261
262
- expect(function() {
262
+ expect(function () {
263
ReactTestUtils.renderIntoDocument(component);
264
}).not.toThrow();
265
});
packages/react-dom/src/__tests__/ReactMount-test.js
+10
-16
@@ -59,9 +59,7 @@ describe('ReactMount', () => {
59
}
60
}
61
62
- expect(() =>
63
- ReactTestUtils.renderIntoDocument(Component),
64
- ).toErrorDev(
62
+ expect(() => ReactTestUtils.renderIntoDocument(Component)).toErrorDev(
63
'Functions are not valid as a React child. ' +
64
'This may happen if you return a Component instead of <Component /> from render. ' +
65
'Or maybe you meant to call this function rather than return it.',
@@ -195,9 +193,7 @@ describe('ReactMount', () => {
193
// Test that blasting away children throws a warning
194
const rootNode = container.firstChild;
195
198
- expect(() =>
199
- ReactDOM.render(<span />, rootNode),
200
- ).toErrorDev(
196
+ expect(() => ReactDOM.render(<span />, rootNode)).toErrorDev(
197
'Warning: render(...): Replacing React-rendered children with a new ' +
198
'root component. If you intended to update the children of this node, ' +
199
'you should instead have the existing children update their state and ' +
@@ -225,9 +221,7 @@ describe('ReactMount', () => {
221
// Make sure ReactDOM and ReactDOMOther are different copies
222
expect(ReactDOM).not.toEqual(ReactDOMOther);
223
228
- expect(() =>
229
- ReactDOMOther.unmountComponentAtNode(container),
230
- ).toErrorDev(
224
+ expect(() => ReactDOMOther.unmountComponentAtNode(container)).toErrorDev(
225
"Warning: unmountComponentAtNode(): The node you're attempting to unmount " +
226
'was rendered by another copy of React.',
227
{withoutStack: true},
@@ -241,34 +235,34 @@ describe('ReactMount', () => {
235
const container = document.createElement('div');
236
let calls = 0;
237
244
- ReactDOM.render(<div />, container, function() {
238
+ ReactDOM.render(<div />, container, function () {
239
expect(this.nodeName).toBe('DIV');
240
calls++;
241
});
242
243
// Update, no type change
250
- ReactDOM.render(<div />, container, function() {
244
+ ReactDOM.render(<div />, container, function () {
245
expect(this.nodeName).toBe('DIV');
246
calls++;
247
});
248
249
// Update, type change
256
- ReactDOM.render(<span />, container, function() {
250
+ ReactDOM.render(<span />, container, function () {
251
expect(this.nodeName).toBe('SPAN');
252
calls++;
253
});
254
255
// Batched update, no type change
262
- ReactDOM.unstable_batchedUpdates(function() {
263
- ReactDOM.render(<span />, container, function() {
256
+ ReactDOM.unstable_batchedUpdates(function () {
257
+ ReactDOM.render(<span />, container, function () {
258
expect(this.nodeName).toBe('SPAN');
259
calls++;
260
});
261
});
262
263
// Batched update, type change
270
- ReactDOM.unstable_batchedUpdates(function() {
271
- ReactDOM.render(<article />, container, function() {
264
+ ReactDOM.unstable_batchedUpdates(function () {
265
+ ReactDOM.render(<article />, container, function () {
266
expect(this.nodeName).toBe('ARTICLE');
267
calls++;
268
});
packages/react-dom/src/__tests__/ReactMountDestruction-test.js
+2
-6
@@ -50,9 +50,7 @@ describe('ReactMount', () => {
50
51
// Test that unmounting at a root node gives a helpful warning
52
const rootDiv = mainContainerDiv.firstChild;
53
- expect(() =>
54
- ReactDOM.unmountComponentAtNode(rootDiv),
55
- ).toErrorDev(
53
+ expect(() => ReactDOM.unmountComponentAtNode(rootDiv)).toErrorDev(
54
"Warning: unmountComponentAtNode(): The node you're attempting to " +
55
'unmount was rendered by React and is not a top-level container. You ' +
56
'may have accidentally passed in a React root node instead of its ' +
@@ -75,9 +73,7 @@ describe('ReactMount', () => {
73
74
// Test that unmounting at a non-root node gives a different warning
75
const nonRootDiv = mainContainerDiv.firstChild.firstChild;
78
- expect(() =>
79
- ReactDOM.unmountComponentAtNode(nonRootDiv),
80
- ).toErrorDev(
76
+ expect(() => ReactDOM.unmountComponentAtNode(nonRootDiv)).toErrorDev(
77
"Warning: unmountComponentAtNode(): The node you're attempting to " +
78
'unmount was rendered by React and is not a top-level container. ' +
79
'Instead, have the parent component update its state and rerender in ' +
packages/react-dom/src/__tests__/ReactMultiChild-test.js
+9
-9
@@ -238,7 +238,7 @@ describe('ReactMultiChild', () => {
238
239
function createIterable(array) {
240
return {
241
- '@@iterator': function() {
241
+ '@@iterator': function () {
242
let i = 0;
243
return {
244
next() {
@@ -304,8 +304,8 @@ describe('ReactMultiChild', () => {
304
305
it('should warn for using generators as children', () => {
306
function* Foo() {
307
- yield (<h1 key="1">Hello</h1>);
308
- yield (<h1 key="2">World</h1>);
307
+ yield <h1 key="1">Hello</h1>;
308
+ yield <h1 key="2">World</h1>;
309
}
310
311
const div = document.createElement('div');
@@ -325,9 +325,9 @@ describe('ReactMultiChild', () => {
325
326
it('should not warn for using generators in legacy iterables', () => {
327
const fooIterable = {
328
- '@@iterator': function*() {
329
- yield (<h1 key="1">Hello</h1>);
330
- yield (<h1 key="2">World</h1>);
328
+ '@@iterator': function* () {
329
+ yield <h1 key="1">Hello</h1>;
330
+ yield <h1 key="2">World</h1>;
331
},
332
};
333
@@ -345,9 +345,9 @@ describe('ReactMultiChild', () => {
345
346
it('should not warn for using generators in modern iterables', () => {
347
const fooIterable = {
348
- [Symbol.iterator]: function*() {
349
- yield (<h1 key="1">Hello</h1>);
350
- yield (<h1 key="2">World</h1>);
348
+ [Symbol.iterator]: function* () {
349
+ yield <h1 key="1">Hello</h1>;
350
+ yield <h1 key="2">World</h1>;
351
},
352
};
353
packages/react-dom/src/__tests__/ReactMultiChildReconcile-test.js
+3
-3
@@ -12,7 +12,7 @@
12
const React = require('react');
13
const ReactDOM = require('react-dom');
14
15
-const stripEmptyValues = function(obj) {
15
+const stripEmptyValues = function (obj) {
16
const ret = {};
17
for (const name in obj) {
18
if (!obj.hasOwnProperty(name)) {
@@ -254,7 +254,7 @@ function prepareChildrenArray(childrenArray) {
254
255
function prepareChildrenLegacyIterable(childrenArray) {
256
return {
257
- '@@iterator': function*() {
257
+ '@@iterator': function* () {
258
// eslint-disable-next-line no-for-of-loops/no-for-of-loops
259
for (const child of childrenArray) {
260
yield child;
@@ -265,7 +265,7 @@ function prepareChildrenLegacyIterable(childrenArray) {
265
266
function prepareChildrenModernIterable(childrenArray) {
267
return {
268
- [Symbol.iterator]: function*() {
268
+ [Symbol.iterator]: function* () {
269
// eslint-disable-next-line no-for-of-loops/no-for-of-loops
270
for (const child of childrenArray) {
271
yield child;
packages/react-dom/src/__tests__/ReactMultiChildText-test.js
+6
-6
@@ -14,7 +14,7 @@ const ReactDOM = require('react-dom');
14
const ReactTestUtils = require('react-dom/test-utils');
15
16
// Helpers
17
-const testAllPermutations = function(testCases) {
17
+const testAllPermutations = function (testCases) {
18
for (let i = 0; i < testCases.length; i += 2) {
19
const renderWithChildren = testCases[i];
20
const expectedResultAfterRender = testCases[i + 1];
@@ -33,7 +33,7 @@ const testAllPermutations = function(testCases) {
33
}
34
};
35
36
-const expectChildren = function(container, children) {
36
+const expectChildren = function (container, children) {
37
const outerNode = container.firstChild;
38
let textNode;
39
if (typeof children === 'string') {
@@ -171,7 +171,7 @@ describe('ReactMultiChildText', () => {
171
});
172
173
it('should throw if rendering both HTML and children', () => {
174
- expect(function() {
174
+ expect(function () {
175
ReactTestUtils.renderIntoDocument(
176
<div dangerouslySetInnerHTML={{__html: 'abcdef'}}>ghjkl</div>,
177
);
@@ -188,7 +188,7 @@ describe('ReactMultiChildText', () => {
188
</div>,
189
);
190
191
- expect(function() {
191
+ expect(function () {
192
ReactTestUtils.renderIntoDocument(
193
<div>
194
<h1>A</h1>
@@ -196,7 +196,7 @@ describe('ReactMultiChildText', () => {
196
);
197
}).not.toThrow();
198
199
- expect(function() {
199
+ expect(function () {
200
ReactTestUtils.renderIntoDocument(
201
<div>
202
<h1>{['A']}</h1>
@@ -204,7 +204,7 @@ describe('ReactMultiChildText', () => {
204
);
205
}).not.toThrow();
206
207
- expect(function() {
207
+ expect(function () {
208
ReactTestUtils.renderIntoDocument(
209
<div>
210
<h1>{['A', 'B']}</h1>
packages/react-dom/src/__tests__/ReactServerRendering-test.js
+4
-9
@@ -613,9 +613,8 @@ describe('ReactDOMServer', () => {
613
describe('renderToStaticNodeStream', () => {
614
it('should generate simple markup', () => {
615
const SuccessfulElement = React.createElement(() => <img />);
616
- const response = ReactDOMServer.renderToStaticNodeStream(
617
- SuccessfulElement,
618
- );
616
+ const response =
617
+ ReactDOMServer.renderToStaticNodeStream(SuccessfulElement);
618
expect(response.read().toString()).toMatch(new RegExp('<img' + '/>'));
619
});
620
@@ -682,9 +681,7 @@ describe('ReactDOMServer', () => {
681
}
682
683
ReactDOMServer.renderToString(<Foo />);
685
- expect(() =>
686
- jest.runOnlyPendingTimers(),
687
- ).toErrorDev(
684
+ expect(() => jest.runOnlyPendingTimers()).toErrorDev(
685
'Warning: setState(...): Can only update a mounting component.' +
686
' This usually means you called setState() outside componentWillMount() on the server.' +
687
' This is a no-op.\n\nPlease check the code for the Foo component.',
@@ -712,9 +709,7 @@ describe('ReactDOMServer', () => {
709
}
710
711
ReactDOMServer.renderToString(<Baz />);
715
- expect(() =>
716
- jest.runOnlyPendingTimers(),
717
- ).toErrorDev(
712
+ expect(() => jest.runOnlyPendingTimers()).toErrorDev(
713
'Warning: forceUpdate(...): Can only update a mounting component. ' +
714
'This usually means you called forceUpdate() outside componentWillMount() on the server. ' +
715
'This is a no-op.\n\nPlease check the code for the Baz component.',
packages/react-dom/src/__tests__/ReactServerRenderingHydration-test.js
+4
-4
@@ -581,18 +581,18 @@ describe('ReactDOMServerHydration', () => {
581
582
// Install setters to activate `in` check
583
Object.defineProperty(customElement, 'str', {
584
- set: function(x) {
584
+ set: function (x) {
585
this._str = x;
586
},
587
- get: function() {
587
+ get: function () {
588
return this._str;
589
},
590
});
591
Object.defineProperty(customElement, 'obj', {
592
- set: function(x) {
592
+ set: function (x) {
593
this._obj = x;
594
},
595
- get: function() {
595
+ get: function () {
596
return this._obj;
597
},
598
});
packages/react-dom/src/__tests__/ReactTestUtils-test.js
+5
-7
@@ -40,9 +40,7 @@ describe('ReactTestUtils', () => {
40
MockedComponent.prototype.render = jest.fn();
41
42
// Patch it up so it returns its children.
43
- expect(() =>
44
- ReactTestUtils.mockComponent(MockedComponent),
45
- ).toWarnDev(
43
+ expect(() => ReactTestUtils.mockComponent(MockedComponent)).toWarnDev(
44
'ReactTestUtils.mockComponent() is deprecated. ' +
45
'Use shallow rendering or jest.mock() instead.\n\n' +
46
'See https://reactjs.org/link/test-utils-mock-component for more information.',
@@ -188,7 +186,7 @@ describe('ReactTestUtils', () => {
186
);
187
188
const log = [];
191
- ReactTestUtils.findAllInRenderedTree(tree, function(child) {
189
+ ReactTestUtils.findAllInRenderedTree(tree, function (child) {
190
if (ReactTestUtils.isDOMComponent(child)) {
191
log.push(ReactDOM.findDOMNode(child).textContent);
192
}
@@ -210,7 +208,7 @@ describe('ReactTestUtils', () => {
208
'textarea',
209
];
210
213
- injectedDOMComponents.forEach(function(type) {
211
+ injectedDOMComponents.forEach(function (type) {
212
const testComponent = ReactTestUtils.renderIntoDocument(
213
React.createElement(type),
214
);
@@ -331,7 +329,7 @@ describe('ReactTestUtils', () => {
329
describe('Simulate', () => {
330
it('should change the value of an input field', () => {
331
const obj = {
334
- handler: function(e) {
332
+ handler: function (e) {
333
e.persist();
334
},
335
};
@@ -367,7 +365,7 @@ describe('ReactTestUtils', () => {
365
}
366
367
const obj = {
370
- handler: function(e) {
368
+ handler: function (e) {
369
e.persist();
370
},
371
};
packages/react-dom/src/__tests__/ReactUpdates-test.js
+30
-30
@@ -58,7 +58,7 @@ describe('ReactUpdates', () => {
58
const instance = ReactTestUtils.renderIntoDocument(<Component />);
59
expect(instance.state.x).toBe(0);
60
61
- ReactDOM.unstable_batchedUpdates(function() {
61
+ ReactDOM.unstable_batchedUpdates(function () {
62
instance.setState({x: 1});
63
instance.setState({x: 2});
64
expect(instance.state.x).toBe(0);
@@ -92,7 +92,7 @@ describe('ReactUpdates', () => {
92
expect(instance.state.x).toBe(0);
93
expect(instance.state.y).toBe(0);
94
95
- ReactDOM.unstable_batchedUpdates(function() {
95
+ ReactDOM.unstable_batchedUpdates(function () {
96
instance.setState({x: 1});
97
instance.setState({y: 2});
98
expect(instance.state.x).toBe(0);
@@ -129,7 +129,7 @@ describe('ReactUpdates', () => {
129
expect(instance.props.x).toBe(0);
130
expect(instance.state.y).toBe(0);
131
132
- ReactDOM.unstable_batchedUpdates(function() {
132
+ ReactDOM.unstable_batchedUpdates(function () {
133
ReactDOM.render(<Component x={1} />, container);
134
instance.setState({y: 2});
135
expect(instance.props.x).toBe(0);
@@ -181,7 +181,7 @@ describe('ReactUpdates', () => {
181
expect(instance.state.x).toBe(0);
182
expect(child.state.y).toBe(0);
183
184
- ReactDOM.unstable_batchedUpdates(function() {
184
+ ReactDOM.unstable_batchedUpdates(function () {
185
instance.setState({x: 1});
186
child.setState({y: 2});
187
expect(instance.state.x).toBe(0);
@@ -235,7 +235,7 @@ describe('ReactUpdates', () => {
235
expect(instance.state.x).toBe(0);
236
expect(child.state.y).toBe(0);
237
238
- ReactDOM.unstable_batchedUpdates(function() {
238
+ ReactDOM.unstable_batchedUpdates(function () {
239
child.setState({y: 2});
240
instance.setState({x: 1});
241
expect(instance.state.x).toBe(0);
@@ -271,9 +271,9 @@ describe('ReactUpdates', () => {
271
expect(instance.state.x).toBe(0);
272
273
let innerCallbackRun = false;
274
- ReactDOM.unstable_batchedUpdates(function() {
275
- instance.setState({x: 1}, function() {
276
- instance.setState({x: 2}, function() {
274
+ ReactDOM.unstable_batchedUpdates(function () {
275
+ instance.setState({x: 1}, function () {
276
+ instance.setState({x: 2}, function () {
277
expect(this).toBe(instance);
278
innerCallbackRun = true;
279
expect(instance.state.x).toBe(2);
@@ -315,11 +315,11 @@ describe('ReactUpdates', () => {
315
expect(instance.state.x).toBe(0);
316
317
let callbacksRun = 0;
318
- ReactDOM.unstable_batchedUpdates(function() {
319
- instance.setState({x: 1}, function() {
318
+ ReactDOM.unstable_batchedUpdates(function () {
319
+ instance.setState({x: 1}, function () {
320
callbacksRun++;
321
});
322
- instance.forceUpdate(function() {
322
+ instance.forceUpdate(function () {
323
callbacksRun++;
324
});
325
expect(instance.state.x).toBe(0);
@@ -366,14 +366,14 @@ describe('ReactUpdates', () => {
366
expect(parentRenderCount).toBe(1);
367
expect(childRenderCount).toBe(1);
368
369
- ReactDOM.unstable_batchedUpdates(function() {
369
+ ReactDOM.unstable_batchedUpdates(function () {
370
instance.setState({x: 1});
371
});
372
373
expect(parentRenderCount).toBe(1);
374
expect(childRenderCount).toBe(1);
375
376
- ReactDOM.unstable_batchedUpdates(function() {
376
+ ReactDOM.unstable_batchedUpdates(function () {
377
instance.childRef.current.setState({x: 1});
378
});
379
@@ -423,10 +423,10 @@ describe('ReactUpdates', () => {
423
let didUpdates = [];
424
425
const UpdateLoggingMixin = {
426
- UNSAFE_componentWillUpdate: function() {
426
+ UNSAFE_componentWillUpdate: function () {
427
willUpdates.push(this.constructor.displayName);
428
},
429
- componentDidUpdate: function() {
429
+ componentDidUpdate: function () {
430
didUpdates.push(this.constructor.displayName);
431
},
432
};
@@ -507,7 +507,7 @@ describe('ReactUpdates', () => {
507
function testUpdates(components, desiredWillUpdates, desiredDidUpdates) {
508
let i;
509
510
- ReactDOM.unstable_batchedUpdates(function() {
510
+ ReactDOM.unstable_batchedUpdates(function () {
511
for (i = 0; i < components.length; i++) {
512
triggerUpdate(components[i]);
513
}
@@ -517,7 +517,7 @@ describe('ReactUpdates', () => {
517
518
// Try them in reverse order
519
520
- ReactDOM.unstable_batchedUpdates(function() {
520
+ ReactDOM.unstable_batchedUpdates(function () {
521
for (i = components.length - 1; i >= 0; i--) {
522
triggerUpdate(components[i]);
523
}
@@ -588,7 +588,7 @@ describe('ReactUpdates', () => {
588
}
589
590
const a = ReactTestUtils.renderIntoDocument(<A />);
591
- ReactDOM.unstable_batchedUpdates(function() {
591
+ ReactDOM.unstable_batchedUpdates(function () {
592
a.setState({x: 1});
593
b.setState({x: 1});
594
});
@@ -616,7 +616,7 @@ describe('ReactUpdates', () => {
616
const x = this.state.x;
617
updates.push('Outer-didUpdate-' + x);
618
updates.push('Inner-setState-' + x);
619
- this.innerRef.current.setState({x: x}, function() {
619
+ this.innerRef.current.setState({x: x}, function () {
620
updates.push('Inner-callback-' + x);
621
});
622
}
@@ -638,10 +638,10 @@ describe('ReactUpdates', () => {
638
const instance = ReactTestUtils.renderIntoDocument(<Outer />);
639
640
updates.push('Outer-setState-1');
641
- instance.setState({x: 1}, function() {
641
+ instance.setState({x: 1}, function () {
642
updates.push('Outer-callback-1');
643
updates.push('Outer-setState-2');
644
- instance.setState({x: 2}, function() {
644
+ instance.setState({x: 2}, function () {
645
updates.push('Outer-callback-2');
646
});
647
});
@@ -706,9 +706,9 @@ describe('ReactUpdates', () => {
706
707
expect(updates).toEqual([0, 1, 2]);
708
709
- ReactDOM.unstable_batchedUpdates(function() {
709
+ ReactDOM.unstable_batchedUpdates(function () {
710
// Simulate update on each component from top to bottom.
711
- instances.forEach(function(instance) {
711
+ instances.forEach(function (instance) {
712
instance.forceUpdate();
713
});
714
});
@@ -795,7 +795,7 @@ describe('ReactUpdates', () => {
795
}
796
}
797
798
- ReactDOM.unstable_batchedUpdates(function() {
798
+ ReactDOM.unstable_batchedUpdates(function () {
799
ReactTestUtils.renderIntoDocument(
800
<div>
801
<A />
@@ -816,7 +816,7 @@ describe('ReactUpdates', () => {
816
817
UNSAFE_componentWillReceiveProps(nextProps) {
818
const newX = nextProps.x;
819
- this.setState({x: newX}, function() {
819
+ this.setState({x: newX}, function () {
820
// State should have updated by the time this callback gets called
821
expect(this.state.x).toBe(newX);
822
callbackCount++;
@@ -861,7 +861,7 @@ describe('ReactUpdates', () => {
861
862
const component = ReactTestUtils.renderIntoDocument(<A />);
863
864
- ReactDOM.unstable_batchedUpdates(function() {
864
+ ReactDOM.unstable_batchedUpdates(function () {
865
// B will have scheduled an update but the batching should ensure that its
866
// update never fires.
867
componentB.setState({updates: 1});
@@ -1003,7 +1003,7 @@ describe('ReactUpdates', () => {
1003
1004
const parent = ReactTestUtils.renderIntoDocument(<Parent />);
1005
const child = parent.getChild();
1006
- ReactDOM.unstable_batchedUpdates(function() {
1006
+ ReactDOM.unstable_batchedUpdates(function () {
1007
parent.forceUpdate();
1008
child.forceUpdate();
1009
});
@@ -1052,7 +1052,7 @@ describe('ReactUpdates', () => {
1052
callbacks = callbacks.filter(c => c !== this.onChange);
1053
}
1054
render() {
1055
- return <div key={Math.random()} onClick={function() {}} />;
1055
+ return <div key={Math.random()} onClick={function () {}} />;
1056
}
1057
}
1058
@@ -1060,7 +1060,7 @@ describe('ReactUpdates', () => {
1060
});
1061
1062
it('unstable_batchedUpdates should return value from a callback', () => {
1063
- const result = ReactDOM.unstable_batchedUpdates(function() {
1063
+ const result = ReactDOM.unstable_batchedUpdates(function () {
1064
return 42;
1065
});
1066
expect(result).toEqual(42);
@@ -1069,7 +1069,7 @@ describe('ReactUpdates', () => {
1069
it('unmounts and remounts a root in the same batch', () => {
1070
const container = document.createElement('div');
1071
ReactDOM.render(<span>a</span>, container);
1072
- ReactDOM.unstable_batchedUpdates(function() {
1072
+ ReactDOM.unstable_batchedUpdates(function () {
1073
ReactDOM.unmountComponentAtNode(container);
1074
ReactDOM.render(<span>b</span>, container);
1075
});
packages/react-dom/src/__tests__/findDOMNode-test.js
+1
-1
@@ -64,7 +64,7 @@ describe('findDOMNode', () => {
64
});
65
66
it('findDOMNode should reject random objects', () => {
67
- expect(function() {
67
+ expect(function () {
68
ReactDOM.findDOMNode({foo: 'bar'});
69
}).toThrowError('Argument appears to not be a ReactComponent. Keys: foo');
70
});
packages/react-dom/src/__tests__/quoteAttributeValueForBrowser-test.js
+1
-1
@@ -51,7 +51,7 @@ describe('quoteAttributeValueForBrowser', () => {
51
52
it('object is passed to a string inside attributes', () => {
53
const sampleObject = {
54
- toString: function() {
54
+ toString: function () {
55
return 'ponys';
56
},
57
};
packages/react-dom/src/__tests__/refs-destruction-test.js
+2
-2
@@ -114,8 +114,8 @@ describe('refs-destruction', () => {
114
componentWillUnmount() {
115
const self = this;
116
// some async animation
117
- setTimeout(function() {
118
- expect(function() {
117
+ setTimeout(function () {
118
+ expect(function () {
119
ReactDOM.unmountComponentAtNode(self.div);
120
}).not.toThrow();
121
document.body.removeChild(self.div);
packages/react-dom/src/__tests__/refs-test.js
+3
-3
@@ -70,7 +70,7 @@ describe('reactiverefs', () => {
70
}
71
}
72
73
- const expectClickLogsLengthToBe = function(instance, length) {
73
+ const expectClickLogsLengthToBe = function (instance, length) {
74
const clickLogs = ReactTestUtils.scryRenderedDOMComponentsWithClass(
75
instance,
76
'clickLogDiv',
@@ -82,7 +82,7 @@ describe('reactiverefs', () => {
82
/**
83
* Render a TestRefsComponent and ensure that the main refs are wired up.
84
*/
85
- const renderTestRefsComponent = function() {
85
+ const renderTestRefsComponent = function () {
86
/**
87
* Only purpose is to test that refs are tracked even when applied to a
88
* component that is injected down several layers. Ref systems are difficult to
@@ -492,7 +492,7 @@ describe('creating element with string ref in constructor', () => {
492
it('throws an error', () => {
493
ReactTestUtils = require('react-dom/test-utils');
494
495
- expect(function() {
495
+ expect(function () {
496
ReactTestUtils.renderIntoDocument(<RefTest />);
497
}).toThrowError(
498
'Element ref was specified as a string (p) but no owner was set. This could happen for one of' +
packages/react-dom/src/__tests__/renderSubtreeIntoContainer-test.js
+4
-4
@@ -13,8 +13,8 @@ const React = require('react');
13
const PropTypes = require('prop-types');
14
const ReactDOM = require('react-dom');
15
const ReactTestUtils = require('react-dom/test-utils');
16
-const renderSubtreeIntoContainer = require('react-dom')
17
- .unstable_renderSubtreeIntoContainer;
16
+const renderSubtreeIntoContainer =
17
+ require('react-dom').unstable_renderSubtreeIntoContainer;
18
19
describe('renderSubtreeIntoContainer', () => {
20
it('should pass context when rendering subtree elsewhere', () => {
@@ -47,7 +47,7 @@ describe('renderSubtreeIntoContainer', () => {
47
48
componentDidMount() {
49
expect(
50
- function() {
50
+ function () {
51
renderSubtreeIntoContainer(this, <Component />, portal);
52
}.bind(this),
53
).toErrorDev(
@@ -92,7 +92,7 @@ describe('renderSubtreeIntoContainer', () => {
92
}
93
94
componentDidMount() {
95
- expect(function() {
95
+ expect(function () {
96
renderSubtreeIntoContainer(<Parent />, <Component />, portal);
97
}).toThrowError('parentComponentmust be a valid React Component');
98
}
packages/react-dom/src/__tests__/utils/ReactDOMServerIntegrationTestUtils.js
+5
-3
@@ -12,7 +12,7 @@
12
const stream = require('stream');
13
const shouldIgnoreConsoleError = require('../../../../../scripts/jest/shouldIgnoreConsoleError');
14
15
-module.exports = function(initModules) {
15
+module.exports = function (initModules) {
16
let ReactDOM;
17
let ReactDOMServer;
18
let act;
@@ -241,8 +241,10 @@ module.exports = function(initModules) {
241
if (shouldUseDocument(element)) {
242
// We can't render into a document during a clean render,
243
// so instead, we'll render the children into the document element.
244
- cleanContainer = getContainerFromMarkup(element, '<html></html>')
245
- .documentElement;
244
+ cleanContainer = getContainerFromMarkup(
245
+ element,
246
+ '<html></html>',
247
+ ).documentElement;
248
element = element.props.children;
249
} else {
250
cleanContainer = document.createElement('div');
packages/react-dom/src/client/ReactDOMLegacy.js
+3
-3
@@ -121,7 +121,7 @@ function legacyCreateRootFromDOMContainer(
121
if (isHydrationContainer) {
122
if (typeof callback === 'function') {
123
const originalCallback = callback;
124
- callback = function() {
124
+ callback = function () {
125
const instance = getPublicRootInstance(root);
126
originalCallback.call(instance);
127
};
@@ -159,7 +159,7 @@ function legacyCreateRootFromDOMContainer(
159
160
if (typeof callback === 'function') {
161
const originalCallback = callback;
162
- callback = function() {
162
+ callback = function () {
163
const instance = getPublicRootInstance(root);
164
originalCallback.call(instance);
165
};
@@ -232,7 +232,7 @@ function legacyRenderSubtreeIntoContainer(
232
root = maybeRoot;
233
if (typeof callback === 'function') {
234
const originalCallback = callback;
235
- callback = function() {
235
+ callback = function () {
236
const instance = getPublicRootInstance(root);
237
originalCallback.call(instance);
238
};
packages/react-dom/src/client/ReactDOMRoot.js
+67
-67
@@ -97,86 +97,86 @@ function ReactDOMRoot(internalRoot: FiberRoot) {
97
}
98
99
// $FlowFixMe[prop-missing] found when upgrading Flow
100
-// $FlowFixMe[missing-this-annot]
101
-ReactDOMHydrationRoot.prototype.render = ReactDOMRoot.prototype.render = function(
102
- children: ReactNodeList,
103
-): void {
104
- const root = this._internalRoot;
105
- if (root === null) {
106
- throw new Error('Cannot update an unmounted root.');
107
- }
108
-
109
- if (__DEV__) {
110
- if (typeof arguments[1] === 'function') {
111
- console.error(
112
- 'render(...): does not support the second callback argument. ' +
113
- 'To execute a side effect after rendering, declare it in a component body with useEffect().',
114
- );
115
- } else if (isValidContainer(arguments[1])) {
116
- console.error(
117
- 'You passed a container to the second argument of root.render(...). ' +
118
- "You don't need to pass it again since you already passed it to create the root.",
119
- );
120
- } else if (typeof arguments[1] !== 'undefined') {
121
- console.error(
122
- 'You passed a second argument to root.render(...) but it only accepts ' +
123
- 'one argument.',
124
- );
100
+ReactDOMHydrationRoot.prototype.render = ReactDOMRoot.prototype.render =
101
+ // $FlowFixMe[missing-this-annot]
102
+ function (children: ReactNodeList): void {
103
+ const root = this._internalRoot;
104
+ if (root === null) {
105
+ throw new Error('Cannot update an unmounted root.');
106
}
107
127
- const container = root.containerInfo;
108
+ if (__DEV__) {
109
+ if (typeof arguments[1] === 'function') {
110
+ console.error(
111
+ 'render(...): does not support the second callback argument. ' +
112
+ 'To execute a side effect after rendering, declare it in a component body with useEffect().',
113
+ );
114
+ } else if (isValidContainer(arguments[1])) {
115
+ console.error(
116
+ 'You passed a container to the second argument of root.render(...). ' +
117
+ "You don't need to pass it again since you already passed it to create the root.",
118
+ );
119
+ } else if (typeof arguments[1] !== 'undefined') {
120
+ console.error(
121
+ 'You passed a second argument to root.render(...) but it only accepts ' +
122
+ 'one argument.',
123
+ );
124
+ }
125
129
- if (
130
- !enableFloat &&
131
- !enableHostSingletons &&
132
- container.nodeType !== COMMENT_NODE
133
- ) {
134
- const hostInstance = findHostInstanceWithNoPortals(root.current);
135
- if (hostInstance) {
136
- if (hostInstance.parentNode !== container) {
137
- console.error(
138
- 'render(...): It looks like the React-rendered content of the ' +
139
- 'root container was removed without using React. This is not ' +
140
- 'supported and will cause errors. Instead, call ' +
141
- "root.unmount() to empty a root's container.",
142
- );
126
+ const container = root.containerInfo;
127
+
128
+ if (
129
+ !enableFloat &&
130
+ !enableHostSingletons &&
131
+ container.nodeType !== COMMENT_NODE
132
+ ) {
133
+ const hostInstance = findHostInstanceWithNoPortals(root.current);
134
+ if (hostInstance) {
135
+ if (hostInstance.parentNode !== container) {
136
+ console.error(
137
+ 'render(...): It looks like the React-rendered content of the ' +
138
+ 'root container was removed without using React. This is not ' +
139
+ 'supported and will cause errors. Instead, call ' +
140
+ "root.unmount() to empty a root's container.",
141
+ );
142
+ }
143
}
144
}
145
}
146
- }
147
- updateContainer(children, root, null, null);
148
-};
146
+ updateContainer(children, root, null, null);
147
+ };
148
149
// $FlowFixMe[prop-missing] found when upgrading Flow
151
-// $FlowFixMe[missing-this-annot]
152
-ReactDOMHydrationRoot.prototype.unmount = ReactDOMRoot.prototype.unmount = function(): void {
153
- if (__DEV__) {
154
- if (typeof arguments[0] === 'function') {
155
- console.error(
156
- 'unmount(...): does not support a callback argument. ' +
157
- 'To execute a side effect after rendering, declare it in a component body with useEffect().',
158
- );
159
- }
160
- }
161
- const root = this._internalRoot;
162
- if (root !== null) {
163
- this._internalRoot = null;
164
- const container = root.containerInfo;
150
+ReactDOMHydrationRoot.prototype.unmount = ReactDOMRoot.prototype.unmount =
151
+ // $FlowFixMe[missing-this-annot]
152
+ function (): void {
153
if (__DEV__) {
166
- if (isAlreadyRendering()) {
154
+ if (typeof arguments[0] === 'function') {
155
console.error(
168
- 'Attempted to synchronously unmount a root while React was already ' +
169
- 'rendering. React cannot finish unmounting the root until the ' +
170
- 'current render has completed, which may lead to a race condition.',
156
+ 'unmount(...): does not support a callback argument. ' +
157
+ 'To execute a side effect after rendering, declare it in a component body with useEffect().',
158
);
159
}
160
}
174
- flushSync(() => {
175
- updateContainer(null, root, null, null);
176
- });
177
- unmarkContainerAsRoot(container);
178
- }
179
-};
161
+ const root = this._internalRoot;
162
+ if (root !== null) {
163
+ this._internalRoot = null;
164
+ const container = root.containerInfo;
165
+ if (__DEV__) {
166
+ if (isAlreadyRendering()) {
167
+ console.error(
168
+ 'Attempted to synchronously unmount a root while React was already ' +
169
+ 'rendering. React cannot finish unmounting the root until the ' +
170
+ 'current render has completed, which may lead to a race condition.',
171
+ );
172
+ }
173
+ }
174
+ flushSync(() => {
175
+ updateContainer(null, root, null, null);
176
+ });
177
+ unmarkContainerAsRoot(container);
178
+ }
179
+ };
180
181
export function createRoot(
182
container: Element | Document | DocumentFragment,
packages/react-dom/src/client/__tests__/getNodeForCharacterOffset-test.js
+2
-2
@@ -10,8 +10,8 @@
10
'use strict';
11
12
// TODO: can we express this test with only public API?
13
-const getNodeForCharacterOffset = require('react-dom-bindings/src/client/getNodeForCharacterOffset')
14
- .default;
13
+const getNodeForCharacterOffset =
14
+ require('react-dom-bindings/src/client/getNodeForCharacterOffset').default;
15
16
// Create node from HTML string
17
function createNode(html) {
packages/react-dom/src/client/__tests__/trustedTypes-test.internal.js
+4
-4
@@ -22,7 +22,7 @@ describe('when Trusted Types are available in global object', () => {
22
container = document.createElement('div');
23
const fakeTTObjects = new Set();
24
window.trustedTypes = {
25
- isHTML: function(value) {
25
+ isHTML: function (value) {
26
if (this !== window.trustedTypes) {
27
throw new Error(this);
28
}
@@ -100,7 +100,7 @@ describe('when Trusted Types are available in global object', () => {
100
const setAttribute = Element.prototype.setAttribute;
101
try {
102
const setAttributeCalls = [];
103
- Element.prototype.setAttribute = function(name, value) {
103
+ Element.prototype.setAttribute = function (name, value) {
104
setAttributeCalls.push([this, name.toLowerCase(), value]);
105
return setAttribute.apply(this, arguments);
106
};
@@ -128,7 +128,7 @@ describe('when Trusted Types are available in global object', () => {
128
const setAttribute = Element.prototype.setAttribute;
129
try {
130
const setAttributeCalls = [];
131
- Element.prototype.setAttribute = function(name, value) {
131
+ Element.prototype.setAttribute = function (name, value) {
132
setAttributeCalls.push([this, name.toLowerCase(), value]);
133
return setAttribute.apply(this, arguments);
134
};
@@ -156,7 +156,7 @@ describe('when Trusted Types are available in global object', () => {
156
const setAttributeNS = Element.prototype.setAttributeNS;
157
try {
158
const setAttributeNSCalls = [];
159
- Element.prototype.setAttributeNS = function(ns, name, value) {
159
+ Element.prototype.setAttributeNS = function (ns, name, value) {
160
setAttributeNSCalls.push([this, ns, name, value]);
161
return setAttributeNS.apply(this, arguments);
162
};
packages/react-dom/src/events/__tests__/DOMPluginEventSystem-test.internal.js
+24
-35
@@ -33,12 +33,12 @@ const eventListenersToClear = [];
33
34
function startNativeEventListenerClearDown() {
35
const nativeWindowEventListener = window.addEventListener;
36
- window.addEventListener = function(...params) {
36
+ window.addEventListener = function (...params) {
37
eventListenersToClear.push({target: window, params});
38
return nativeWindowEventListener.apply(this, params);
39
};
40
const nativeDocumentEventListener = document.addEventListener;
41
- document.addEventListener = function(...params) {
41
+ document.addEventListener = function (...params) {
42
eventListenersToClear.push({target: document, params});
43
return nativeDocumentEventListener.apply(this, params);
44
};
@@ -2352,12 +2352,10 @@ describe('DOMPluginEventSystem', () => {
2352
const onBeforeBlur = jest.fn(e => log.push(e.type));
2353
const innerRef = React.createRef();
2354
const innerRef2 = React.createRef();
2355
- const setAfterBlurHandle = ReactDOM.unstable_createEventHandle(
2356
- 'afterblur',
2357
- );
2358
- const setBeforeBlurHandle = ReactDOM.unstable_createEventHandle(
2359
- 'beforeblur',
2360
- );
2355
+ const setAfterBlurHandle =
2356
+ ReactDOM.unstable_createEventHandle('afterblur');
2357
+ const setBeforeBlurHandle =
2358
+ ReactDOM.unstable_createEventHandle('beforeblur');
2359
2360
const Component = ({show}) => {
2361
const ref = React.useRef(null);
@@ -2411,12 +2409,10 @@ describe('DOMPluginEventSystem', () => {
2409
const onBeforeBlur = jest.fn(e => log.push(e.type));
2410
const innerRef = React.createRef();
2411
const innerRef2 = React.createRef();
2414
- const setAfterBlurHandle = ReactDOM.unstable_createEventHandle(
2415
- 'afterblur',
2416
- );
2417
- const setBeforeBlurHandle = ReactDOM.unstable_createEventHandle(
2418
- 'beforeblur',
2419
- );
2412
+ const setAfterBlurHandle =
2413
+ ReactDOM.unstable_createEventHandle('afterblur');
2414
+ const setBeforeBlurHandle =
2415
+ ReactDOM.unstable_createEventHandle('beforeblur');
2416
2417
const Component = ({show}) => {
2418
const ref = React.useRef(null);
@@ -2468,9 +2464,8 @@ describe('DOMPluginEventSystem', () => {
2464
const onBeforeBlur = jest.fn();
2465
const innerRef = React.createRef();
2466
const innerRef2 = React.createRef();
2471
- const setBeforeBlurHandle = ReactDOM.unstable_createEventHandle(
2472
- 'beforeblur',
2473
- );
2467
+ const setBeforeBlurHandle =
2468
+ ReactDOM.unstable_createEventHandle('beforeblur');
2469
const ref2 = React.createRef();
2470
2471
const Component = ({show}) => {
@@ -2533,12 +2528,10 @@ describe('DOMPluginEventSystem', () => {
2528
const promise = new Promise(
2529
resolvePromise => (resolve = resolvePromise),
2530
);
2536
- const setAfterBlurHandle = ReactDOM.unstable_createEventHandle(
2537
- 'afterblur',
2538
- );
2539
- const setBeforeBlurHandle = ReactDOM.unstable_createEventHandle(
2540
- 'beforeblur',
2541
- );
2531
+ const setAfterBlurHandle =
2532
+ ReactDOM.unstable_createEventHandle('afterblur');
2533
+ const setBeforeBlurHandle =
2534
+ ReactDOM.unstable_createEventHandle('beforeblur');
2535
2536
function Child() {
2537
if (suspend) {
@@ -2608,9 +2601,8 @@ describe('DOMPluginEventSystem', () => {
2601
const onBeforeBlur = jest.fn();
2602
const innerRef = React.createRef();
2603
const innerRef2 = React.createRef();
2611
- const setBeforeBlurHandle = ReactDOM.unstable_createEventHandle(
2612
- 'beforeblur',
2613
- );
2604
+ const setBeforeBlurHandle =
2605
+ ReactDOM.unstable_createEventHandle('beforeblur');
2606
const ref2 = React.createRef();
2607
const Suspense = React.Suspense;
2608
let suspend = false;
@@ -2689,9 +2681,8 @@ describe('DOMPluginEventSystem', () => {
2681
const Suspense = React.Suspense;
2682
let suspend = false;
2683
const promise = Promise.resolve();
2692
- const setBeforeBlurHandle = ReactDOM.unstable_createEventHandle(
2693
- 'beforeblur',
2694
- );
2684
+ const setBeforeBlurHandle =
2685
+ ReactDOM.unstable_createEventHandle('beforeblur');
2686
const innerRef = React.createRef();
2687
2688
function Child() {
@@ -3208,12 +3199,10 @@ describe('DOMPluginEventSystem', () => {
3199
container.addEventListener('wheel', handler);
3200
3201
const ref = React.createRef();
3211
- const setTouchStart = ReactDOM.unstable_createEventHandle(
3212
- 'touchstart',
3213
- );
3214
- const setTouchMove = ReactDOM.unstable_createEventHandle(
3215
- 'touchmove',
3216
- );
3202
+ const setTouchStart =
3203
+ ReactDOM.unstable_createEventHandle('touchstart');
3204
+ const setTouchMove =
3205
+ ReactDOM.unstable_createEventHandle('touchmove');
3206
const setWheel = ReactDOM.unstable_createEventHandle('wheel');
3207
3208
function Component() {
packages/react-dom/src/events/plugins/__tests__/ChangeEventPlugin-test.js
+3
-3
@@ -42,14 +42,14 @@ describe('ChangeEventPlugin', () => {
42
// - calling 'window.postMessage' should actually fire postmessage handlers
43
const originalAddEventListener = global.addEventListener;
44
let postMessageCallback;
45
- global.addEventListener = function(eventName, callback, useCapture) {
45
+ global.addEventListener = function (eventName, callback, useCapture) {
46
if (eventName === 'message') {
47
postMessageCallback = callback;
48
} else {
49
originalAddEventListener(eventName, callback, useCapture);
50
}
51
};
52
- global.postMessage = function(messageKey, targetOrigin) {
52
+ global.postMessage = function (messageKey, targetOrigin) {
53
const postMessageEvent = {source: window, data: messageKey};
54
if (postMessageCallback) {
55
postMessageCallback(postMessageEvent);
@@ -472,7 +472,7 @@ describe('ChangeEventPlugin', () => {
472
// https://github.com/facebook/react/issues/10196
473
try {
474
originalCreateElement = document.createElement;
475
- document.createElement = function() {
475
+ document.createElement = function () {
476
const node = originalCreateElement.apply(this, arguments);
477
Object.defineProperty(node, 'value', {
478
get() {},
packages/react-dom/src/events/plugins/__tests__/SelectEventPlugin-test.js
+2
-2
@@ -40,7 +40,7 @@ describe('SelectEventPlugin', () => {
40
41
// Pass `onMouseDown` so React registers a top-level listener.
42
const node = ReactDOM.render(
43
- <input type="text" onMouseDown={function() {}} />,
43
+ <input type="text" onMouseDown={function () {}} />,
44
container,
45
);
46
@@ -177,7 +177,7 @@ describe('SelectEventPlugin', () => {
177
expect(select).toHaveBeenCalledTimes(1);
178
});
179
180
- it('should handle selectionchange events', function() {
180
+ it('should handle selectionchange events', function () {
181
const onSelect = jest.fn();
182
const node = ReactDOM.render(
183
<input type="text" onSelect={onSelect} />,
packages/react-dom/src/events/plugins/__tests__/SimpleEventPlugin-test.js
+14
-14
@@ -9,7 +9,7 @@
9
10
'use strict';
11
12
-describe('SimpleEventPlugin', function() {
12
+describe('SimpleEventPlugin', function () {
13
let React;
14
let ReactDOM;
15
let ReactDOMClient;
@@ -36,7 +36,7 @@ describe('SimpleEventPlugin', function() {
36
return element;
37
}
38
39
- beforeEach(function() {
39
+ beforeEach(function () {
40
jest.resetModules();
41
React = require('react');
42
ReactDOM = require('react-dom');
@@ -53,12 +53,12 @@ describe('SimpleEventPlugin', function() {
53
}
54
});
55
56
- it('A non-interactive tags click when disabled', function() {
56
+ it('A non-interactive tags click when disabled', function () {
57
const element = <div onClick={onClick} />;
58
expectClickThru(mounted(element));
59
});
60
61
- it('A non-interactive tags clicks bubble when disabled', function() {
61
+ it('A non-interactive tags clicks bubble when disabled', function () {
62
const element = mounted(
63
<div onClick={onClick}>
64
<div />
@@ -69,7 +69,7 @@ describe('SimpleEventPlugin', function() {
69
expect(onClick).toHaveBeenCalledTimes(1);
70
});
71
72
- it('does not register a click when clicking a child of a disabled element', function() {
72
+ it('does not register a click when clicking a child of a disabled element', function () {
73
const element = mounted(
74
<button onClick={onClick} disabled={true}>
75
<span />
@@ -81,7 +81,7 @@ describe('SimpleEventPlugin', function() {
81
expect(onClick).toHaveBeenCalledTimes(0);
82
});
83
84
- it('triggers click events for children of disabled elements', function() {
84
+ it('triggers click events for children of disabled elements', function () {
85
const element = mounted(
86
<button disabled={true}>
87
<span onClick={onClick} />
@@ -93,7 +93,7 @@ describe('SimpleEventPlugin', function() {
93
expect(onClick).toHaveBeenCalledTimes(1);
94
});
95
96
- it('triggers parent captured click events when target is a child of a disabled elements', function() {
96
+ it('triggers parent captured click events when target is a child of a disabled elements', function () {
97
const element = mounted(
98
<div onClickCapture={onClick}>
99
<button disabled={true}>
@@ -107,7 +107,7 @@ describe('SimpleEventPlugin', function() {
107
expect(onClick).toHaveBeenCalledTimes(1);
108
});
109
110
- it('triggers captured click events for children of disabled elements', function() {
110
+ it('triggers captured click events for children of disabled elements', function () {
111
const element = mounted(
112
<button disabled={true}>
113
<span onClickCapture={onClick} />
@@ -119,8 +119,8 @@ describe('SimpleEventPlugin', function() {
119
expect(onClick).toHaveBeenCalledTimes(1);
120
});
121
122
- ['button', 'input', 'select', 'textarea'].forEach(function(tagName) {
123
- describe(tagName, function() {
122
+ ['button', 'input', 'select', 'textarea'].forEach(function (tagName) {
123
+ describe(tagName, function () {
124
it('should forward clicks when it starts out not disabled', () => {
125
const element = React.createElement(tagName, {
126
onClick: onClick,
@@ -379,10 +379,10 @@ describe('SimpleEventPlugin', function() {
379
});
380
});
381
382
- describe('iOS bubbling click fix', function() {
382
+ describe('iOS bubbling click fix', function () {
383
// See http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
384
385
- it('does not add a local click to interactive elements', function() {
385
+ it('does not add a local click to interactive elements', function () {
386
container = document.createElement('div');
387
388
ReactDOM.render(<button onClick={onClick} />, container);
@@ -394,7 +394,7 @@ describe('SimpleEventPlugin', function() {
394
expect(onClick).toHaveBeenCalledTimes(0);
395
});
396
397
- it('adds a local click listener to non-interactive elements', function() {
397
+ it('adds a local click listener to non-interactive elements', function () {
398
container = document.createElement('div');
399
400
ReactDOM.render(<div onClick={onClick} />, container);
@@ -411,7 +411,7 @@ describe('SimpleEventPlugin', function() {
411
412
const passiveEvents = [];
413
const nativeAddEventListener = container.addEventListener;
414
- container.addEventListener = function(type, fn, options) {
414
+ container.addEventListener = function (type, fn, options) {
415
if (options !== null && typeof options === 'object') {
416
if (options.passive) {
417
passiveEvents.push(type);
packages/react-dom/src/test-utils/ReactTestUtils.js
+8
-8
@@ -192,7 +192,7 @@ function findAllInRenderedTree(inst, test) {
192
*/
193
function scryRenderedDOMComponentsWithClass(root, classNames) {
194
validateClassInstance(root, 'scryRenderedDOMComponentsWithClass');
195
- return findAllInRenderedTree(root, function(inst) {
195
+ return findAllInRenderedTree(root, function (inst) {
196
if (isDOMComponent(inst)) {
197
let className = inst.className;
198
if (typeof className !== 'string') {
@@ -211,7 +211,7 @@ function scryRenderedDOMComponentsWithClass(root, classNames) {
211
212
classNames = classNames.split(/\s+/);
213
}
214
- return classNames.every(function(name) {
214
+ return classNames.every(function (name) {
215
return classList.indexOf(name) !== -1;
216
});
217
}
@@ -247,7 +247,7 @@ function findRenderedDOMComponentWithClass(root, className) {
247
*/
248
function scryRenderedDOMComponentsWithTag(root, tagName) {
249
validateClassInstance(root, 'scryRenderedDOMComponentsWithTag');
250
- return findAllInRenderedTree(root, function(inst) {
250
+ return findAllInRenderedTree(root, function (inst) {
251
return (
252
isDOMComponent(inst) &&
253
inst.tagName.toUpperCase() === tagName.toUpperCase()
@@ -282,7 +282,7 @@ function findRenderedDOMComponentWithTag(root, tagName) {
282
*/
283
function scryRenderedComponentsWithType(root, componentType) {
284
validateClassInstance(root, 'scryRenderedComponentsWithType');
285
- return findAllInRenderedTree(root, function(inst) {
285
+ return findAllInRenderedTree(root, function (inst) {
286
return isCompositeComponentWithType(inst, componentType);
287
});
288
}
@@ -335,7 +335,7 @@ function mockComponent(module, mockTagName) {
335
336
mockTagName = mockTagName || module.mockTagName || 'div';
337
338
- module.prototype.render.mockImplementation(function() {
338
+ module.prototype.render.mockImplementation(function () {
339
return React.createElement(mockTagName, null, this.props.children);
340
});
341
@@ -392,7 +392,7 @@ function executeDispatchesInOrder(event) {
392
* @param {?object} event Synthetic event to be dispatched.
393
* @private
394
*/
395
-const executeDispatchesAndRelease = function(event /* ReactSyntheticEvent */) {
395
+const executeDispatchesAndRelease = function (event /* ReactSyntheticEvent */) {
396
if (event) {
397
executeDispatchesInOrder(event);
398
@@ -575,7 +575,7 @@ const directDispatchEventTypes = new Set([
575
* - ... (All keys from event plugin `eventTypes` objects)
576
*/
577
function makeSimulator(eventType) {
578
- return function(domNode, eventData) {
578
+ return function (domNode, eventData) {
579
if (React.isValidElement(domNode)) {
580
throw new Error(
581
'TestUtils.Simulate expected a DOM node as the first argument but received ' +
@@ -616,7 +616,7 @@ function makeSimulator(eventType) {
616
accumulateTwoPhaseDispatchesSingle(event);
617
}
618
619
- ReactDOM.unstable_batchedUpdates(function() {
619
+ ReactDOM.unstable_batchedUpdates(function () {
620
// Normally extractEvent enqueues a state restore, but we'll just always
621
// do that since we're by-passing it here.
622
enqueueStateRestore(domNode);
packages/react-native-renderer/src/NativeMethodsMixinUtils.js
+1
-1
@@ -15,7 +15,7 @@ export function mountSafeCallback_NOT_REALLY_SAFE(
15
context: any,
16
callback: ?Function,
17
): any {
18
- return function() {
18
+ return function () {
19
if (!callback) {
20
return undefined;
21
}
packages/react-native-renderer/src/ReactFabricEventEmitter.js
+1
-1
@@ -96,7 +96,7 @@ export function dispatchEvent(
96
}
97
}
98
99
- batchedUpdates(function() {
99
+ batchedUpdates(function () {
100
// Emit event to the RawEventEmitter. This is an unused-by-default EventEmitter
101
// that can be used to instrument event performance monitoring (primarily - could be useful
102
// for other things too).
packages/react-native-renderer/src/ReactFabricGlobalResponderHandler.js
+1
-1
@@ -11,7 +11,7 @@
11
import {UIManager} from 'react-native/Libraries/ReactPrivate/ReactNativePrivateInterface';
12
13
const ReactFabricGlobalResponderHandler = {
14
- onChange: function(from: any, to: any, blockNativeResponder: boolean) {
14
+ onChange: function (from: any, to: any, blockNativeResponder: boolean) {
15
const fromOrTo = from || to;
16
const fromOrToStateNode = fromOrTo && fromOrTo.stateNode;
17
const isFabric = !!(
packages/react-native-renderer/src/ReactNativeBridgeEventPlugin.js
+3
-5
@@ -23,10 +23,8 @@ import forEachAccumulated from './legacy-events/forEachAccumulated';
23
import {HostComponent} from 'react-reconciler/src/ReactWorkTags';
24
import isArray from 'shared/isArray';
25
26
-const {
27
- customBubblingEventTypes,
28
- customDirectEventTypes,
29
-} = ReactNativeViewConfigRegistry;
26
+const {customBubblingEventTypes, customDirectEventTypes} =
27
+ ReactNativeViewConfigRegistry;
28
29
// Start of inline: the below functions were inlined from
30
// EventPropagator.js, as they deviated from ReactDOM's newer
@@ -187,7 +185,7 @@ function accumulateDirectDispatches(events: ?(Array<Object> | Object)) {
185
const ReactNativeBridgeEventPlugin = {
186
eventTypes: ({}: EventTypes),
187
190
- extractEvents: function(
188
+ extractEvents: function (
189
topLevelType: TopLevelType,
190
targetInst: null | Object,
191
nativeEvent: AnyNativeEvent,
packages/react-native-renderer/src/ReactNativeEventEmitter.js
+3
-3
@@ -44,7 +44,7 @@ const EMPTY_NATIVE_EVENT = (({}: any): AnyNativeEvent);
44
* @return {Array<Touch>} Subsequence of touch objects.
45
*/
46
// $FlowFixMe[missing-local-annot]
47
-const touchSubsequence = function(touches, indices) {
47
+const touchSubsequence = function (touches, indices) {
48
const ret = [];
49
for (let i = 0; i < indices.length; i++) {
50
ret.push(touches[indices[i]]);
@@ -63,7 +63,7 @@ const touchSubsequence = function(touches, indices) {
63
* @param {Array<number>} indices Indices to remove from `touches`.
64
* @return {Array<Touch>} Subsequence of removed touch objects.
65
*/
66
-const removeTouchesAtIndices = function(
66
+const removeTouchesAtIndices = function (
67
touches: Array<Object>,
68
indices: Array<number>,
69
): Array<Object> {
@@ -110,7 +110,7 @@ function _receiveRootNodeIDEvent(
110
target = inst.stateNode;
111
}
112
113
- batchedUpdates(function() {
113
+ batchedUpdates(function () {
114
runExtractedPluginEventsInBatch(topLevelType, inst, nativeEvent, target);
115
});
116
// React Native doesn't use ReactControlledComponent but if it did, here's
packages/react-native-renderer/src/ReactNativeFiberHostComponent.js
+2
-1
@@ -82,7 +82,8 @@ class ReactNativeFiberHostComponent {
82
// Already a node handle
83
relativeNode = relativeToNativeNode;
84
} else {
85
- const nativeNode: ReactNativeFiberHostComponent = (relativeToNativeNode: any);
85
+ const nativeNode: ReactNativeFiberHostComponent =
86
+ (relativeToNativeNode: any);
87
if (nativeNode._nativeTag) {
88
relativeNode = nativeNode._nativeTag;
89
}
packages/react-native-renderer/src/ReactNativeFiberInspector.js
+11
-12
@@ -38,7 +38,7 @@ let traverseOwnerTreeUp;
38
39
if (__DEV__ || enableGetInspectorDataForInstanceInProduction) {
40
// $FlowFixMe[missing-local-annot]
41
- createHierarchy = function(fiberHierarchy) {
41
+ createHierarchy = function (fiberHierarchy) {
42
return fiberHierarchy.map(fiber => ({
43
name: getComponentNameFromType(fiber.type),
44
getInspectorData: findNodeHandle => {
@@ -68,7 +68,7 @@ if (__DEV__ || enableGetInspectorDataForInstanceInProduction) {
68
};
69
70
// $FlowFixMe[missing-local-annot]
71
- getHostNode = function(fiber: Fiber | null, findNodeHandle) {
71
+ getHostNode = function (fiber: Fiber | null, findNodeHandle) {
72
let hostNode;
73
// look for children first for the hostNode
74
// as composite fibers do not have a hostNode
@@ -85,7 +85,7 @@ if (__DEV__ || enableGetInspectorDataForInstanceInProduction) {
85
};
86
87
// $FlowFixMe[missing-local-annot]
88
- getHostProps = function(fiber) {
88
+ getHostProps = function (fiber) {
89
const host = findCurrentHostFiber(fiber);
90
if (host) {
91
return host.memoizedProps || emptyObject;
@@ -93,7 +93,7 @@ if (__DEV__ || enableGetInspectorDataForInstanceInProduction) {
93
return emptyObject;
94
};
95
96
- getInspectorDataForInstance = function(
96
+ getInspectorDataForInstance = function (
97
closestInstance: Fiber | null,
98
): InspectorData {
99
// Handle case where user clicks outside of ReactNative
@@ -123,14 +123,14 @@ if (__DEV__ || enableGetInspectorDataForInstanceInProduction) {
123
};
124
};
125
126
- getOwnerHierarchy = function(instance: any) {
126
+ getOwnerHierarchy = function (instance: any) {
127
const hierarchy = [];
128
traverseOwnerTreeUp(hierarchy, instance);
129
return hierarchy;
130
};
131
132
// $FlowFixMe[missing-local-annot]
133
- lastNonHostInstance = function(hierarchy) {
133
+ lastNonHostInstance = function (hierarchy) {
134
for (let i = hierarchy.length - 1; i > 1; i--) {
135
const instance = hierarchy[i];
136
@@ -142,7 +142,7 @@ if (__DEV__ || enableGetInspectorDataForInstanceInProduction) {
142
};
143
144
// $FlowFixMe[missing-local-annot]
145
- traverseOwnerTreeUp = function(hierarchy, instance: any) {
145
+ traverseOwnerTreeUp = function (hierarchy, instance: any) {
146
if (instance) {
147
hierarchy.unshift(instance);
148
traverseOwnerTreeUp(hierarchy, instance._debugOwner);
@@ -160,7 +160,7 @@ let getInspectorDataForViewAtPoint: (
160
) => void;
161
162
if (__DEV__) {
163
- getInspectorDataForViewTag = function(viewTag: number): Object {
163
+ getInspectorDataForViewTag = function (viewTag: number): Object {
164
const closestInstance = getClosestInstanceFromNode(viewTag);
165
166
// Handle case where user clicks outside of ReactNative
@@ -189,7 +189,7 @@ if (__DEV__) {
189
};
190
};
191
192
- getInspectorDataForViewAtPoint = function(
192
+ getInspectorDataForViewAtPoint = function (
193
findNodeHandle: (componentOrHandle: any) => ?number,
194
inspectedView: Object,
195
locationX: number,
@@ -223,9 +223,8 @@ if (__DEV__) {
223
nativeFabricUIManager.measure(
224
internalInstanceHandle.stateNode.node,
225
(x, y, width, height, pageX, pageY) => {
226
- const inspectorData = getInspectorDataForInstance(
227
- closestInstance,
228
- );
226
+ const inspectorData =
227
+ getInspectorDataForInstance(closestInstance);
228
callback({
229
...inspectorData,
230
pointerY: locationY,
packages/react-native-renderer/src/ReactNativeGetListeners.js
+2
-2
@@ -118,7 +118,7 @@ export default function getListeners(
118
// and pass them an Event.
119
// When this API is more stable and used more frequently, we can revisit.
120
// $FlowFixMe[missing-local-annot]
121
- const listenerFnWrapper = function(syntheticEvent, ...args) {
121
+ const listenerFnWrapper = function (syntheticEvent, ...args) {
122
const eventInst = new CustomEvent(mangledImperativeRegistrationName, {
123
detail: syntheticEvent.nativeEvent,
124
});
@@ -133,7 +133,7 @@ export default function getListeners(
133
// and by removing it from eventListeners once it is called (but only
134
// when it's actually been executed).
135
if (listenerObj.options.once) {
136
- listeners.push(function(...args) {
136
+ listeners.push(function (...args) {
137
// Remove from the event listener once it's been called
138
stateNode.canonical.removeEventListener_unstable(
139
mangledImperativeRegistrationName,
packages/react-native-renderer/src/ReactNativeGlobalResponderHandler.js
+1
-1
@@ -11,7 +11,7 @@
11
import {UIManager} from 'react-native/Libraries/ReactPrivate/ReactNativePrivateInterface';
12
13
const ReactNativeGlobalResponderHandler = {
14
- onChange: function(from: any, to: any, blockNativeResponder: boolean) {
14
+ onChange: function (from: any, to: any, blockNativeResponder: boolean) {
15
if (to !== null) {
16
const tag = to.stateNode._nativeTag;
17
UIManager.setJSResponder(tag, blockNativeResponder);
packages/react-native-renderer/src/ReactNativeTypes.js
+5
-5
@@ -48,7 +48,7 @@ export type AttributeConfiguration = $ReadOnly<{
48
[propName: string]: AnyAttributeType,
49
style: $ReadOnly<{
50
[propName: string]: AnyAttributeType,
51
- ...,
51
+ ...
52
}>,
53
...
54
}>;
@@ -57,7 +57,7 @@ export type PartialAttributeConfiguration = $ReadOnly<{
57
[propName: string]: AnyAttributeType,
58
style?: $ReadOnly<{
59
[propName: string]: AnyAttributeType,
60
- ...,
60
+ ...
61
}>,
62
...
63
}>;
@@ -76,13 +76,13 @@ export type ViewConfig = $ReadOnly<{
76
skipBubbling?: ?boolean,
77
}>,
78
}>,
79
- ...,
79
+ ...
80
}>,
81
directEventTypes?: $ReadOnly<{
82
[eventName: string]: $ReadOnly<{
83
registrationName: string,
84
}>,
85
- ...,
85
+ ...
86
}>,
87
uiViewClassName: string,
88
validAttributes: AttributeConfiguration,
@@ -119,7 +119,7 @@ type SecretInternalsType = {
119
120
type InspectorDataProps = $ReadOnly<{
121
[propName: string]: string,
122
- ...,
122
+ ...
123
}>;
124
125
type InspectorDataSource = $ReadOnly<{
packages/react-native-renderer/src/__mocks__/react-native/Libraries/ReactPrivate/InitializeNativeFabricUIManager.js
+2
-2
@@ -23,7 +23,7 @@ function dumpSubtree(info, indent) {
23
}
24
25
const RCTFabricUIManager = {
26
- __dumpChildSetForJestTestsOnly: function(childSet) {
26
+ __dumpChildSetForJestTestsOnly: function (childSet) {
27
const result = [];
28
// eslint-disable-next-line no-for-of-loops/no-for-of-loops
29
for (const child of childSet) {
@@ -31,7 +31,7 @@ const RCTFabricUIManager = {
31
}
32
return result.join('\n');
33
},
34
- __dumpHierarchyForJestTestsOnly: function() {
34
+ __dumpHierarchyForJestTestsOnly: function () {
35
const result = [];
36
// eslint-disable-next-line no-for-of-loops/no-for-of-loops
37
for (const [rootTag, childSet] of roots) {
packages/react-native-renderer/src/__mocks__/react-native/Libraries/ReactPrivate/ReactNativePrivateInitializeCore.js
-1
@@ -12,4 +12,3 @@
12
// Noop
13
14
// TODO #10932517: Move all initialization callers back into react-native
15
-
packages/react-native-renderer/src/__mocks__/react-native/Libraries/ReactPrivate/ReactNativeViewConfigRegistry.js
+2
-2
@@ -68,7 +68,7 @@ function processEventTypes(
68
* The callback is deferred until the view is actually rendered.
69
* This is done to avoid causing Prepack deopts.
70
*/
71
-exports.register = function(name: string, callback: ViewConfigGetter): string {
71
+exports.register = function (name: string, callback: ViewConfigGetter): string {
72
if (viewConfigCallbacks.has(name)) {
73
throw new Error(`Tried to register two views with the same name ${name}`);
74
}
@@ -90,7 +90,7 @@ exports.register = function(name: string, callback: ViewConfigGetter): string {
90
* If this is the first time the view has been used,
91
* This configuration will be lazy-loaded from UIManager.
92
*/
93
-exports.get = function(name: string): ReactNativeBaseComponentViewConfig<> {
93
+exports.get = function (name: string): ReactNativeBaseComponentViewConfig<> {
94
let viewConfig;
95
if (!viewConfigs.has(name)) {
96
const callback = viewConfigCallbacks.get(name);
packages/react-native-renderer/src/__mocks__/react-native/Libraries/ReactPrivate/UIManager.js
+2
-2
@@ -62,7 +62,7 @@ function removeChild(parent, child) {
62
}
63
64
const RCTUIManager = {
65
- __dumpHierarchyForJestTestsOnly: function() {
65
+ __dumpHierarchyForJestTestsOnly: function () {
66
function dumpSubtree(tag, indent) {
67
const info = views.get(tag);
68
let out = '';
@@ -155,7 +155,7 @@ const RCTUIManager = {
155
}
156
}),
157
updateView: jest.fn(),
158
- removeSubviewsFromContainerWithID: jest.fn(function(parentTag) {
158
+ removeSubviewsFromContainerWithID: jest.fn(function (parentTag) {
159
views.get(parentTag).children.forEach(tag => removeChild(parentTag, tag));
160
}),
161
replaceExistingNonRootView: jest.fn(),
packages/react-native-renderer/src/__mocks__/react-native/Libraries/ReactPrivate/deepDiffer.js
+1
-1
@@ -15,7 +15,7 @@ type Options = {+unsafelyIgnoreFunctions?: boolean};
15
/*
16
* @returns {bool} true if different, false if equal
17
*/
18
-const deepDiffer = function(
18
+const deepDiffer = function (
19
one: any,
20
two: any,
21
maxDepthOrOptions: Options | number = -1,
packages/react-native-renderer/src/__mocks__/react-native/Libraries/ReactPrivate/deepFreezeAndThrowOnMutationInDev.js
+1
-1
@@ -9,6 +9,6 @@
9
10
// TODO: move into react or fbjs
11
12
-const deepFreezeAndThrowOnMutationInDev = function() {};
12
+const deepFreezeAndThrowOnMutationInDev = function () {};
13
14
module.exports = deepFreezeAndThrowOnMutationInDev;
packages/react-native-renderer/src/__mocks__/react-native/Libraries/ReactPrivate/flattenStyle.js
+1
-1
@@ -9,6 +9,6 @@
9
10
// TODO: Move flattenStyle into react
11
12
-const flattenStyle = function() {};
12
+const flattenStyle = function () {};
13
14
module.exports = flattenStyle;
packages/react-native-renderer/src/__tests__/EventPluginRegistry-test.internal.js
+8
-8
@@ -21,8 +21,8 @@ describe('EventPluginRegistry', () => {
21
// safe to remove too.
22
EventPluginRegistry = require('react-native-renderer/src/legacy-events/EventPluginRegistry');
23
24
- createPlugin = function(properties) {
25
- return Object.assign({extractEvents: function() {}}, properties);
24
+ createPlugin = function (properties) {
25
+ return Object.assign({extractEvents: function () {}}, properties);
26
};
27
});
28
@@ -92,7 +92,7 @@ describe('EventPluginRegistry', () => {
92
93
EventPluginRegistry.injectEventPluginOrder(['bad']);
94
95
- expect(function() {
95
+ expect(function () {
96
EventPluginRegistry.injectEventPluginsByName({
97
bad: BadPlugin,
98
});
@@ -108,7 +108,7 @@ describe('EventPluginRegistry', () => {
108
109
EventPluginRegistry.injectEventPluginOrder(['one']);
110
111
- expect(function() {
111
+ expect(function () {
112
EventPluginRegistry.injectEventPluginsByName({
113
one: OnePlugin,
114
random: RandomPlugin,
@@ -124,7 +124,7 @@ describe('EventPluginRegistry', () => {
124
125
EventPluginRegistry.injectEventPluginOrder(pluginOrdering);
126
127
- expect(function() {
127
+ expect(function () {
128
EventPluginRegistry.injectEventPluginOrder(pluginOrdering);
129
}).toThrowError(
130
'EventPluginRegistry: Cannot inject event plugin ordering more than ' +
@@ -138,7 +138,7 @@ describe('EventPluginRegistry', () => {
138
139
EventPluginRegistry.injectEventPluginsByName({same: OnePlugin});
140
141
- expect(function() {
141
+ expect(function () {
142
EventPluginRegistry.injectEventPluginsByName({same: TwoPlugin});
143
}).toThrowError(
144
'EventPluginRegistry: Cannot inject two different event plugins using ' +
@@ -208,7 +208,7 @@ describe('EventPluginRegistry', () => {
208
two: TwoPlugin,
209
});
210
211
- expect(function() {
211
+ expect(function () {
212
EventPluginRegistry.injectEventPluginOrder(['one', 'two']);
213
}).toThrowError(
214
'EventPluginRegistry: More than one plugin attempted to publish the same ' +
@@ -227,7 +227,7 @@ describe('EventPluginRegistry', () => {
227
228
EventPluginRegistry.injectEventPluginsByName({one: OnePlugin});
229
230
- expect(function() {
230
+ expect(function () {
231
EventPluginRegistry.injectEventPluginOrder(['one']);
232
}).toThrowError(
233
'EventPluginRegistry: Failed to publish event `badEvent` for plugin ' +
packages/react-native-renderer/src/__tests__/ReactFabric-test.internal.js
+24
-39
@@ -37,8 +37,9 @@ describe('ReactFabric', () => {
37
React = require('react');
38
StrictMode = React.StrictMode;
39
ReactFabric = require('react-native-renderer/fabric');
40
- createReactNativeComponentClass = require('react-native/Libraries/ReactPrivate/ReactNativePrivateInterface')
41
- .ReactNativeViewConfigRegistry.register;
40
+ createReactNativeComponentClass =
41
+ require('react-native/Libraries/ReactPrivate/ReactNativePrivateInterface')
42
+ .ReactNativeViewConfigRegistry.register;
43
44
act = require('jest-react').act;
45
});
@@ -241,9 +242,11 @@ describe('ReactFabric', () => {
242
expect(nativeFabricUIManager.dispatchCommand).not.toBeCalled();
243
ReactFabric.dispatchCommand(viewRef, 'updateCommand', [10, 20]);
244
expect(nativeFabricUIManager.dispatchCommand).toHaveBeenCalledTimes(1);
244
- expect(
245
- nativeFabricUIManager.dispatchCommand,
246
- ).toHaveBeenCalledWith(expect.any(Object), 'updateCommand', [10, 20]);
245
+ expect(nativeFabricUIManager.dispatchCommand).toHaveBeenCalledWith(
246
+ expect.any(Object),
247
+ 'updateCommand',
248
+ [10, 20],
249
+ );
250
});
251
252
it('should warn and no-op if calling dispatchCommand on non native refs', () => {
@@ -350,7 +353,7 @@ describe('ReactFabric', () => {
353
const c = ReactFabric.render(
354
<View foo="foo" ref={v => (a = v)} />,
355
11,
353
- function() {
356
+ function () {
357
b = this;
358
},
359
);
@@ -471,7 +474,7 @@ describe('ReactFabric', () => {
474
}));
475
476
const snapshots = [];
474
- nativeFabricUIManager.completeRoot.mockImplementation(function(
477
+ nativeFabricUIManager.completeRoot.mockImplementation(function (
478
rootTag,
479
newChildSet,
480
) {
@@ -597,16 +600,10 @@ describe('ReactFabric', () => {
600
1,
601
);
602
600
- const [
601
- ,
602
- ,
603
- ,
604
- ,
605
- instanceHandle,
606
- ] = nativeFabricUIManager.createNode.mock.calls[0];
607
- const [
608
- dispatchEvent,
609
- ] = nativeFabricUIManager.registerEventHandler.mock.calls[0];
603
+ const [, , , , instanceHandle] =
604
+ nativeFabricUIManager.createNode.mock.calls[0];
605
+ const [dispatchEvent] =
606
+ nativeFabricUIManager.registerEventHandler.mock.calls[0];
607
608
const touchEvent = {
609
touches: [],
@@ -694,16 +691,10 @@ describe('ReactFabric', () => {
691
expect(nativeFabricUIManager.registerEventHandler.mock.calls.length).toBe(
692
1,
693
);
697
- const [
698
- ,
699
- ,
700
- ,
701
- ,
702
- childInstance,
703
- ] = nativeFabricUIManager.createNode.mock.calls[0];
704
- const [
705
- dispatchEvent,
706
- ] = nativeFabricUIManager.registerEventHandler.mock.calls[0];
694
+ const [, , , , childInstance] =
695
+ nativeFabricUIManager.createNode.mock.calls[0];
696
+ const [dispatchEvent] =
697
+ nativeFabricUIManager.registerEventHandler.mock.calls[0];
698
699
dispatchEvent(childInstance, 'topDefaultBubblingEvent', event);
700
expect(targetBubble).toHaveBeenCalledTimes(1);
@@ -750,15 +741,10 @@ describe('ReactFabric', () => {
741
}));
742
743
function getViewById(id) {
753
- const [
754
- reactTag,
755
- ,
756
- ,
757
- ,
758
- instanceHandle,
759
- ] = nativeFabricUIManager.createNode.mock.calls.find(
760
- args => args[3] && args[3].id === id,
761
- );
744
+ const [reactTag, , , , instanceHandle] =
745
+ nativeFabricUIManager.createNode.mock.calls.find(
746
+ args => args[3] && args[3].id === id,
747
+ );
748
749
return {reactTag, instanceHandle};
750
}
@@ -796,9 +782,8 @@ describe('ReactFabric', () => {
782
);
783
});
784
799
- const [
800
- dispatchEvent,
801
- ] = nativeFabricUIManager.registerEventHandler.mock.calls[0];
785
+ const [dispatchEvent] =
786
+ nativeFabricUIManager.registerEventHandler.mock.calls[0];
787
788
dispatchEvent(getViewById('one').instanceHandle, 'topTouchStart', {
789
target: getViewById('one').reactTag,
packages/react-native-renderer/src/__tests__/ReactFabricAndNative-test.internal.js
+20
-14
@@ -24,16 +24,17 @@ describe('created with ReactFabric called with ReactNative', () => {
24
ReactNative = require('react-native-renderer');
25
jest.resetModules();
26
ReactNativePrivateInterface = require('react-native/Libraries/ReactPrivate/ReactNativePrivateInterface');
27
- UIManager = require('react-native/Libraries/ReactPrivate/ReactNativePrivateInterface')
28
- .UIManager;
27
+ UIManager =
28
+ require('react-native/Libraries/ReactPrivate/ReactNativePrivateInterface').UIManager;
29
jest.mock('shared/ReactFeatureFlags', () =>
30
require('shared/forks/ReactFeatureFlags.native-oss'),
31
);
32
33
React = require('react');
34
ReactFabric = require('react-native-renderer/fabric');
35
- createReactNativeComponentClass = require('react-native/Libraries/ReactPrivate/ReactNativePrivateInterface')
36
- .ReactNativeViewConfigRegistry.register;
35
+ createReactNativeComponentClass =
36
+ require('react-native/Libraries/ReactPrivate/ReactNativePrivateInterface')
37
+ .ReactNativeViewConfigRegistry.register;
38
});
39
40
it('find Fabric instances with the RN renderer', () => {
@@ -89,9 +90,11 @@ describe('created with ReactFabric called with ReactNative', () => {
90
expect(nativeFabricUIManager.dispatchCommand).not.toBeCalled();
91
ReactNative.dispatchCommand(ref.current, 'myCommand', [10, 20]);
92
expect(nativeFabricUIManager.dispatchCommand).toHaveBeenCalledTimes(1);
92
- expect(
93
- nativeFabricUIManager.dispatchCommand,
94
- ).toHaveBeenCalledWith(expect.any(Object), 'myCommand', [10, 20]);
93
+ expect(nativeFabricUIManager.dispatchCommand).toHaveBeenCalledWith(
94
+ expect.any(Object),
95
+ 'myCommand',
96
+ [10, 20],
97
+ );
98
expect(UIManager.dispatchViewManagerCommand).not.toBeCalled();
99
});
100
@@ -124,16 +127,17 @@ describe('created with ReactNative called with ReactFabric', () => {
127
require('react-native/Libraries/ReactPrivate/InitializeNativeFabricUIManager');
128
ReactFabric = require('react-native-renderer/fabric');
129
jest.resetModules();
127
- UIManager = require('react-native/Libraries/ReactPrivate/ReactNativePrivateInterface')
128
- .UIManager;
130
+ UIManager =
131
+ require('react-native/Libraries/ReactPrivate/ReactNativePrivateInterface').UIManager;
132
jest.mock('shared/ReactFeatureFlags', () =>
133
require('shared/forks/ReactFeatureFlags.native-oss'),
134
);
135
ReactNative = require('react-native-renderer');
136
137
React = require('react');
135
- createReactNativeComponentClass = require('react-native/Libraries/ReactPrivate/ReactNativePrivateInterface')
136
- .ReactNativeViewConfigRegistry.register;
138
+ createReactNativeComponentClass =
139
+ require('react-native/Libraries/ReactPrivate/ReactNativePrivateInterface')
140
+ .ReactNativeViewConfigRegistry.register;
141
});
142
143
it('find Paper instances with the Fabric renderer', () => {
@@ -189,9 +193,11 @@ describe('created with ReactNative called with ReactFabric', () => {
193
expect(UIManager.dispatchViewManagerCommand).not.toBeCalled();
194
ReactFabric.dispatchCommand(ref.current, 'myCommand', [10, 20]);
195
expect(UIManager.dispatchViewManagerCommand).toHaveBeenCalledTimes(1);
192
- expect(
193
- UIManager.dispatchViewManagerCommand,
194
- ).toHaveBeenCalledWith(expect.any(Number), 'myCommand', [10, 20]);
196
+ expect(UIManager.dispatchViewManagerCommand).toHaveBeenCalledWith(
197
+ expect.any(Number),
198
+ 'myCommand',
199
+ [10, 20],
200
+ );
201
202
expect(nativeFabricUIManager.dispatchCommand).not.toBeCalled();
203
});
packages/react-native-renderer/src/__tests__/ReactFabricHostComponent-test.internal.js
+3
-2
@@ -32,8 +32,9 @@ beforeEach(() => {
32
*/
33
function mockRenderKeys(keyLists) {
34
const ReactFabric = require('react-native-renderer/fabric');
35
- const createReactNativeComponentClass = require('react-native/Libraries/ReactPrivate/ReactNativePrivateInterface')
36
- .ReactNativeViewConfigRegistry.register;
35
+ const createReactNativeComponentClass =
36
+ require('react-native/Libraries/ReactPrivate/ReactNativePrivateInterface')
37
+ .ReactNativeViewConfigRegistry.register;
38
const {act} = require('jest-react');
39
40
const mockContainerTag = 11;
packages/react-native-renderer/src/__tests__/ReactNativeAttributePayload-test.internal.js
+8
-8
@@ -211,19 +211,19 @@ describe('ReactNativeAttributePayload', () => {
211
expect(
212
diff(
213
{
214
- a: function() {
214
+ a: function () {
215
return 1;
216
},
217
- b: function() {
217
+ b: function () {
218
return 2;
219
},
220
c: 3,
221
},
222
{
223
- b: function() {
223
+ b: function () {
224
return 9;
225
},
226
- c: function() {
226
+ c: function () {
227
return 3;
228
},
229
},
@@ -236,12 +236,12 @@ describe('ReactNativeAttributePayload', () => {
236
expect(
237
diff(
238
{
239
- a: function() {
239
+ a: function () {
240
return 1;
241
},
242
},
243
{
244
- a: function() {
244
+ a: function () {
245
return 9;
246
},
247
},
@@ -255,14 +255,14 @@ describe('ReactNativeAttributePayload', () => {
255
diff(
256
{
257
wrapper: {
258
- a: function() {
258
+ a: function () {
259
return 1;
260
},
261
},
262
},
263
{
264
wrapper: {
265
- a: function() {
265
+ a: function () {
266
return 9;
267
},
268
},
packages/react-native-renderer/src/__tests__/ReactNativeError-test.internal.js
+4
-3
@@ -18,7 +18,7 @@ let computeComponentStackForErrorReporting;
18
function normalizeCodeLocInfo(str) {
19
return (
20
str &&
21
- str.replace(/\n +(?:at|in) ([\S]+)[^\n]*/g, function(m, name) {
21
+ str.replace(/\n +(?:at|in) ([\S]+)[^\n]*/g, function (m, name) {
22
return '\n in ' + name + ' (at **)';
23
})
24
);
@@ -30,8 +30,9 @@ describe('ReactNativeError', () => {
30
31
React = require('react');
32
ReactNative = require('react-native-renderer');
33
- createReactNativeComponentClass = require('react-native/Libraries/ReactPrivate/ReactNativePrivateInterface')
34
- .ReactNativeViewConfigRegistry.register;
33
+ createReactNativeComponentClass =
34
+ require('react-native/Libraries/ReactPrivate/ReactNativePrivateInterface')
35
+ .ReactNativeViewConfigRegistry.register;
36
computeComponentStackForErrorReporting =
37
ReactNative.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
38
.computeComponentStackForErrorReporting;
packages/react-native-renderer/src/__tests__/ReactNativeEvents-test.internal.js
+9
-8
@@ -64,16 +64,17 @@ beforeEach(() => {
64
jest.resetModules();
65
66
PropTypes = require('prop-types');
67
- RCTEventEmitter = require('react-native/Libraries/ReactPrivate/ReactNativePrivateInterface')
68
- .RCTEventEmitter;
67
+ RCTEventEmitter =
68
+ require('react-native/Libraries/ReactPrivate/ReactNativePrivateInterface').RCTEventEmitter;
69
React = require('react');
70
ReactNative = require('react-native-renderer');
71
- ResponderEventPlugin = require('react-native-renderer/src/legacy-events/ResponderEventPlugin')
72
- .default;
73
- UIManager = require('react-native/Libraries/ReactPrivate/ReactNativePrivateInterface')
74
- .UIManager;
75
- createReactNativeComponentClass = require('react-native/Libraries/ReactPrivate/ReactNativePrivateInterface')
76
- .ReactNativeViewConfigRegistry.register;
71
+ ResponderEventPlugin =
72
+ require('react-native-renderer/src/legacy-events/ResponderEventPlugin').default;
73
+ UIManager =
74
+ require('react-native/Libraries/ReactPrivate/ReactNativePrivateInterface').UIManager;
75
+ createReactNativeComponentClass =
76
+ require('react-native/Libraries/ReactPrivate/ReactNativePrivateInterface')
77
+ .ReactNativeViewConfigRegistry.register;
78
});
79
80
it('fails to register the same event name with different types', () => {
packages/react-native-renderer/src/__tests__/ReactNativeMount-test.internal.js
+13
-10
@@ -34,12 +34,13 @@ describe('ReactNative', () => {
34
StrictMode = React.StrictMode;
35
ReactNative = require('react-native-renderer');
36
ReactNativePrivateInterface = require('react-native/Libraries/ReactPrivate/ReactNativePrivateInterface');
37
- UIManager = require('react-native/Libraries/ReactPrivate/ReactNativePrivateInterface')
38
- .UIManager;
39
- createReactNativeComponentClass = require('react-native/Libraries/ReactPrivate/ReactNativePrivateInterface')
40
- .ReactNativeViewConfigRegistry.register;
41
- TextInputState = require('react-native/Libraries/ReactPrivate/ReactNativePrivateInterface')
42
- .TextInputState;
37
+ UIManager =
38
+ require('react-native/Libraries/ReactPrivate/ReactNativePrivateInterface').UIManager;
39
+ createReactNativeComponentClass =
40
+ require('react-native/Libraries/ReactPrivate/ReactNativePrivateInterface')
41
+ .ReactNativeViewConfigRegistry.register;
42
+ TextInputState =
43
+ require('react-native/Libraries/ReactPrivate/ReactNativePrivateInterface').TextInputState;
44
});
45
46
it('should be able to create and render a native component', () => {
@@ -123,9 +124,11 @@ describe('ReactNative', () => {
124
expect(UIManager.dispatchViewManagerCommand).not.toBeCalled();
125
ReactNative.dispatchCommand(viewRef, 'updateCommand', [10, 20]);
126
expect(UIManager.dispatchViewManagerCommand).toHaveBeenCalledTimes(1);
126
- expect(
127
- UIManager.dispatchViewManagerCommand,
128
- ).toHaveBeenCalledWith(expect.any(Number), 'updateCommand', [10, 20]);
127
+ expect(UIManager.dispatchViewManagerCommand).toHaveBeenCalledWith(
128
+ expect.any(Number),
129
+ 'updateCommand',
130
+ [10, 20],
131
+ );
132
});
133
134
it('should warn and no-op if calling dispatchCommand on non native refs', () => {
@@ -388,7 +391,7 @@ describe('ReactNative', () => {
391
const c = ReactNative.render(
392
<View foo="foo" ref={v => (a = v)} />,
393
11,
391
- function() {
394
+ function () {
395
b = this;
396
},
397
);
packages/react-native-renderer/src/__tests__/ResponderEventPlugin-test.internal.js
+22
-19
@@ -18,7 +18,7 @@ let EventBatching;
18
let EventPluginUtils;
19
let ResponderEventPlugin;
20
21
-const touch = function(nodeHandle, i) {
21
+const touch = function (nodeHandle, i) {
22
return {target: nodeHandle, identifier: i};
23
};
24
@@ -37,7 +37,7 @@ function injectComponentTree(ComponentTree) {
37
* @return {TouchEvent} Model of a touch event that is compliant with responder
38
* system plugin.
39
*/
40
-const touchEvent = function(nodeHandle, touches, changedTouches) {
40
+const touchEvent = function (nodeHandle, touches, changedTouches) {
41
return {
42
target: nodeHandle,
43
changedTouches: changedTouches,
@@ -45,7 +45,7 @@ const touchEvent = function(nodeHandle, touches, changedTouches) {
45
};
46
};
47
48
-const subsequence = function(arr, indices) {
48
+const subsequence = function (arr, indices) {
49
const ret = [];
50
for (let i = 0; i < indices.length; i++) {
51
const index = indices[i];
@@ -54,7 +54,7 @@ const subsequence = function(arr, indices) {
54
return ret;
55
};
56
57
-const antiSubsequence = function(arr, indices) {
57
+const antiSubsequence = function (arr, indices) {
58
const ret = [];
59
for (let i = 0; i < arr.length; i++) {
60
if (indices.indexOf(i) === -1) {
@@ -68,7 +68,7 @@ const antiSubsequence = function(arr, indices) {
68
* Helper for creating touch test config data.
69
* @param allTouchHandles
70
*/
71
-const _touchConfig = function(
71
+const _touchConfig = function (
72
topType,
73
targetNodeHandle,
74
allTouchHandles,
@@ -117,7 +117,7 @@ const _touchConfig = function(
117
* @return {object} Config data used by test cases for extracting responder
118
* events.
119
*/
120
-const startConfig = function(nodeHandle, allTouchHandles, changedIndices) {
120
+const startConfig = function (nodeHandle, allTouchHandles, changedIndices) {
121
return _touchConfig(
122
'topTouchStart',
123
nodeHandle,
@@ -130,7 +130,7 @@ const startConfig = function(nodeHandle, allTouchHandles, changedIndices) {
130
/**
131
* @see `startConfig`
132
*/
133
-const moveConfig = function(nodeHandle, allTouchHandles, changedIndices) {
133
+const moveConfig = function (nodeHandle, allTouchHandles, changedIndices) {
134
return _touchConfig(
135
'topTouchMove',
136
nodeHandle,
@@ -143,7 +143,7 @@ const moveConfig = function(nodeHandle, allTouchHandles, changedIndices) {
143
/**
144
* @see `startConfig`
145
*/
146
-const endConfig = function(nodeHandle, allTouchHandles, changedIndices) {
146
+const endConfig = function (nodeHandle, allTouchHandles, changedIndices) {
147
return _touchConfig(
148
'topTouchEnd',
149
nodeHandle,
@@ -181,7 +181,7 @@ const endConfig = function(nodeHandle, allTouchHandles, changedIndices) {
181
*
182
*/
183
const NA = -1;
184
-const oneEventLoopTestConfig = function(readableIDToID) {
184
+const oneEventLoopTestConfig = function (readableIDToID) {
185
const ret = {
186
// Negotiation
187
scrollShouldSetResponder: {bubbled: {}, captured: {}},
@@ -228,9 +228,9 @@ const oneEventLoopTestConfig = function(readableIDToID) {
228
* @param {object} eventTestConfig
229
* @param {object} readableIDToID
230
*/
231
-const registerTestHandlers = function(eventTestConfig, readableIDToID) {
231
+const registerTestHandlers = function (eventTestConfig, readableIDToID) {
232
const runs = {dispatchCount: 0};
233
- const neverFire = function(readableID, registrationName) {
233
+ const neverFire = function (readableID, registrationName) {
234
runs.dispatchCount++;
235
expect('').toBe(
236
'Event type: ' +
@@ -243,7 +243,10 @@ const registerTestHandlers = function(eventTestConfig, readableIDToID) {
243
);
244
};
245
246
- const registerOneEventType = function(registrationName, eventTypeTestConfig) {
246
+ const registerOneEventType = function (
247
+ registrationName,
248
+ eventTypeTestConfig,
249
+ ) {
250
for (const readableID in eventTypeTestConfig) {
251
const nodeConfig = eventTypeTestConfig[readableID];
252
const id = readableIDToID[readableID];
@@ -252,7 +255,7 @@ const registerTestHandlers = function(eventTestConfig, readableIDToID) {
255
? neverFire.bind(null, readableID, registrationName)
256
: // We partially apply readableID and nodeConfig, as they change in the
257
// parent closure across iterations.
255
- function(rID, config, e) {
258
+ function (rID, config, e) {
259
expect(
260
rID +
261
'->' +
@@ -292,9 +295,9 @@ const registerTestHandlers = function(eventTestConfig, readableIDToID) {
295
return runs;
296
};
297
295
-const run = function(config, hierarchyConfig, nativeEventConfig) {
298
+const run = function (config, hierarchyConfig, nativeEventConfig) {
299
let max = NA;
297
- const searchForMax = function(nodeConfig) {
300
+ const searchForMax = function (nodeConfig) {
301
for (const readableID in nodeConfig) {
302
const order = nodeConfig[readableID].order;
303
max = order > max ? order : max;
@@ -408,8 +411,8 @@ describe('ResponderEventPlugin', () => {
411
412
EventBatching = require('react-native-renderer/src/legacy-events/EventBatching');
413
EventPluginUtils = require('react-native-renderer/src/legacy-events/EventPluginUtils');
411
- ResponderEventPlugin = require('react-native-renderer/src/legacy-events/ResponderEventPlugin')
412
- .default;
414
+ ResponderEventPlugin =
415
+ require('react-native-renderer/src/legacy-events/ResponderEventPlugin').default;
416
417
deleteAllListeners(GRANDPARENT_INST);
418
deleteAllListeners(PARENT_INST);
@@ -1379,8 +1382,8 @@ describe('ResponderEventPlugin', () => {
1382
// ResponderEventPlugin uses `getLowestCommonAncestor`
1383
const React = require('react');
1384
const ReactTestUtils = require('react-dom/test-utils');
1382
- const getLowestCommonAncestor = require('react-native-renderer/src/legacy-events/ResponderEventPlugin')
1383
- .getLowestCommonAncestor;
1385
+ const getLowestCommonAncestor =
1386
+ require('react-native-renderer/src/legacy-events/ResponderEventPlugin').getLowestCommonAncestor;
1387
// This works by accident and will likely break in the future.
1388
const ReactDOMComponentTree = require('react-dom-bindings/src/client/ReactDOMComponentTree');
1389
packages/react-native-renderer/src/__tests__/createReactNativeComponentClass-test.internal.js
+3
-2
@@ -18,8 +18,9 @@ describe('createReactNativeComponentClass', () => {
18
beforeEach(() => {
19
jest.resetModules();
20
21
- createReactNativeComponentClass = require('react-native/Libraries/ReactPrivate/ReactNativePrivateInterface')
22
- .ReactNativeViewConfigRegistry.register;
21
+ createReactNativeComponentClass =
22
+ require('react-native/Libraries/ReactPrivate/ReactNativePrivateInterface')
23
+ .ReactNativeViewConfigRegistry.register;
24
React = require('react');
25
ReactNative = require('react-native-renderer');
26
});
packages/react-native-renderer/src/legacy-events/EventBatching.js
+2
-2
@@ -25,7 +25,7 @@ let eventQueue: ?(Array<ReactSyntheticEvent> | ReactSyntheticEvent) = null;
25
* @param {?object} event Synthetic event to be dispatched.
26
* @private
27
*/
28
-const executeDispatchesAndRelease = function(event: ReactSyntheticEvent) {
28
+const executeDispatchesAndRelease = function (event: ReactSyntheticEvent) {
29
if (event) {
30
executeDispatchesInOrder(event);
31
@@ -35,7 +35,7 @@ const executeDispatchesAndRelease = function(event: ReactSyntheticEvent) {
35
}
36
};
37
// $FlowFixMe[missing-local-annot]
38
-const executeDispatchesAndReleaseTopLevel = function(e) {
38
+const executeDispatchesAndReleaseTopLevel = function (e) {
39
return executeDispatchesAndRelease(e);
40
};
41
packages/react-native-renderer/src/legacy-events/EventPluginUtils.js
+1
-1
@@ -32,7 +32,7 @@ export function setComponentTree(
32
33
let validateEventDispatches;
34
if (__DEV__) {
35
- validateEventDispatches = function(event) {
35
+ validateEventDispatches = function (event) {
36
const dispatchListeners = event._dispatchListeners;
37
const dispatchInstances = event._dispatchInstances;
38
packages/react-native-renderer/src/legacy-events/ReactGenericBatching.js
+2
-2
@@ -12,10 +12,10 @@
12
// scheduled work and instead do synchronous work.
13
14
// Defaults
15
-let batchedUpdatesImpl = function(fn, bookkeeping) {
15
+let batchedUpdatesImpl = function (fn, bookkeeping) {
16
return fn(bookkeeping);
17
};
18
-let discreteUpdatesImpl = function(fn, a, b, c, d) {
18
+let discreteUpdatesImpl = function (fn, a, b, c, d) {
19
return fn(a, b, c, d);
20
};
21
packages/react-native-renderer/src/legacy-events/ResponderEventPlugin.js
+3
-3
@@ -44,7 +44,7 @@ let responderInst = null;
44
*/
45
let trackedTouchCount = 0;
46
47
-const changeResponder = function(nextResponderInst, blockHostResponder) {
47
+const changeResponder = function (nextResponderInst, blockHostResponder) {
48
const oldResponderInst = responderInst;
49
responderInst = nextResponderInst;
50
if (ResponderEventPlugin.GlobalResponderHandler !== null) {
@@ -683,7 +683,7 @@ function noResponderTouches(nativeEvent) {
683
684
const ResponderEventPlugin = {
685
/* For unit testing only */
686
- _getResponder: function() {
686
+ _getResponder: function () {
687
return responderInst;
688
},
689
@@ -694,7 +694,7 @@ const ResponderEventPlugin = {
694
* `touchEnd`. On certain platforms, this means that a native scroll has
695
* assumed control and the original touch targets are destroyed.
696
*/
697
- extractEvents: function(
697
+ extractEvents: function (
698
topLevelType,
699
targetInst,
700
nativeEvent,
packages/react-native-renderer/src/legacy-events/ResponderSyntheticEvent.js
+1
-1
@@ -13,7 +13,7 @@ import SyntheticEvent from './SyntheticEvent';
13
* `ResponderEventPlugin` will populate it appropriately.
14
*/
15
const ResponderSyntheticEvent = SyntheticEvent.extend({
16
- touchHistory: function(nativeEvent) {
16
+ touchHistory: function (nativeEvent) {
17
return null; // Actually doesn't even look at the native event.
18
},
19
});
packages/react-native-renderer/src/legacy-events/SyntheticEvent.js
+8
-8
@@ -19,13 +19,13 @@ const EventInterface = {
19
type: null,
20
target: null,
21
// currentTarget is set when dispatching; no use in copying it here
22
- currentTarget: function() {
22
+ currentTarget: function () {
23
return null;
24
},
25
eventPhase: null,
26
bubbles: null,
27
cancelable: null,
28
- timeStamp: function(event) {
28
+ timeStamp: function (event) {
29
return event.timeStamp || Date.now();
30
},
31
defaultPrevented: null,
@@ -113,7 +113,7 @@ function SyntheticEvent(
113
}
114
115
assign(SyntheticEvent.prototype, {
116
- preventDefault: function() {
116
+ preventDefault: function () {
117
this.defaultPrevented = true;
118
const event = this.nativeEvent;
119
if (!event) {
@@ -128,7 +128,7 @@ assign(SyntheticEvent.prototype, {
128
this.isDefaultPrevented = functionThatReturnsTrue;
129
},
130
131
- stopPropagation: function() {
131
+ stopPropagation: function () {
132
const event = this.nativeEvent;
133
if (!event) {
134
return;
@@ -153,7 +153,7 @@ assign(SyntheticEvent.prototype, {
153
* them back into the pool. This allows a way to hold onto a reference that
154
* won't be added back into the pool.
155
*/
156
- persist: function() {
156
+ persist: function () {
157
this.isPersistent = functionThatReturnsTrue;
158
},
159
@@ -167,7 +167,7 @@ assign(SyntheticEvent.prototype, {
167
/**
168
* `PooledClass` looks for `destructor` on each instance it releases.
169
*/
170
- destructor: function() {
170
+ destructor: function () {
171
const Interface = this.constructor.Interface;
172
for (const propName in Interface) {
173
if (__DEV__) {
@@ -228,10 +228,10 @@ SyntheticEvent.Interface = EventInterface;
228
/**
229
* Helper to reduce boilerplate when creating subclasses.
230
*/
231
-SyntheticEvent.extend = function(Interface) {
231
+SyntheticEvent.extend = function (Interface) {
232
const Super = this;
233
234
- const E = function() {};
234
+ const E = function () {};
235
E.prototype = Super.prototype;
236
const prototype = new E();
237
packages/react-noop-renderer/src/createReactNoop.js
+1
-3
@@ -959,9 +959,7 @@ function createReactNoop(reconciler: Function, useMutation: boolean) {
959
return Scheduler.unstable_clearYields();
960
},
961
962
- flushWithHostCounters(
963
- fn: () => void,
964
- ):
962
+ flushWithHostCounters(fn: () => void):
963
| {
964
hostDiffCounter: number,
965
hostUpdateCounter: number,
packages/react-reconciler/src/ReactChildFiber.js
+3
-4
@@ -187,7 +187,7 @@ function coerceRef(
187
) {
188
return current.ref;
189
}
190
- const ref = function(value: mixed) {
190
+ const ref = function (value: mixed) {
191
const refs = resolvedInst.refs;
192
if (value === null) {
193
delete refs[stringRef];
@@ -1354,9 +1354,8 @@ function createChildReconciler(
1354
return reconcileChildFibers;
1355
}
1356
1357
-export const reconcileChildFibers: ChildReconciler = createChildReconciler(
1358
- true,
1359
-);
1357
+export const reconcileChildFibers: ChildReconciler =
1358
+ createChildReconciler(true);
1359
export const mountChildFibers: ChildReconciler = createChildReconciler(false);
1360
1361
export function cloneChildFibers(
packages/react-reconciler/src/ReactFiber.js
+1
-1
@@ -225,7 +225,7 @@ function FiberNode(
225
// is faster.
226
// 5) It should be easy to port this to a C struct and keep a C implementation
227
// compatible.
228
-const createFiber = function(
228
+const createFiber = function (
229
tag: WorkTag,
230
pendingProps: mixed,
231
key: null | string,
packages/react-reconciler/src/ReactFiberBeginWork.js
+32
-35
@@ -763,9 +763,8 @@ function updateOffscreenComponent(
763
// and resume this tree later.
764
765
// Schedule this fiber to re-render at Offscreen priority
766
- workInProgress.lanes = workInProgress.childLanes = laneToLanes(
767
- OffscreenLane,
768
- );
766
+ workInProgress.lanes = workInProgress.childLanes =
767
+ laneToLanes(OffscreenLane);
768
769
// Include the base lanes from the last render
770
const nextBaseLanes =
@@ -1483,7 +1482,8 @@ function updateHostRoot(
1482
isDehydrated: false,
1483
cache: nextState.cache,
1484
};
1486
- const updateQueue: UpdateQueue<RootState> = (workInProgress.updateQueue: any);
1485
+ const updateQueue: UpdateQueue<RootState> =
1486
+ (workInProgress.updateQueue: any);
1487
// `baseState` can always be the last state because the root doesn't
1488
// have reducer functions so it doesn't need rebasing.
1489
updateQueue.baseState = overrideState;
@@ -1707,9 +1707,8 @@ function mountLazyComponent(
1707
case FunctionComponent: {
1708
if (__DEV__) {
1709
validateFunctionComponentInDev(workInProgress, Component);
1710
- workInProgress.type = Component = resolveFunctionForHotReloading(
1711
- Component,
1712
- );
1710
+ workInProgress.type = Component =
1711
+ resolveFunctionForHotReloading(Component);
1712
}
1713
child = updateFunctionComponent(
1714
null,
@@ -1722,9 +1721,8 @@ function mountLazyComponent(
1721
}
1722
case ClassComponent: {
1723
if (__DEV__) {
1725
- workInProgress.type = Component = resolveClassForHotReloading(
1726
- Component,
1727
- );
1724
+ workInProgress.type = Component =
1725
+ resolveClassForHotReloading(Component);
1726
}
1727
child = updateClassComponent(
1728
null,
@@ -1737,9 +1735,8 @@ function mountLazyComponent(
1735
}
1736
case ForwardRef: {
1737
if (__DEV__) {
1740
- workInProgress.type = Component = resolveForwardRefForHotReloading(
1741
- Component,
1742
- );
1738
+ workInProgress.type = Component =
1739
+ resolveForwardRefForHotReloading(Component);
1740
}
1741
child = updateForwardRef(
1742
null,
@@ -2270,15 +2267,15 @@ function updateSuspenseComponent(
2267
renderLanes,
2268
);
2269
const primaryChildFragment: Fiber = (workInProgress.child: any);
2273
- primaryChildFragment.memoizedState = mountSuspenseOffscreenState(
2274
- renderLanes,
2275
- );
2270
+ primaryChildFragment.memoizedState =
2271
+ mountSuspenseOffscreenState(renderLanes);
2272
workInProgress.memoizedState = SUSPENDED_MARKER;
2273
if (enableTransitionTracing) {
2274
const currentTransitions = getPendingTransitions();
2275
if (currentTransitions !== null) {
2276
const parentMarkerInstances = getMarkerInstances();
2281
- const offscreenQueue: OffscreenQueue | null = (primaryChildFragment.updateQueue: any);
2277
+ const offscreenQueue: OffscreenQueue | null =
2278
+ (primaryChildFragment.updateQueue: any);
2279
if (offscreenQueue === null) {
2280
const newOffscreenQueue: OffscreenQueue = {
2281
transitions: currentTransitions,
@@ -2309,9 +2306,8 @@ function updateSuspenseComponent(
2306
renderLanes,
2307
);
2308
const primaryChildFragment: Fiber = (workInProgress.child: any);
2312
- primaryChildFragment.memoizedState = mountSuspenseOffscreenState(
2313
- renderLanes,
2314
- );
2309
+ primaryChildFragment.memoizedState =
2310
+ mountSuspenseOffscreenState(renderLanes);
2311
workInProgress.memoizedState = SUSPENDED_MARKER;
2312
2313
// TODO: Transition Tracing is not yet implemented for CPU Suspense.
@@ -2377,8 +2373,10 @@ function updateSuspenseComponent(
2373
const currentTransitions = getPendingTransitions();
2374
if (currentTransitions !== null) {
2375
const parentMarkerInstances = getMarkerInstances();
2380
- const offscreenQueue: OffscreenQueue | null = (primaryChildFragment.updateQueue: any);
2381
- const currentOffscreenQueue: OffscreenQueue | null = (current.updateQueue: any);
2376
+ const offscreenQueue: OffscreenQueue | null =
2377
+ (primaryChildFragment.updateQueue: any);
2378
+ const currentOffscreenQueue: OffscreenQueue | null =
2379
+ (current.updateQueue: any);
2380
if (offscreenQueue === null) {
2381
const newOffscreenQueue: OffscreenQueue = {
2382
transitions: currentTransitions,
@@ -2804,9 +2802,8 @@ function updateDehydratedSuspenseComponent(
2802
// client side render instead.
2803
let digest, message, stack;
2804
if (__DEV__) {
2807
- ({digest, message, stack} = getSuspenseInstanceFallbackErrorDetails(
2808
- suspenseInstance,
2809
- ));
2805
+ ({digest, message, stack} =
2806
+ getSuspenseInstanceFallbackErrorDetails(suspenseInstance));
2807
} else {
2808
({digest} = getSuspenseInstanceFallbackErrorDetails(suspenseInstance));
2809
}
@@ -2989,17 +2986,17 @@ function updateDehydratedSuspenseComponent(
2986
2987
const nextPrimaryChildren = nextProps.children;
2988
const nextFallbackChildren = nextProps.fallback;
2992
- const fallbackChildFragment = mountSuspenseFallbackAfterRetryWithoutHydrating(
2993
- current,
2994
- workInProgress,
2995
- nextPrimaryChildren,
2996
- nextFallbackChildren,
2997
- renderLanes,
2998
- );
2989
+ const fallbackChildFragment =
2990
+ mountSuspenseFallbackAfterRetryWithoutHydrating(
2991
+ current,
2992
+ workInProgress,
2993
+ nextPrimaryChildren,
2994
+ nextFallbackChildren,
2995
+ renderLanes,
2996
+ );
2997
const primaryChildFragment: Fiber = (workInProgress.child: any);
3000
- primaryChildFragment.memoizedState = mountSuspenseOffscreenState(
3001
- renderLanes,
3002
- );
2998
+ primaryChildFragment.memoizedState =
2999
+ mountSuspenseOffscreenState(renderLanes);
3000
workInProgress.memoizedState = SUSPENDED_MARKER;
3001
return fallbackChildFragment;
3002
}
packages/react-reconciler/src/ReactFiberClassComponent.js
+3
-3
@@ -103,7 +103,7 @@ if (__DEV__) {
103
104
const didWarnOnInvalidCallback = new Set();
105
106
- warnOnInvalidCallback = function(callback: mixed, callerName: string) {
106
+ warnOnInvalidCallback = function (callback: mixed, callerName: string) {
107
if (callback === null || typeof callback === 'function') {
108
return;
109
}
@@ -119,7 +119,7 @@ if (__DEV__) {
119
}
120
};
121
122
- warnOnUndefinedDerivedState = function(type: any, partialState: any) {
122
+ warnOnUndefinedDerivedState = function (type: any, partialState: any) {
123
if (partialState === undefined) {
124
const componentName = getComponentNameFromType(type) || 'Component';
125
if (!didWarnAboutUndefinedDerivedState.has(componentName)) {
@@ -140,7 +140,7 @@ if (__DEV__) {
140
// exception.
141
Object.defineProperty(fakeInternalInstance, '_processChildContext', {
142
enumerable: false,
143
- value: function(): empty {
143
+ value: function (): empty {
144
throw new Error(
145
'_processChildContext is not available in React 16+. This likely ' +
146
'means you have multiple copies of React and are attempting to nest ' +
packages/react-reconciler/src/ReactFiberClassUpdateQueue.js
+4
-4
@@ -636,7 +636,8 @@ export function processUpdateQueue<State>(
636
const lastPendingUpdate = pendingQueue;
637
// Intentionally unsound. Pending updates form a circular list, but we
638
// unravel them when transferring them to the base queue.
639
- const firstPendingUpdate = ((lastPendingUpdate.next: any): Update<State>);
639
+ const firstPendingUpdate =
640
+ ((lastPendingUpdate.next: any): Update<State>);
641
lastPendingUpdate.next = null;
642
update = firstPendingUpdate;
643
queue.lastBaseUpdate = lastPendingUpdate;
@@ -707,9 +708,8 @@ export function deferHiddenCallbacks<State>(
708
if (existingHiddenCallbacks === null) {
709
updateQueue.shared.hiddenCallbacks = newHiddenCallbacks;
710
} else {
710
- updateQueue.shared.hiddenCallbacks = existingHiddenCallbacks.concat(
711
- newHiddenCallbacks,
712
- );
711
+ updateQueue.shared.hiddenCallbacks =
712
+ existingHiddenCallbacks.concat(newHiddenCallbacks);
713
}
714
}
715
}
packages/react-reconciler/src/ReactFiberCommitWork.js
+23
-12
@@ -247,7 +247,7 @@ export function reportUncaughtErrorInDEV(error: mixed) {
247
}
248
}
249
250
-const callComponentWillUnmountWithTimer = function(
250
+const callComponentWillUnmountWithTimer = function (
251
current: Fiber,
252
instance: any,
253
) {
@@ -510,7 +510,8 @@ function commitBeforeMutationEffectsOnFiber(finishedWork: Fiber) {
510
prevState,
511
);
512
if (__DEV__) {
513
- const didWarnSet = ((didWarnAboutUndefinedSnapshotBeforeUpdate: any): Set<mixed>);
513
+ const didWarnSet =
514
+ ((didWarnAboutUndefinedSnapshotBeforeUpdate: any): Set<mixed>);
515
if (snapshot === undefined && !didWarnSet.has(finishedWork.type)) {
516
didWarnSet.add(finishedWork.type);
517
console.error(
@@ -575,7 +576,8 @@ function commitHookEffectListUnmount(
576
finishedWork: Fiber,
577
nearestMountedAncestor: Fiber | null,
578
) {
578
- const updateQueue: FunctionComponentUpdateQueue | null = (finishedWork.updateQueue: any);
579
+ const updateQueue: FunctionComponentUpdateQueue | null =
580
+ (finishedWork.updateQueue: any);
581
const lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;
582
if (lastEffect !== null) {
583
const firstEffect = lastEffect.next;
@@ -621,7 +623,8 @@ function commitHookEffectListUnmount(
623
}
624
625
function commitHookEffectListMount(flags: HookFlags, finishedWork: Fiber) {
624
- const updateQueue: FunctionComponentUpdateQueue | null = (finishedWork.updateQueue: any);
626
+ const updateQueue: FunctionComponentUpdateQueue | null =
627
+ (finishedWork.updateQueue: any);
628
const lastEffect = updateQueue !== null ? updateQueue.lastEffect : null;
629
if (lastEffect !== null) {
630
const firstEffect = lastEffect.next;
@@ -709,7 +712,8 @@ function commitHookEffectListMount(flags: HookFlags, finishedWork: Fiber) {
712
}
713
714
function commitUseEffectEventMount(finishedWork: Fiber) {
712
- const updateQueue: FunctionComponentUpdateQueue | null = (finishedWork.updateQueue: any);
715
+ const updateQueue: FunctionComponentUpdateQueue | null =
716
+ (finishedWork.updateQueue: any);
717
const eventPayloads = updateQueue !== null ? updateQueue.events : null;
718
if (eventPayloads !== null) {
719
for (let ii = 0; ii < eventPayloads.length; ii++) {
@@ -913,7 +917,8 @@ function commitClassLayoutLifecycles(
917
function commitClassCallbacks(finishedWork: Fiber) {
918
// TODO: I think this is now always non-null by the time it reaches the
919
// commit phase. Consider removing the type check.
916
- const updateQueue: UpdateQueue<mixed> | null = (finishedWork.updateQueue: any);
920
+ const updateQueue: UpdateQueue<mixed> | null =
921
+ (finishedWork.updateQueue: any);
922
if (updateQueue !== null) {
923
const instance = finishedWork.stateNode;
924
if (__DEV__) {
@@ -1080,7 +1085,8 @@ function commitLayoutEffectOnFiber(
1085
if (flags & Callback) {
1086
// TODO: I think this is now always non-null by the time it reaches the
1087
// commit phase. Consider removing the type check.
1083
- const updateQueue: UpdateQueue<mixed> | null = (finishedWork.updateQueue: any);
1088
+ const updateQueue: UpdateQueue<mixed> | null =
1089
+ (finishedWork.updateQueue: any);
1090
if (updateQueue !== null) {
1091
let instance = null;
1092
if (finishedWork.child !== null) {
@@ -2166,7 +2172,8 @@ function commitDeletionEffectsOnFiber(
2172
case MemoComponent:
2173
case SimpleMemoComponent: {
2174
if (!offscreenSubtreeWasHidden) {
2169
- const updateQueue: FunctionComponentUpdateQueue | null = (deletedFiber.updateQueue: any);
2175
+ const updateQueue: FunctionComponentUpdateQueue | null =
2176
+ (deletedFiber.updateQueue: any);
2177
if (updateQueue !== null) {
2178
const lastEffect = updateQueue.lastEffect;
2179
if (lastEffect !== null) {
@@ -2588,7 +2595,8 @@ function commitMutationEffectsOnFiber(
2595
}
2596
2597
if (flags & Callback && offscreenSubtreeIsHidden) {
2591
- const updateQueue: UpdateQueue<mixed> | null = (finishedWork.updateQueue: any);
2598
+ const updateQueue: UpdateQueue<mixed> | null =
2599
+ (finishedWork.updateQueue: any);
2600
if (updateQueue !== null) {
2601
deferHiddenCallbacks(updateQueue);
2602
}
@@ -2679,7 +2687,8 @@ function commitMutationEffectsOnFiber(
2687
current !== null ? current.memoizedProps : newProps;
2688
const type = finishedWork.type;
2689
// TODO: Type the updateQueue to be specific to host components.
2682
- const updatePayload: null | UpdatePayload = (finishedWork.updateQueue: any);
2690
+ const updatePayload: null | UpdatePayload =
2691
+ (finishedWork.updateQueue: any);
2692
finishedWork.updateQueue = null;
2693
if (updatePayload !== null) {
2694
try {
@@ -2897,7 +2906,8 @@ function commitMutationEffectsOnFiber(
2906
2907
// TODO: Move to passive phase
2908
if (flags & Update) {
2900
- const offscreenQueue: OffscreenQueue | null = (finishedWork.updateQueue: any);
2909
+ const offscreenQueue: OffscreenQueue | null =
2910
+ (finishedWork.updateQueue: any);
2911
if (offscreenQueue !== null) {
2912
const wakeables = offscreenQueue.wakeables;
2913
if (wakeables !== null) {
@@ -3130,7 +3140,8 @@ export function reappearLayoutEffects(
3140
3141
// Commit any callbacks that would have fired while the component
3142
// was hidden.
3133
- const updateQueue: UpdateQueue<mixed> | null = (finishedWork.updateQueue: any);
3143
+ const updateQueue: UpdateQueue<mixed> | null =
3144
+ (finishedWork.updateQueue: any);
3145
if (updateQueue !== null) {
3146
commitHiddenCallbacks(updateQueue, instance);
3147
}
packages/react-reconciler/src/ReactFiberCompleteWork.js
+35
-23
@@ -211,7 +211,7 @@ let updateHostText;
211
if (supportsMutation) {
212
// Mutation mode
213
214
- appendAllChildren = function(
214
+ appendAllChildren = function (
215
parent: Instance,
216
workInProgress: Fiber,
217
needsVisibilityToggle: boolean,
@@ -255,10 +255,13 @@ if (supportsMutation) {
255
}
256
};
257
258
- updateHostContainer = function(current: null | Fiber, workInProgress: Fiber) {
258
+ updateHostContainer = function (
259
+ current: null | Fiber,
260
+ workInProgress: Fiber,
261
+ ) {
262
// Noop
263
};
261
- updateHostComponent = function(
264
+ updateHostComponent = function (
265
current: Fiber,
266
workInProgress: Fiber,
267
type: Type,
@@ -297,7 +300,7 @@ if (supportsMutation) {
300
markUpdate(workInProgress);
301
}
302
};
300
- updateHostText = function(
303
+ updateHostText = function (
304
current: Fiber,
305
workInProgress: Fiber,
306
oldText: string,
@@ -311,7 +314,7 @@ if (supportsMutation) {
314
} else if (supportsPersistence) {
315
// Persistent host tree mode
316
314
- appendAllChildren = function(
317
+ appendAllChildren = function (
318
parent: Instance,
319
workInProgress: Fiber,
320
needsVisibilityToggle: boolean,
@@ -378,7 +381,7 @@ if (supportsMutation) {
381
};
382
383
// An unfortunate fork of appendAllChildren because we have two different parent types.
381
- const appendAllChildrenToContainer = function(
384
+ const appendAllChildrenToContainer = function (
385
containerChildSet: ChildSet,
386
workInProgress: Fiber,
387
needsVisibilityToggle: boolean,
@@ -450,7 +453,10 @@ if (supportsMutation) {
453
node = node.sibling;
454
}
455
};
453
- updateHostContainer = function(current: null | Fiber, workInProgress: Fiber) {
456
+ updateHostContainer = function (
457
+ current: null | Fiber,
458
+ workInProgress: Fiber,
459
+ ) {
460
const portalOrRoot: {
461
containerInfo: Container,
462
pendingChildren: ChildSet,
@@ -470,7 +476,7 @@ if (supportsMutation) {
476
finalizeContainerChildren(container, newChildSet);
477
}
478
};
473
- updateHostComponent = function(
479
+ updateHostComponent = function (
480
current: Fiber,
481
workInProgress: Fiber,
482
type: Type,
@@ -531,7 +537,7 @@ if (supportsMutation) {
537
appendAllChildren(newInstance, workInProgress, false, false);
538
}
539
};
534
- updateHostText = function(
540
+ updateHostText = function (
541
current: Fiber,
542
workInProgress: Fiber,
543
oldText: string,
@@ -556,10 +562,13 @@ if (supportsMutation) {
562
};
563
} else {
564
// No host operations
559
- updateHostContainer = function(current: null | Fiber, workInProgress: Fiber) {
565
+ updateHostContainer = function (
566
+ current: null | Fiber,
567
+ workInProgress: Fiber,
568
+ ) {
569
// Noop
570
};
562
- updateHostComponent = function(
571
+ updateHostComponent = function (
572
current: Fiber,
573
workInProgress: Fiber,
574
type: Type,
@@ -567,7 +576,7 @@ if (supportsMutation) {
576
) {
577
// Noop
578
};
570
- updateHostText = function(
579
+ updateHostText = function (
580
current: Fiber,
581
workInProgress: Fiber,
582
oldText: string,
@@ -810,7 +819,8 @@ function completeDehydratedSuspenseBoundary(
819
const primaryChildFragment = workInProgress.child;
820
if (primaryChildFragment !== null) {
821
// $FlowFixMe Flow doesn't support type casting in combination with the -= operator
813
- workInProgress.treeBaseDuration -= ((primaryChildFragment.treeBaseDuration: any): number);
822
+ workInProgress.treeBaseDuration -=
823
+ ((primaryChildFragment.treeBaseDuration: any): number);
824
}
825
}
826
}
@@ -839,7 +849,8 @@ function completeDehydratedSuspenseBoundary(
849
const primaryChildFragment = workInProgress.child;
850
if (primaryChildFragment !== null) {
851
// $FlowFixMe Flow doesn't support type casting in combination with the -= operator
842
- workInProgress.treeBaseDuration -= ((primaryChildFragment.treeBaseDuration: any): number);
852
+ workInProgress.treeBaseDuration -=
853
+ ((primaryChildFragment.treeBaseDuration: any): number);
854
}
855
}
856
}
@@ -1170,11 +1181,12 @@ function completeWork(
1181
(current.memoizedState !== null &&
1182
current.memoizedState.dehydrated !== null)
1183
) {
1173
- const fallthroughToNormalSuspensePath = completeDehydratedSuspenseBoundary(
1174
- current,
1175
- workInProgress,
1176
- nextState,
1177
- );
1184
+ const fallthroughToNormalSuspensePath =
1185
+ completeDehydratedSuspenseBoundary(
1186
+ current,
1187
+ workInProgress,
1188
+ nextState,
1189
+ );
1190
if (!fallthroughToNormalSuspensePath) {
1191
if (workInProgress.flags & ShouldCapture) {
1192
// Special case. There were remaining unhydrated nodes. We treat
@@ -1281,7 +1293,8 @@ function completeWork(
1293
const primaryChildFragment = workInProgress.child;
1294
if (primaryChildFragment !== null) {
1295
// $FlowFixMe Flow doesn't support type casting in combination with the -= operator
1284
- workInProgress.treeBaseDuration -= ((primaryChildFragment.treeBaseDuration: any): number);
1296
+ workInProgress.treeBaseDuration -=
1297
+ ((primaryChildFragment.treeBaseDuration: any): number);
1298
}
1299
}
1300
}
@@ -1511,9 +1524,8 @@ function completeWork(
1524
ForceSuspenseFallback,
1525
);
1526
} else {
1514
- suspenseContext = setDefaultShallowSuspenseListContext(
1515
- suspenseContext,
1516
- );
1527
+ suspenseContext =
1528
+ setDefaultShallowSuspenseListContext(suspenseContext);
1529
}
1530
pushSuspenseListContext(workInProgress, suspenseContext);
1531
// Do a pass over the next row.
packages/react-reconciler/src/ReactFiberContext.js
+5
-5
@@ -30,9 +30,8 @@ if (__DEV__) {
30
}
31
32
// A cursor to the current merged context object on the stack.
33
-const contextStackCursor: StackCursor<Object> = createCursor(
34
- emptyContextObject,
35
-);
33
+const contextStackCursor: StackCursor<Object> =
34
+ createCursor(emptyContextObject);
35
// A cursor to a boolean indicating whether the context has changed.
36
const didPerformWorkStackCursor: StackCursor<boolean> = createCursor(false);
37
// Keep track of the previous context object that was on the stack.
@@ -207,8 +206,9 @@ function processChildContext(
206
for (const contextKey in childContext) {
207
if (!(contextKey in childContextTypes)) {
208
throw new Error(
210
- `${getComponentNameFromFiber(fiber) ||
211
- 'Unknown'}.getChildContext(): key "${contextKey}" is not defined in childContextTypes.`,
209
+ `${
210
+ getComponentNameFromFiber(fiber) || 'Unknown'
211
+ }.getChildContext(): key "${contextKey}" is not defined in childContextTypes.`,
212
);
213
}
214
}
packages/react-reconciler/src/ReactFiberHiddenContext.js
+4
-6
@@ -27,12 +27,10 @@ type HiddenContext = {
27
28
// TODO: This isn't being used yet, but it's intended to replace the
29
// InvisibleParentContext that is currently managed by SuspenseContext.
30
-export const currentTreeHiddenStackCursor: StackCursor<HiddenContext | null> = createCursor(
31
- null,
32
-);
33
-export const prevRenderLanesStackCursor: StackCursor<Lanes> = createCursor(
34
- NoLanes,
35
-);
30
+export const currentTreeHiddenStackCursor: StackCursor<HiddenContext | null> =
31
+ createCursor(null);
32
+export const prevRenderLanesStackCursor: StackCursor<Lanes> =
33
+ createCursor(NoLanes);
34
35
export function pushHiddenContext(fiber: Fiber, context: HiddenContext): void {
36
const prevRenderLanes = getRenderLanes();
packages/react-reconciler/src/ReactFiberHooks.js
+163
-151
@@ -968,7 +968,8 @@ function use<T>(usable: Usable<T>): T {
968
function useMemoCache(size: number): Array<any> {
969
let memoCache = null;
970
// Fast-path, load memo cache from wip fiber if already prepared
971
- let updateQueue: FunctionComponentUpdateQueue | null = (currentlyRenderingFiber.updateQueue: any);
971
+ let updateQueue: FunctionComponentUpdateQueue | null =
972
+ (currentlyRenderingFiber.updateQueue: any);
973
if (updateQueue !== null) {
974
memoCache = updateQueue.memoCache;
975
}
@@ -976,7 +977,8 @@ function useMemoCache(size: number): Array<any> {
977
if (memoCache == null) {
978
const current: Fiber | null = currentlyRenderingFiber.alternate;
979
if (current !== null) {
979
- const currentUpdateQueue: FunctionComponentUpdateQueue | null = (current.updateQueue: any);
980
+ const currentUpdateQueue: FunctionComponentUpdateQueue | null =
981
+ (current.updateQueue: any);
982
if (currentUpdateQueue !== null) {
983
const currentMemoCache: ?MemoCache = currentUpdateQueue.memoCache;
984
if (currentMemoCache != null) {
@@ -1739,7 +1741,8 @@ function pushStoreConsistencyCheck<T>(
1741
getSnapshot,
1742
value: renderedSnapshot,
1743
};
1742
- let componentUpdateQueue: null | FunctionComponentUpdateQueue = (currentlyRenderingFiber.updateQueue: any);
1744
+ let componentUpdateQueue: null | FunctionComponentUpdateQueue =
1745
+ (currentlyRenderingFiber.updateQueue: any);
1746
if (componentUpdateQueue === null) {
1747
componentUpdateQueue = createFunctionComponentUpdateQueue();
1748
currentlyRenderingFiber.updateQueue = (componentUpdateQueue: any);
@@ -1826,13 +1829,8 @@ function mountState<S>(
1829
lastRenderedState: (initialState: any),
1830
};
1831
hook.queue = queue;
1829
- const dispatch: Dispatch<
1830
- BasicStateAction<S>,
1831
- > = (queue.dispatch = (dispatchSetState.bind(
1832
- null,
1833
- currentlyRenderingFiber,
1834
- queue,
1835
- ): any));
1832
+ const dispatch: Dispatch<BasicStateAction<S>> = (queue.dispatch =
1833
+ (dispatchSetState.bind(null, currentlyRenderingFiber, queue): any));
1834
return [hook.memoizedState, dispatch];
1835
}
1836
@@ -1862,7 +1860,8 @@ function pushEffect(
1860
// Circular
1861
next: (null: any),
1862
};
1865
- let componentUpdateQueue: null | FunctionComponentUpdateQueue = (currentlyRenderingFiber.updateQueue: any);
1863
+ let componentUpdateQueue: null | FunctionComponentUpdateQueue =
1864
+ (currentlyRenderingFiber.updateQueue: any);
1865
if (componentUpdateQueue === null) {
1866
componentUpdateQueue = createFunctionComponentUpdateQueue();
1867
currentlyRenderingFiber.updateQueue = (componentUpdateQueue: any);
@@ -2056,7 +2055,8 @@ function useEffectEventImpl<Args, Return, F: (...Array<Args>) => Return>(
2055
payload: EventFunctionPayload<Args, Return, F>,
2056
) {
2057
currentlyRenderingFiber.flags |= UpdateEffect;
2059
- let componentUpdateQueue: null | FunctionComponentUpdateQueue = (currentlyRenderingFiber.updateQueue: any);
2058
+ let componentUpdateQueue: null | FunctionComponentUpdateQueue =
2059
+ (currentlyRenderingFiber.updateQueue: any);
2060
if (componentUpdateQueue === null) {
2061
componentUpdateQueue = createFunctionComponentUpdateQueue();
2062
currentlyRenderingFiber.updateQueue = (componentUpdateQueue: any);
@@ -2643,7 +2643,8 @@ function dispatchSetState<S, A>(
2643
let prevDispatcher;
2644
if (__DEV__) {
2645
prevDispatcher = ReactCurrentDispatcher.current;
2646
- ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
2646
+ ReactCurrentDispatcher.current =
2647
+ InvalidNestedHooksDispatcherOnUpdateInDEV;
2648
}
2649
try {
2650
const currentState: S = (queue.lastRenderedState: any);
@@ -2699,7 +2700,8 @@ function enqueueRenderPhaseUpdate<S, A>(
2700
// This is a render phase update. Stash it in a lazily-created map of
2701
// queue -> linked list of updates. After this render pass, we'll restart
2702
// and apply the stashed updates on top of the work-in-progress hook.
2702
- didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = true;
2703
+ didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate =
2704
+ true;
2705
const pending = queue.pending;
2706
if (pending === null) {
2707
// This is the first update. Create a circular list.
@@ -3047,11 +3049,12 @@ if (__DEV__) {
3049
},
3050
};
3051
if (enableCache) {
3050
- (HooksDispatcherOnMountInDEV: Dispatcher).useCacheRefresh = function useCacheRefresh() {
3051
- currentHookNameInDev = 'useCacheRefresh';
3052
- mountHookTypesDev();
3053
- return mountRefresh();
3054
- };
3052
+ (HooksDispatcherOnMountInDEV: Dispatcher).useCacheRefresh =
3053
+ function useCacheRefresh() {
3054
+ currentHookNameInDev = 'useCacheRefresh';
3055
+ mountHookTypesDev();
3056
+ return mountRefresh();
3057
+ };
3058
}
3059
if (enableUseHook) {
3060
(HooksDispatcherOnMountInDEV: Dispatcher).use = use;
@@ -3060,15 +3063,14 @@ if (__DEV__) {
3063
(HooksDispatcherOnMountInDEV: Dispatcher).useMemoCache = useMemoCache;
3064
}
3065
if (enableUseEffectEventHook) {
3063
- (HooksDispatcherOnMountInDEV: Dispatcher).useEffectEvent = function useEffectEvent<
3064
- Args,
3065
- Return,
3066
- F: (...Array<Args>) => Return,
3067
- >(callback: F): F {
3068
- currentHookNameInDev = 'useEffectEvent';
3069
- mountHookTypesDev();
3070
- return mountEvent(callback);
3071
- };
3066
+ (HooksDispatcherOnMountInDEV: Dispatcher).useEffectEvent =
3067
+ function useEffectEvent<Args, Return, F: (...Array<Args>) => Return>(
3068
+ callback: F,
3069
+ ): F {
3070
+ currentHookNameInDev = 'useEffectEvent';
3071
+ mountHookTypesDev();
3072
+ return mountEvent(callback);
3073
+ };
3074
}
3075
3076
HooksDispatcherOnMountWithHookTypesInDEV = {
@@ -3202,28 +3204,29 @@ if (__DEV__) {
3204
},
3205
};
3206
if (enableCache) {
3205
- (HooksDispatcherOnMountWithHookTypesInDEV: Dispatcher).useCacheRefresh = function useCacheRefresh() {
3206
- currentHookNameInDev = 'useCacheRefresh';
3207
- updateHookTypesDev();
3208
- return mountRefresh();
3209
- };
3207
+ (HooksDispatcherOnMountWithHookTypesInDEV: Dispatcher).useCacheRefresh =
3208
+ function useCacheRefresh() {
3209
+ currentHookNameInDev = 'useCacheRefresh';
3210
+ updateHookTypesDev();
3211
+ return mountRefresh();
3212
+ };
3213
}
3214
if (enableUseHook) {
3215
(HooksDispatcherOnMountWithHookTypesInDEV: Dispatcher).use = use;
3216
}
3217
if (enableUseMemoCacheHook) {
3215
- (HooksDispatcherOnMountWithHookTypesInDEV: Dispatcher).useMemoCache = useMemoCache;
3218
+ (HooksDispatcherOnMountWithHookTypesInDEV: Dispatcher).useMemoCache =
3219
+ useMemoCache;
3220
}
3221
if (enableUseEffectEventHook) {
3218
- (HooksDispatcherOnMountWithHookTypesInDEV: Dispatcher).useEffectEvent = function useEffectEvent<
3219
- Args,
3220
- Return,
3221
- F: (...Array<Args>) => Return,
3222
- >(callback: F): F {
3223
- currentHookNameInDev = 'useEffectEvent';
3224
- updateHookTypesDev();
3225
- return mountEvent(callback);
3226
- };
3222
+ (HooksDispatcherOnMountWithHookTypesInDEV: Dispatcher).useEffectEvent =
3223
+ function useEffectEvent<Args, Return, F: (...Array<Args>) => Return>(
3224
+ callback: F,
3225
+ ): F {
3226
+ currentHookNameInDev = 'useEffectEvent';
3227
+ updateHookTypesDev();
3228
+ return mountEvent(callback);
3229
+ };
3230
}
3231
3232
HooksDispatcherOnUpdateInDEV = {
@@ -3277,7 +3280,8 @@ if (__DEV__) {
3280
currentHookNameInDev = 'useMemo';
3281
updateHookTypesDev();
3282
const prevDispatcher = ReactCurrentDispatcher.current;
3280
- ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
3283
+ ReactCurrentDispatcher.current =
3284
+ InvalidNestedHooksDispatcherOnUpdateInDEV;
3285
try {
3286
return updateMemo(create, deps);
3287
} finally {
@@ -3292,7 +3296,8 @@ if (__DEV__) {
3296
currentHookNameInDev = 'useReducer';
3297
updateHookTypesDev();
3298
const prevDispatcher = ReactCurrentDispatcher.current;
3295
- ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
3299
+ ReactCurrentDispatcher.current =
3300
+ InvalidNestedHooksDispatcherOnUpdateInDEV;
3301
try {
3302
return updateReducer(reducer, initialArg, init);
3303
} finally {
@@ -3310,7 +3315,8 @@ if (__DEV__) {
3315
currentHookNameInDev = 'useState';
3316
updateHookTypesDev();
3317
const prevDispatcher = ReactCurrentDispatcher.current;
3313
- ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
3318
+ ReactCurrentDispatcher.current =
3319
+ InvalidNestedHooksDispatcherOnUpdateInDEV;
3320
try {
3321
return updateState(initialState);
3322
} finally {
@@ -3357,11 +3363,12 @@ if (__DEV__) {
3363
},
3364
};
3365
if (enableCache) {
3360
- (HooksDispatcherOnUpdateInDEV: Dispatcher).useCacheRefresh = function useCacheRefresh() {
3361
- currentHookNameInDev = 'useCacheRefresh';
3362
- updateHookTypesDev();
3363
- return updateRefresh();
3364
- };
3366
+ (HooksDispatcherOnUpdateInDEV: Dispatcher).useCacheRefresh =
3367
+ function useCacheRefresh() {
3368
+ currentHookNameInDev = 'useCacheRefresh';
3369
+ updateHookTypesDev();
3370
+ return updateRefresh();
3371
+ };
3372
}
3373
if (enableUseHook) {
3374
(HooksDispatcherOnUpdateInDEV: Dispatcher).use = use;
@@ -3370,15 +3377,14 @@ if (__DEV__) {
3377
(HooksDispatcherOnUpdateInDEV: Dispatcher).useMemoCache = useMemoCache;
3378
}
3379
if (enableUseEffectEventHook) {
3373
- (HooksDispatcherOnUpdateInDEV: Dispatcher).useEffectEvent = function useEffectEvent<
3374
- Args,
3375
- Return,
3376
- F: (...Array<Args>) => Return,
3377
- >(callback: F): F {
3378
- currentHookNameInDev = 'useEffectEvent';
3379
- updateHookTypesDev();
3380
- return updateEvent(callback);
3381
- };
3380
+ (HooksDispatcherOnUpdateInDEV: Dispatcher).useEffectEvent =
3381
+ function useEffectEvent<Args, Return, F: (...Array<Args>) => Return>(
3382
+ callback: F,
3383
+ ): F {
3384
+ currentHookNameInDev = 'useEffectEvent';
3385
+ updateHookTypesDev();
3386
+ return updateEvent(callback);
3387
+ };
3388
}
3389
3390
HooksDispatcherOnRerenderInDEV = {
@@ -3433,7 +3439,8 @@ if (__DEV__) {
3439
currentHookNameInDev = 'useMemo';
3440
updateHookTypesDev();
3441
const prevDispatcher = ReactCurrentDispatcher.current;
3436
- ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnRerenderInDEV;
3442
+ ReactCurrentDispatcher.current =
3443
+ InvalidNestedHooksDispatcherOnRerenderInDEV;
3444
try {
3445
return updateMemo(create, deps);
3446
} finally {
@@ -3448,7 +3455,8 @@ if (__DEV__) {
3455
currentHookNameInDev = 'useReducer';
3456
updateHookTypesDev();
3457
const prevDispatcher = ReactCurrentDispatcher.current;
3451
- ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnRerenderInDEV;
3458
+ ReactCurrentDispatcher.current =
3459
+ InvalidNestedHooksDispatcherOnRerenderInDEV;
3460
try {
3461
return rerenderReducer(reducer, initialArg, init);
3462
} finally {
@@ -3466,7 +3474,8 @@ if (__DEV__) {
3474
currentHookNameInDev = 'useState';
3475
updateHookTypesDev();
3476
const prevDispatcher = ReactCurrentDispatcher.current;
3469
- ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnRerenderInDEV;
3477
+ ReactCurrentDispatcher.current =
3478
+ InvalidNestedHooksDispatcherOnRerenderInDEV;
3479
try {
3480
return rerenderState(initialState);
3481
} finally {
@@ -3513,11 +3522,12 @@ if (__DEV__) {
3522
},
3523
};
3524
if (enableCache) {
3516
- (HooksDispatcherOnRerenderInDEV: Dispatcher).useCacheRefresh = function useCacheRefresh() {
3517
- currentHookNameInDev = 'useCacheRefresh';
3518
- updateHookTypesDev();
3519
- return updateRefresh();
3520
- };
3525
+ (HooksDispatcherOnRerenderInDEV: Dispatcher).useCacheRefresh =
3526
+ function useCacheRefresh() {
3527
+ currentHookNameInDev = 'useCacheRefresh';
3528
+ updateHookTypesDev();
3529
+ return updateRefresh();
3530
+ };
3531
}
3532
if (enableUseHook) {
3533
(HooksDispatcherOnRerenderInDEV: Dispatcher).use = use;
@@ -3526,15 +3536,14 @@ if (__DEV__) {
3536
(HooksDispatcherOnRerenderInDEV: Dispatcher).useMemoCache = useMemoCache;
3537
}
3538
if (enableUseEffectEventHook) {
3529
- (HooksDispatcherOnRerenderInDEV: Dispatcher).useEffectEvent = function useEffectEvent<
3530
- Args,
3531
- Return,
3532
- F: (...Array<Args>) => Return,
3533
- >(callback: F): F {
3534
- currentHookNameInDev = 'useEffectEvent';
3535
- updateHookTypesDev();
3536
- return updateEvent(callback);
3537
- };
3539
+ (HooksDispatcherOnRerenderInDEV: Dispatcher).useEffectEvent =
3540
+ function useEffectEvent<Args, Return, F: (...Array<Args>) => Return>(
3541
+ callback: F,
3542
+ ): F {
3543
+ currentHookNameInDev = 'useEffectEvent';
3544
+ updateHookTypesDev();
3545
+ return updateEvent(callback);
3546
+ };
3547
}
3548
3549
InvalidNestedHooksDispatcherOnMountInDEV = {
@@ -3685,14 +3694,15 @@ if (__DEV__) {
3694
},
3695
};
3696
if (enableCache) {
3688
- (InvalidNestedHooksDispatcherOnMountInDEV: Dispatcher).useCacheRefresh = function useCacheRefresh() {
3689
- currentHookNameInDev = 'useCacheRefresh';
3690
- mountHookTypesDev();
3691
- return mountRefresh();
3692
- };
3697
+ (InvalidNestedHooksDispatcherOnMountInDEV: Dispatcher).useCacheRefresh =
3698
+ function useCacheRefresh() {
3699
+ currentHookNameInDev = 'useCacheRefresh';
3700
+ mountHookTypesDev();
3701
+ return mountRefresh();
3702
+ };
3703
}
3704
if (enableUseHook) {
3695
- (InvalidNestedHooksDispatcherOnMountInDEV: Dispatcher).use = function<T>(
3705
+ (InvalidNestedHooksDispatcherOnMountInDEV: Dispatcher).use = function <T>(
3706
usable: Usable<T>,
3707
): T {
3708
warnInvalidHookAccess();
@@ -3700,24 +3710,22 @@ if (__DEV__) {
3710
};
3711
}
3712
if (enableUseMemoCacheHook) {
3703
- (InvalidNestedHooksDispatcherOnMountInDEV: Dispatcher).useMemoCache = function(
3704
- size: number,
3705
- ): Array<any> {
3706
- warnInvalidHookAccess();
3707
- return useMemoCache(size);
3708
- };
3713
+ (InvalidNestedHooksDispatcherOnMountInDEV: Dispatcher).useMemoCache =
3714
+ function (size: number): Array<any> {
3715
+ warnInvalidHookAccess();
3716
+ return useMemoCache(size);
3717
+ };
3718
}
3719
if (enableUseEffectEventHook) {
3711
- (InvalidNestedHooksDispatcherOnMountInDEV: Dispatcher).useEffectEvent = function useEffectEvent<
3712
- Args,
3713
- Return,
3714
- F: (...Array<Args>) => Return,
3715
- >(callback: F): F {
3716
- currentHookNameInDev = 'useEffectEvent';
3717
- warnInvalidHookAccess();
3718
- mountHookTypesDev();
3719
- return mountEvent(callback);
3720
- };
3720
+ (InvalidNestedHooksDispatcherOnMountInDEV: Dispatcher).useEffectEvent =
3721
+ function useEffectEvent<Args, Return, F: (...Array<Args>) => Return>(
3722
+ callback: F,
3723
+ ): F {
3724
+ currentHookNameInDev = 'useEffectEvent';
3725
+ warnInvalidHookAccess();
3726
+ mountHookTypesDev();
3727
+ return mountEvent(callback);
3728
+ };
3729
}
3730
3731
InvalidNestedHooksDispatcherOnUpdateInDEV = {
@@ -3779,7 +3787,8 @@ if (__DEV__) {
3787
warnInvalidHookAccess();
3788
updateHookTypesDev();
3789
const prevDispatcher = ReactCurrentDispatcher.current;
3782
- ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
3790
+ ReactCurrentDispatcher.current =
3791
+ InvalidNestedHooksDispatcherOnUpdateInDEV;
3792
try {
3793
return updateMemo(create, deps);
3794
} finally {
@@ -3795,7 +3804,8 @@ if (__DEV__) {
3804
warnInvalidHookAccess();
3805
updateHookTypesDev();
3806
const prevDispatcher = ReactCurrentDispatcher.current;
3798
- ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
3807
+ ReactCurrentDispatcher.current =
3808
+ InvalidNestedHooksDispatcherOnUpdateInDEV;
3809
try {
3810
return updateReducer(reducer, initialArg, init);
3811
} finally {
@@ -3815,7 +3825,8 @@ if (__DEV__) {
3825
warnInvalidHookAccess();
3826
updateHookTypesDev();
3827
const prevDispatcher = ReactCurrentDispatcher.current;
3818
- ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
3828
+ ReactCurrentDispatcher.current =
3829
+ InvalidNestedHooksDispatcherOnUpdateInDEV;
3830
try {
3831
return updateState(initialState);
3832
} finally {
@@ -3868,14 +3879,15 @@ if (__DEV__) {
3879
},
3880
};
3881
if (enableCache) {
3871
- (InvalidNestedHooksDispatcherOnUpdateInDEV: Dispatcher).useCacheRefresh = function useCacheRefresh() {
3872
- currentHookNameInDev = 'useCacheRefresh';
3873
- updateHookTypesDev();
3874
- return updateRefresh();
3875
- };
3882
+ (InvalidNestedHooksDispatcherOnUpdateInDEV: Dispatcher).useCacheRefresh =
3883
+ function useCacheRefresh() {
3884
+ currentHookNameInDev = 'useCacheRefresh';
3885
+ updateHookTypesDev();
3886
+ return updateRefresh();
3887
+ };
3888
}
3889
if (enableUseHook) {
3878
- (InvalidNestedHooksDispatcherOnUpdateInDEV: Dispatcher).use = function<T>(
3890
+ (InvalidNestedHooksDispatcherOnUpdateInDEV: Dispatcher).use = function <T>(
3891
usable: Usable<T>,
3892
): T {
3893
warnInvalidHookAccess();
@@ -3883,24 +3895,22 @@ if (__DEV__) {
3895
};
3896
}
3897
if (enableUseMemoCacheHook) {
3886
- (InvalidNestedHooksDispatcherOnUpdateInDEV: Dispatcher).useMemoCache = function(
3887
- size: number,
3888
- ): Array<any> {
3889
- warnInvalidHookAccess();
3890
- return useMemoCache(size);
3891
- };
3898
+ (InvalidNestedHooksDispatcherOnUpdateInDEV: Dispatcher).useMemoCache =
3899
+ function (size: number): Array<any> {
3900
+ warnInvalidHookAccess();
3901
+ return useMemoCache(size);
3902
+ };
3903
}
3904
if (enableUseEffectEventHook) {
3894
- (InvalidNestedHooksDispatcherOnUpdateInDEV: Dispatcher).useEffectEvent = function useEffectEvent<
3895
- Args,
3896
- Return,
3897
- F: (...Array<Args>) => Return,
3898
- >(callback: F): F {
3899
- currentHookNameInDev = 'useEffectEvent';
3900
- warnInvalidHookAccess();
3901
- updateHookTypesDev();
3902
- return updateEvent(callback);
3903
- };
3905
+ (InvalidNestedHooksDispatcherOnUpdateInDEV: Dispatcher).useEffectEvent =
3906
+ function useEffectEvent<Args, Return, F: (...Array<Args>) => Return>(
3907
+ callback: F,
3908
+ ): F {
3909
+ currentHookNameInDev = 'useEffectEvent';
3910
+ warnInvalidHookAccess();
3911
+ updateHookTypesDev();
3912
+ return updateEvent(callback);
3913
+ };
3914
}
3915
3916
InvalidNestedHooksDispatcherOnRerenderInDEV = {
@@ -3963,7 +3973,8 @@ if (__DEV__) {
3973
warnInvalidHookAccess();
3974
updateHookTypesDev();
3975
const prevDispatcher = ReactCurrentDispatcher.current;
3966
- ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
3976
+ ReactCurrentDispatcher.current =
3977
+ InvalidNestedHooksDispatcherOnUpdateInDEV;
3978
try {
3979
return updateMemo(create, deps);
3980
} finally {
@@ -3979,7 +3990,8 @@ if (__DEV__) {
3990
warnInvalidHookAccess();
3991
updateHookTypesDev();
3992
const prevDispatcher = ReactCurrentDispatcher.current;
3982
- ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
3993
+ ReactCurrentDispatcher.current =
3994
+ InvalidNestedHooksDispatcherOnUpdateInDEV;
3995
try {
3996
return rerenderReducer(reducer, initialArg, init);
3997
} finally {
@@ -3999,7 +4011,8 @@ if (__DEV__) {
4011
warnInvalidHookAccess();
4012
updateHookTypesDev();
4013
const prevDispatcher = ReactCurrentDispatcher.current;
4002
- ReactCurrentDispatcher.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
4014
+ ReactCurrentDispatcher.current =
4015
+ InvalidNestedHooksDispatcherOnUpdateInDEV;
4016
try {
4017
return rerenderState(initialState);
4018
} finally {
@@ -4052,38 +4065,37 @@ if (__DEV__) {
4065
},
4066
};
4067
if (enableCache) {
4055
- (InvalidNestedHooksDispatcherOnRerenderInDEV: Dispatcher).useCacheRefresh = function useCacheRefresh() {
4056
- currentHookNameInDev = 'useCacheRefresh';
4057
- updateHookTypesDev();
4058
- return updateRefresh();
4059
- };
4068
+ (InvalidNestedHooksDispatcherOnRerenderInDEV: Dispatcher).useCacheRefresh =
4069
+ function useCacheRefresh() {
4070
+ currentHookNameInDev = 'useCacheRefresh';
4071
+ updateHookTypesDev();
4072
+ return updateRefresh();
4073
+ };
4074
}
4075
if (enableUseHook) {
4062
- (InvalidNestedHooksDispatcherOnRerenderInDEV: Dispatcher).use = function<T>(
4063
- usable: Usable<T>,
4064
- ): T {
4076
+ (InvalidNestedHooksDispatcherOnRerenderInDEV: Dispatcher).use = function <
4077
+ T,
4078
+ >(usable: Usable<T>): T {
4079
warnInvalidHookAccess();
4080
return use(usable);
4081
};
4082
}
4083
if (enableUseMemoCacheHook) {
4070
- (InvalidNestedHooksDispatcherOnRerenderInDEV: Dispatcher).useMemoCache = function(
4071
- size: number,
4072
- ): Array<any> {
4073
- warnInvalidHookAccess();
4074
- return useMemoCache(size);
4075
- };
4084
+ (InvalidNestedHooksDispatcherOnRerenderInDEV: Dispatcher).useMemoCache =
4085
+ function (size: number): Array<any> {
4086
+ warnInvalidHookAccess();
4087
+ return useMemoCache(size);
4088
+ };
4089
}
4090
if (enableUseEffectEventHook) {
4078
- (InvalidNestedHooksDispatcherOnRerenderInDEV: Dispatcher).useEffectEvent = function useEffectEvent<
4079
- Args,
4080
- Return,
4081
- F: (...Array<Args>) => Return,
4082
- >(callback: F): F {
4083
- currentHookNameInDev = 'useEffectEvent';
4084
- warnInvalidHookAccess();
4085
- updateHookTypesDev();
4086
- return updateEvent(callback);
4087
- };
4091
+ (InvalidNestedHooksDispatcherOnRerenderInDEV: Dispatcher).useEffectEvent =
4092
+ function useEffectEvent<Args, Return, F: (...Array<Args>) => Return>(
4093
+ callback: F,
4094
+ ): F {
4095
+ currentHookNameInDev = 'useEffectEvent';
4096
+ warnInvalidHookAccess();
4097
+ updateHookTypesDev();
4098
+ return updateEvent(callback);
4099
+ };
4100
}
4101
}
packages/react-reconciler/src/ReactFiberHostContext.js
+2
-3
@@ -16,9 +16,8 @@ import {createCursor, push, pop} from './ReactFiberStack';
16
17
const contextStackCursor: StackCursor<HostContext | null> = createCursor(null);
18
const contextFiberStackCursor: StackCursor<Fiber | null> = createCursor(null);
19
-const rootInstanceStackCursor: StackCursor<Container | null> = createCursor(
20
- null,
21
-);
19
+const rootInstanceStackCursor: StackCursor<Container | null> =
20
+ createCursor(null);
21
22
function requiredContext<Value>(c: Value | null): Value {
23
if (__DEV__) {
packages/react-reconciler/src/ReactFiberHydrationContext.js
+8
-12
@@ -124,9 +124,8 @@ function enterHydrationState(fiber: Fiber): boolean {
124
}
125
126
const parentInstance: Container = fiber.stateNode.containerInfo;
127
- nextHydratableInstance = getFirstHydratableChildWithinContainer(
128
- parentInstance,
129
- );
127
+ nextHydratableInstance =
128
+ getFirstHydratableChildWithinContainer(parentInstance);
129
hydrationParentFiber = fiber;
130
isHydrating = true;
131
hydrationErrors = null;
@@ -142,9 +141,8 @@ function reenterHydrationStateFromDehydratedSuspenseInstance(
141
if (!supportsHydration) {
142
return false;
143
}
145
- nextHydratableInstance = getFirstHydratableChildWithinSuspenseInstance(
146
- suspenseInstance,
147
- );
144
+ nextHydratableInstance =
145
+ getFirstHydratableChildWithinSuspenseInstance(suspenseInstance);
146
hydrationParentFiber = fiber;
147
isHydrating = true;
148
hydrationErrors = null;
@@ -367,9 +365,8 @@ function tryHydrate(fiber: Fiber, nextInstance: any) {
365
return false;
366
}
367
case SuspenseComponent: {
370
- const suspenseInstance: null | SuspenseInstance = canHydrateSuspenseInstance(
371
- nextInstance,
372
- );
368
+ const suspenseInstance: null | SuspenseInstance =
369
+ canHydrateSuspenseInstance(nextInstance);
370
if (suspenseInstance !== null) {
371
const suspenseState: SuspenseState = {
372
dehydrated: suspenseInstance,
@@ -381,9 +378,8 @@ function tryHydrate(fiber: Fiber, nextInstance: any) {
378
// This simplifies the code for getHostSibling and deleting nodes,
379
// since it doesn't have to consider all Suspense boundaries and
380
// check if they're dehydrated ones or not.
384
- const dehydratedFragment = createFiberFromDehydratedFragment(
385
- suspenseInstance,
386
- );
381
+ const dehydratedFragment =
382
+ createFiberFromDehydratedFragment(suspenseInstance);
383
dehydratedFragment.return = fiber;
384
fiber.child = dehydratedFragment;
385
hydrationParentFiber = fiber;
packages/react-reconciler/src/ReactFiberSuspenseContext.js
+2
-3
@@ -19,9 +19,8 @@ import {OffscreenComponent} from './ReactWorkTags';
19
20
// The Suspense handler is the boundary that should capture if something
21
// suspends, i.e. it's the nearest `catch` block on the stack.
22
-const suspenseHandlerStackCursor: StackCursor<Fiber | null> = createCursor(
23
- null,
24
-);
22
+const suspenseHandlerStackCursor: StackCursor<Fiber | null> =
23
+ createCursor(null);
24
25
// Represents the outermost boundary that is not visible in the current tree.
26
// Everything above this is the "shell". When this is null, it means we're
packages/react-reconciler/src/ReactFiberThrow.js
+4
-2
@@ -413,7 +413,8 @@ function throwException(
413
//
414
// When the wakeable resolves, we'll attempt to render the boundary
415
// again ("retry").
416
- const wakeables: Set<Wakeable> | null = (suspenseBoundary.updateQueue: any);
416
+ const wakeables: Set<Wakeable> | null =
417
+ (suspenseBoundary.updateQueue: any);
418
if (wakeables === null) {
419
suspenseBoundary.updateQueue = new Set([wakeable]);
420
} else {
@@ -424,7 +425,8 @@ function throwException(
425
case OffscreenComponent: {
426
if (suspenseBoundary.mode & ConcurrentMode) {
427
suspenseBoundary.flags |= ShouldCapture;
427
- const offscreenQueue: OffscreenQueue | null = (suspenseBoundary.updateQueue: any);
428
+ const offscreenQueue: OffscreenQueue | null =
429
+ (suspenseBoundary.updateQueue: any);
430
if (offscreenQueue === null) {
431
const newOffscreenQueue: OffscreenQueue = {
432
transitions: null,
packages/react-reconciler/src/ReactFiberTracingMarkerComponent.js
+2
-3
@@ -191,9 +191,8 @@ export function processTransitionCallbacks(
191
// tracing marker can be logged as complete
192
// This code lives separate from the ReactFiberTransition code because
193
// we push and pop on the tracing marker, not the suspense boundary
194
-const markerInstanceStack: StackCursor<Array<TracingMarkerInstance> | null> = createCursor(
195
- null,
196
-);
194
+const markerInstanceStack: StackCursor<Array<TracingMarkerInstance> | null> =
195
+ createCursor(null);
196
197
export function pushRootMarkerInstance(workInProgress: Fiber): void {
198
if (enableTransitionTracing) {
packages/react-reconciler/src/ReactFiberTransition.js
+2
-3
@@ -44,9 +44,8 @@ const resumedCache: StackCursor<Cache | null> = createCursor(null);
44
// comparing the arrays of transitions when we combine them and storing them
45
// and filtering out the duplicates, we will instead store the unprocessed transitions
46
// in an array and actually filter them in the passive phase.
47
-const transitionStack: StackCursor<Array<Transition> | null> = createCursor(
48
- null,
49
-);
47
+const transitionStack: StackCursor<Array<Transition> | null> =
48
+ createCursor(null);
49
50
function peekCacheFromPool(): Cache | null {
51
if (!enableCache) {
packages/react-reconciler/src/ReactFiberWorkLoop.js
+8
-8
@@ -361,14 +361,12 @@ let workInProgressRootRenderPhaseUpdatedLanes: Lanes = NoLanes;
361
// Lanes that were pinged (in an interleaved event) during this render.
362
let workInProgressRootPingedLanes: Lanes = NoLanes;
363
// Errors that are thrown during the render phase.
364
-let workInProgressRootConcurrentErrors: Array<
365
- CapturedValue<mixed>,
366
-> | null = null;
364
+let workInProgressRootConcurrentErrors: Array<CapturedValue<mixed>> | null =
365
+ null;
366
// These are errors that we recovered from without surfacing them to the UI.
367
// We will log them once the tree commits.
369
-let workInProgressRootRecoverableErrors: Array<
370
- CapturedValue<mixed>,
371
-> | null = null;
368
+let workInProgressRootRecoverableErrors: Array<CapturedValue<mixed>> | null =
369
+ null;
370
371
// The most recent time we committed a fallback. This lets us ensure a train
372
// model where we don't commit new loading states in too quick succession.
@@ -1397,7 +1395,8 @@ function isRenderConsistentWithExternalStores(finishedWork: Fiber): boolean {
1395
let node: Fiber = finishedWork;
1396
while (true) {
1397
if (node.flags & StoreConsistency) {
1400
- const updateQueue: FunctionComponentUpdateQueue | null = (node.updateQueue: any);
1398
+ const updateQueue: FunctionComponentUpdateQueue | null =
1399
+ (node.updateQueue: any);
1400
if (updateQueue !== null) {
1401
const checks = updateQueue.stores;
1402
if (checks !== null) {
@@ -2969,7 +2968,8 @@ function commitRootImpl(
2968
const prevRootTransitionCallbacks = root.transitionCallbacks;
2969
if (prevRootTransitionCallbacks !== null) {
2970
schedulePostPaintCallback(endTime => {
2972
- const prevPendingTransitionCallbacks = currentPendingTransitionCallbacks;
2971
+ const prevPendingTransitionCallbacks =
2972
+ currentPendingTransitionCallbacks;
2973
if (prevPendingTransitionCallbacks !== null) {
2974
currentPendingTransitionCallbacks = null;
2975
scheduleCallback(IdleSchedulerPriority, () => {
packages/react-reconciler/src/__tests__/ReactActWarnings-test.js
+2
-6
@@ -311,9 +311,7 @@ describe('act warnings', () => {
311
expect(root).toMatchRenderedOutput('Loading...');
312
313
// This is a retry, not a ping, because we already showed a fallback.
314
- expect(() =>
315
- resolveText('Async'),
316
- ).toErrorDev(
314
+ expect(() => resolveText('Async')).toErrorDev(
315
'A suspended resource finished loading inside a test, but the event ' +
316
'was not wrapped in act(...)',
317
{withoutStack: true},
@@ -349,9 +347,7 @@ describe('act warnings', () => {
347
expect(root).toMatchRenderedOutput('(empty)');
348
349
// This is a ping, not a retry, because no fallback is showing.
352
- expect(() =>
353
- resolveText('Async'),
354
- ).toErrorDev(
350
+ expect(() => resolveText('Async')).toErrorDev(
351
'A suspended resource finished loading inside a test, but the event ' +
352
'was not wrapped in act(...)',
353
{withoutStack: true},
packages/react-reconciler/src/__tests__/ReactDeferredValue-test.js
+16
-12
@@ -41,9 +41,10 @@ describe('ReactDeferredValue', () => {
41
// render. A naive implementation would endlessly spawn deferred renders.
42
const {value: deferredValue} = useDeferredValue({value});
43
44
- const child = useMemo(() => <Text text={'Original: ' + value} />, [
45
- value,
46
- ]);
44
+ const child = useMemo(
45
+ () => <Text text={'Original: ' + value} />,
46
+ [value],
47
+ );
48
49
const deferredChild = useMemo(
50
() => <Text text={'Deferred: ' + deferredValue} />,
@@ -101,9 +102,10 @@ describe('ReactDeferredValue', () => {
102
function App({value}) {
103
const deferredValue = useDeferredValue(value);
104
104
- const child = useMemo(() => <Text text={'Original: ' + value} />, [
105
- value,
106
- ]);
105
+ const child = useMemo(
106
+ () => <Text text={'Original: ' + value} />,
107
+ [value],
108
+ );
109
110
const deferredChild = useMemo(
111
() => <Text text={'Deferred: ' + deferredValue} />,
@@ -166,9 +168,10 @@ describe('ReactDeferredValue', () => {
168
169
const deferredValue = useDeferredValue(value);
170
169
- const child = useMemo(() => <Text text={'Original: ' + value} />, [
170
- value,
171
- ]);
171
+ const child = useMemo(
172
+ () => <Text text={'Original: ' + value} />,
173
+ [value],
174
+ );
175
176
const deferredChild = useMemo(
177
() => <Text text={'Deferred: ' + deferredValue} />,
@@ -231,9 +234,10 @@ describe('ReactDeferredValue', () => {
234
235
const deferredValue = useDeferredValue(value);
236
234
- const child = useMemo(() => <Text text={'Original: ' + value} />, [
235
- value,
236
- ]);
237
+ const child = useMemo(
238
+ () => <Text text={'Original: ' + value} />,
239
+ [value],
240
+ );
241
242
const deferredChild = useMemo(
243
() => <Text text={'Deferred: ' + deferredValue} />,
packages/react-reconciler/src/__tests__/ReactDisableSchedulerTimeoutBasedOnReactExpirationTime-test.internal.js
+2
-2
@@ -29,7 +29,7 @@ describe('ReactSuspenseList', () => {
29
30
function createAsyncText(text) {
31
let resolved = false;
32
- const Component = function() {
32
+ const Component = function () {
33
if (!resolved) {
34
Scheduler.unstable_yieldValue('Suspend! [' + text + ']');
35
throw promise;
@@ -37,7 +37,7 @@ describe('ReactSuspenseList', () => {
37
return <Text text={text} />;
38
};
39
const promise = new Promise(resolve => {
40
- Component.resolve = function() {
40
+ Component.resolve = function () {
41
resolved = true;
42
return resolve();
43
};
packages/react-reconciler/src/__tests__/ReactFiberHostContext-test.internal.js
+19
-19
@@ -22,10 +22,10 @@ describe('ReactFiberHostContext', () => {
22
React = require('react');
23
act = React.unstable_act;
24
ReactFiberReconciler = require('react-reconciler');
25
- ConcurrentRoot = require('react-reconciler/src/ReactRootTags')
26
- .ConcurrentRoot;
27
- DefaultEventPriority = require('react-reconciler/src/ReactEventPriorities')
28
- .DefaultEventPriority;
25
+ ConcurrentRoot =
26
+ require('react-reconciler/src/ReactRootTags').ConcurrentRoot;
27
+ DefaultEventPriority =
28
+ require('react-reconciler/src/ReactEventPriorities').DefaultEventPriority;
29
});
30
31
global.IS_REACT_ACT_ENVIRONMENT = true;
@@ -35,44 +35,44 @@ describe('ReactFiberHostContext', () => {
35
const rootContext = {};
36
const childContext = {};
37
const Renderer = ReactFiberReconciler({
38
- prepareForCommit: function(hostContext) {
38
+ prepareForCommit: function (hostContext) {
39
expect(hostContext).toBe(rootContext);
40
return null;
41
},
42
- resetAfterCommit: function(hostContext) {
42
+ resetAfterCommit: function (hostContext) {
43
expect(hostContext).toBe(rootContext);
44
},
45
- getRootHostContext: function() {
45
+ getRootHostContext: function () {
46
return rootContext;
47
},
48
- getChildHostContext: function() {
48
+ getChildHostContext: function () {
49
return childContext;
50
},
51
- shouldSetTextContent: function() {
51
+ shouldSetTextContent: function () {
52
return false;
53
},
54
- createInstance: function() {
54
+ createInstance: function () {
55
return null;
56
},
57
- finalizeInitialChildren: function() {
57
+ finalizeInitialChildren: function () {
58
return null;
59
},
60
- appendInitialChild: function() {
60
+ appendInitialChild: function () {
61
return null;
62
},
63
- now: function() {
63
+ now: function () {
64
return 0;
65
},
66
- appendChildToContainer: function() {
66
+ appendChildToContainer: function () {
67
return null;
68
},
69
- clearContainer: function() {},
70
- getCurrentEventPriority: function() {
69
+ clearContainer: function () {},
70
+ getCurrentEventPriority: function () {
71
return DefaultEventPriority;
72
},
73
- requestPostPaintCallback: function() {},
74
- prepareRendererToRender: function() {},
75
- resetRendererAfterRender: function() {},
73
+ requestPostPaintCallback: function () {},
74
+ prepareRendererToRender: function () {},
75
+ resetRendererAfterRender: function () {},
76
supportsMutation: true,
77
});
78
packages/react-reconciler/src/__tests__/ReactFragment-test.js
+20
-20
@@ -14,7 +14,7 @@ let ReactNoop;
14
let Scheduler;
15
16
describe('ReactFragment', () => {
17
- beforeEach(function() {
17
+ beforeEach(function () {
18
jest.resetModules();
19
20
React = require('react');
@@ -83,7 +83,7 @@ describe('ReactFragment', () => {
83
expect(ReactNoop.getChildren()).toEqual([span(), span()]);
84
});
85
86
- it('should preserve state of children with 1 level nesting', function() {
86
+ it('should preserve state of children with 1 level nesting', function () {
87
const ops = [];
88
89
class Stateful extends React.Component {
@@ -123,7 +123,7 @@ describe('ReactFragment', () => {
123
expect(ReactNoop.getChildren()).toEqual([div()]);
124
});
125
126
- it('should preserve state between top-level fragments', function() {
126
+ it('should preserve state between top-level fragments', function () {
127
const ops = [];
128
129
class Stateful extends React.Component {
@@ -164,7 +164,7 @@ describe('ReactFragment', () => {
164
expect(ReactNoop.getChildren()).toEqual([div()]);
165
});
166
167
- it('should preserve state of children nested at same level', function() {
167
+ it('should preserve state of children nested at same level', function () {
168
const ops = [];
169
170
class Stateful extends React.Component {
@@ -214,7 +214,7 @@ describe('ReactFragment', () => {
214
expect(ReactNoop.getChildren()).toEqual([div()]);
215
});
216
217
- it('should not preserve state in non-top-level fragment nesting', function() {
217
+ it('should not preserve state in non-top-level fragment nesting', function () {
218
const ops = [];
219
220
class Stateful extends React.Component {
@@ -257,7 +257,7 @@ describe('ReactFragment', () => {
257
expect(ReactNoop.getChildren()).toEqual([div()]);
258
});
259
260
- it('should not preserve state of children if nested 2 levels without siblings', function() {
260
+ it('should not preserve state of children if nested 2 levels without siblings', function () {
261
const ops = [];
262
263
class Stateful extends React.Component {
@@ -298,7 +298,7 @@ describe('ReactFragment', () => {
298
expect(ReactNoop.getChildren()).toEqual([div()]);
299
});
300
301
- it('should not preserve state of children if nested 2 levels with siblings', function() {
301
+ it('should not preserve state of children if nested 2 levels with siblings', function () {
302
const ops = [];
303
304
class Stateful extends React.Component {
@@ -340,7 +340,7 @@ describe('ReactFragment', () => {
340
expect(ReactNoop.getChildren()).toEqual([div()]);
341
});
342
343
- it('should preserve state between array nested in fragment and fragment', function() {
343
+ it('should preserve state between array nested in fragment and fragment', function () {
344
const ops = [];
345
346
class Stateful extends React.Component {
@@ -379,7 +379,7 @@ describe('ReactFragment', () => {
379
expect(ReactNoop.getChildren()).toEqual([div()]);
380
});
381
382
- it('should preserve state between top level fragment and array', function() {
382
+ it('should preserve state between top level fragment and array', function () {
383
const ops = [];
384
385
class Stateful extends React.Component {
@@ -418,7 +418,7 @@ describe('ReactFragment', () => {
418
expect(ReactNoop.getChildren()).toEqual([div()]);
419
});
420
421
- it('should not preserve state between array nested in fragment and double nested fragment', function() {
421
+ it('should not preserve state between array nested in fragment and double nested fragment', function () {
422
const ops = [];
423
424
class Stateful extends React.Component {
@@ -459,7 +459,7 @@ describe('ReactFragment', () => {
459
expect(ReactNoop.getChildren()).toEqual([div()]);
460
});
461
462
- it('should not preserve state between array nested in fragment and double nested array', function() {
462
+ it('should not preserve state between array nested in fragment and double nested array', function () {
463
const ops = [];
464
465
class Stateful extends React.Component {
@@ -496,7 +496,7 @@ describe('ReactFragment', () => {
496
expect(ReactNoop.getChildren()).toEqual([div()]);
497
});
498
499
- it('should preserve state between double nested fragment and double nested array', function() {
499
+ it('should preserve state between double nested fragment and double nested array', function () {
500
const ops = [];
501
502
class Stateful extends React.Component {
@@ -537,7 +537,7 @@ describe('ReactFragment', () => {
537
expect(ReactNoop.getChildren()).toEqual([div()]);
538
});
539
540
- it('should not preserve state of children when the keys are different', function() {
540
+ it('should not preserve state of children when the keys are different', function () {
541
const ops = [];
542
543
class Stateful extends React.Component {
@@ -579,7 +579,7 @@ describe('ReactFragment', () => {
579
expect(ReactNoop.getChildren()).toEqual([div()]);
580
});
581
582
- it('should not preserve state between unkeyed and keyed fragment', function() {
582
+ it('should not preserve state between unkeyed and keyed fragment', function () {
583
const ops = [];
584
585
class Stateful extends React.Component {
@@ -620,7 +620,7 @@ describe('ReactFragment', () => {
620
expect(ReactNoop.getChildren()).toEqual([div()]);
621
});
622
623
- it('should preserve state with reordering in multiple levels', function() {
623
+ it('should preserve state with reordering in multiple levels', function () {
624
const ops = [];
625
626
class Stateful extends React.Component {
@@ -673,7 +673,7 @@ describe('ReactFragment', () => {
673
expect(ReactNoop.getChildren()).toEqual([div(span(), div(div()), span())]);
674
});
675
676
- it('should not preserve state when switching to a keyed fragment to an array', function() {
676
+ it('should not preserve state when switching to a keyed fragment to an array', function () {
677
const ops = [];
678
679
class Stateful extends React.Component {
@@ -722,7 +722,7 @@ describe('ReactFragment', () => {
722
expect(ReactNoop.getChildren()).toEqual([div(div(), span())]);
723
});
724
725
- it('should not preserve state when switching a nested unkeyed fragment to a passthrough component', function() {
725
+ it('should not preserve state when switching a nested unkeyed fragment to a passthrough component', function () {
726
const ops = [];
727
728
function Passthrough({children}) {
@@ -771,7 +771,7 @@ describe('ReactFragment', () => {
771
expect(ReactNoop.getChildren()).toEqual([div()]);
772
});
773
774
- it('should not preserve state when switching a nested keyed fragment to a passthrough component', function() {
774
+ it('should not preserve state when switching a nested keyed fragment to a passthrough component', function () {
775
const ops = [];
776
777
function Passthrough({children}) {
@@ -820,7 +820,7 @@ describe('ReactFragment', () => {
820
expect(ReactNoop.getChildren()).toEqual([div()]);
821
});
822
823
- it('should not preserve state when switching a nested keyed array to a passthrough component', function() {
823
+ it('should not preserve state when switching a nested keyed array to a passthrough component', function () {
824
const ops = [];
825
826
function Passthrough({children}) {
@@ -865,7 +865,7 @@ describe('ReactFragment', () => {
865
expect(ReactNoop.getChildren()).toEqual([div()]);
866
});
867
868
- it('should preserve state when it does not change positions', function() {
868
+ it('should preserve state when it does not change positions', function () {
869
const ops = [];
870
871
class Stateful extends React.Component {
packages/react-reconciler/src/__tests__/ReactHooksWithNoopRenderer-test.js
+11
-9
@@ -59,8 +59,8 @@ describe('ReactHooksWithNoopRenderer', () => {
59
useTransition = React.useTransition;
60
useDeferredValue = React.useDeferredValue;
61
Suspense = React.Suspense;
62
- ContinuousEventPriority = require('react-reconciler/constants')
63
- .ContinuousEventPriority;
62
+ ContinuousEventPriority =
63
+ require('react-reconciler/constants').ContinuousEventPriority;
64
if (gate(flags => flags.enableSuspenseList)) {
65
SuspenseList = React.SuspenseList;
66
}
@@ -2317,7 +2317,7 @@ describe('ReactHooksWithNoopRenderer', () => {
2317
let LogOnlyErrorBoundary;
2318
2319
beforeEach(() => {
2320
- BrokenUseEffectCleanup = function() {
2320
+ BrokenUseEffectCleanup = function () {
2321
useEffect(() => {
2322
Scheduler.unstable_yieldValue('BrokenUseEffectCleanup useEffect');
2323
return () => {
@@ -3426,9 +3426,10 @@ describe('ReactHooksWithNoopRenderer', () => {
3426
3427
function Counter({incrementBy}) {
3428
const [count, updateCount] = useState(0);
3429
- const increment = useCallback(() => updateCount(c => c + incrementBy), [
3430
- incrementBy,
3431
- ]);
3429
+ const increment = useCallback(
3430
+ () => updateCount(c => c + incrementBy),
3431
+ [incrementBy],
3432
+ );
3433
return (
3434
<>
3435
<IncrementButton increment={increment} ref={button} />
@@ -3537,9 +3538,10 @@ describe('ReactHooksWithNoopRenderer', () => {
3538
3539
it('should not invoke memoized function during re-renders unless inputs change', () => {
3540
function LazyCompute(props) {
3540
- const computed = useMemo(() => props.compute(props.input), [
3541
- props.input,
3542
- ]);
3541
+ const computed = useMemo(
3542
+ () => props.compute(props.input),
3543
+ [props.input],
3544
+ );
3545
const [count, setCount] = useState(0);
3546
if (count < 3) {
3547
setCount(count + 1);
packages/react-reconciler/src/__tests__/ReactIncremental-test.js
+2
-2
@@ -2854,7 +2854,7 @@ describe('ReactIncremental', () => {
2854
jest.resetModules();
2855
let receivedNonExtensibleObjects;
2856
// eslint-disable-next-line no-extend-native
2857
- Map.prototype.set = function(key) {
2857
+ Map.prototype.set = function (key) {
2858
if (typeof key === 'object' && key !== null) {
2859
if (!Object.isExtensible(key)) {
2860
receivedNonExtensibleObjects = true;
@@ -2882,7 +2882,7 @@ describe('ReactIncremental', () => {
2882
// doesn't cause a failure.
2883
jest.resetModules();
2884
// eslint-disable-next-line no-extend-native
2885
- Map.prototype.set = function(key, value) {
2885
+ Map.prototype.set = function (key, value) {
2886
if (typeof key === 'object' && key !== null) {
2887
// A polyfill could do something like this.
2888
// It would throw if an object is not extensible.
packages/react-reconciler/src/__tests__/ReactIncrementalErrorHandling-test.internal.js
+3
-5
@@ -41,7 +41,7 @@ describe('ReactIncrementalErrorHandling', () => {
41
function normalizeCodeLocInfo(str) {
42
return (
43
str &&
44
- str.replace(/\n +(?:at|in) ([\S]+)[^\n]*/g, function(m, name) {
44
+ str.replace(/\n +(?:at|in) ([\S]+)[^\n]*/g, function (m, name) {
45
return '\n in ' + name + ' (at **)';
46
})
47
);
@@ -1379,9 +1379,7 @@ describe('ReactIncrementalErrorHandling', () => {
1379
1380
it('recovers from uncaught reconciler errors', () => {
1381
const InvalidType = undefined;
1382
- expect(() =>
1383
- ReactNoop.render(<InvalidType />),
1384
- ).toErrorDev(
1382
+ expect(() => ReactNoop.render(<InvalidType />)).toErrorDev(
1383
'Warning: React.createElement: type is invalid -- expected a string',
1384
{withoutStack: true},
1385
);
@@ -1750,7 +1748,7 @@ describe('ReactIncrementalErrorHandling', () => {
1748
});
1749
1750
it('provides component stack even if overriding prepareStackTrace', () => {
1753
- Error.prepareStackTrace = function(error, callsites) {
1751
+ Error.prepareStackTrace = function (error, callsites) {
1752
const stack = ['An error occurred:', error.message];
1753
for (let i = 0; i < callsites.length; i++) {
1754
const callsite = callsites[i];
packages/react-reconciler/src/__tests__/ReactIncrementalSideEffects-test.js
+10
-12
@@ -74,7 +74,7 @@ describe('ReactIncrementalSideEffects', () => {
74
expect(ReactNoop.getChildren()).toEqual([div(span(), span())]);
75
});
76
77
- it('can update child nodes of a fragment', function() {
77
+ it('can update child nodes of a fragment', function () {
78
function Bar(props) {
79
return <span>{props.text}</span>;
80
}
@@ -110,7 +110,7 @@ describe('ReactIncrementalSideEffects', () => {
110
]);
111
});
112
113
- it('can update child nodes rendering into text nodes', function() {
113
+ it('can update child nodes rendering into text nodes', function () {
114
function Bar(props) {
115
return props.text;
116
}
@@ -135,7 +135,7 @@ describe('ReactIncrementalSideEffects', () => {
135
expect(ReactNoop.getChildren()).toEqual([div('World', 'World', '!')]);
136
});
137
138
- it('can deletes children either components, host or text', function() {
138
+ it('can deletes children either components, host or text', function () {
139
function Bar(props) {
140
return <span prop={props.children} />;
141
}
@@ -161,7 +161,7 @@ describe('ReactIncrementalSideEffects', () => {
161
expect(ReactNoop.getChildren()).toEqual([div()]);
162
});
163
164
- it('can delete a child that changes type - implicit keys', function() {
164
+ it('can delete a child that changes type - implicit keys', function () {
165
let unmounted = false;
166
167
class ClassComponent extends React.Component {
@@ -213,7 +213,7 @@ describe('ReactIncrementalSideEffects', () => {
213
expect(ReactNoop.getChildren()).toEqual([div('Trail')]);
214
});
215
216
- it('can delete a child that changes type - explicit keys', function() {
216
+ it('can delete a child that changes type - explicit keys', function () {
217
let unmounted = false;
218
219
class ClassComponent extends React.Component {
@@ -264,9 +264,8 @@ describe('ReactIncrementalSideEffects', () => {
264
return <span prop={props.children} />;
265
}
266
267
- const portalContainer = ReactNoop.getOrCreateRootContainer(
268
- 'portalContainer',
269
- );
267
+ const portalContainer =
268
+ ReactNoop.getOrCreateRootContainer('portalContainer');
269
function Foo(props) {
270
return ReactNoop.createPortal(
271
props.show ? [<div key="a" />, <Bar key="b">Hello</Bar>, 'World'] : [],
@@ -340,9 +339,8 @@ describe('ReactIncrementalSideEffects', () => {
339
return <span prop={props.children} />;
340
}
341
343
- const portalContainer = ReactNoop.getOrCreateRootContainer(
344
- 'portalContainer',
345
- );
342
+ const portalContainer =
343
+ ReactNoop.getOrCreateRootContainer('portalContainer');
344
function Foo(props) {
345
return ReactNoop.createPortal(
346
[<div key="a" />, <Bar key="b">Hello</Bar>, 'World'],
@@ -786,7 +784,7 @@ describe('ReactIncrementalSideEffects', () => {
784
expect(innerSpanA).toBe(innerSpanB);
785
});
786
789
- xit('can defer side-effects and reuse them later - complex', function() {
787
+ xit('can defer side-effects and reuse them later - complex', function () {
788
let ops = [];
789
790
class Bar extends React.Component {
packages/react-reconciler/src/__tests__/ReactIncrementalUpdates-test.js
+4
-16
@@ -24,8 +24,8 @@ describe('ReactIncrementalUpdates', () => {
24
ReactNoop = require('react-noop-renderer');
25
Scheduler = require('scheduler');
26
act = require('jest-react').act;
27
- ContinuousEventPriority = require('react-reconciler/constants')
28
- .ContinuousEventPriority;
27
+ ContinuousEventPriority =
28
+ require('react-reconciler/constants').ContinuousEventPriority;
29
});
30
31
function span(prop) {
@@ -139,13 +139,7 @@ describe('ReactIncrementalUpdates', () => {
139
state = {};
140
render() {
141
instance = this;
142
- return (
143
- <span
144
- prop={Object.keys(this.state)
145
- .sort()
146
- .join('')}
147
- />
148
- );
142
+ return <span prop={Object.keys(this.state).sort().join('')} />;
143
}
144
}
145
@@ -250,13 +244,7 @@ describe('ReactIncrementalUpdates', () => {
244
state = {};
245
render() {
246
instance = this;
253
- return (
254
- <span
255
- prop={Object.keys(this.state)
256
- .sort()
257
- .join('')}
258
- />
259
- );
247
+ return <span prop={Object.keys(this.state).sort().join('')} />;
248
}
249
}
250
packages/react-reconciler/src/__tests__/ReactIsomorphicAct-test.js
+2
-2
@@ -22,8 +22,8 @@ describe('isomorphic act()', () => {
22
React = require('react');
23
24
ReactNoop = require('react-noop-renderer');
25
- DiscreteEventPriority = require('react-reconciler/constants')
26
- .DiscreteEventPriority;
25
+ DiscreteEventPriority =
26
+ require('react-reconciler/constants').DiscreteEventPriority;
27
act = React.unstable_act;
28
use = React.use;
29
Suspense = React.Suspense;
packages/react-reconciler/src/__tests__/ReactLazy-test.internal.js
+1
-1
@@ -9,7 +9,7 @@ let lazy;
9
function normalizeCodeLocInfo(str) {
10
return (
11
str &&
12
- str.replace(/\n +(?:at|in) ([\S]+)[^\n]*/g, function(m, name) {
12
+ str.replace(/\n +(?:at|in) ([\S]+)[^\n]*/g, function (m, name) {
13
return '\n in ' + name + ' (at **)';
14
})
15
);
packages/react-reconciler/src/__tests__/ReactMemo-test.js
+2
-6
@@ -469,9 +469,7 @@ describe('memo', () => {
469
});
470
471
it('warns if the first argument is undefined', () => {
472
- expect(() =>
473
- memo(),
474
- ).toErrorDev(
472
+ expect(() => memo()).toErrorDev(
473
'memo: The first argument must be a component. Instead ' +
474
'received: undefined',
475
{withoutStack: true},
@@ -479,9 +477,7 @@ describe('memo', () => {
477
});
478
479
it('warns if the first argument is null', () => {
482
- expect(() =>
483
- memo(null),
484
- ).toErrorDev(
480
+ expect(() => memo(null)).toErrorDev(
481
'memo: The first argument must be a component. Instead ' +
482
'received: null',
483
{withoutStack: true},
packages/react-reconciler/src/__tests__/ReactNewContext-test.js
+1
-3
@@ -1588,9 +1588,7 @@ describe('ReactNewContext', () => {
1588
1589
const LIMIT = 100;
1590
for (let i = 0; i < LIMIT; i++) {
1591
- const seed = Math.random()
1592
- .toString(36)
1593
- .substr(2, 5);
1591
+ const seed = Math.random().toString(36).substr(2, 5);
1592
const actions = randomActions(5);
1593
try {
1594
simulate(seed, actions);
packages/react-reconciler/src/__tests__/ReactSuspenseEffectsSemantics-test.js
+15
-10
@@ -2529,13 +2529,15 @@ describe('ReactSuspenseEffectsSemantics', () => {
2529
2530
React.useLayoutEffect(() => {
2531
Scheduler.unstable_yieldValue(
2532
- `RefCheckerOuter create layout refObject? ${refObject.current !=
2533
- null} refCallback? ${manualRef.current != null}`,
2532
+ `RefCheckerOuter create layout refObject? ${
2533
+ refObject.current != null
2534
+ } refCallback? ${manualRef.current != null}`,
2535
);
2536
return () => {
2537
Scheduler.unstable_yieldValue(
2537
- `RefCheckerOuter destroy layout refObject? ${refObject.current !=
2538
- null} refCallback? ${manualRef.current != null}`,
2538
+ `RefCheckerOuter destroy layout refObject? ${
2539
+ refObject.current != null
2540
+ } refCallback? ${manualRef.current != null}`,
2541
);
2542
};
2543
}, []);
@@ -2556,13 +2558,15 @@ describe('ReactSuspenseEffectsSemantics', () => {
2558
Scheduler.unstable_yieldValue(`RefCheckerInner:${text} render`);
2559
React.useLayoutEffect(() => {
2560
Scheduler.unstable_yieldValue(
2559
- `RefCheckerInner:${text} create layout ref? ${forwardedRef.current !=
2560
- null}`,
2561
+ `RefCheckerInner:${text} create layout ref? ${
2562
+ forwardedRef.current != null
2563
+ }`,
2564
);
2565
return () => {
2566
Scheduler.unstable_yieldValue(
2564
- `RefCheckerInner:${text} destroy layout ref? ${forwardedRef.current !=
2565
- null}`,
2567
+ `RefCheckerInner:${text} destroy layout ref? ${
2568
+ forwardedRef.current != null
2569
+ }`,
2570
);
2571
};
2572
}, []);
@@ -2965,8 +2969,9 @@ describe('ReactSuspenseEffectsSemantics', () => {
2969
);
2970
return () => {
2971
Scheduler.unstable_yieldValue(
2968
- `RefChecker destroy layout ref? ${forwardedRef.current ===
2969
- 'test'}`,
2972
+ `RefChecker destroy layout ref? ${
2973
+ forwardedRef.current === 'test'
2974
+ }`,
2975
);
2976
};
2977
}, []);
packages/react-reconciler/src/__tests__/ReactSuspenseList-test.js
+3
-3
@@ -28,7 +28,7 @@ describe('ReactSuspenseList', () => {
28
29
function createAsyncText(text) {
30
let resolved = false;
31
- const Component = function() {
31
+ const Component = function () {
32
if (!resolved) {
33
Scheduler.unstable_yieldValue('Suspend! [' + text + ']');
34
throw promise;
@@ -36,7 +36,7 @@ describe('ReactSuspenseList', () => {
36
return <Text text={text} />;
37
};
38
const promise = new Promise(resolve => {
39
- Component.resolve = function() {
39
+ Component.resolve = function () {
40
resolved = true;
41
return resolve();
42
};
@@ -1166,7 +1166,7 @@ describe('ReactSuspenseList', () => {
1166
const F = createAsyncText('F');
1167
1168
function createSyncText(text) {
1169
- return function() {
1169
+ return function () {
1170
return <Text text={text} />;
1171
};
1172
}
packages/react-reconciler/src/__tests__/ReactTopLevelFragment-test.js
+7
-7
@@ -16,15 +16,15 @@ let Scheduler;
16
17
// This is a new feature in Fiber so I put it in its own test file. It could
18
// probably move to one of the other test files once it is official.
19
-describe('ReactTopLevelFragment', function() {
20
- beforeEach(function() {
19
+describe('ReactTopLevelFragment', function () {
20
+ beforeEach(function () {
21
jest.resetModules();
22
React = require('react');
23
ReactNoop = require('react-noop-renderer');
24
Scheduler = require('scheduler');
25
});
26
27
- it('should render a simple fragment at the top of a component', function() {
27
+ it('should render a simple fragment at the top of a component', function () {
28
function Fragment() {
29
return [<div key="a">Hello</div>, <div key="b">World</div>];
30
}
@@ -32,7 +32,7 @@ describe('ReactTopLevelFragment', function() {
32
expect(Scheduler).toFlushWithoutYielding();
33
});
34
35
- it('should preserve state when switching from a single child', function() {
35
+ it('should preserve state when switching from a single child', function () {
36
let instance = null;
37
38
class Stateful extends React.Component {
@@ -64,7 +64,7 @@ describe('ReactTopLevelFragment', function() {
64
expect(instanceB).toBe(instanceA);
65
});
66
67
- it('should not preserve state when switching to a nested array', function() {
67
+ it('should not preserve state when switching to a nested array', function () {
68
let instance = null;
69
70
class Stateful extends React.Component {
@@ -96,7 +96,7 @@ describe('ReactTopLevelFragment', function() {
96
expect(instanceB).not.toBe(instanceA);
97
});
98
99
- it('preserves state if an implicit key slot switches from/to null', function() {
99
+ it('preserves state if an implicit key slot switches from/to null', function () {
100
let instance = null;
101
102
class Stateful extends React.Component {
@@ -133,7 +133,7 @@ describe('ReactTopLevelFragment', function() {
133
expect(instanceC === instanceA).toBe(true);
134
});
135
136
- it('should preserve state in a reorder', function() {
136
+ it('should preserve state in a reorder', function () {
137
let instance = null;
138
139
class Stateful extends React.Component {
packages/react-reconciler/src/__tests__/ReactUpdatePriority-test.js
+2
-2
@@ -15,8 +15,8 @@ describe('ReactUpdatePriority', () => {
15
ReactNoop = require('react-noop-renderer');
16
Scheduler = require('scheduler');
17
act = require('jest-react').act;
18
- ContinuousEventPriority = require('react-reconciler/constants')
19
- .ContinuousEventPriority;
18
+ ContinuousEventPriority =
19
+ require('react-reconciler/constants').ContinuousEventPriority;
20
startTransition = React.startTransition;
21
useState = React.useState;
22
useEffect = React.useEffect;
packages/react-refresh/src/ReactFreshBabelPlugin.js
+1
-1
@@ -7,7 +7,7 @@
7
8
'use strict';
9
10
-export default function(babel, opts = {}) {
10
+export default function (babel, opts = {}) {
11
if (typeof babel.env === 'function') {
12
// Only available in Babel 7.
13
const env = babel.env();
packages/react-refresh/src/ReactFreshRuntime.js
+10
-13
@@ -47,17 +47,14 @@ const PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
47
// We never remove these associations.
48
// It's OK to reference families, but use WeakMap/Set for types.
49
const allFamiliesByID: Map<string, Family> = new Map();
50
-const allFamiliesByType:
51
- | WeakMap<any, Family>
52
- | Map<any, Family> = new PossiblyWeakMap();
53
-const allSignaturesByType:
54
- | WeakMap<any, Signature>
55
- | Map<any, Signature> = new PossiblyWeakMap();
50
+const allFamiliesByType: WeakMap<any, Family> | Map<any, Family> =
51
+ new PossiblyWeakMap();
52
+const allSignaturesByType: WeakMap<any, Signature> | Map<any, Signature> =
53
+ new PossiblyWeakMap();
54
// This WeakMap is read by React, so we only put families
55
// that have actually been edited here. This keeps checks fast.
58
-const updatedFamiliesByType:
59
- | WeakMap<any, Family>
60
- | Map<any, Family> = new PossiblyWeakMap();
56
+const updatedFamiliesByType: WeakMap<any, Family> | Map<any, Family> =
57
+ new PossiblyWeakMap();
58
59
// This is cleared on every performReactRefresh() call.
60
// It is an array of [Family, NextType] tuples.
@@ -490,7 +487,7 @@ export function injectIntoGlobalHook(globalObject: any): void {
487
488
// Here, we just want to get a reference to scheduleRefresh.
489
const oldInject = hook.inject;
493
- hook.inject = function(this: mixed, injected) {
490
+ hook.inject = function (this: mixed, injected) {
491
const id = oldInject.apply(this, arguments);
492
if (
493
typeof injected.scheduleRefresh === 'function' &&
@@ -518,7 +515,7 @@ export function injectIntoGlobalHook(globalObject: any): void {
515
// We also want to track currently mounted roots.
516
const oldOnCommitFiberRoot = hook.onCommitFiberRoot;
517
const oldOnScheduleFiberRoot = hook.onScheduleFiberRoot || (() => {});
521
- hook.onScheduleFiberRoot = function(
518
+ hook.onScheduleFiberRoot = function (
519
this: mixed,
520
id: number,
521
root: FiberRoot,
@@ -534,7 +531,7 @@ export function injectIntoGlobalHook(globalObject: any): void {
531
}
532
return oldOnScheduleFiberRoot.apply(this, arguments);
533
};
537
- hook.onCommitFiberRoot = function(
534
+ hook.onCommitFiberRoot = function (
535
this: mixed,
536
id: number,
537
root: FiberRoot,
@@ -648,7 +645,7 @@ export function createSignatureFunctionForTransform(): <T>(
645
let savedType;
646
let hasCustomHooks;
647
let didCollectHooks = false;
651
- return function<T>(
648
+ return function <T>(
649
type: T,
650
key: string,
651
forceReset?: boolean,
packages/react-refresh/src/__tests__/ReactFresh-test.js
+1
-1
@@ -3607,7 +3607,7 @@ describe('ReactFresh', () => {
3607
// a proper reload because we will bottle up the update.
3608
// So we're being somewhat conservative.
3609
expect(ReactFreshRuntime.isLikelyComponentType(() => {})).toBe(false);
3610
- expect(ReactFreshRuntime.isLikelyComponentType(function() {})).toBe(
3610
+ expect(ReactFreshRuntime.isLikelyComponentType(function () {})).toBe(
3611
false,
3612
);
3613
expect(
packages/react-refresh/src/__tests__/ReactFreshIntegration-test.js
+1
-1
@@ -95,7 +95,7 @@ describe('ReactFreshIntegration', () => {
95
});
96
97
describe('with typescript syntax', () => {
98
- runTests(function(source) {
98
+ runTests(function (source) {
99
const typescriptSource = babel.transform(source, {
100
babelrc: false,
101
configFile: false,
packages/react-refresh/src/__tests__/ReactFreshMultipleRenderer-test.internal.js
+4
-4
@@ -43,12 +43,12 @@ describe('ReactFresh', () => {
43
44
it('can update components managed by different renderers independently', () => {
45
if (__DEV__) {
46
- const InnerV1 = function() {
46
+ const InnerV1 = function () {
47
return <ReactART.Shape fill="blue" />;
48
};
49
ReactFreshRuntime.register(InnerV1, 'Inner');
50
51
- const OuterV1 = function() {
51
+ const OuterV1 = function () {
52
return (
53
<div style={{color: 'blue'}}>
54
<ReactART.Surface>
@@ -66,7 +66,7 @@ describe('ReactFresh', () => {
66
expect(pathEl.getAttributeNS(null, 'fill')).toBe('rgb(0, 0, 255)');
67
68
// Perform a hot update to the ART-rendered component.
69
- const InnerV2 = function() {
69
+ const InnerV2 = function () {
70
return <ReactART.Shape fill="red" />;
71
};
72
ReactFreshRuntime.register(InnerV2, 'Inner');
@@ -78,7 +78,7 @@ describe('ReactFresh', () => {
78
expect(pathEl.getAttributeNS(null, 'fill')).toBe('rgb(255, 0, 0)');
79
80
// Perform a hot update to the DOM-rendered component.
81
- const OuterV2 = function() {
81
+ const OuterV2 = function () {
82
return (
83
<div style={{color: 'red'}}>
84
<ReactART.Surface>
packages/react-server-dom-relay/src/ReactFlightDOMRelayServerHostConfig.js
+2
-3
@@ -194,9 +194,8 @@ export function scheduleWork(callback: () => void) {
194
export function flushBuffered(destination: Destination) {}
195
196
export const supportsRequestStorage = false;
197
-export const requestStorage: AsyncLocalStorage<
198
- Map<Function, mixed>,
199
-> = (null: any);
197
+export const requestStorage: AsyncLocalStorage<Map<Function, mixed>> =
198
+ (null: any);
199
200
export function beginWriting(destination: Destination) {}
201
packages/react-server-dom-relay/src/ReactServerStreamConfigFB.js
+2
-3
@@ -24,9 +24,8 @@ export function scheduleWork(callback: () => void) {
24
export function flushBuffered(destination: Destination) {}
25
26
export const supportsRequestStorage = false;
27
-export const requestStorage: AsyncLocalStorage<
28
- Map<Function, mixed>,
29
-> = (null: any);
27
+export const requestStorage: AsyncLocalStorage<Map<Function, mixed>> =
28
+ (null: any);
29
30
export function beginWriting(destination: Destination) {}
31
packages/react-server-dom-relay/src/__tests__/ReactFlightDOMRelay-test.internal.js
+1
-1
@@ -226,7 +226,7 @@ describe('ReactFlightDOMRelay', () => {
226
Foo.prototype = Object.create(Bar.prototype);
227
// This is enumerable which some polyfills do.
228
Foo.prototype.constructor = Foo;
229
- Foo.prototype.method = function() {};
229
+ Foo.prototype.method = function () {};
230
231
expect(() => {
232
const transport = [];
packages/react-server-dom-webpack/src/ReactFlightClientWebpackBundlerConfig.js
+4
-2
@@ -95,12 +95,14 @@ export function preloadModule<T>(
95
});
96
modulePromise.then(
97
value => {
98
- const fulfilledThenable: FulfilledThenable<mixed> = (modulePromise: any);
98
+ const fulfilledThenable: FulfilledThenable<mixed> =
99
+ (modulePromise: any);
100
fulfilledThenable.status = 'fulfilled';
101
fulfilledThenable.value = value;
102
},
103
reason => {
103
- const rejectedThenable: RejectedThenable<mixed> = (modulePromise: any);
104
+ const rejectedThenable: RejectedThenable<mixed> =
105
+ (modulePromise: any);
106
rejectedThenable.status = 'rejected';
107
rejectedThenable.reason = reason;
108
},
packages/react-server-dom-webpack/src/ReactFlightDOMClient.js
+4
-10
@@ -38,18 +38,12 @@ function startReadingFromStream(
38
}
39
const buffer: Uint8Array = (value: any);
40
processBinaryChunk(response, buffer);
41
- return reader
42
- .read()
43
- .then(progress)
44
- .catch(error);
41
+ return reader.read().then(progress).catch(error);
42
}
43
function error(e: any) {
44
reportGlobalError(response, e);
45
}
49
- reader
50
- .read()
51
- .then(progress)
52
- .catch(error);
46
+ reader.read().then(progress).catch(error);
47
}
48
49
function createFromReadableStream<T>(
@@ -71,10 +65,10 @@ function createFromFetch<T>(
65
options && options.moduleMap ? options.moduleMap : null,
66
);
67
promiseForResponse.then(
74
- function(r) {
68
+ function (r) {
69
startReadingFromStream(response, (r.body: any));
70
},
77
- function(e) {
71
+ function (e) {
72
reportGlobalError(response, e);
73
},
74
);
packages/react-server-dom-webpack/src/ReactFlightWebpackNodeRegister.js
+10
-10
@@ -16,7 +16,7 @@ module.exports = function register() {
16
const PROMISE_PROTOTYPE = Promise.prototype;
17
18
const deepProxyHandlers = {
19
- get: function(target: Function, name: string, receiver: Proxy<Function>) {
19
+ get: function (target: Function, name: string, receiver: Proxy<Function>) {
20
switch (name) {
21
// These names are read by the Flight runtime if you end up using the exports object.
22
case '$$typeof':
@@ -68,13 +68,13 @@ module.exports = function register() {
68
'You can only pass the imported name through.',
69
);
70
},
71
- set: function() {
71
+ set: function () {
72
throw new Error('Cannot assign to a client module from a server module.');
73
},
74
};
75
76
const proxyHandlers = {
77
- get: function(target: Function, name: string, receiver: Proxy<Function>) {
77
+ get: function (target: Function, name: string, receiver: Proxy<Function>) {
78
switch (name) {
79
// These names are read by the Flight runtime if you end up using the exports object.
80
case '$$typeof':
@@ -104,7 +104,7 @@ module.exports = function register() {
104
// an ESM compat module but then we'll check again on the client.
105
const moduleId = target.filepath;
106
target.default = Object.defineProperties(
107
- (function() {
107
+ (function () {
108
throw new Error(
109
`Attempted to call the default export of ${moduleId} from the server` +
110
`but it's on the client. It's not possible to invoke a client function from ` +
@@ -134,7 +134,7 @@ module.exports = function register() {
134
135
const innerModuleId = target.filepath;
136
const clientReference: Function = Object.defineProperties(
137
- (function() {
137
+ (function () {
138
throw new Error(
139
`Attempted to call the module exports of ${innerModuleId} from the server` +
140
`but it's on the client. It's not possible to invoke a client function from ` +
@@ -185,7 +185,7 @@ module.exports = function register() {
185
let cachedReference = target[name];
186
if (!cachedReference) {
187
const reference = Object.defineProperties(
188
- (function() {
188
+ (function () {
189
throw new Error(
190
// eslint-disable-next-line react-internal/safe-string-coercion
191
`Attempted to call ${String(name)}() from the server but ${String(
@@ -213,16 +213,16 @@ module.exports = function register() {
213
// Pretend to be a Promise in case anyone asks.
214
return PROMISE_PROTOTYPE;
215
},
216
- set: function() {
216
+ set: function () {
217
throw new Error('Cannot assign to a client module from a server module.');
218
},
219
};
220
221
// $FlowFixMe[prop-missing] found when upgrading Flow
222
- Module._extensions['.client.js'] = function(module, path) {
222
+ Module._extensions['.client.js'] = function (module, path) {
223
const moduleId: string = (url.pathToFileURL(path).href: any);
224
const clientReference: Function = Object.defineProperties(
225
- (function() {
225
+ (function () {
226
throw new Error(
227
`Attempted to call the module exports of ${moduleId} from the server` +
228
`but it's on the client. It's not possible to invoke a client function from ` +
@@ -247,7 +247,7 @@ module.exports = function register() {
247
248
// $FlowFixMe[prop-missing] found when upgrading Flow
249
// $FlowFixMe[missing-this-annot]
250
- Module._resolveFilename = function(request, parent, isMain, options) {
250
+ Module._resolveFilename = function (request, parent, isMain, options) {
251
const resolved = originalResolveFilename.apply(this, arguments);
252
if (resolved.endsWith('.server.js')) {
253
if (
packages/react-server-dom-webpack/src/ReactFlightWebpackPlugin.js
+11
-11
@@ -119,7 +119,7 @@ export default class ReactFlightWebpackPlugin {
119
contextResolver,
120
compiler.inputFileSystem,
121
contextModuleFactory,
122
- function(err, resolvedClientRefs) {
122
+ function (err, resolvedClientRefs) {
123
if (err) {
124
callback(err);
125
return;
@@ -205,7 +205,7 @@ export default class ReactFlightWebpackPlugin {
205
name: PLUGIN_NAME,
206
stage: Compilation.PROCESS_ASSETS_STAGE_REPORT,
207
},
208
- function() {
208
+ function () {
209
if (clientFileNameFound === false) {
210
compilation.warnings.push(
211
new WebpackError(
@@ -220,8 +220,8 @@ export default class ReactFlightWebpackPlugin {
220
[string]: {chunks: $FlowFixMe, id: $FlowFixMe, name: string},
221
},
222
} = {};
223
- compilation.chunkGroups.forEach(function(chunkGroup) {
224
- const chunkIds = chunkGroup.chunks.map(function(c) {
223
+ compilation.chunkGroups.forEach(function (chunkGroup) {
224
+ const chunkIds = chunkGroup.chunks.map(function (c) {
225
return c.id;
226
});
227
@@ -248,7 +248,7 @@ export default class ReactFlightWebpackPlugin {
248
? moduleProvidedExports
249
: [],
250
)
251
- .forEach(function(name) {
251
+ .forEach(function (name) {
252
moduleExports[name] = {
253
id,
254
chunks: chunkIds,
@@ -262,12 +262,11 @@ export default class ReactFlightWebpackPlugin {
262
}
263
}
264
265
- chunkGroup.chunks.forEach(function(chunk) {
266
- const chunkModules = compilation.chunkGraph.getChunkModulesIterable(
267
- chunk,
268
- );
265
+ chunkGroup.chunks.forEach(function (chunk) {
266
+ const chunkModules =
267
+ compilation.chunkGraph.getChunkModulesIterable(chunk);
268
270
- Array.from(chunkModules).forEach(function(module) {
269
+ Array.from(chunkModules).forEach(function (module) {
270
const moduleId = compilation.chunkGraph.getModuleId(module);
271
272
recordModule(moduleId, module);
@@ -316,7 +315,8 @@ export default class ReactFlightWebpackPlugin {
315
cb(null, [new ClientReferenceDependency(clientReferencePath)]);
316
return;
317
}
319
- const clientReferenceSearch: ClientReferenceSearchPath = clientReferencePath;
318
+ const clientReferenceSearch: ClientReferenceSearchPath =
319
+ clientReferencePath;
320
contextResolver.resolve(
321
{},
322
context,
packages/react-server-dom-webpack/src/__tests__/ReactFlightDOM-test.js
+5
-4
@@ -10,7 +10,8 @@
10
'use strict';
11
12
// Polyfills for test environment
13
-global.ReadableStream = require('web-streams-polyfill/ponyfill/es6').ReadableStream;
13
+global.ReadableStream =
14
+ require('web-streams-polyfill/ponyfill/es6').ReadableStream;
15
global.TextDecoder = require('util').TextDecoder;
16
17
// Don't wait before processing work on the server.
@@ -738,7 +739,7 @@ describe('ReactFlightDOM', () => {
739
it('should be able to recover from a direct reference erroring client-side', async () => {
740
const reportedErrors = [];
741
741
- const ClientComponent = clientExports(function({prop}) {
742
+ const ClientComponent = clientExports(function ({prop}) {
743
return 'This should never render';
744
});
745
@@ -784,7 +785,7 @@ describe('ReactFlightDOM', () => {
785
it('should be able to recover from a direct reference erroring client-side async', async () => {
786
const reportedErrors = [];
787
787
- const ClientComponent = clientExports(function({prop}) {
788
+ const ClientComponent = clientExports(function ({prop}) {
789
return 'This should never render';
790
});
791
@@ -842,7 +843,7 @@ describe('ReactFlightDOM', () => {
843
it('should be able to recover from a direct reference erroring server-side', async () => {
844
const reportedErrors = [];
845
845
- const ClientComponent = clientExports(function({prop}) {
846
+ const ClientComponent = clientExports(function ({prop}) {
847
return 'This should never render';
848
});
849
packages/react-server-dom-webpack/src/__tests__/ReactFlightDOMBrowser-test.js
+2
-1
@@ -10,7 +10,8 @@
10
'use strict';
11
12
// Polyfills for test environment
13
-global.ReadableStream = require('web-streams-polyfill/ponyfill/es6').ReadableStream;
13
+global.ReadableStream =
14
+ require('web-streams-polyfill/ponyfill/es6').ReadableStream;
15
global.TextEncoder = require('util').TextEncoder;
16
global.TextDecoder = require('util').TextDecoder;
17
packages/react-server-dom-webpack/src/__tests__/utils/WebpackMock.js
+1
-1
@@ -14,7 +14,7 @@ let webpackModuleIdx = 0;
14
const webpackModules = {};
15
const webpackErroredModules = {};
16
const webpackMap = {};
17
-global.__webpack_require__ = function(id) {
17
+global.__webpack_require__ = function (id) {
18
if (webpackErroredModules[id]) {
19
throw webpackErroredModules[id];
20
}
packages/react-server-native-relay/src/ReactFlightNativeRelayServerHostConfig.js
+2
-3
@@ -189,9 +189,8 @@ export function scheduleWork(callback: () => void) {
189
export function flushBuffered(destination: Destination) {}
190
191
export const supportsRequestStorage = false;
192
-export const requestStorage: AsyncLocalStorage<
193
- Map<Function, mixed>,
194
-> = (null: any);
192
+export const requestStorage: AsyncLocalStorage<Map<Function, mixed>> =
193
+ (null: any);
194
195
export function beginWriting(destination: Destination) {}
196
packages/react-server-native-relay/src/__tests__/ReactFlightNativeRelay-test.internal.js
+4
-3
@@ -25,8 +25,9 @@ describe('ReactFlightNativeRelay', () => {
25
React = require('react');
26
// TODO: Switch this out to react-native
27
ReactFabric = require('react-native-renderer/fabric');
28
- createReactNativeComponentClass = require('react-native/Libraries/ReactPrivate/ReactNativePrivateInterface')
29
- .ReactNativeViewConfigRegistry.register;
28
+ createReactNativeComponentClass =
29
+ require('react-native/Libraries/ReactPrivate/ReactNativePrivateInterface')
30
+ .ReactNativeViewConfigRegistry.register;
31
View = createReactNativeComponentClass('RCTView', () => ({
32
validAttributes: {},
33
uiViewClassName: 'RCTView',
@@ -122,7 +123,7 @@ describe('ReactFlightNativeRelay', () => {
123
Foo.prototype = Object.create(Bar.prototype);
124
// This is enumerable which some polyfills do.
125
Foo.prototype.constructor = Foo;
125
- Foo.prototype.method = function() {};
126
+ Foo.prototype.method = function () {};
127
128
expect(() => {
129
const transport = [];
packages/react-server/src/ReactFizzClassComponent.js
+2
-2
@@ -41,7 +41,7 @@ if (__DEV__) {
41
42
const didWarnOnInvalidCallback = new Set();
43
44
- warnOnInvalidCallback = function(callback: mixed, callerName: string) {
44
+ warnOnInvalidCallback = function (callback: mixed, callerName: string) {
45
if (callback === null || typeof callback === 'function') {
46
return;
47
}
@@ -57,7 +57,7 @@ if (__DEV__) {
57
}
58
};
59
60
- warnOnUndefinedDerivedState = function(type: any, partialState: any) {
60
+ warnOnUndefinedDerivedState = function (type: any, partialState: any) {
61
if (partialState === undefined) {
62
const componentName = getComponentNameFromType(type) || 'Component';
63
if (!didWarnAboutUndefinedDerivedState.has(componentName)) {
packages/react-server/src/ReactFizzContext.js
+3
-2
@@ -78,8 +78,9 @@ export function processChildContext(
78
for (const contextKey in childContext) {
79
if (!(contextKey in childContextTypes)) {
80
throw new Error(
81
- `${getComponentNameFromType(type) ||
82
- 'Unknown'}.getChildContext(): key "${contextKey}" is not defined in childContextTypes.`,
81
+ `${
82
+ getComponentNameFromType(type) || 'Unknown'
83
+ }.getChildContext(): key "${contextKey}" is not defined in childContextTypes.`,
84
);
85
}
86
}
packages/react-server/src/ReactFlightServer.js
+6
-5
@@ -194,7 +194,7 @@ export function createRequest(
194
identifierCount: 1,
195
onError: onError === undefined ? defaultErrorHandler : onError,
196
// $FlowFixMe[missing-this-annot]
197
- toJSON: function(key: string, value: ReactModel): ReactJSONValue {
197
+ toJSON: function (key: string, value: ReactModel): ReactJSONValue {
198
return resolveModelToJSON(request, this, key, value);
199
},
200
};
@@ -533,7 +533,7 @@ function isSimpleObject(object: any): boolean {
533
function objectName(object: mixed): string {
534
// $FlowFixMe[method-unbinding]
535
const name = Object.prototype.toString.call(object);
536
- return name.replace(/^\[object (.*)\]$/, function(m, p0) {
536
+ return name.replace(/^\[object (.*)\]$/, function (m, p0) {
537
return p0;
538
});
539
}
@@ -1031,9 +1031,10 @@ function logRecoverableError(request: Request, error: mixed): string {
1031
return errorDigest || '';
1032
}
1033
1034
-function getErrorMessageAndStackDev(
1035
- error: mixed,
1036
-): {message: string, stack: string} {
1034
+function getErrorMessageAndStackDev(error: mixed): {
1035
+ message: string,
1036
+ stack: string,
1037
+} {
1038
if (__DEV__) {
1039
let message;
1040
let stack = '';
packages/react-server/src/ReactServerStreamConfigBrowser.js
+2
-3
@@ -24,9 +24,8 @@ export function flushBuffered(destination: Destination) {
24
// For now we support AsyncLocalStorage as a global for the "browser" builds
25
// TODO: Move this to some special WinterCG build.
26
export const supportsRequestStorage = typeof AsyncLocalStorage === 'function';
27
-export const requestStorage: AsyncLocalStorage<
28
- Map<Function, mixed>,
29
-> = supportsRequestStorage ? new AsyncLocalStorage() : (null: any);
27
+export const requestStorage: AsyncLocalStorage<Map<Function, mixed>> =
28
+ supportsRequestStorage ? new AsyncLocalStorage() : (null: any);
29
30
const VIEW_SIZE = 512;
31
let currentView = null;
packages/react-server/src/ReactServerStreamConfigNode.js
+7
-6
@@ -35,9 +35,8 @@ export function flushBuffered(destination: Destination) {
35
}
36
37
export const supportsRequestStorage = true;
38
-export const requestStorage: AsyncLocalStorage<
39
- Map<Function, mixed>,
40
-> = new AsyncLocalStorage();
38
+export const requestStorage: AsyncLocalStorage<Map<Function, mixed>> =
39
+ new AsyncLocalStorage();
40
41
const VIEW_SIZE = 2048;
42
let currentView = null;
@@ -78,9 +77,11 @@ function writeStringChunk(destination: Destination, stringChunk: string) {
77
if (read < stringChunk.length) {
78
writeToDestination(destination, (currentView: any));
79
currentView = new Uint8Array(VIEW_SIZE);
81
- // $FlowFixMe[incompatible-call] found when upgrading Flow
82
- writtenBytes = textEncoder.encodeInto(stringChunk.slice(read), currentView)
83
- .written;
80
+ writtenBytes = textEncoder.encodeInto(
81
+ stringChunk.slice(read),
82
+ // $FlowFixMe[incompatible-call] found when upgrading Flow
83
+ currentView,
84
+ ).written;
85
}
86
87
if (writtenBytes === VIEW_SIZE) {
packages/react-test-renderer/src/ReactTestRenderer.js
+2
-2
@@ -84,7 +84,7 @@ type FindOptions = $Shape<{
84
export type Predicate = (node: ReactTestInstance) => ?boolean;
85
86
const defaultTestOptions = {
87
- createNodeMock: function() {
87
+ createNodeMock: function () {
88
return null;
89
},
90
};
@@ -592,7 +592,7 @@ function create(
592
({
593
configurable: true,
594
enumerable: true,
595
- get: function() {
595
+ get: function () {
596
if (root === null) {
597
throw new Error("Can't access .root on unmounted test renderer");
598
}
packages/react/index.js
+2
-3
@@ -8,9 +8,8 @@
8
*/
9
10
// Keep in sync with https://github.com/facebook/flow/blob/main/lib/react.js
11
-export type StatelessFunctionalComponent<
12
- P,
13
-> = React$StatelessFunctionalComponent<P>;
11
+export type StatelessFunctionalComponent<P> =
12
+ React$StatelessFunctionalComponent<P>;
13
export type ComponentType<-P> = React$ComponentType<P>;
14
export type AbstractComponent<
15
-Config,
packages/react/src/ReactBaseClasses.js
+4
-4
@@ -53,7 +53,7 @@ Component.prototype.isReactComponent = {};
53
* @final
54
* @protected
55
*/
56
-Component.prototype.setState = function(partialState, callback) {
56
+Component.prototype.setState = function (partialState, callback) {
57
if (
58
typeof partialState !== 'object' &&
59
typeof partialState !== 'function' &&
@@ -82,7 +82,7 @@ Component.prototype.setState = function(partialState, callback) {
82
* @final
83
* @protected
84
*/
85
-Component.prototype.forceUpdate = function(callback) {
85
+Component.prototype.forceUpdate = function (callback) {
86
this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
87
};
88
@@ -104,9 +104,9 @@ if (__DEV__) {
104
'https://github.com/facebook/react/issues/3236).',
105
],
106
};
107
- const defineDeprecationWarning = function(methodName, info) {
107
+ const defineDeprecationWarning = function (methodName, info) {
108
Object.defineProperty(Component.prototype, methodName, {
109
- get: function() {
109
+ get: function () {
110
console.warn(
111
'%s(...) is deprecated in plain JavaScript React classes. %s',
112
info[0],
packages/react/src/ReactCache.js
+1
-1
@@ -53,7 +53,7 @@ function createCacheNode<T>(): CacheNode<T> {
53
}
54
55
export function cache<A: Iterable<mixed>, T>(fn: (...A) => T): (...A) => T {
56
- return function() {
56
+ return function () {
57
const dispatcher = ReactCurrentCache.current;
58
if (!dispatcher) {
59
// If there is no dispatcher, then we treat this as not being cached.
packages/react/src/ReactChildren.js
+3
-3
@@ -34,7 +34,7 @@ function escape(key: string): string {
34
'=': '=0',
35
':': '=2',
36
};
37
- const escapedString = key.replace(escapeRegex, function(match) {
37
+ const escapedString = key.replace(escapeRegex, function (match) {
38
return escaperLookup[match];
39
});
40
@@ -251,7 +251,7 @@ function mapChildren(
251
}
252
const result: Array<React$Node> = [];
253
let count = 0;
254
- mapIntoArray(children, result, '', '', function(child) {
254
+ mapIntoArray(children, result, '', '', function (child) {
255
return func.call(context, child, count++);
256
});
257
return result;
@@ -297,7 +297,7 @@ function forEachChildren(
297
mapChildren(
298
children,
299
// $FlowFixMe[missing-this-annot]
300
- function() {
300
+ function () {
301
forEachFunc.apply(this, arguments);
302
// Don't return anything.
303
},
packages/react/src/ReactDebugCurrentFrame.js
+2
-2
@@ -22,7 +22,7 @@ export function setExtraStackFrame(stack: null | string): void {
22
}
23
24
if (__DEV__) {
25
- ReactDebugCurrentFrame.setExtraStackFrame = function(stack: null | string) {
25
+ ReactDebugCurrentFrame.setExtraStackFrame = function (stack: null | string) {
26
if (__DEV__) {
27
currentExtraStackFrame = stack;
28
}
@@ -30,7 +30,7 @@ if (__DEV__) {
30
// Stack implementation injected by the current renderer.
31
ReactDebugCurrentFrame.getCurrentStack = (null: null | (() => string));
32
33
- ReactDebugCurrentFrame.getStackAddendum = function(): string {
33
+ ReactDebugCurrentFrame.getStackAddendum = function (): string {
34
let stack = '';
35
36
// Add an extra top frame while an element is being validated
packages/react/src/ReactElement.js
+3
-3
@@ -53,7 +53,7 @@ function hasValidKey(config) {
53
}
54
55
function defineKeyPropWarningGetter(props, displayName) {
56
- const warnAboutAccessingKey = function() {
56
+ const warnAboutAccessingKey = function () {
57
if (__DEV__) {
58
if (!specialPropKeyWarningShown) {
59
specialPropKeyWarningShown = true;
@@ -75,7 +75,7 @@ function defineKeyPropWarningGetter(props, displayName) {
75
}
76
77
function defineRefPropWarningGetter(props, displayName) {
78
- const warnAboutAccessingRef = function() {
78
+ const warnAboutAccessingRef = function () {
79
if (__DEV__) {
80
if (!specialPropRefWarningShown) {
81
specialPropRefWarningShown = true;
@@ -145,7 +145,7 @@ function warnIfStringRefCannotBeAutoConverted(config) {
145
* indicating filename, line number, and/or other information.
146
* @internal
147
*/
148
-const ReactElement = function(type, key, ref, self, source, owner, props) {
148
+const ReactElement = function (type, key, ref, self, source, owner, props) {
149
const element = {
150
// This tag allows us to uniquely identify this as a React Element
151
$$typeof: REACT_ELEMENT_TYPE,
packages/react/src/ReactElementValidator.js
+1
-1
@@ -518,7 +518,7 @@ export function createFactoryWithValidation(type) {
518
// Legacy hook: remove it
519
Object.defineProperty(validatedFactory, 'type', {
520
enumerable: false,
521
- get: function() {
521
+ get: function () {
522
console.warn(
523
'Factory.type is deprecated. Access the class directly ' +
524
'before passing it to createFactory.',
packages/react/src/ReactForwardRef.js
+2
-2
@@ -54,10 +54,10 @@ export function forwardRef<Props, ElementType: React$ElementType>(
54
Object.defineProperty(elementType, 'displayName', {
55
enumerable: false,
56
configurable: true,
57
- get: function() {
57
+ get: function () {
58
return ownName;
59
},
60
- set: function(name) {
60
+ set: function (name) {
61
ownName = name;
62
63
// The inner component shouldn't inherit this display name in most cases,
packages/react/src/ReactMemo.js
+2
-2
@@ -34,10 +34,10 @@ export function memo<Props>(
34
Object.defineProperty(elementType, 'displayName', {
35
enumerable: false,
36
configurable: true,
37
- get: function() {
37
+ get: function () {
38
return ownName;
39
},
40
- set: function(name) {
40
+ set: function (name) {
41
ownName = name;
42
43
// The inner component shouldn't inherit this display name in most cases,
packages/react/src/ReactNoopUpdateQueue.js
+4
-4
@@ -40,7 +40,7 @@ const ReactNoopUpdateQueue = {
40
* @protected
41
* @final
42
*/
43
- isMounted: function(publicInstance) {
43
+ isMounted: function (publicInstance) {
44
return false;
45
},
46
@@ -59,7 +59,7 @@ const ReactNoopUpdateQueue = {
59
* @param {?string} callerName name of the calling function in the public API.
60
* @internal
61
*/
62
- enqueueForceUpdate: function(publicInstance, callback, callerName) {
62
+ enqueueForceUpdate: function (publicInstance, callback, callerName) {
63
warnNoop(publicInstance, 'forceUpdate');
64
},
65
@@ -76,7 +76,7 @@ const ReactNoopUpdateQueue = {
76
* @param {?string} callerName name of the calling function in the public API.
77
* @internal
78
*/
79
- enqueueReplaceState: function(
79
+ enqueueReplaceState: function (
80
publicInstance,
81
completeState,
82
callback,
@@ -97,7 +97,7 @@ const ReactNoopUpdateQueue = {
97
* @param {?string} Name of the calling function in the public API.
98
* @internal
99
*/
100
- enqueueSetState: function(
100
+ enqueueSetState: function (
101
publicInstance,
102
partialState,
103
callback,
packages/react/src/__tests__/ReactChildren-test.js
+29
-29
@@ -21,7 +21,7 @@ describe('ReactChildren', () => {
21
22
it('should support identity for simple', () => {
23
const context = {};
24
- const callback = jest.fn().mockImplementation(function(kid, index) {
24
+ const callback = jest.fn().mockImplementation(function (kid, index) {
25
expect(this).toBe(context);
26
return kid;
27
});
@@ -46,7 +46,7 @@ describe('ReactChildren', () => {
46
47
it('should support Portal components', () => {
48
const context = {};
49
- const callback = jest.fn().mockImplementation(function(kid, index) {
49
+ const callback = jest.fn().mockImplementation(function (kid, index) {
50
expect(this).toBe(context);
51
return kid;
52
});
@@ -71,7 +71,7 @@ describe('ReactChildren', () => {
71
72
it('should treat single arrayless child as being in array', () => {
73
const context = {};
74
- const callback = jest.fn().mockImplementation(function(kid, index) {
74
+ const callback = jest.fn().mockImplementation(function (kid, index) {
75
expect(this).toBe(context);
76
return kid;
77
});
@@ -92,7 +92,7 @@ describe('ReactChildren', () => {
92
93
it('should treat single child in array as expected', () => {
94
const context = {};
95
- const callback = jest.fn().mockImplementation(function(kid, index) {
95
+ const callback = jest.fn().mockImplementation(function (kid, index) {
96
expect(this).toBe(context);
97
return kid;
98
});
@@ -119,7 +119,7 @@ describe('ReactChildren', () => {
119
const four = <div key="keyFour" />;
120
const context = {};
121
122
- const callback = jest.fn().mockImplementation(function(kid) {
122
+ const callback = jest.fn().mockImplementation(function (kid) {
123
expect(this).toBe(context);
124
return kid;
125
});
@@ -165,7 +165,7 @@ describe('ReactChildren', () => {
165
const a = <a key="aNode" />;
166
167
const context = {};
168
- const callback = jest.fn().mockImplementation(function(kid) {
168
+ const callback = jest.fn().mockImplementation(function (kid) {
169
expect(this).toBe(context);
170
return kid;
171
});
@@ -225,7 +225,7 @@ describe('ReactChildren', () => {
225
const five = <div key="keyFive" />;
226
227
const context = {};
228
- const callback = jest.fn().mockImplementation(function(kid) {
228
+ const callback = jest.fn().mockImplementation(function (kid) {
229
return kid;
230
});
231
@@ -263,7 +263,7 @@ describe('ReactChildren', () => {
263
const zeroForceKey = <div key="keyZero" />;
264
const oneForceKey = <div key="keyOne" />;
265
const context = {};
266
- const callback = jest.fn().mockImplementation(function(kid) {
266
+ const callback = jest.fn().mockImplementation(function (kid) {
267
expect(this).toBe(context);
268
return kid;
269
});
@@ -298,10 +298,10 @@ describe('ReactChildren', () => {
298
299
it('should be called for each child in an iterable without keys', () => {
300
const threeDivIterable = {
301
- '@@iterator': function() {
301
+ '@@iterator': function () {
302
let i = 0;
303
return {
304
- next: function() {
304
+ next: function () {
305
if (i++ < 3) {
306
return {value: <div />, done: false};
307
} else {
@@ -313,7 +313,7 @@ describe('ReactChildren', () => {
313
};
314
315
const context = {};
316
- const callback = jest.fn().mockImplementation(function(kid) {
316
+ const callback = jest.fn().mockImplementation(function (kid) {
317
expect(this).toBe(context);
318
return kid;
319
});
@@ -349,10 +349,10 @@ describe('ReactChildren', () => {
349
350
it('should be called for each child in an iterable with keys', () => {
351
const threeDivIterable = {
352
- '@@iterator': function() {
352
+ '@@iterator': function () {
353
let i = 0;
354
return {
355
- next: function() {
355
+ next: function () {
356
if (i++ < 3) {
357
return {value: <div key={'#' + i} />, done: false};
358
} else {
@@ -364,7 +364,7 @@ describe('ReactChildren', () => {
364
};
365
366
const context = {};
367
- const callback = jest.fn().mockImplementation(function(kid) {
367
+ const callback = jest.fn().mockImplementation(function (kid) {
368
expect(this).toBe(context);
369
return kid;
370
});
@@ -397,7 +397,7 @@ describe('ReactChildren', () => {
397
398
it('should not enumerate enumerable numbers (#4776)', () => {
399
/*eslint-disable no-extend-native */
400
- Number.prototype['@@iterator'] = function() {
400
+ Number.prototype['@@iterator'] = function () {
401
throw new Error('number iterator called');
402
};
403
/*eslint-enable no-extend-native */
@@ -412,12 +412,12 @@ describe('ReactChildren', () => {
412
);
413
414
const context = {};
415
- const callback = jest.fn().mockImplementation(function(kid) {
415
+ const callback = jest.fn().mockImplementation(function (kid) {
416
expect(this).toBe(context);
417
return kid;
418
});
419
420
- const assertCalls = function() {
420
+ const assertCalls = function () {
421
expect(callback).toHaveBeenCalledTimes(3);
422
expect(callback).toHaveBeenCalledWith(5, 0);
423
expect(callback).toHaveBeenCalledWith(12, 1);
@@ -454,7 +454,7 @@ describe('ReactChildren', () => {
454
);
455
456
const context = {};
457
- const callback = jest.fn().mockImplementation(function(kid) {
457
+ const callback = jest.fn().mockImplementation(function (kid) {
458
expect(this).toBe(context);
459
return kid;
460
});
@@ -482,7 +482,7 @@ describe('ReactChildren', () => {
482
});
483
484
it('should pass key to returned component', () => {
485
- const mapFn = function(kid, index) {
485
+ const mapFn = function (kid, index) {
486
return <div>{kid}</div>;
487
};
488
@@ -499,7 +499,7 @@ describe('ReactChildren', () => {
499
500
it('should invoke callback with the right context', () => {
501
let lastContext;
502
- const callback = function(kid, index) {
502
+ const callback = function (kid, index) {
503
lastContext = this;
504
return this;
505
};
@@ -536,7 +536,7 @@ describe('ReactChildren', () => {
536
<span />, // Map from null to something.
537
<div key="keyFour" />,
538
];
539
- const callback = jest.fn().mockImplementation(function(kid, index) {
539
+ const callback = jest.fn().mockImplementation(function (kid, index) {
540
return mapped[index];
541
});
542
@@ -597,7 +597,7 @@ describe('ReactChildren', () => {
597
const fourMapped = <div key="keyFour" />;
598
const fiveMapped = <div />;
599
600
- const callback = jest.fn().mockImplementation(function(kid) {
600
+ const callback = jest.fn().mockImplementation(function (kid) {
601
switch (kid) {
602
case zero:
603
return zeroMapped;
@@ -666,7 +666,7 @@ describe('ReactChildren', () => {
666
// Key should be added even if we don't supply it!
667
const oneForceKeyMapped = <div />;
668
669
- const mapFn = function(kid, index) {
669
+ const mapFn = function (kid, index) {
670
return index === 0 ? zeroForceKeyMapped : oneForceKeyMapped;
671
};
672
@@ -702,7 +702,7 @@ describe('ReactChildren', () => {
702
const zero = <div />;
703
const one = <div key="0" />;
704
705
- const mapFn = function() {
705
+ const mapFn = function () {
706
return null;
707
};
708
@@ -713,7 +713,7 @@ describe('ReactChildren', () => {
713
</div>
714
);
715
716
- expect(function() {
716
+ expect(function () {
717
React.Children.map(instance.props.children, mapFn);
718
}).not.toThrow();
719
});
@@ -935,8 +935,8 @@ describe('ReactChildren', () => {
935
});
936
937
it('should throw on object', () => {
938
- expect(function() {
939
- React.Children.forEach({a: 1, b: 2}, function() {}, null);
938
+ expect(function () {
939
+ React.Children.forEach({a: 1, b: 2}, function () {}, null);
940
}).toThrowError(
941
'Objects are not valid as a React child (found: object with keys ' +
942
'{a, b}).' +
@@ -950,8 +950,8 @@ describe('ReactChildren', () => {
950
it('should throw on regex', () => {
951
// Really, we care about dates (#4840) but those have nondeterministic
952
// serialization (timezones) so let's test a regex instead:
953
- expect(function() {
954
- React.Children.forEach(/abc/, function() {}, null);
953
+ expect(function () {
954
+ React.Children.forEach(/abc/, function () {}, null);
955
}).toThrowError(
956
'Objects are not valid as a React child (found: /abc/).' +
957
(__DEV__
packages/react/src/__tests__/ReactES6Class-test.js
+3
-5
@@ -18,7 +18,7 @@ let act;
18
describe('ReactES6Class', () => {
19
let container;
20
let root;
21
- const freeze = function(expectation) {
21
+ const freeze = function (expectation) {
22
Object.freeze(expectation);
23
return expectation;
24
};
@@ -301,7 +301,7 @@ describe('ReactES6Class', () => {
301
});
302
303
it('should warn with non-object in the initial state property', () => {
304
- [['an array'], 'a string', 1234].forEach(function(state) {
304
+ [['an array'], 'a string', 1234].forEach(function (state) {
305
class Foo extends React.Component {
306
constructor() {
307
super();
@@ -549,9 +549,7 @@ describe('ReactES6Class', () => {
549
'replaceState(...) is deprecated in plain JavaScript React classes',
550
{withoutStack: true},
551
);
552
- expect(() =>
553
- expect(() => ref.current.isMounted()).toThrow(),
554
- ).toWarnDev(
552
+ expect(() => expect(() => ref.current.isMounted()).toThrow()).toWarnDev(
553
'isMounted(...) is deprecated in plain JavaScript React classes',
554
{withoutStack: true},
555
);
packages/react/src/__tests__/ReactElement-test.js
+3
-5
@@ -71,9 +71,7 @@ describe('ReactElement', () => {
71
72
it('should warn when `key` is being accessed on a host element', () => {
73
const element = <div key="3" />;
74
- expect(
75
- () => void element.props.key,
76
- ).toErrorDev(
74
+ expect(() => void element.props.key).toErrorDev(
75
'div: `key` is not a prop. Trying to access it will result ' +
76
'in `undefined` being returned. If you need to access the same ' +
77
'value within the child component, you should pass it as a different ' +
@@ -336,7 +334,7 @@ describe('ReactElement', () => {
334
const el = <div className="moo" />;
335
336
if (__DEV__) {
339
- expect(function() {
337
+ expect(function () {
338
el.props.className = 'quack';
339
}).toThrow();
340
expect(el.props.className).toBe('moo');
@@ -363,7 +361,7 @@ describe('ReactElement', () => {
361
const el = <div>{this.props.sound}</div>;
362
363
if (__DEV__) {
366
- expect(function() {
364
+ expect(function () {
365
el.props.className = 'quack';
366
}).toThrow();
367
expect(el.props.className).toBe(undefined);
packages/react/src/__tests__/ReactElementJSX-test.js
+3
-5
@@ -92,7 +92,7 @@ describe('ReactElement.jsx', () => {
92
const el = JSXRuntime.jsx('div', {className: 'moo'});
93
94
if (__DEV__) {
95
- expect(function() {
95
+ expect(function () {
96
el.props.className = 'quack';
97
}).toThrow();
98
expect(el.props.className).toBe('moo');
@@ -121,7 +121,7 @@ describe('ReactElement.jsx', () => {
121
const el = JSXRuntime.jsx('div', {children: this.props.sound});
122
123
if (__DEV__) {
124
- expect(function() {
124
+ expect(function () {
125
el.props.className = 'quack';
126
}).toThrow();
127
expect(el.props.className).toBe(undefined);
@@ -200,9 +200,7 @@ describe('ReactElement.jsx', () => {
200
201
it('should warn when `key` is being accessed on a host element', () => {
202
const element = JSXRuntime.jsxs('div', {}, '3');
203
- expect(
204
- () => void element.props.key,
205
- ).toErrorDev(
203
+ expect(() => void element.props.key).toErrorDev(
204
'div: `key` is not a prop. Trying to access it will result ' +
205
'in `undefined` being returned. If you need to access the same ' +
206
'value within the child component, you should pass it as a different ' +
packages/react/src/__tests__/ReactElementValidator-test.internal.js
+6
-8
@@ -148,10 +148,10 @@ describe('ReactElementValidator', () => {
148
149
it('warns for keys for iterables of elements in rest args', () => {
150
const iterable = {
151
- '@@iterator': function() {
151
+ '@@iterator': function () {
152
let i = 0;
153
return {
154
- next: function() {
154
+ next: function () {
155
const done = ++i > 2;
156
return {
157
value: done ? undefined : React.createElement(ComponentClass),
@@ -176,10 +176,10 @@ describe('ReactElementValidator', () => {
176
177
it('does not warns for iterable elements with keys', () => {
178
const iterable = {
179
- '@@iterator': function() {
179
+ '@@iterator': function () {
180
let i = 0;
181
return {
182
- next: function() {
182
+ next: function () {
183
const done = ++i > 2;
184
return {
185
value: done
@@ -455,9 +455,7 @@ describe('ReactElementValidator', () => {
455
{withoutStack: true},
456
);
457
458
- expect(
459
- () => TestFactory.type,
460
- ).toWarnDev(
458
+ expect(() => TestFactory.type).toWarnDev(
459
'Warning: Factory.type is deprecated. Access the class directly before ' +
460
'passing it to createFactory.',
461
{withoutStack: true},
@@ -485,7 +483,7 @@ describe('ReactElementValidator', () => {
483
484
it('should not enumerate enumerable numbers (#4776)', () => {
485
/*eslint-disable no-extend-native */
488
- Number.prototype['@@iterator'] = function() {
486
+ Number.prototype['@@iterator'] = function () {
487
throw new Error('number iterator called');
488
};
489
/*eslint-enable no-extend-native */
packages/react/src/__tests__/ReactFetch-test.js
+2
-1
@@ -10,7 +10,8 @@
10
'use strict';
11
12
// Polyfills for test environment
13
-global.ReadableStream = require('web-streams-polyfill/ponyfill/es6').ReadableStream;
13
+global.ReadableStream =
14
+ require('web-streams-polyfill/ponyfill/es6').ReadableStream;
15
global.TextEncoder = require('util').TextEncoder;
16
global.TextDecoder = require('util').TextDecoder;
17
global.Headers = require('node-fetch').Headers;
packages/react/src/__tests__/ReactJSXElementValidator-test.js
+9
-15
@@ -75,10 +75,10 @@ describe('ReactJSXElementValidator', () => {
75
76
it('warns for keys for iterables of elements in rest args', () => {
77
const iterable = {
78
- '@@iterator': function() {
78
+ '@@iterator': function () {
79
let i = 0;
80
return {
81
- next: function() {
81
+ next: function () {
82
const done = ++i > 2;
83
return {value: done ? undefined : <Component />, done: done};
84
},
@@ -99,10 +99,10 @@ describe('ReactJSXElementValidator', () => {
99
100
it('does not warn for iterable elements with keys', () => {
101
const iterable = {
102
- '@@iterator': function() {
102
+ '@@iterator': function () {
103
let i = 0;
104
return {
105
- next: function() {
105
+ next: function () {
106
const done = ++i > 2;
107
return {
108
value: done ? undefined : <Component key={'#' + i} />,
@@ -118,10 +118,10 @@ describe('ReactJSXElementValidator', () => {
118
119
it('does not warn for numeric keys in entry iterable as a child', () => {
120
const iterable = {
121
- '@@iterator': function() {
121
+ '@@iterator': function () {
122
let i = 0;
123
return {
124
- next: function() {
124
+ next: function () {
125
const done = ++i > 2;
126
return {value: done ? undefined : [i, <Component />], done: done};
127
},
@@ -210,9 +210,7 @@ describe('ReactJSXElementValidator', () => {
210
const Null = null;
211
const True = true;
212
const Div = 'div';
213
- expect(
214
- () => void (<Undefined />),
215
- ).toErrorDev(
213
+ expect(() => void (<Undefined />)).toErrorDev(
214
'Warning: React.createElement: type is invalid -- expected a string ' +
215
'(for built-in components) or a class/function (for composite ' +
216
'components) but got: undefined. You likely forgot to export your ' +
@@ -221,18 +219,14 @@ describe('ReactJSXElementValidator', () => {
219
'\n\nCheck your code at **.',
220
{withoutStack: true},
221
);
224
- expect(
225
- () => void (<Null />),
226
- ).toErrorDev(
222
+ expect(() => void (<Null />)).toErrorDev(
223
'Warning: React.createElement: type is invalid -- expected a string ' +
224
'(for built-in components) or a class/function (for composite ' +
225
'components) but got: null.' +
226
'\n\nCheck your code at **.',
227
{withoutStack: true},
228
);
233
- expect(
234
- () => void (<True />),
235
- ).toErrorDev(
229
+ expect(() => void (<True />)).toErrorDev(
230
'Warning: React.createElement: type is invalid -- expected a string ' +
231
'(for built-in components) or a class/function (for composite ' +
232
'components) but got: boolean.' +
packages/react/src/__tests__/ReactProfiler-test.internal.js
+6
-3
@@ -30,9 +30,12 @@ function loadModules({
30
31
ReactFeatureFlags.enableProfilerTimer = enableProfilerTimer;
32
ReactFeatureFlags.enableProfilerCommitHooks = enableProfilerCommitHooks;
33
- ReactFeatureFlags.enableProfilerNestedUpdatePhase = enableProfilerNestedUpdatePhase;
34
- ReactFeatureFlags.enableProfilerNestedUpdateScheduledHook = enableProfilerNestedUpdateScheduledHook;
35
- ReactFeatureFlags.replayFailedUnitOfWorkWithInvokeGuardedCallback = replayFailedUnitOfWorkWithInvokeGuardedCallback;
33
+ ReactFeatureFlags.enableProfilerNestedUpdatePhase =
34
+ enableProfilerNestedUpdatePhase;
35
+ ReactFeatureFlags.enableProfilerNestedUpdateScheduledHook =
36
+ enableProfilerNestedUpdateScheduledHook;
37
+ ReactFeatureFlags.replayFailedUnitOfWorkWithInvokeGuardedCallback =
38
+ replayFailedUnitOfWorkWithInvokeGuardedCallback;
39
40
React = require('react');
41
Scheduler = require('scheduler');
packages/react/src/__tests__/ReactStrictMode-test.js
+3
-9
@@ -710,17 +710,13 @@ Please update the following components: Parent`,
710
const container = document.createElement('div');
711
const root = ReactDOMClient.createRoot(container);
712
root.render(<StrictRoot foo={true} />);
713
- expect(() =>
714
- Scheduler.unstable_flushAll(),
715
- ).toErrorDev(
713
+ expect(() => Scheduler.unstable_flushAll()).toErrorDev(
714
'Using UNSAFE_componentWillMount in strict mode is not recommended',
715
{withoutStack: true},
716
);
717
718
root.render(<StrictRoot foo={false} />);
721
- expect(() =>
722
- Scheduler.unstable_flushAll(),
723
- ).toErrorDev(
719
+ expect(() => Scheduler.unstable_flushAll()).toErrorDev(
720
'Using UNSAFE_componentWillMount in strict mode is not recommended',
721
{withoutStack: true},
722
);
@@ -770,9 +766,7 @@ Please update the following components: Parent`,
766
767
const container = document.createElement('div');
768
773
- expect(() =>
774
- ReactDOM.render(<SyncRoot />, container),
775
- ).toErrorDev(
769
+ expect(() => ReactDOM.render(<SyncRoot />, container)).toErrorDev(
770
'Using UNSAFE_componentWillReceiveProps in strict mode is not recommended',
771
{withoutStack: true},
772
);
packages/react/src/__tests__/createReactClassIntegration-test.js
+54
-58
@@ -30,7 +30,7 @@ describe('create-react-class-integration', () => {
30
});
31
32
it('should throw when `render` is not specified', () => {
33
- expect(function() {
33
+ expect(function () {
34
createReactClass({});
35
}).toThrowError(
36
'createClass(...): Class specification must implement a `render` method.',
@@ -43,7 +43,7 @@ describe('create-react-class-integration', () => {
43
propTypes: {
44
value: propValidator,
45
},
46
- render: function() {
46
+ render: function () {
47
return <div />;
48
},
49
});
@@ -59,7 +59,7 @@ describe('create-react-class-integration', () => {
59
propTypes: {
60
prop: null,
61
},
62
- render: function() {
62
+ render: function () {
63
return <span>{this.props.prop}</span>;
64
},
65
}),
@@ -77,7 +77,7 @@ describe('create-react-class-integration', () => {
77
contextTypes: {
78
prop: null,
79
},
80
- render: function() {
80
+ render: function () {
81
return <span>{this.props.prop}</span>;
82
},
83
}),
@@ -95,7 +95,7 @@ describe('create-react-class-integration', () => {
95
childContextTypes: {
96
prop: null,
97
},
98
- render: function() {
98
+ render: function () {
99
return <span>{this.props.prop}</span>;
100
},
101
}),
@@ -109,10 +109,10 @@ describe('create-react-class-integration', () => {
109
it('should warn when misspelling shouldComponentUpdate', () => {
110
expect(() =>
111
createReactClass({
112
- componentShouldUpdate: function() {
112
+ componentShouldUpdate: function () {
113
return false;
114
},
115
- render: function() {
115
+ render: function () {
116
return <div />;
117
},
118
}),
@@ -126,10 +126,10 @@ describe('create-react-class-integration', () => {
126
expect(() =>
127
createReactClass({
128
displayName: 'NamedComponent',
129
- componentShouldUpdate: function() {
129
+ componentShouldUpdate: function () {
130
return false;
131
},
132
- render: function() {
132
+ render: function () {
133
return <div />;
134
},
135
}),
@@ -144,10 +144,10 @@ describe('create-react-class-integration', () => {
144
it('should warn when misspelling componentWillReceiveProps', () => {
145
expect(() =>
146
createReactClass({
147
- componentWillRecieveProps: function() {
147
+ componentWillRecieveProps: function () {
148
return false;
149
},
150
- render: function() {
150
+ render: function () {
151
return <div />;
152
},
153
}),
@@ -161,10 +161,10 @@ describe('create-react-class-integration', () => {
161
it('should warn when misspelling UNSAFE_componentWillReceiveProps', () => {
162
expect(() =>
163
createReactClass({
164
- UNSAFE_componentWillRecieveProps: function() {
164
+ UNSAFE_componentWillRecieveProps: function () {
165
return false;
166
},
167
- render: function() {
167
+ render: function () {
168
return <div />;
169
},
170
}),
@@ -176,17 +176,17 @@ describe('create-react-class-integration', () => {
176
});
177
178
it('should throw if a reserved property is in statics', () => {
179
- expect(function() {
179
+ expect(function () {
180
createReactClass({
181
statics: {
182
- getDefaultProps: function() {
182
+ getDefaultProps: function () {
183
return {
184
foo: 0,
185
};
186
},
187
},
188
189
- render: function() {
189
+ render: function () {
190
return <span />;
191
},
192
});
@@ -212,7 +212,7 @@ describe('create-react-class-integration', () => {
212
childContextTypes: {
213
foo: PropTypes.string,
214
},
215
- render: function() {
215
+ render: function () {
216
return <div />;
217
},
218
}),
@@ -235,12 +235,12 @@ describe('create-react-class-integration', () => {
235
def: 0,
236
ghi: null,
237
jkl: 'mno',
238
- pqr: function() {
238
+ pqr: function () {
239
return this;
240
},
241
},
242
243
- render: function() {
243
+ render: function () {
244
return <span />;
245
},
246
});
@@ -260,12 +260,12 @@ describe('create-react-class-integration', () => {
260
261
it('should work with object getInitialState() return values', () => {
262
const Component = createReactClass({
263
- getInitialState: function() {
263
+ getInitialState: function () {
264
return {
265
occupation: 'clown',
266
};
267
},
268
- render: function() {
268
+ render: function () {
269
return <span />;
270
},
271
});
@@ -279,7 +279,7 @@ describe('create-react-class-integration', () => {
279
getInitialState() {
280
return {};
281
},
282
- render: function() {
282
+ render: function () {
283
return <span />;
284
},
285
});
@@ -322,17 +322,17 @@ describe('create-react-class-integration', () => {
322
});
323
324
it('should throw with non-object getInitialState() return values', () => {
325
- [['an array'], 'a string', 1234].forEach(function(state) {
325
+ [['an array'], 'a string', 1234].forEach(function (state) {
326
const Component = createReactClass({
327
- getInitialState: function() {
327
+ getInitialState: function () {
328
return state;
329
},
330
- render: function() {
330
+ render: function () {
331
return <span />;
332
},
333
});
334
let instance = <Component />;
335
- expect(function() {
335
+ expect(function () {
336
instance = ReactTestUtils.renderIntoDocument(instance);
337
}).toThrowError(
338
'Component.getInitialState(): must return an object or null',
@@ -342,10 +342,10 @@ describe('create-react-class-integration', () => {
342
343
it('should work with a null getInitialState() return value', () => {
344
const Component = createReactClass({
345
- getInitialState: function() {
345
+ getInitialState: function () {
346
return null;
347
},
348
- render: function() {
348
+ render: function () {
349
return <span />;
350
},
351
});
@@ -361,9 +361,7 @@ describe('create-react-class-integration', () => {
361
},
362
});
363
364
- expect(() =>
365
- expect(() => Component()).toThrow(),
366
- ).toErrorDev(
364
+ expect(() => expect(() => Component()).toThrow()).toErrorDev(
365
'Warning: Something is calling a React component directly. Use a ' +
366
'factory or JSX instead. See: https://fb.me/react-legacyfactory',
367
{withoutStack: true},
@@ -425,7 +423,7 @@ describe('create-react-class-integration', () => {
423
let instance;
424
const Component = createReactClass({
425
statics: {
428
- getDerivedStateFromProps: function() {
426
+ getDerivedStateFromProps: function () {
427
return {foo: 'bar'};
428
},
429
},
@@ -434,7 +432,7 @@ describe('create-react-class-integration', () => {
432
return {};
433
},
434
437
- render: function() {
435
+ render: function () {
436
instance = this;
437
return null;
438
},
@@ -483,7 +481,7 @@ describe('create-react-class-integration', () => {
481
const Foo = createReactClass({
482
displayName: 'Foo',
483
statics: {
486
- getSnapshotBeforeUpdate: function() {
484
+ getSnapshotBeforeUpdate: function () {
485
return null;
486
},
487
},
@@ -503,11 +501,11 @@ describe('create-react-class-integration', () => {
501
const Component = createReactClass({
502
displayName: 'Component',
503
statics: {
506
- getDerivedStateFromProps: function() {
504
+ getDerivedStateFromProps: function () {
505
return null;
506
},
507
},
510
- render: function() {
508
+ render: function () {
509
return null;
510
},
511
});
@@ -524,23 +522,23 @@ describe('create-react-class-integration', () => {
522
it('should not invoke deprecated lifecycles (cWM/cWRP/cWU) if new static gDSFP is present', () => {
523
const Component = createReactClass({
524
statics: {
527
- getDerivedStateFromProps: function() {
525
+ getDerivedStateFromProps: function () {
526
return null;
527
},
528
},
531
- componentWillMount: function() {
529
+ componentWillMount: function () {
530
throw Error('unexpected');
531
},
534
- componentWillReceiveProps: function() {
532
+ componentWillReceiveProps: function () {
533
throw Error('unexpected');
534
},
537
- componentWillUpdate: function() {
535
+ componentWillUpdate: function () {
536
throw Error('unexpected');
537
},
540
- getInitialState: function() {
538
+ getInitialState: function () {
539
return {};
540
},
543
- render: function() {
541
+ render: function () {
542
return null;
543
},
544
});
@@ -570,20 +568,20 @@ describe('create-react-class-integration', () => {
568
569
it('should not invoke deprecated lifecycles (cWM/cWRP/cWU) if new getSnapshotBeforeUpdate is present', () => {
570
const Component = createReactClass({
573
- getSnapshotBeforeUpdate: function() {
571
+ getSnapshotBeforeUpdate: function () {
572
return null;
573
},
576
- componentWillMount: function() {
574
+ componentWillMount: function () {
575
throw Error('unexpected');
576
},
579
- componentWillReceiveProps: function() {
577
+ componentWillReceiveProps: function () {
578
throw Error('unexpected');
579
},
582
- componentWillUpdate: function() {
580
+ componentWillUpdate: function () {
581
throw Error('unexpected');
582
},
585
- componentDidUpdate: function() {},
586
- render: function() {
583
+ componentDidUpdate: function () {},
584
+ render: function () {
585
return null;
586
},
587
});
@@ -617,27 +615,27 @@ describe('create-react-class-integration', () => {
615
const Component = createReactClass({
616
mixins: [
617
{
620
- componentWillMount: function() {
618
+ componentWillMount: function () {
619
log.push('componentWillMount');
620
},
623
- componentWillReceiveProps: function() {
621
+ componentWillReceiveProps: function () {
622
log.push('componentWillReceiveProps');
623
},
626
- componentWillUpdate: function() {
624
+ componentWillUpdate: function () {
625
log.push('componentWillUpdate');
626
},
627
},
628
],
631
- UNSAFE_componentWillMount: function() {
629
+ UNSAFE_componentWillMount: function () {
630
log.push('UNSAFE_componentWillMount');
631
},
634
- UNSAFE_componentWillReceiveProps: function() {
632
+ UNSAFE_componentWillReceiveProps: function () {
633
log.push('UNSAFE_componentWillReceiveProps');
634
},
637
- UNSAFE_componentWillUpdate: function() {
635
+ UNSAFE_componentWillUpdate: function () {
636
log.push('UNSAFE_componentWillUpdate');
637
},
640
- render: function() {
638
+ render: function () {
639
return null;
640
},
641
});
@@ -719,9 +717,7 @@ describe('create-react-class-integration', () => {
717
718
const container = document.createElement('div');
719
722
- expect(() =>
723
- ReactDOM.render(<Component />, container),
724
- ).toErrorDev(
720
+ expect(() => ReactDOM.render(<Component />, container)).toErrorDev(
721
'Warning: MyComponent: isMounted is deprecated. Instead, make sure to ' +
722
'clean up subscriptions and pending requests in componentWillUnmount ' +
723
'to prevent memory leaks.',
packages/react/src/__tests__/forwardRef-test.js
+7
-21
@@ -126,9 +126,7 @@ describe('forwardRef', () => {
126
});
127
128
it('should warn if not provided a callback during creation', () => {
129
- expect(() =>
130
- React.forwardRef(undefined),
131
- ).toErrorDev(
129
+ expect(() => React.forwardRef(undefined)).toErrorDev(
130
'forwardRef requires a render function but was given undefined.',
131
{withoutStack: true},
132
);
@@ -138,18 +136,14 @@ describe('forwardRef', () => {
136
withoutStack: true,
137
},
138
);
141
- expect(() =>
142
- React.forwardRef('foo'),
143
- ).toErrorDev(
139
+ expect(() => React.forwardRef('foo')).toErrorDev(
140
'forwardRef requires a render function but was given string.',
141
{withoutStack: true},
142
);
143
});
144
145
it('should warn if no render function is provided', () => {
150
- expect(
151
- React.forwardRef,
152
- ).toErrorDev(
146
+ expect(React.forwardRef).toErrorDev(
147
'forwardRef requires a render function but was given undefined.',
148
{withoutStack: true},
149
);
@@ -166,16 +160,12 @@ describe('forwardRef', () => {
160
}
161
renderWithDefaultProps.defaultProps = {};
162
169
- expect(() =>
170
- React.forwardRef(renderWithPropTypes),
171
- ).toErrorDev(
163
+ expect(() => React.forwardRef(renderWithPropTypes)).toErrorDev(
164
'forwardRef render functions do not support propTypes or defaultProps. ' +
165
'Did you accidentally pass a React component?',
166
{withoutStack: true},
167
);
176
- expect(() =>
177
- React.forwardRef(renderWithDefaultProps),
178
- ).toErrorDev(
168
+ expect(() => React.forwardRef(renderWithDefaultProps)).toErrorDev(
169
'forwardRef render functions do not support propTypes or defaultProps. ' +
170
'Did you accidentally pass a React component?',
171
{withoutStack: true},
@@ -191,9 +181,7 @@ describe('forwardRef', () => {
181
it('should warn if the render function provided does not use the forwarded ref parameter', () => {
182
const arityOfOne = props => <div {...props} />;
183
194
- expect(() =>
195
- React.forwardRef(arityOfOne),
196
- ).toErrorDev(
184
+ expect(() => React.forwardRef(arityOfOne)).toErrorDev(
185
'forwardRef render functions accept exactly two parameters: props and ref. ' +
186
'Did you forget to use the ref parameter?',
187
{withoutStack: true},
@@ -208,9 +196,7 @@ describe('forwardRef', () => {
196
it('should warn if the render function provided expects to use more than two parameters', () => {
197
const arityOfThree = (props, ref, x) => <div {...props} ref={ref} x={x} />;
198
211
- expect(() =>
212
- React.forwardRef(arityOfThree),
213
- ).toErrorDev(
199
+ expect(() => React.forwardRef(arityOfThree)).toErrorDev(
200
'forwardRef render functions accept exactly two parameters: props and ref. ' +
201
'Any additional parameter will be undefined.',
202
{withoutStack: true},
packages/react/src/__tests__/onlyChild-test.js
+5
-5
@@ -27,7 +27,7 @@ describe('onlyChild', () => {
27
});
28
29
it('should fail when passed two children', () => {
30
- expect(function() {
30
+ expect(function () {
31
const instance = (
32
<WrapComponent>
33
<div />
@@ -39,26 +39,26 @@ describe('onlyChild', () => {
39
});
40
41
it('should fail when passed nully values', () => {
42
- expect(function() {
42
+ expect(function () {
43
const instance = <WrapComponent>{null}</WrapComponent>;
44
React.Children.only(instance.props.children);
45
}).toThrow();
46
47
- expect(function() {
47
+ expect(function () {
48
const instance = <WrapComponent>{undefined}</WrapComponent>;
49
React.Children.only(instance.props.children);
50
}).toThrow();
51
});
52
53
it('should fail when key/value objects', () => {
54
- expect(function() {
54
+ expect(function () {
55
const instance = <WrapComponent>{[<span key="abc" />]}</WrapComponent>;
56
React.Children.only(instance.props.children);
57
}).toThrow();
58
});
59
60
it('should not fail when passed interpolated single child', () => {
61
- expect(function() {
61
+ expect(function () {
62
const instance = <WrapComponent>{<span />}</WrapComponent>;
63
React.Children.only(instance.props.children);
64
}).not.toThrow();
packages/react/src/jsx/ReactJSXElement.js
+3
-3
@@ -83,7 +83,7 @@ function warnIfStringRefCannotBeAutoConverted(config, self) {
83
84
function defineKeyPropWarningGetter(props, displayName) {
85
if (__DEV__) {
86
- const warnAboutAccessingKey = function() {
86
+ const warnAboutAccessingKey = function () {
87
if (!specialPropKeyWarningShown) {
88
specialPropKeyWarningShown = true;
89
console.error(
@@ -105,7 +105,7 @@ function defineKeyPropWarningGetter(props, displayName) {
105
106
function defineRefPropWarningGetter(props, displayName) {
107
if (__DEV__) {
108
- const warnAboutAccessingRef = function() {
108
+ const warnAboutAccessingRef = function () {
109
if (!specialPropRefWarningShown) {
110
specialPropRefWarningShown = true;
111
console.error(
@@ -145,7 +145,7 @@ function defineRefPropWarningGetter(props, displayName) {
145
* indicating filename, line number, and/or other information.
146
* @internal
147
*/
148
-const ReactElement = function(type, key, ref, self, source, owner, props) {
148
+const ReactElement = function (type, key, ref, self, source, owner, props) {
149
const element = {
150
// This tag allows us to uniquely identify this as a React Element
151
$$typeof: REACT_ELEMENT_TYPE,
packages/scheduler/npm/umd/scheduler.development.js
+2
-2
@@ -11,14 +11,14 @@
11
12
'use strict';
13
14
-(function(global, factory) {
14
+(function (global, factory) {
15
// eslint-disable-next-line ft-flow/no-unused-expressions
16
typeof exports === 'object' && typeof module !== 'undefined'
17
? (module.exports = factory(require('react')))
18
: typeof define === 'function' && define.amd // eslint-disable-line no-undef
19
? define(['react'], factory) // eslint-disable-line no-undef
20
: (global.Scheduler = factory(global));
21
-})(this, function(global) {
21
+})(this, function (global) {
22
function unstable_now() {
23
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_now.apply(
24
this,
packages/scheduler/npm/umd/scheduler.production.min.js
+2
-2
@@ -11,14 +11,14 @@
11
12
'use strict';
13
14
-(function(global, factory) {
14
+(function (global, factory) {
15
// eslint-disable-next-line ft-flow/no-unused-expressions
16
typeof exports === 'object' && typeof module !== 'undefined'
17
? (module.exports = factory(require('react')))
18
: typeof define === 'function' && define.amd // eslint-disable-line no-undef
19
? define(['react'], factory) // eslint-disable-line no-undef
20
: (global.Scheduler = factory(global));
21
-})(this, function(global) {
21
+})(this, function (global) {
22
function unstable_now() {
23
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_now.apply(
24
this,
packages/scheduler/npm/umd/scheduler.profiling.min.js
+2
-2
@@ -11,14 +11,14 @@
11
12
'use strict';
13
14
-(function(global, factory) {
14
+(function (global, factory) {
15
// eslint-disable-next-line ft-flow/no-unused-expressions
16
typeof exports === 'object' && typeof module !== 'undefined'
17
? (module.exports = factory(require('react')))
18
: typeof define === 'function' && define.amd // eslint-disable-line no-undef
19
? define(['react'], factory) // eslint-disable-line no-undef
20
: (global.Scheduler = factory(global));
21
-})(this, function(global) {
21
+})(this, function (global) {
22
function unstable_now() {
23
return global.React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Scheduler.unstable_now.apply(
24
this,
packages/scheduler/src/__tests__/SchedulerPostTask-test.js
+1
-1
@@ -83,7 +83,7 @@ describe('SchedulerPostTask', () => {
83
const scheduler = {};
84
global.scheduler = scheduler;
85
86
- scheduler.postTask = function(callback, {priority, signal}) {
86
+ scheduler.postTask = function (callback, {priority, signal}) {
87
const id = idCounter++;
88
log(
89
`Post Task ${id} [${priority === undefined ? '<default>' : priority}]`,
packages/scheduler/src/__tests__/SchedulerProfiling-test.js
+2
-1
@@ -81,7 +81,8 @@ describe('Scheduler', () => {
81
const SchedulerResumeEvent = 8;
82
83
function stopProfilingAndPrintFlamegraph() {
84
- const eventBuffer = Scheduler.unstable_Profiling.stopLoggingProfilingEvents();
84
+ const eventBuffer =
85
+ Scheduler.unstable_Profiling.stopLoggingProfilingEvents();
86
if (eventBuffer === null) {
87
return '(empty profile)';
88
}
packages/scheduler/src/__tests__/SchedulerSetImmediate-test.js
+2
-2
@@ -76,7 +76,7 @@ describe('SchedulerDOMSetImmediate', () => {
76
};
77
78
// Unused: we expect setImmediate to be preferred.
79
- global.MessageChannel = function() {
79
+ global.MessageChannel = function () {
80
return {
81
port1: {},
82
port2: {
@@ -88,7 +88,7 @@ describe('SchedulerDOMSetImmediate', () => {
88
};
89
90
let pendingSetImmediateCallback = null;
91
- global.setImmediate = function(cb) {
91
+ global.setImmediate = function (cb) {
92
if (pendingSetImmediateCallback) {
93
throw Error('Message event already scheduled');
94
}
packages/scheduler/src/__tests__/SchedulerUMDBundle-test.internal.js
+2
-2
@@ -42,8 +42,8 @@ describe('Scheduling UMD bundle', () => {
42
const umdAPIDev = require('../../npm/umd/scheduler.development');
43
const umdAPIProd = require('../../npm/umd/scheduler.production.min');
44
const umdAPIProfiling = require('../../npm/umd/scheduler.profiling.min');
45
- const secretAPI = require('react/src/forks/ReactSharedInternals.umd')
46
- .default;
45
+ const secretAPI =
46
+ require('react/src/forks/ReactSharedInternals.umd').default;
47
validateForwardedAPIs(api, [
48
umdAPIDev,
49
umdAPIProd,
packages/scheduler/src/forks/Scheduler.js
+1
-1
@@ -330,7 +330,7 @@ function unstable_wrapCallback<T: (...Array<mixed>) => mixed>(callback: T): T {
330
var parentPriorityLevel = currentPriorityLevel;
331
// $FlowFixMe[incompatible-return]
332
// $FlowFixMe[missing-this-annot]
333
- return function() {
333
+ return function () {
334
// This is a fork of runWithPriority, inlined for performance.
335
var previousPriorityLevel = currentPriorityLevel;
336
currentPriorityLevel = parentPriorityLevel;
packages/scheduler/src/forks/SchedulerMock.js
+1
-1
@@ -323,7 +323,7 @@ function unstable_wrapCallback<T: (...Array<mixed>) => mixed>(callback: T): T {
323
var parentPriorityLevel = currentPriorityLevel;
324
// $FlowFixMe[incompatible-return]
325
// $FlowFixMe[missing-this-annot]
326
- return function() {
326
+ return function () {
327
// This is a fork of runWithPriority, inlined for performance.
328
var previousPriorityLevel = currentPriorityLevel;
329
currentPriorityLevel = parentPriorityLevel;
packages/scheduler/src/forks/SchedulerPostTask.js
+1
-3
@@ -67,9 +67,7 @@ export function unstable_requestPaint() {
67
// Since we yield every frame regardless, `requestPaint` has no effect.
68
}
69
70
-type SchedulerCallback<T> = (
71
- didTimeout_DEPRECATED: boolean,
72
-) =>
70
+type SchedulerCallback<T> = (didTimeout_DEPRECATED: boolean) =>
71
| T
72
// May return a continuation
73
| SchedulerCallback<T>;
packages/shared/ReactComponentStackFrame.js
+2
-2
@@ -97,12 +97,12 @@ export function describeNativeComponentFrame(
97
// This should throw.
98
if (construct) {
99
// Something should be setting the props in the constructor.
100
- const Fake = function() {
100
+ const Fake = function () {
101
throw Error();
102
};
103
// $FlowFixMe
104
Object.defineProperty(Fake.prototype, 'props', {
105
- set: function() {
105
+ set: function () {
106
// We use a throwing setter instead of frozen or non-writable props
107
// because that won't throw in a non-strict mode function.
108
throw Error();
packages/shared/ReactFeatureFlags.js
+2
-1
@@ -31,7 +31,8 @@ export const skipUnmountedBoundaries = true;
31
export const enableClientRenderFallbackOnTextMismatch = true;
32
33
// TODO: Need to review this code one more time before landing
34
-export const enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay = true;
34
+export const enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay =
35
+ true;
36
37
// Recoil still uses useMutableSource in www, need to delete
38
export const enableUseMutableSource = false;
packages/shared/__tests__/ReactErrorUtils-test.internal.js
+9
-9
@@ -19,7 +19,7 @@ describe('ReactErrorUtils', () => {
19
20
it(`it should rethrow caught errors`, () => {
21
const err = new Error('foo');
22
- const callback = function() {
22
+ const callback = function () {
23
throw err;
24
};
25
ReactErrorUtils.invokeGuardedCallbackAndCatchFirstError(
@@ -47,7 +47,7 @@ describe('ReactErrorUtils', () => {
47
const context = {didCall: false};
48
ReactErrorUtils.invokeGuardedCallback(
49
'foo',
50
- function() {
50
+ function () {
51
this.didCall = true;
52
},
53
context,
@@ -59,7 +59,7 @@ describe('ReactErrorUtils', () => {
59
const error = new Error();
60
const returnValue = ReactErrorUtils.invokeGuardedCallback(
61
'foo',
62
- function() {
62
+ function () {
63
throw error;
64
},
65
null,
@@ -84,10 +84,10 @@ describe('ReactErrorUtils', () => {
84
const err3 = new Error();
85
ReactErrorUtils.invokeGuardedCallback(
86
'foo',
87
- function() {
87
+ function () {
88
ReactErrorUtils.invokeGuardedCallback(
89
'foo',
90
- function() {
90
+ function () {
91
throw err1;
92
},
93
null,
@@ -108,10 +108,10 @@ describe('ReactErrorUtils', () => {
108
let err2;
109
ReactErrorUtils.invokeGuardedCallback(
110
'foo',
111
- function() {
111
+ function () {
112
ReactErrorUtils.invokeGuardedCallback(
113
'foo',
114
- function() {
114
+ function () {
115
throw err1;
116
},
117
null,
@@ -163,7 +163,7 @@ describe('ReactErrorUtils', () => {
163
it('catches null values', () => {
164
ReactErrorUtils.invokeGuardedCallback(
165
null,
166
- function() {
166
+ function () {
167
throw null; // eslint-disable-line no-throw-literal
168
},
169
null,
@@ -192,7 +192,7 @@ describe('ReactErrorUtils', () => {
192
193
try {
194
const err = new Error('foo');
195
- const callback = function() {
195
+ const callback = function () {
196
throw err;
197
};
198
ReactErrorUtils.invokeGuardedCallbackAndCatchFirstError(
packages/shared/enqueueTask.js
+1
-1
@@ -24,7 +24,7 @@ export default function enqueueTask(task: () => void): void {
24
// we're in a browser
25
// we can't use regular timers because they may still be faked
26
// so we try MessageChannel+postMessage instead
27
- enqueueTaskImpl = function(callback: () => void) {
27
+ enqueueTaskImpl = function (callback: () => void) {
28
if (__DEV__) {
29
if (didWarnAboutMessageChannel === false) {
30
didWarnAboutMessageChannel = true;
packages/shared/forks/ReactFeatureFlags.native-fb.js
+2
-1
@@ -51,7 +51,8 @@ export const enableCPUSuspense = true;
51
export const enableUseHook = true;
52
export const enableUseMemoCacheHook = true;
53
export const enableUseEffectEventHook = false;
54
-export const enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay = true;
54
+export const enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay =
55
+ true;
56
export const enableClientRenderFallbackOnTextMismatch = true;
57
export const enableComponentStackLocations = false;
58
export const enableLegacyFBSupport = false;
packages/shared/forks/ReactFeatureFlags.native-oss.js
+2
-1
@@ -41,7 +41,8 @@ export const enableCPUSuspense = false;
41
export const enableUseHook = true;
42
export const enableUseMemoCacheHook = false;
43
export const enableUseEffectEventHook = false;
44
-export const enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay = true;
44
+export const enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay =
45
+ true;
46
export const enableClientRenderFallbackOnTextMismatch = true;
47
export const enableComponentStackLocations = false;
48
export const enableLegacyFBSupport = false;
packages/shared/forks/ReactFeatureFlags.test-renderer.js
+2
-1
@@ -41,7 +41,8 @@ export const enableCPUSuspense = false;
41
export const enableUseHook = true;
42
export const enableUseMemoCacheHook = false;
43
export const enableUseEffectEventHook = false;
44
-export const enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay = true;
44
+export const enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay =
45
+ true;
46
export const enableClientRenderFallbackOnTextMismatch = true;
47
export const enableComponentStackLocations = true;
48
export const enableLegacyFBSupport = false;
packages/shared/forks/ReactFeatureFlags.test-renderer.native.js
+2
-1
@@ -48,7 +48,8 @@ export const enableCPUSuspense = false;
48
export const enableUseHook = true;
49
export const enableUseMemoCacheHook = false;
50
export const enableUseEffectEventHook = false;
51
-export const enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay = true;
51
+export const enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay =
52
+ true;
53
export const enableClientRenderFallbackOnTextMismatch = true;
54
export const createRootStrictEffectsByDefault = false;
55
export const enableUseRefAccessWarning = false;
packages/shared/forks/ReactFeatureFlags.test-renderer.www.js
+2
-1
@@ -41,7 +41,8 @@ export const enableCPUSuspense = false;
41
export const enableUseHook = true;
42
export const enableUseMemoCacheHook = false;
43
export const enableUseEffectEventHook = false;
44
-export const enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay = true;
44
+export const enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay =
45
+ true;
46
export const enableClientRenderFallbackOnTextMismatch = true;
47
export const enableComponentStackLocations = true;
48
export const enableLegacyFBSupport = false;
packages/shared/forks/ReactFeatureFlags.testing.js
+2
-1
@@ -41,7 +41,8 @@ export const enableCPUSuspense = false;
41
export const enableUseHook = true;
42
export const enableUseMemoCacheHook = false;
43
export const enableUseEffectEventHook = false;
44
-export const enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay = true;
44
+export const enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay =
45
+ true;
46
export const enableClientRenderFallbackOnTextMismatch = true;
47
export const enableComponentStackLocations = true;
48
export const enableLegacyFBSupport = false;
packages/shared/forks/ReactFeatureFlags.testing.www.js
+2
-1
@@ -41,7 +41,8 @@ export const enableCPUSuspense = true;
41
export const enableUseHook = true;
42
export const enableUseMemoCacheHook = false;
43
export const enableUseEffectEventHook = false;
44
-export const enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay = true;
44
+export const enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay =
45
+ true;
46
export const enableClientRenderFallbackOnTextMismatch = true;
47
export const enableComponentStackLocations = true;
48
export const enableLegacyFBSupport = !__EXPERIMENTAL__;
packages/shared/forks/ReactFeatureFlags.www-dynamic.js
+2
-1
@@ -23,7 +23,8 @@ export const disableSchedulerTimeoutInWorkLoop = __VARIANT__;
23
export const enableLazyContextPropagation = __VARIANT__;
24
export const enableSyncDefaultUpdates = __VARIANT__;
25
export const enableUnifiedSyncLane = __VARIANT__;
26
-export const enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay = __VARIANT__;
26
+export const enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay =
27
+ __VARIANT__;
28
export const enableTransitionTracing = __VARIANT__;
29
// Enable this flag to help with concurrent mode debugging.
30
// It logs information to the console about React scheduling, rendering, and commit phases.
packages/shared/forks/invokeGuardedCallbackImpl.www.js
+1
-1
@@ -16,7 +16,7 @@ if (typeof ReactFbErrorUtils.invokeGuardedCallback !== 'function') {
16
);
17
}
18
19
-const invokeGuardedCallbackImpl = function<A, B, C, D, E, F, Context>(
19
+const invokeGuardedCallbackImpl = function <A, B, C, D, E, F, Context>(
20
name: string | null,
21
func: (a: A, b: B, c: C, d: D, e: E, f: F) => mixed,
22
context: Context,
packages/use-sync-external-store/src/__tests__/useSyncExternalStoreNative-test.js
+4
-4
@@ -66,10 +66,10 @@ describe('useSyncExternalStore (userspace shim, server rendering)', () => {
66
),
67
);
68
}
69
- useSyncExternalStore = require('use-sync-external-store/shim')
70
- .useSyncExternalStore;
71
- useSyncExternalStoreWithSelector = require('use-sync-external-store/shim/with-selector')
72
- .useSyncExternalStoreWithSelector;
69
+ useSyncExternalStore =
70
+ require('use-sync-external-store/shim').useSyncExternalStore;
71
+ useSyncExternalStoreWithSelector =
72
+ require('use-sync-external-store/shim/with-selector').useSyncExternalStoreWithSelector;
73
});
74
75
function Text({text}) {
packages/use-sync-external-store/src/__tests__/useSyncExternalStoreShared-test.js
+4
-4
@@ -73,10 +73,10 @@ describe('Shared useSyncExternalStore behavior (shim and built-in)', () => {
73
jest.requireActual('use-sync-external-store/shim'),
74
);
75
}
76
- useSyncExternalStore = require('use-sync-external-store/shim')
77
- .useSyncExternalStore;
78
- useSyncExternalStoreWithSelector = require('use-sync-external-store/shim/with-selector')
79
- .useSyncExternalStoreWithSelector;
76
+ useSyncExternalStore =
77
+ require('use-sync-external-store/shim').useSyncExternalStore;
78
+ useSyncExternalStoreWithSelector =
79
+ require('use-sync-external-store/shim/with-selector').useSyncExternalStoreWithSelector;
80
});
81
82
function Text({text}) {
packages/use-sync-external-store/src/__tests__/useSyncExternalStoreShimServer-test.js
+2
-2
@@ -45,8 +45,8 @@ describe('useSyncExternalStore (userspace shim, server rendering)', () => {
45
ReactDOMServer = require('react-dom/server');
46
Scheduler = require('scheduler');
47
48
- useSyncExternalStore = require('use-sync-external-store/shim')
49
- .useSyncExternalStore;
48
+ useSyncExternalStore =
49
+ require('use-sync-external-store/shim').useSyncExternalStore;
50
});
51
52
function Text({text}) {
scripts/babel/transform-object-assign.js
+3
-3
@@ -21,13 +21,13 @@ module.exports = function autoImporter(babel) {
21
}
22
23
return {
24
- pre: function() {
24
+ pre: function () {
25
// map from module to generated identifier
26
this.id = null;
27
},
28
29
visitor: {
30
- CallExpression: function(path, file) {
30
+ CallExpression: function (path, file) {
31
if (/shared(\/|\\)assign/.test(file.filename)) {
32
// Don't replace Object.assign if we're transforming shared/assign
33
return;
@@ -39,7 +39,7 @@ module.exports = function autoImporter(babel) {
39
}
40
},
41
42
- MemberExpression: function(path, file) {
42
+ MemberExpression: function (path, file) {
43
if (/shared(\/|\\)assign/.test(file.filename)) {
44
// Don't replace Object.assign if we're transforming shared/assign
45
return;
scripts/babel/transform-replace-console-calls.js
+1
-1
@@ -43,7 +43,7 @@ module.exports = function replaceConsoleCalls(babel) {
43
44
return {
45
visitor: {
46
- CallExpression: function(path, pass) {
46
+ CallExpression: function (path, pass) {
47
if (path.node.callee.type !== 'MemberExpression') {
48
return;
49
}
scripts/bench/benchmarks/hacker-news/benchmark.js
+1
-1
@@ -1,4 +1,4 @@
1
-(function() {
1
+(function () {
2
'use strict';
3
4
const e = React.createElement;
scripts/bench/benchmarks/hacker-news/top-stories.js
+127
-736
@@ -4,18 +4,8 @@ window.stories = [
4
descendants: 49,
5
id: 14201562,
6
kids: [
7
- 14201704,
8
- 14202297,
9
- 14202233,
10
- 14201771,
11
- 14201765,
12
- 14201897,
13
- 14201750,
14
- 14201913,
15
- 14201854,
16
- 14201667,
17
- 14201759,
18
- 14202073,
7
+ 14201704, 14202297, 14202233, 14201771, 14201765, 14201897, 14201750,
8
+ 14201913, 14201854, 14201667, 14201759, 14202073,
9
],
10
score: 186,
11
time: 1493197629,
@@ -41,19 +31,8 @@ window.stories = [
31
descendants: 137,
32
id: 14200563,
33
kids: [
44
- 14201274,
45
- 14200711,
46
- 14201147,
47
- 14201365,
48
- 14201499,
49
- 14200618,
50
- 14201169,
51
- 14200911,
52
- 14200734,
53
- 14201083,
54
- 14200706,
55
- 14200785,
56
- 14201032,
34
+ 14201274, 14200711, 14201147, 14201365, 14201499, 14200618, 14201169,
35
+ 14200911, 14200734, 14201083, 14200706, 14200785, 14201032,
36
],
37
score: 178,
38
time: 1493183234,
@@ -66,38 +45,11 @@ window.stories = [
45
descendants: 203,
46
id: 14196731,
47
kids: [
69
- 14201298,
70
- 14201838,
71
- 14201381,
72
- 14197574,
73
- 14201398,
74
- 14199764,
75
- 14198491,
76
- 14197000,
77
- 14198224,
78
- 14200614,
79
- 14201983,
80
- 14200697,
81
- 14199252,
82
- 14201214,
83
- 14198923,
84
- 14200224,
85
- 14197509,
86
- 14200859,
87
- 14200064,
88
- 14200114,
89
- 14197256,
90
- 14197220,
91
- 14200653,
92
- 14197186,
93
- 14199258,
94
- 14197155,
95
- 14197344,
96
- 14198361,
97
- 14197969,
98
- 14199813,
99
- 14197259,
100
- 14197503,
48
+ 14201298, 14201838, 14201381, 14197574, 14201398, 14199764, 14198491,
49
+ 14197000, 14198224, 14200614, 14201983, 14200697, 14199252, 14201214,
50
+ 14198923, 14200224, 14197509, 14200859, 14200064, 14200114, 14197256,
51
+ 14197220, 14200653, 14197186, 14199258, 14197155, 14197344, 14198361,
52
+ 14197969, 14199813, 14197259, 14197503,
53
],
54
score: 562,
55
time: 1493145853,
@@ -110,68 +62,15 @@ window.stories = [
62
descendants: 565,
63
id: 14196812,
64
kids: [
113
- 14198306,
114
- 14197339,
115
- 14200899,
116
- 14198165,
117
- 14198750,
118
- 14202199,
119
- 14201432,
120
- 14197619,
121
- 14197471,
122
- 14201113,
123
- 14202214,
124
- 14202043,
125
- 14197313,
126
- 14197751,
127
- 14197332,
128
- 14198050,
129
- 14201616,
130
- 14197404,
131
- 14199730,
132
- 14198007,
133
- 14197358,
134
- 14197283,
135
- 14200959,
136
- 14197891,
137
- 14198203,
138
- 14197312,
139
- 14200796,
140
- 14201528,
141
- 14197249,
142
- 14198271,
143
- 14197989,
144
- 14198842,
145
- 14197205,
146
- 14199148,
147
- 14197458,
148
- 14200457,
149
- 14197330,
150
- 14199993,
151
- 14197855,
152
- 14200102,
153
- 14197378,
154
- 14199315,
155
- 14198240,
156
- 14198397,
157
- 14199326,
158
- 14200159,
159
- 14198798,
160
- 14201296,
161
- 14198173,
162
- 14197323,
163
- 14197383,
164
- 14197459,
165
- 14197275,
166
- 14198305,
167
- 14198005,
168
- 14198015,
169
- 14199380,
170
- 14199079,
171
- 14198413,
172
- 14197334,
173
- 14197327,
174
- 14197234,
65
+ 14198306, 14197339, 14200899, 14198165, 14198750, 14202199, 14201432,
66
+ 14197619, 14197471, 14201113, 14202214, 14202043, 14197313, 14197751,
67
+ 14197332, 14198050, 14201616, 14197404, 14199730, 14198007, 14197358,
68
+ 14197283, 14200959, 14197891, 14198203, 14197312, 14200796, 14201528,
69
+ 14197249, 14198271, 14197989, 14198842, 14197205, 14199148, 14197458,
70
+ 14200457, 14197330, 14199993, 14197855, 14200102, 14197378, 14199315,
71
+ 14198240, 14198397, 14199326, 14200159, 14198798, 14201296, 14198173,
72
+ 14197323, 14197383, 14197459, 14197275, 14198305, 14198005, 14198015,
73
+ 14199380, 14199079, 14198413, 14197334, 14197327, 14197234,
74
],
75
score: 385,
76
time: 1493146342,
@@ -184,34 +83,15 @@ window.stories = [
83
descendants: 63,
84
id: 14196322,
85
kids: [
187
- 14197628,
188
- 14200026,
189
- 14197457,
190
- 14197486,
191
- 14202126,
192
- 14201266,
193
- 14197227,
194
- 14199404,
195
- 14199338,
196
- 14196382,
197
- 14200598,
198
- 14197377,
199
- 14199689,
200
- 14198538,
201
- 14196905,
202
- 14200404,
203
- 14198781,
204
- 14197278,
205
- 14197888,
206
- 14197742,
207
- 14197764,
86
+ 14197628, 14200026, 14197457, 14197486, 14202126, 14201266, 14197227,
87
+ 14199404, 14199338, 14196382, 14200598, 14197377, 14199689, 14198538,
88
+ 14196905, 14200404, 14198781, 14197278, 14197888, 14197742, 14197764,
89
],
90
score: 316,
91
time: 1493143464,
92
title: 'Experimental Nighttime Photography with Nexus and Pixel',
93
type: 'story',
213
- url:
214
- 'https://research.googleblog.com/2017/04/experimental-nighttime-photography-with.html',
94
+ url: 'https://research.googleblog.com/2017/04/experimental-nighttime-photography-with.html',
95
},
96
{
97
by: 'networked',
@@ -239,24 +119,9 @@ window.stories = [
119
descendants: 80,
120
id: 14196077,
121
kids: [
242
- 14199434,
243
- 14196279,
244
- 14196604,
245
- 14197440,
246
- 14201734,
247
- 14200922,
248
- 14200452,
249
- 14197115,
250
- 14199837,
251
- 14199894,
252
- 14196596,
253
- 14198243,
254
- 14196565,
255
- 14197400,
256
- 14197049,
257
- 14197686,
258
- 14198545,
259
- 14198475,
122
+ 14199434, 14196279, 14196604, 14197440, 14201734, 14200922, 14200452,
123
+ 14197115, 14199837, 14199894, 14196596, 14198243, 14196565, 14197400,
124
+ 14197049, 14197686, 14198545, 14198475,
125
],
126
score: 717,
127
time: 1493142008,
@@ -270,15 +135,8 @@ window.stories = [
135
descendants: 16,
136
id: 14201670,
137
kids: [
273
- 14201835,
274
- 14202115,
275
- 14202176,
276
- 14201890,
277
- 14202325,
278
- 14201859,
279
- 14202158,
280
- 14201763,
281
- 14201902,
138
+ 14201835, 14202115, 14202176, 14201890, 14202325, 14201859, 14202158,
139
+ 14201763, 14201902,
140
],
141
score: 62,
142
time: 1493198949,
@@ -305,33 +163,19 @@ window.stories = [
163
time: 1493181245,
164
title: 'Building Functional Chatbot for Messenger with Ruby on Rails',
165
type: 'story',
308
- url:
309
- 'https://tutorials.botsfloor.com/chatbot-development-tutorial-how-to-build-a-fully-functional-weather-bot-on-facebook-messenger-c94ac7c59185',
166
+ url: 'https://tutorials.botsfloor.com/chatbot-development-tutorial-how-to-build-a-fully-functional-weather-bot-on-facebook-messenger-c94ac7c59185',
167
},
168
{
169
by: 'nanospeck',
170
descendants: 23,
171
id: 14201207,
172
kids: [
316
- 14202252,
317
- 14201646,
318
- 14201620,
319
- 14202076,
320
- 14201511,
321
- 14201324,
322
- 14201940,
323
- 14201425,
324
- 14201505,
325
- 14201304,
326
- 14201435,
327
- 14201287,
328
- 14201739,
329
- 14202031,
173
+ 14202252, 14201646, 14201620, 14202076, 14201511, 14201324, 14201940,
174
+ 14201425, 14201505, 14201304, 14201435, 14201287, 14201739, 14202031,
175
14202018,
176
],
177
score: 57,
333
- text:
334
- 'This question was asked on both 2015 & 2016 in HN. I would like to ask it again today to know what are the newest options for this.<p>Q: What would you recommend as a reasonably priced (sub 150$) quad-copter/drone, that has a camera, the ability to be programmed (so that I can process video/write my own stability algorithms for it), good range, and reasonable flying time?\nIn the event nothing fits that price point, any pointers on what the state of the art is?<p>Thanks!',
178
+ text: 'This question was asked on both 2015 & 2016 in HN. I would like to ask it again today to know what are the newest options for this.<p>Q: What would you recommend as a reasonably priced (sub 150$) quad-copter/drone, that has a camera, the ability to be programmed (so that I can process video/write my own stability algorithms for it), good range, and reasonable flying time?\nIn the event nothing fits that price point, any pointers on what the state of the art is?<p>Thanks!',
179
time: 1493192641,
180
title: 'Ask HN (again): What is the best affordable programmable drone?',
181
type: 'story',
@@ -341,20 +185,8 @@ window.stories = [
185
descendants: 57,
186
id: 14196708,
187
kids: [
344
- 14197480,
345
- 14198523,
346
- 14198705,
347
- 14200969,
348
- 14200079,
349
- 14197605,
350
- 14198979,
351
- 14202203,
352
- 14197679,
353
- 14198461,
354
- 14200389,
355
- 14198065,
356
- 14197883,
357
- 14197908,
188
+ 14197480, 14198523, 14198705, 14200969, 14200079, 14197605, 14198979,
189
+ 14202203, 14197679, 14198461, 14200389, 14198065, 14197883, 14197908,
190
],
191
score: 123,
192
time: 1493145655,
@@ -367,20 +199,8 @@ window.stories = [
199
descendants: 55,
200
id: 14195956,
201
kids: [
370
- 14199594,
371
- 14196972,
372
- 14202101,
373
- 14198197,
374
- 14196771,
375
- 14197326,
376
- 14196956,
377
- 14200842,
378
- 14201529,
379
- 14198581,
380
- 14196777,
381
- 14200177,
382
- 14200422,
383
- 14198571,
202
+ 14199594, 14196972, 14202101, 14198197, 14196771, 14197326, 14196956,
203
+ 14200842, 14201529, 14198581, 14196777, 14200177, 14200422, 14198571,
204
],
205
score: 167,
206
time: 1493141367,
@@ -393,15 +213,8 @@ window.stories = [
213
descendants: 19,
214
id: 14199364,
215
kids: [
396
- 14199735,
397
- 14200889,
398
- 14202245,
399
- 14200205,
400
- 14200104,
401
- 14201697,
402
- 14200061,
403
- 14199996,
404
- 14199867,
216
+ 14199735, 14200889, 14202245, 14200205, 14200104, 14201697, 14200061,
217
+ 14199996, 14199867,
218
],
219
score: 66,
220
time: 1493164755,
@@ -415,34 +228,10 @@ window.stories = [
228
descendants: 121,
229
id: 14195664,
230
kids: [
418
- 14196654,
419
- 14196206,
420
- 14196677,
421
- 14197035,
422
- 14196041,
423
- 14196399,
424
- 14196200,
425
- 14196140,
426
- 14196216,
427
- 14196421,
428
- 14196370,
429
- 14196146,
430
- 14197601,
431
- 14197107,
432
- 14196866,
433
- 14196691,
434
- 14197704,
435
- 14196772,
436
- 14200089,
437
- 14198588,
438
- 14196937,
439
- 14198530,
440
- 14197119,
441
- 14197247,
442
- 14198632,
443
- 14196137,
444
- 14200323,
445
- 14196346,
231
+ 14196654, 14196206, 14196677, 14197035, 14196041, 14196399, 14196200,
232
+ 14196140, 14196216, 14196421, 14196370, 14196146, 14197601, 14197107,
233
+ 14196866, 14196691, 14197704, 14196772, 14200089, 14198588, 14196937,
234
+ 14198530, 14197119, 14197247, 14198632, 14196137, 14200323, 14196346,
235
],
236
score: 486,
237
time: 1493139957,
@@ -455,36 +244,16 @@ window.stories = [
244
descendants: 89,
245
id: 14191186,
246
kids: [
458
- 14200855,
459
- 14200035,
460
- 14200110,
461
- 14201408,
462
- 14202159,
463
- 14197876,
464
- 14200348,
465
- 14198720,
466
- 14198183,
467
- 14199824,
468
- 14198281,
469
- 14201643,
470
- 14201591,
471
- 14199541,
472
- 14198423,
473
- 14201738,
474
- 14200037,
475
- 14201349,
476
- 14200028,
477
- 14201206,
478
- 14197995,
479
- 14197830,
480
- 14199603,
247
+ 14200855, 14200035, 14200110, 14201408, 14202159, 14197876, 14200348,
248
+ 14198720, 14198183, 14199824, 14198281, 14201643, 14201591, 14199541,
249
+ 14198423, 14201738, 14200037, 14201349, 14200028, 14201206, 14197995,
250
+ 14197830, 14199603,
251
],
252
score: 135,
253
time: 1493100791,
254
title: 'How to Say (Almost) Everything in a Hundred-Word Language (2015)',
255
type: 'story',
486
- url:
487
- 'https://www.theatlantic.com/technology/archive/2015/07/toki-pona-smallest-language/398363/?single_page=true',
256
+ url: 'https://www.theatlantic.com/technology/archive/2015/07/toki-pona-smallest-language/398363/?single_page=true',
257
},
258
{
259
by: 'runesoerensen',
@@ -502,16 +271,8 @@ window.stories = [
271
descendants: 20,
272
id: 14199299,
273
kids: [
505
- 14200694,
506
- 14201832,
507
- 14200517,
508
- 14201760,
509
- 14200966,
510
- 14200558,
511
- 14201815,
512
- 14201231,
513
- 14201073,
514
- 14201124,
274
+ 14200694, 14201832, 14200517, 14201760, 14200966, 14200558, 14201815,
275
+ 14201231, 14201073, 14201124,
276
],
277
score: 54,
278
time: 1493163960,
@@ -535,13 +296,7 @@ window.stories = [
296
descendants: 33,
297
id: 14199125,
298
kids: [
538
- 14202332,
539
- 14201634,
540
- 14201200,
541
- 14201215,
542
- 14201157,
543
- 14201898,
544
- 14201969,
299
+ 14202332, 14201634, 14201200, 14201215, 14201157, 14201898, 14201969,
300
14201125,
301
],
302
score: 52,
@@ -555,76 +310,27 @@ window.stories = [
310
descendants: 170,
311
id: 14200486,
312
kids: [
558
- 14200680,
559
- 14200677,
560
- 14201515,
561
- 14200793,
562
- 14200534,
563
- 14200908,
564
- 14200649,
565
- 14200633,
566
- 14200701,
567
- 14202295,
568
- 14200578,
569
- 14200709,
570
- 14200580,
571
- 14201107,
572
- 14201779,
573
- 14200773,
574
- 14200804,
575
- 14200720,
576
- 14202060,
577
- 14200948,
578
- 14200903,
579
- 14200748,
580
- 14200875,
581
- 14200750,
582
- 14200821,
583
- 14200756,
584
- 14201707,
585
- 14201689,
586
- 14200669,
587
- 14200997,
588
- 14200818,
589
- 14201586,
590
- 14200603,
591
- 14201054,
592
- 14201457,
593
- 14200616,
594
- 14201095,
595
- 14200915,
596
- 14200878,
597
- 14200629,
598
- 14201523,
599
- 14200620,
313
+ 14200680, 14200677, 14201515, 14200793, 14200534, 14200908, 14200649,
314
+ 14200633, 14200701, 14202295, 14200578, 14200709, 14200580, 14201107,
315
+ 14201779, 14200773, 14200804, 14200720, 14202060, 14200948, 14200903,
316
+ 14200748, 14200875, 14200750, 14200821, 14200756, 14201707, 14201689,
317
+ 14200669, 14200997, 14200818, 14201586, 14200603, 14201054, 14201457,
318
+ 14200616, 14201095, 14200915, 14200878, 14200629, 14201523, 14200620,
319
14202099,
320
],
321
score: 316,
322
time: 1493181945,
323
title: 'Suicide of an Uber engineer: Widow blames job stress',
324
type: 'story',
606
- url:
607
- 'https://www.sfchronicle.com/business/article/Suicide-of-an-Uber-engineer-widow-blames-job-11095807.php?t=7e40d1f554&cmpid=fb-premium&cmpid=twitter-premium',
325
+ url: 'https://www.sfchronicle.com/business/article/Suicide-of-an-Uber-engineer-widow-blames-job-11095807.php?t=7e40d1f554&cmpid=fb-premium&cmpid=twitter-premium',
326
},
327
{
328
by: 'catc',
329
descendants: 34,
330
id: 14195522,
331
kids: [
614
- 14202316,
615
- 14202278,
616
- 14197167,
617
- 14199152,
618
- 14202077,
619
- 14197239,
620
- 14197721,
621
- 14197632,
622
- 14197219,
623
- 14198296,
624
- 14197245,
625
- 14197201,
626
- 14197403,
627
- 14198051,
332
+ 14202316, 14202278, 14197167, 14199152, 14202077, 14197239, 14197721,
333
+ 14197632, 14197219, 14198296, 14197245, 14197201, 14197403, 14198051,
334
14196747,
335
],
336
score: 87,
@@ -639,43 +345,22 @@ window.stories = [
345
descendants: 152,
346
id: 14192353,
347
kids: [
642
- 14197671,
643
- 14197754,
644
- 14199091,
645
- 14198533,
646
- 14201249,
647
- 14198626,
648
- 14198263,
649
- 14198009,
650
- 14195130,
651
- 14199551,
652
- 14197663,
653
- 14198285,
654
- 14199611,
655
- 14199835,
656
- 14197482,
657
- 14198924,
658
- 14198943,
348
+ 14197671, 14197754, 14199091, 14198533, 14201249, 14198626, 14198263,
349
+ 14198009, 14195130, 14199551, 14197663, 14198285, 14199611, 14199835,
350
+ 14197482, 14198924, 14198943,
351
],
352
score: 273,
353
time: 1493117771,
354
title: 'Windows Is Bloated, Thanks to Adobe’s Extensible Metadata Platform',
355
type: 'story',
664
- url:
665
- 'https://www.thurrott.com/windows/109962/windows-bloated-thanks-adobes-extensible-metadata-platform',
356
+ url: 'https://www.thurrott.com/windows/109962/windows-bloated-thanks-adobes-extensible-metadata-platform',
357
},
358
{
359
by: 'craigcannon',
360
descendants: 23,
361
id: 14197852,
362
kids: [
672
- 14200024,
673
- 14199986,
674
- 14202106,
675
- 14198011,
676
- 14199228,
677
- 14202138,
678
- 14198917,
363
+ 14200024, 14199986, 14202106, 14198011, 14199228, 14202138, 14198917,
364
14198607,
365
],
366
score: 58,
@@ -689,42 +374,23 @@ window.stories = [
374
descendants: 105,
375
id: 14198229,
376
kids: [
692
- 14200202,
693
- 14198948,
694
- 14199770,
695
- 14198634,
696
- 14200263,
697
- 14198797,
698
- 14198919,
699
- 14200447,
700
- 14198645,
701
- 14199267,
702
- 14199124,
703
- 14198833,
704
- 14199059,
377
+ 14200202, 14198948, 14199770, 14198634, 14200263, 14198797, 14198919,
378
+ 14200447, 14198645, 14199267, 14199124, 14198833, 14199059,
379
],
380
score: 282,
381
time: 1493155745,
382
title:
383
'Uber must turn over information about its acquisition of Otto to Waymo',
384
type: 'story',
711
- url:
712
- 'https://techcrunch.com/2017/04/25/uber-must-turn-over-information-about-its-acquisition-of-otto-to-waymo-court-rules/',
385
+ url: 'https://techcrunch.com/2017/04/25/uber-must-turn-over-information-about-its-acquisition-of-otto-to-waymo-court-rules/',
386
},
387
{
388
by: 'JoshTriplett',
389
descendants: 116,
390
id: 14198403,
391
kids: [
719
- 14199771,
720
- 14199980,
721
- 14198664,
722
- 14198764,
723
- 14201086,
724
- 14200307,
725
- 14199294,
726
- 14198860,
727
- 14198817,
392
+ 14199771, 14199980, 14198664, 14198764, 14201086, 14200307, 14199294,
393
+ 14198860, 14198817,
394
],
395
score: 139,
396
time: 1493156882,
@@ -737,20 +403,8 @@ window.stories = [
403
descendants: 50,
404
id: 14191577,
405
kids: [
740
- 14194021,
741
- 14195402,
742
- 14193886,
743
- 14193792,
744
- 14194355,
745
- 14197136,
746
- 14200386,
747
- 14194151,
748
- 14193989,
749
- 14193798,
750
- 14194042,
751
- 14197100,
752
- 14198984,
753
- 14193925,
406
+ 14194021, 14195402, 14193886, 14193792, 14194355, 14197136, 14200386,
407
+ 14194151, 14193989, 14193798, 14194042, 14197100, 14198984, 14193925,
408
14194170,
409
],
410
score: 365,
@@ -764,16 +418,8 @@ window.stories = [
418
descendants: 29,
419
id: 14192946,
420
kids: [
767
- 14202311,
768
- 14202299,
769
- 14201900,
770
- 14200029,
771
- 14198260,
772
- 14198605,
773
- 14201850,
774
- 14199858,
775
- 14198223,
776
- 14198610,
421
+ 14202311, 14202299, 14201900, 14200029, 14198260, 14198605, 14201850,
422
+ 14199858, 14198223, 14198610,
423
],
424
score: 61,
425
time: 1493124627,
@@ -791,33 +437,22 @@ window.stories = [
437
title:
438
'The Republican Lawmaker Who Secretly Created Reddit’s Women-Hating ‘Red Pill’',
439
type: 'story',
794
- url:
795
- 'http://www.thedailybeast.com/articles/2017/04/25/the-republican-lawmaker-who-secretly-created-reddit-s-women-hating-red-pill.html',
440
+ url: 'http://www.thedailybeast.com/articles/2017/04/25/the-republican-lawmaker-who-secretly-created-reddit-s-women-hating-red-pill.html',
441
},
442
{
443
by: 'anguswithgusto',
444
descendants: 55,
445
id: 14196325,
446
kids: [
802
- 14197131,
803
- 14196789,
804
- 14197299,
805
- 14197466,
806
- 14196737,
807
- 14199929,
808
- 14197550,
809
- 14197511,
810
- 14196888,
811
- 14200109,
812
- 14197101,
447
+ 14197131, 14196789, 14197299, 14197466, 14196737, 14199929, 14197550,
448
+ 14197511, 14196888, 14200109, 14197101,
449
],
450
score: 80,
451
time: 1493143475,
452
title:
453
'Gett in advanced talks to buy Juno for $250M as Uber rivals consolidate',
454
type: 'story',
819
- url:
820
- 'https://techcrunch.com/2017/04/25/gett-in-advanced-talks-to-buy-juno-for-250m-as-uber-rivals-consolidate/',
455
+ url: 'https://techcrunch.com/2017/04/25/gett-in-advanced-talks-to-buy-juno-for-250m-as-uber-rivals-consolidate/',
456
},
457
{
458
by: 'fabuzaid',
@@ -835,13 +470,7 @@ window.stories = [
470
descendants: 61,
471
id: 14196154,
472
kids: [
838
- 14197614,
839
- 14196853,
840
- 14197074,
841
- 14197050,
842
- 14200090,
843
- 14197731,
844
- 14196352,
473
+ 14197614, 14196853, 14197074, 14197050, 14200090, 14197731, 14196352,
474
14197442,
475
],
476
score: 72,
@@ -855,87 +484,29 @@ window.stories = [
484
descendants: 254,
485
id: 14189392,
486
kids: [
858
- 14190198,
859
- 14190800,
860
- 14193591,
861
- 14190274,
862
- 14189796,
863
- 14190118,
864
- 14190405,
865
- 14190006,
866
- 14189430,
867
- 14190244,
868
- 14189877,
869
- 14190064,
870
- 14190211,
871
- 14189918,
872
- 14190071,
873
- 14191312,
874
- 14195969,
875
- 14190542,
876
- 14194775,
877
- 14189900,
878
- 14190032,
879
- 14189847,
880
- 14192128,
881
- 14191737,
882
- 14191047,
883
- 14190992,
884
- 14192759,
885
- 14191405,
886
- 14190815,
887
- 14194136,
888
- 14190737,
889
- 14190552,
890
- 14191385,
891
- 14189816,
892
- 14191316,
893
- 14193780,
894
- 14193979,
895
- 14190768,
896
- 14192973,
897
- 14191217,
898
- 14190879,
899
- 14190780,
900
- 14189914,
901
- 14190925,
902
- 14192906,
903
- 14190528,
904
- 14189893,
905
- 14190007,
906
- 14189929,
907
- 14190049,
908
- 14191859,
909
- 14191304,
910
- 14190177,
911
- 14193355,
912
- 14193352,
913
- 14190324,
914
- 14190846,
915
- 14189803,
487
+ 14190198, 14190800, 14193591, 14190274, 14189796, 14190118, 14190405,
488
+ 14190006, 14189430, 14190244, 14189877, 14190064, 14190211, 14189918,
489
+ 14190071, 14191312, 14195969, 14190542, 14194775, 14189900, 14190032,
490
+ 14189847, 14192128, 14191737, 14191047, 14190992, 14192759, 14191405,
491
+ 14190815, 14194136, 14190737, 14190552, 14191385, 14189816, 14191316,
492
+ 14193780, 14193979, 14190768, 14192973, 14191217, 14190879, 14190780,
493
+ 14189914, 14190925, 14192906, 14190528, 14189893, 14190007, 14189929,
494
+ 14190049, 14191859, 14191304, 14190177, 14193355, 14193352, 14190324,
495
+ 14190846, 14189803,
496
],
497
score: 630,
498
time: 1493076480,
499
title: 'Robert M. Pirsig has died',
500
type: 'story',
921
- url:
922
- 'https://www.npr.org/sections/thetwo-way/2017/04/24/525443040/-zen-and-the-art-of-motorcycle-maintenance-author-robert-m-pirsig-dies-at-88',
501
+ url: 'https://www.npr.org/sections/thetwo-way/2017/04/24/525443040/-zen-and-the-art-of-motorcycle-maintenance-author-robert-m-pirsig-dies-at-88',
502
},
503
{
504
by: 'artsandsci',
505
descendants: 67,
506
id: 14194422,
507
kids: [
929
- 14199418,
930
- 14196266,
931
- 14197226,
932
- 14196647,
933
- 14196324,
934
- 14201761,
935
- 14196265,
936
- 14195599,
937
- 14199054,
938
- 14196057,
508
+ 14199418, 14196266, 14197226, 14196647, 14196324, 14201761, 14196265,
509
+ 14195599, 14199054, 14196057,
510
],
511
score: 127,
512
time: 1493134376,
@@ -964,55 +535,19 @@ window.stories = [
535
time: 1493163087,
536
title: 'Should Curve25519 keys be validated?',
537
type: 'story',
967
- url:
968
- 'https://research.kudelskisecurity.com/2017/04/25/should-ecdh-keys-be-validated/',
538
+ url: 'https://research.kudelskisecurity.com/2017/04/25/should-ecdh-keys-be-validated/',
539
},
540
{
541
by: 'spearo77',
542
descendants: 213,
543
id: 14189688,
544
kids: [
975
- 14191654,
976
- 14192373,
977
- 14190683,
978
- 14192095,
979
- 14191856,
980
- 14190771,
981
- 14190570,
982
- 14190599,
983
- 14190721,
984
- 14192049,
985
- 14189694,
986
- 14191430,
987
- 14193610,
988
- 14190543,
989
- 14190372,
990
- 14191818,
991
- 14192171,
992
- 14192177,
993
- 14192135,
994
- 14191483,
995
- 14190560,
996
- 14190341,
997
- 14190362,
998
- 14190452,
999
- 14192563,
1000
- 14190458,
1001
- 14195245,
1002
- 14190809,
1003
- 14192706,
1004
- 14192959,
1005
- 14190636,
1006
- 14190634,
1007
- 14190368,
1008
- 14191163,
1009
- 14191379,
1010
- 14190668,
1011
- 14191673,
1012
- 14190884,
1013
- 14192565,
1014
- 14190480,
1015
- 14190442,
545
+ 14191654, 14192373, 14190683, 14192095, 14191856, 14190771, 14190570,
546
+ 14190599, 14190721, 14192049, 14189694, 14191430, 14193610, 14190543,
547
+ 14190372, 14191818, 14192171, 14192177, 14192135, 14191483, 14190560,
548
+ 14190341, 14190362, 14190452, 14192563, 14190458, 14195245, 14190809,
549
+ 14192706, 14192959, 14190636, 14190634, 14190368, 14191163, 14191379,
550
+ 14190668, 14191673, 14190884, 14192565, 14190480, 14190442,
551
],
552
score: 447,
553
time: 1493079289,
@@ -1025,83 +560,17 @@ window.stories = [
560
descendants: 294,
561
id: 14182262,
562
kids: [
1028
- 14183335,
1029
- 14183715,
1030
- 14182725,
1031
- 14183897,
1032
- 14185812,
1033
- 14184510,
1034
- 14182468,
1035
- 14183231,
1036
- 14182580,
1037
- 14183996,
1038
- 14182449,
1039
- 14185671,
1040
- 14182428,
1041
- 14182666,
1042
- 14186599,
1043
- 14182519,
1044
- 14185571,
1045
- 14185159,
1046
- 14182636,
1047
- 14185864,
1048
- 14188340,
1049
- 14183433,
1050
- 14183146,
1051
- 14184034,
1052
- 14184363,
1053
- 14183368,
1054
- 14183098,
1055
- 14182495,
1056
- 14182753,
1057
- 14184720,
1058
- 14188085,
1059
- 14187692,
1060
- 14183633,
1061
- 14188137,
1062
- 14182606,
1063
- 14186796,
1064
- 14196166,
1065
- 14185084,
1066
- 14185899,
1067
- 14188219,
1068
- 14186885,
1069
- 14183406,
1070
- 14185561,
1071
- 14183388,
1072
- 14191457,
1073
- 14183281,
1074
- 14183399,
1075
- 14183674,
1076
- 14183236,
1077
- 14183990,
1078
- 14183760,
1079
- 14183248,
1080
- 14184114,
1081
- 14183318,
1082
- 14183457,
1083
- 14186509,
1084
- 14186900,
1085
- 14186695,
1086
- 14188405,
1087
- 14184636,
1088
- 14184630,
1089
- 14188301,
1090
- 14184144,
1091
- 14183023,
1092
- 14184555,
1093
- 14185946,
1094
- 14184611,
1095
- 14184490,
1096
- 14183653,
1097
- 14183881,
1098
- 14182715,
1099
- 14184440,
1100
- 14182573,
1101
- 14183251,
1102
- 14184962,
1103
- 14187249,
1104
- 14182545,
563
+ 14183335, 14183715, 14182725, 14183897, 14185812, 14184510, 14182468,
564
+ 14183231, 14182580, 14183996, 14182449, 14185671, 14182428, 14182666,
565
+ 14186599, 14182519, 14185571, 14185159, 14182636, 14185864, 14188340,
566
+ 14183433, 14183146, 14184034, 14184363, 14183368, 14183098, 14182495,
567
+ 14182753, 14184720, 14188085, 14187692, 14183633, 14188137, 14182606,
568
+ 14186796, 14196166, 14185084, 14185899, 14188219, 14186885, 14183406,
569
+ 14185561, 14183388, 14191457, 14183281, 14183399, 14183674, 14183236,
570
+ 14183990, 14183760, 14183248, 14184114, 14183318, 14183457, 14186509,
571
+ 14186900, 14186695, 14188405, 14184636, 14184630, 14188301, 14184144,
572
+ 14183023, 14184555, 14185946, 14184611, 14184490, 14183653, 14183881,
573
+ 14182715, 14184440, 14182573, 14183251, 14184962, 14187249, 14182545,
574
14192314,
575
],
576
score: 1356,
@@ -1140,68 +609,32 @@ window.stories = [
609
time: 1493147015,
610
title: 'One GraphQL Client for JavaScript, iOS, and Android',
611
type: 'story',
1143
- url:
1144
- 'https://dev-blog.apollodata.com/one-graphql-client-for-javascript-ios-and-android-64993c1b7991',
612
+ url: 'https://dev-blog.apollodata.com/one-graphql-client-for-javascript-ios-and-android-64993c1b7991',
613
},
614
{
615
by: 'uptown',
616
descendants: 166,
617
id: 14192817,
618
kids: [
1151
- 14197690,
1152
- 14195597,
1153
- 14196750,
1154
- 14195237,
1155
- 14196320,
1156
- 14195150,
1157
- 14198816,
1158
- 14194916,
1159
- 14197746,
1160
- 14196332,
1161
- 14194695,
1162
- 14196726,
1163
- 14194947,
1164
- 14199715,
1165
- 14195059,
1166
- 14195778,
1167
- 14196204,
1168
- 14200435,
1169
- 14194780,
1170
- 14195030,
1171
- 14198452,
1172
- 14199023,
1173
- 14194852,
1174
- 14197577,
1175
- 14197778,
1176
- 14195361,
1177
- 14196368,
1178
- 14194948,
1179
- 14199024,
1180
- 14195060,
1181
- 14199498,
619
+ 14197690, 14195597, 14196750, 14195237, 14196320, 14195150, 14198816,
620
+ 14194916, 14197746, 14196332, 14194695, 14196726, 14194947, 14199715,
621
+ 14195059, 14195778, 14196204, 14200435, 14194780, 14195030, 14198452,
622
+ 14199023, 14194852, 14197577, 14197778, 14195361, 14196368, 14194948,
623
+ 14199024, 14195060, 14199498,
624
],
625
score: 226,
626
time: 1493123621,
627
title: 'How Yahoo Killed Flickr (2012)',
628
type: 'story',
1187
- url:
1188
- 'https://gizmodo.com/5910223/how-yahoo-killed-flickr-and-lost-the-internet',
629
+ url: 'https://gizmodo.com/5910223/how-yahoo-killed-flickr-and-lost-the-internet',
630
},
631
{
632
by: 'mattklein123',
633
descendants: 42,
634
id: 14194026,
635
kids: [
1195
- 14194573,
1196
- 14195577,
1197
- 14194430,
1198
- 14195407,
1199
- 14194569,
1200
- 14195298,
1201
- 14200054,
1202
- 14194456,
1203
- 14198329,
1204
- 14199198,
636
+ 14194573, 14195577, 14194430, 14195407, 14194569, 14195298, 14200054,
637
+ 14194456, 14198329, 14199198,
638
],
639
score: 167,
640
time: 1493131921,
@@ -1219,32 +652,16 @@ window.stories = [
652
title:
653
'Modern Hieroglyphs: Binary Logic Behind the Universal “Power Symbol”',
654
type: 'story',
1222
- url:
1223
- 'https://99percentinvisible.org/article/modern-hieroglyphics-binary-logic-behind-universal-power-symbol/',
655
+ url: 'https://99percentinvisible.org/article/modern-hieroglyphics-binary-logic-behind-universal-power-symbol/',
656
},
657
{
658
by: 'LaFolle',
659
descendants: 92,
660
id: 14191681,
661
kids: [
1230
- 14192477,
1231
- 14194490,
1232
- 14192316,
1233
- 14193364,
1234
- 14192065,
1235
- 14193499,
1236
- 14194324,
1237
- 14192622,
1238
- 14192020,
1239
- 14195866,
1240
- 14192496,
1241
- 14196391,
1242
- 14192138,
1243
- 14192714,
1244
- 14195151,
1245
- 14195094,
1246
- 14192110,
1247
- 14192155,
662
+ 14192477, 14194490, 14192316, 14193364, 14192065, 14193499, 14194324,
663
+ 14192622, 14192020, 14195866, 14192496, 14196391, 14192138, 14192714,
664
+ 14195151, 14195094, 14192110, 14192155,
665
],
666
score: 138,
667
time: 1493108371,
@@ -1257,65 +674,39 @@ window.stories = [
674
descendants: 18,
675
id: 14190736,
676
kids: [
1260
- 14197744,
1261
- 14195753,
1262
- 14197880,
1263
- 14197735,
1264
- 14195874,
1265
- 14197023,
1266
- 14196660,
677
+ 14197744, 14195753, 14197880, 14197735, 14195874, 14197023, 14196660,
678
],
679
score: 81,
680
time: 1493093860,
681
title: 'The legend of the Legion',
682
type: 'story',
1272
- url:
1273
- 'https://aeon.co/essays/why-young-men-queue-up-to-die-in-the-french-foreign-legion',
683
+ url: 'https://aeon.co/essays/why-young-men-queue-up-to-die-in-the-french-foreign-legion',
684
},
685
{
686
by: 'bufordsharkley',
687
descendants: 92,
688
id: 14197013,
689
kids: [
1280
- 14197983,
1281
- 14197168,
1282
- 14197701,
1283
- 14198239,
1284
- 14197514,
1285
- 14198064,
1286
- 14197476,
1287
- 14198489,
1288
- 14197761,
1289
- 14197080,
1290
- 14198905,
1291
- 14198068,
1292
- 14198579,
690
+ 14197983, 14197168, 14197701, 14198239, 14197514, 14198064, 14197476,
691
+ 14198489, 14197761, 14197080, 14198905, 14198068, 14198579,
692
],
693
score: 69,
694
time: 1493147532,
695
title: "Cracking the Mystery of Labor's Falling Share of GDP",
696
type: 'story',
1298
- url:
1299
- 'https://www.bloomberg.com/view/articles/2017-04-24/cracking-the-mystery-of-labor-s-falling-share-of-gdp',
697
+ url: 'https://www.bloomberg.com/view/articles/2017-04-24/cracking-the-mystery-of-labor-s-falling-share-of-gdp',
698
},
699
{
700
by: 'rbanffy',
701
descendants: 27,
702
id: 14198470,
703
kids: [
1306
- 14199443,
1307
- 14201987,
1308
- 14199461,
1309
- 14199729,
1310
- 14201519,
1311
- 14198762,
1312
- 14199524,
704
+ 14199443, 14201987, 14199461, 14199729, 14201519, 14198762, 14199524,
705
],
706
score: 52,
707
time: 1493157378,
708
title: 'How the Internet Gave Mail-Order Brides the Power',
709
type: 'story',
1318
- url:
1319
- 'https://backchannel.com/how-the-internet-gave-mail-order-brides-the-power-1af8c8a40562',
710
+ url: 'https://backchannel.com/how-the-internet-gave-mail-order-brides-the-power-1af8c8a40562',
711
},
712
];
scripts/bench/benchmarks/pe-class-components/benchmark.js
+96
-96
@@ -1,4 +1,4 @@
1
-(function() {
1
+(function () {
2
'use strict';
3
4
class ReactImage0 extends React.Component {
@@ -246,7 +246,7 @@
246
label: null,
247
href: '#',
248
rel: undefined,
249
- onClick: function() {},
249
+ onClick: function () {},
250
},
251
null,
252
React.createElement(
@@ -279,7 +279,7 @@
279
label: null,
280
href: '#',
281
rel: undefined,
282
- onClick: function() {},
282
+ onClick: function () {},
283
},
284
undefined,
285
'Remove',
@@ -293,7 +293,7 @@
293
target: '_blank',
294
href: '/ads/manage/billing.php?act=10149999073643408',
295
rel: undefined,
296
- onClick: function() {},
296
+ onClick: function () {},
297
},
298
React.createElement(XUIText29, {x: 48})
299
);
@@ -308,7 +308,7 @@
308
label: null,
309
href: '#',
310
rel: undefined,
311
- onClick: function() {},
311
+ onClick: function () {},
312
},
313
null,
314
React.createElement(
@@ -330,7 +330,7 @@
330
label: null,
331
href: '#',
332
rel: undefined,
333
- onClick: function() {},
333
+ onClick: function () {},
334
},
335
null,
336
React.createElement(
@@ -353,7 +353,7 @@
353
label: null,
354
href: '#',
355
rel: undefined,
356
- onClick: function() {},
356
+ onClick: function () {},
357
},
358
undefined,
359
'Lifetime',
@@ -363,21 +363,21 @@
363
if (this.props.x === 207) {
364
return React.createElement(
365
'a',
366
- {href: '#', rel: undefined, onClick: function() {}},
366
+ {href: '#', rel: undefined, onClick: function () {}},
367
'Create Ad Set'
368
);
369
}
370
if (this.props.x === 209) {
371
return React.createElement(
372
'a',
373
- {href: '#', rel: undefined, onClick: function() {}},
373
+ {href: '#', rel: undefined, onClick: function () {}},
374
'View Ad Set'
375
);
376
}
377
if (this.props.x === 241) {
378
return React.createElement(
379
'a',
380
- {href: '#', rel: undefined, onClick: function() {}},
380
+ {href: '#', rel: undefined, onClick: function () {}},
381
'Set a Limit'
382
);
383
}
@@ -391,7 +391,7 @@
391
label: null,
392
href: '#',
393
rel: undefined,
394
- onClick: function() {},
394
+ onClick: function () {},
395
},
396
null,
397
React.createElement(
@@ -451,7 +451,7 @@
451
'button',
452
{
453
className: '_5n7z _4jy0 _4jy4 _517h _51sy _42ft',
454
- onClick: function() {},
454
+ onClick: function () {},
455
label: null,
456
type: 'submit',
457
value: '1',
@@ -467,7 +467,7 @@
467
{
468
className: '_5n7z _2yak _4lj- _4jy0 _4jy4 _517h _51sy _42ft _42fr',
469
disabled: true,
470
- onClick: function() {},
470
+ onClick: function () {},
471
'data-tooltip-content': 'You have no changes to publish',
472
'data-hover': 'tooltip',
473
label: null,
@@ -487,7 +487,7 @@
487
'button',
488
{
489
className: '_u_k _4jy0 _4jy4 _517h _51sy _42ft',
490
- onClick: function() {},
490
+ onClick: function () {},
491
label: null,
492
type: 'submit',
493
value: '1',
@@ -520,7 +520,7 @@
520
'data-hover': 'tooltip',
521
className: '_d2_ _u_k noMargin _4jy0 _4jy4 _517h _51sy _42ft',
522
disabled: false,
523
- onClick: function() {},
523
+ onClick: function () {},
524
label: null,
525
type: 'submit',
526
value: '1',
@@ -554,7 +554,7 @@
554
'data-hover': 'tooltip',
555
'data-tooltip-content': 'Revert',
556
disabled: true,
557
- onClick: function() {},
557
+ onClick: function () {},
558
label: null,
559
type: 'submit',
560
value: '1',
@@ -573,7 +573,7 @@
573
'data-hover': 'tooltip',
574
'data-tooltip-content': 'Delete',
575
disabled: false,
576
- onClick: function() {},
576
+ onClick: function () {},
577
label: null,
578
type: 'submit',
579
value: '1',
@@ -592,7 +592,7 @@
592
'data-hover': 'tooltip',
593
'data-tooltip-content': 'Duplicate',
594
disabled: false,
595
- onClick: function() {},
595
+ onClick: function () {},
596
label: null,
597
type: 'submit',
598
value: '1',
@@ -610,7 +610,7 @@
610
className: '_u_k noMargin _p _4jy0 _4jy4 _517h _51sy _42ft',
611
'data-hover': 'tooltip',
612
'data-tooltip-content': 'Export & Import',
613
- onClick: function() {},
613
+ onClick: function () {},
614
label: null,
615
type: 'submit',
616
value: '1',
@@ -630,7 +630,7 @@
630
'data-tooltip-content': 'Create Report',
631
disabled: false,
632
style: {boxSizing: 'border-box', height: '28px', width: '48px'},
633
- onClick: function() {},
633
+ onClick: function () {},
634
label: null,
635
type: 'submit',
636
value: '1',
@@ -649,7 +649,7 @@
649
'data-hover': 'tooltip',
650
'data-tooltip-content': 'Campaign Tags',
651
disabled: false,
652
- onClick: function() {},
652
+ onClick: function () {},
653
label: null,
654
type: 'submit',
655
value: '1',
@@ -671,7 +671,7 @@
671
{
672
className: '_3yz9 _1t-2 _50z- _50zy _50zz _50z- _5upp _42ft',
673
size: 'small',
674
- onClick: function() {},
674
+ onClick: function () {},
675
type: 'button',
676
title: 'Remove',
677
'data-hover': undefined,
@@ -689,7 +689,7 @@
689
'button',
690
{
691
className: '_5b5u _5b5v _4jy0 _4jy3 _517h _51sy _42ft',
692
- onClick: function() {},
692
+ onClick: function () {},
693
label: null,
694
type: 'submit',
695
value: '1',
@@ -704,7 +704,7 @@
704
'button',
705
{
706
className: '_1wdf _4jy0 _517i _517h _51sy _42ft',
707
- onClick: function() {},
707
+ onClick: function () {},
708
label: null,
709
type: 'submit',
710
value: '1',
@@ -725,7 +725,7 @@
725
className: '_u_k _3c5o _1-r0 _4jy0 _4jy4 _517h _51sy _42ft',
726
'data-hover': 'tooltip',
727
'data-tooltip-content': 'List Settings',
728
- onClick: function() {},
728
+ onClick: function () {},
729
label: null,
730
type: 'submit',
731
value: '1',
@@ -746,7 +746,7 @@
746
'data-tooltip-position': 'right',
747
'data-tooltip-content': 'Campaigns',
748
'data-hover': 'tooltip',
749
- onClick: function() {},
749
+ onClick: function () {},
750
label: null,
751
type: 'submit',
752
value: '1',
@@ -770,7 +770,7 @@
770
'data-tooltip-position': 'right',
771
'data-tooltip-content': 'Ad Sets',
772
'data-hover': 'tooltip',
773
- onClick: function() {},
773
+ onClick: function () {},
774
label: null,
775
type: 'submit',
776
value: '1',
@@ -794,7 +794,7 @@
794
'data-tooltip-position': 'right',
795
'data-tooltip-content': 'Ads',
796
'data-hover': 'tooltip',
797
- onClick: function() {},
797
+ onClick: function () {},
798
label: null,
799
type: 'submit',
800
value: '1',
@@ -1089,7 +1089,7 @@
1089
if (this.props.x === 16) {
1090
return React.createElement(
1091
'div',
1092
- {className: '_3ut-', onClick: function() {}},
1092
+ {className: '_3ut-', onClick: function () {}},
1093
React.createElement(
1094
'span',
1095
{className: '_3uu0'},
@@ -1865,7 +1865,7 @@
1865
disabled: true,
1866
name: 'filterUnpublished',
1867
value: 'on',
1868
- onClick: function() {},
1868
+ onClick: function () {},
1869
className: null,
1870
id: 'js_input_label_21',
1871
type: 'checkbox',
@@ -1882,7 +1882,7 @@
1882
{className: '_4h2r _55sg _kv1'},
1883
React.createElement('input', {
1884
checked: undefined,
1885
- onChange: function() {},
1885
+ onChange: function () {},
1886
className: null,
1887
type: 'checkbox',
1888
}),
@@ -1932,8 +1932,8 @@
1932
React.createElement(
1933
'span',
1934
{
1935
- onMouseEnter: function() {},
1936
- onMouseLeave: function() {},
1935
+ onMouseEnter: function () {},
1936
+ onMouseLeave: function () {},
1937
onMouseUp: undefined,
1938
},
1939
React.createElement('span', {className: '_3o_j'}),
@@ -1949,8 +1949,8 @@
1949
React.createElement(
1950
'span',
1951
{
1952
- onMouseEnter: function() {},
1953
- onMouseLeave: function() {},
1952
+ onMouseEnter: function () {},
1953
+ onMouseLeave: function () {},
1954
onMouseUp: undefined,
1955
},
1956
React.createElement('span', {className: '_3o_j'}),
@@ -2007,7 +2007,7 @@
2007
{className: '_3yz4', 'aria-hidden': false},
2008
React.createElement(
2009
'div',
2010
- {onClick: function() {}, className: '_3yz5'},
2010
+ {onClick: function () {}, className: '_3yz5'},
2011
React.createElement(ReactImage0, {x: 148}),
2012
React.createElement('div', {className: '_3yz7'}, 'Campaigns:'),
2013
React.createElement(
@@ -2181,10 +2181,10 @@
2181
id: undefined,
2182
maxLength: null,
2183
value: 'Test Campaign',
2184
- onBlur: function() {},
2185
- onChange: function() {},
2186
- onFocus: function() {},
2187
- onKeyDown: function() {},
2184
+ onBlur: function () {},
2185
+ onChange: function () {},
2186
+ onFocus: function () {},
2187
+ onKeyDown: function () {},
2188
}),
2189
null
2190
),
@@ -2270,7 +2270,7 @@
2270
if (this.props.x === 196) {
2271
return React.createElement(
2272
'div',
2273
- {className: '_1-ly _59j9 _d9a', onClick: function() {}},
2273
+ {className: '_1-ly _59j9 _d9a', onClick: function () {}},
2274
React.createElement(ReactImage0, {x: 195}),
2275
React.createElement('div', {className: '_vf7'}),
2276
React.createElement('div', {className: '_vf8'})
@@ -2279,7 +2279,7 @@
2279
if (this.props.x === 199) {
2280
return React.createElement(
2281
'div',
2282
- {className: ' _1-lz _d9a', onClick: function() {}},
2282
+ {className: ' _1-lz _d9a', onClick: function () {}},
2283
React.createElement(ReactImage0, {x: 198}),
2284
React.createElement('div', {className: '_vf7'}),
2285
React.createElement('div', {className: '_vf8'})
@@ -2762,14 +2762,14 @@
2762
return React.createElement(
2763
'div',
2764
{},
2765
- React.createElement('div', {onWheel: function() {}})
2765
+ React.createElement('div', {onWheel: function () {}})
2766
);
2767
}
2768
if (this.props.x === 292) {
2769
return React.createElement(
2770
'div',
2771
{},
2772
- React.createElement('div', {onWheel: function() {}}, [
2772
+ React.createElement('div', {onWheel: function () {}}, [
2773
React.createElement(
2774
'div',
2775
{key: 'campaign_group_errors_section98010048849317'},
@@ -2836,7 +2836,7 @@
2836
'data-tooltip-position': 'below',
2837
disabled: false,
2838
value: true,
2839
- onToggle: function() {},
2839
+ onToggle: function () {},
2840
className: '_128j _128k _128n',
2841
role: 'checkbox',
2842
'aria-checked': 'true',
@@ -2845,9 +2845,9 @@
2845
'div',
2846
{
2847
className: '_128o',
2848
- onClick: function() {},
2849
- onKeyDown: function() {},
2850
- onMouseDown: function() {},
2848
+ onClick: function () {},
2849
+ onKeyDown: function () {},
2850
+ onMouseDown: function () {},
2851
tabIndex: '0',
2852
},
2853
React.createElement('div', {className: '_128p'})
@@ -4071,7 +4071,7 @@
4071
{
4072
className: '_4lg9',
4073
style: {height: 25},
4074
- onMouseDown: function() {},
4074
+ onMouseDown: function () {},
4075
},
4076
React.createElement('div', {
4077
className: '_4lga _4lgb',
@@ -4117,7 +4117,7 @@
4117
{
4118
className: '_4lg9',
4119
style: {height: 25},
4120
- onMouseDown: function() {},
4120
+ onMouseDown: function () {},
4121
},
4122
React.createElement('div', {
4123
className: '_4lga _4lgb',
@@ -4139,7 +4139,7 @@
4139
{
4140
className: '_4lg9',
4141
style: {height: 25},
4142
- onMouseDown: function() {},
4142
+ onMouseDown: function () {},
4143
},
4144
React.createElement('div', {
4145
className: '_4lga _4lgb',
@@ -4161,7 +4161,7 @@
4161
{
4162
className: '_4lg9',
4163
style: {height: 25},
4164
- onMouseDown: function() {},
4164
+ onMouseDown: function () {},
4165
},
4166
React.createElement('div', {
4167
className: '_4lga _4lgb',
@@ -4183,7 +4183,7 @@
4183
{
4184
className: '_4lg9',
4185
style: {height: 25},
4186
- onMouseDown: function() {},
4186
+ onMouseDown: function () {},
4187
},
4188
React.createElement('div', {
4189
className: '_4lga _4lgb',
@@ -4205,7 +4205,7 @@
4205
{
4206
className: '_4lg9',
4207
style: {height: 25},
4208
- onMouseDown: function() {},
4208
+ onMouseDown: function () {},
4209
},
4210
React.createElement('div', {
4211
className: '_4lga _4lgb',
@@ -4227,7 +4227,7 @@
4227
{
4228
className: '_4lg9',
4229
style: {height: 25},
4230
- onMouseDown: function() {},
4230
+ onMouseDown: function () {},
4231
},
4232
React.createElement('div', {
4233
className: '_4lga _4lgb',
@@ -4249,7 +4249,7 @@
4249
{
4250
className: '_4lg9',
4251
style: {height: 25},
4252
- onMouseDown: function() {},
4252
+ onMouseDown: function () {},
4253
},
4254
React.createElement('div', {
4255
className: '_4lga _4lgb',
@@ -4271,7 +4271,7 @@
4271
{
4272
className: '_4lg9',
4273
style: {height: 25},
4274
- onMouseDown: function() {},
4274
+ onMouseDown: function () {},
4275
},
4276
React.createElement('div', {
4277
className: '_4lga _4lgb',
@@ -4293,7 +4293,7 @@
4293
{
4294
className: '_4lg9',
4295
style: {height: 25},
4296
- onMouseDown: function() {},
4296
+ onMouseDown: function () {},
4297
},
4298
React.createElement('div', {
4299
className: '_4lga _4lgb',
@@ -4315,7 +4315,7 @@
4315
{
4316
className: '_4lg9',
4317
style: {height: 25},
4318
- onMouseDown: function() {},
4318
+ onMouseDown: function () {},
4319
},
4320
React.createElement('div', {
4321
className: '_4lga _4lgb',
@@ -4337,7 +4337,7 @@
4337
{
4338
className: '_4lg9',
4339
style: {height: 25},
4340
- onMouseDown: function() {},
4340
+ onMouseDown: function () {},
4341
},
4342
React.createElement('div', {
4343
className: '_4lga _4lgb',
@@ -4359,7 +4359,7 @@
4359
{
4360
className: '_4lg9',
4361
style: {height: 25},
4362
- onMouseDown: function() {},
4362
+ onMouseDown: function () {},
4363
},
4364
React.createElement('div', {
4365
className: '_4lga _4lgb',
@@ -4381,7 +4381,7 @@
4381
{
4382
className: '_4lg9',
4383
style: {height: 25},
4384
- onMouseDown: function() {},
4384
+ onMouseDown: function () {},
4385
},
4386
React.createElement('div', {
4387
className: '_4lga _4lgb',
@@ -4403,7 +4403,7 @@
4403
{
4404
className: '_4lg9',
4405
style: {height: 25},
4406
- onMouseDown: function() {},
4406
+ onMouseDown: function () {},
4407
},
4408
React.createElement('div', {
4409
className: '_4lga _4lgb',
@@ -4425,7 +4425,7 @@
4425
{
4426
className: '_4lg9',
4427
style: {height: 25},
4428
- onMouseDown: function() {},
4428
+ onMouseDown: function () {},
4429
},
4430
React.createElement('div', {
4431
className: '_4lga _4lgb',
@@ -4447,7 +4447,7 @@
4447
{
4448
className: '_4lg9',
4449
style: {height: 25},
4450
- onMouseDown: function() {},
4450
+ onMouseDown: function () {},
4451
},
4452
React.createElement('div', {
4453
className: '_4lga _4lgb',
@@ -4469,7 +4469,7 @@
4469
{
4470
className: '_4lg9',
4471
style: {height: 25},
4472
- onMouseDown: function() {},
4472
+ onMouseDown: function () {},
4473
},
4474
React.createElement('div', {
4475
className: '_4lga _4lgb',
@@ -4491,7 +4491,7 @@
4491
{
4492
className: '_4lg9',
4493
style: {height: 25},
4494
- onMouseDown: function() {},
4494
+ onMouseDown: function () {},
4495
},
4496
React.createElement('div', {
4497
className: '_4lga _4lgb',
@@ -4753,7 +4753,7 @@
4753
if (this.props.x === 341) {
4754
return React.createElement(
4755
'div',
4756
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4756
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4757
React.createElement(
4758
'div',
4759
{className: '_2eq6'},
@@ -4765,7 +4765,7 @@
4765
if (this.props.x === 347) {
4766
return React.createElement(
4767
'div',
4768
- {onClick: function() {}, className: '_54_8 _1kst _4h2r _2wzx'},
4768
+ {onClick: function () {}, className: '_54_8 _1kst _4h2r _2wzx'},
4769
React.createElement(
4770
'div',
4771
{className: '_2eq6'},
@@ -4777,7 +4777,7 @@
4777
if (this.props.x === 353) {
4778
return React.createElement(
4779
'div',
4780
- {onClick: function() {}, className: '_54_8 _1kst _4h2r _2wzx'},
4780
+ {onClick: function () {}, className: '_54_8 _1kst _4h2r _2wzx'},
4781
React.createElement(
4782
'div',
4783
{className: '_2eq6'},
@@ -4789,7 +4789,7 @@
4789
if (this.props.x === 358) {
4790
return React.createElement(
4791
'div',
4792
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4792
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4793
React.createElement(
4794
'div',
4795
{className: '_2eq6'},
@@ -4801,7 +4801,7 @@
4801
if (this.props.x === 363) {
4802
return React.createElement(
4803
'div',
4804
- {onClick: function() {}, className: '_54_8 _54_9 _4h2r _2wzx'},
4804
+ {onClick: function () {}, className: '_54_8 _54_9 _4h2r _2wzx'},
4805
React.createElement(
4806
'div',
4807
{className: '_2eq6'},
@@ -4813,7 +4813,7 @@
4813
if (this.props.x === 370) {
4814
return React.createElement(
4815
'div',
4816
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4816
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4817
React.createElement(
4818
'div',
4819
{className: '_2eq6'},
@@ -4825,7 +4825,7 @@
4825
if (this.props.x === 375) {
4826
return React.createElement(
4827
'div',
4828
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4828
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4829
React.createElement(
4830
'div',
4831
{className: '_2eq6'},
@@ -4837,7 +4837,7 @@
4837
if (this.props.x === 380) {
4838
return React.createElement(
4839
'div',
4840
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4840
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4841
React.createElement(
4842
'div',
4843
{className: '_2eq6'},
@@ -4849,7 +4849,7 @@
4849
if (this.props.x === 385) {
4850
return React.createElement(
4851
'div',
4852
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4852
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4853
React.createElement(
4854
'div',
4855
{className: '_2eq6'},
@@ -4861,7 +4861,7 @@
4861
if (this.props.x === 390) {
4862
return React.createElement(
4863
'div',
4864
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4864
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4865
React.createElement(
4866
'div',
4867
{className: '_2eq6'},
@@ -4873,7 +4873,7 @@
4873
if (this.props.x === 395) {
4874
return React.createElement(
4875
'div',
4876
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4876
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4877
React.createElement(
4878
'div',
4879
{className: '_2eq6'},
@@ -4885,7 +4885,7 @@
4885
if (this.props.x === 400) {
4886
return React.createElement(
4887
'div',
4888
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4888
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4889
React.createElement(
4890
'div',
4891
{className: '_2eq6'},
@@ -4897,7 +4897,7 @@
4897
if (this.props.x === 405) {
4898
return React.createElement(
4899
'div',
4900
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4900
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4901
React.createElement(
4902
'div',
4903
{className: '_2eq6'},
@@ -4909,7 +4909,7 @@
4909
if (this.props.x === 410) {
4910
return React.createElement(
4911
'div',
4912
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4912
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4913
React.createElement(
4914
'div',
4915
{className: '_2eq6'},
@@ -4921,7 +4921,7 @@
4921
if (this.props.x === 415) {
4922
return React.createElement(
4923
'div',
4924
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4924
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4925
React.createElement(
4926
'div',
4927
{className: '_2eq6'},
@@ -4933,7 +4933,7 @@
4933
if (this.props.x === 420) {
4934
return React.createElement(
4935
'div',
4936
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4936
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4937
React.createElement(
4938
'div',
4939
{className: '_2eq6'},
@@ -4945,7 +4945,7 @@
4945
if (this.props.x === 425) {
4946
return React.createElement(
4947
'div',
4948
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4948
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4949
React.createElement(
4950
'div',
4951
{className: '_2eq6'},
@@ -4957,7 +4957,7 @@
4957
if (this.props.x === 430) {
4958
return React.createElement(
4959
'div',
4960
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4960
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4961
React.createElement(
4962
'div',
4963
{className: '_2eq6'},
@@ -4969,7 +4969,7 @@
4969
if (this.props.x === 435) {
4970
return React.createElement(
4971
'div',
4972
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4972
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4973
React.createElement(
4974
'div',
4975
{className: '_2eq6'},
@@ -4981,7 +4981,7 @@
4981
if (this.props.x === 440) {
4982
return React.createElement(
4983
'div',
4984
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4984
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4985
React.createElement(
4986
'div',
4987
{className: '_2eq6'},
@@ -4993,7 +4993,7 @@
4993
if (this.props.x === 445) {
4994
return React.createElement(
4995
'div',
4996
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4996
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4997
React.createElement(
4998
'div',
4999
{className: '_2eq6'},
@@ -5139,11 +5139,11 @@
5139
return React.createElement(
5140
'div',
5141
{
5142
- onFocus: function() {},
5143
- onBlur: function() {},
5144
- onKeyDown: function() {},
5145
- onMouseDown: function() {},
5146
- onWheel: function() {},
5142
+ onFocus: function () {},
5143
+ onBlur: function () {},
5144
+ onKeyDown: function () {},
5145
+ onMouseDown: function () {},
5146
+ onWheel: function () {},
5147
className: '_1t0r _1t0t _4jdr _1t0u',
5148
style: {width: 1209, zIndex: 99},
5149
tabIndex: 0,
@@ -5193,7 +5193,7 @@
5193
'div',
5194
{
5195
className: '_3h1i _1mie',
5196
- onWheel: function() {},
5196
+ onWheel: function () {},
5197
style: {height: 25, width: 1209},
5198
},
5199
React.createElement(
@@ -5245,7 +5245,7 @@
5245
if (this.props.x === 466) {
5246
return React.createElement(
5247
'div',
5248
- {className: '_5d6f', tabIndex: '0', onKeyDown: function() {}},
5248
+ {className: '_5d6f', tabIndex: '0', onKeyDown: function () {}},
5249
React.createElement(AdsSelectableFixedDataTable155, {x: 465})
5250
);
5251
}
@@ -5257,7 +5257,7 @@
5257
if (this.props.x === 467) {
5258
return React.createElement(
5259
'div',
5260
- {onCopy: function() {}},
5260
+ {onCopy: function () {}},
5261
React.createElement(AdsDataTableKeyboardSupportDecorator156, {x: 466})
5262
);
5263
}
scripts/bench/benchmarks/pe-functional-components/benchmark.js
+362
-285
@@ -1,7 +1,7 @@
1
-(function() {
1
+(function () {
2
'use strict';
3
4
- var ReactImage0 = function(props) {
4
+ var ReactImage0 = function (props) {
5
if (props.x === 0) {
6
return React.createElement('i', {
7
alt: '',
@@ -232,7 +232,7 @@
232
}
233
};
234
235
- var AbstractLink1 = function(props) {
235
+ var AbstractLink1 = function (props) {
236
if (props.x === 1) {
237
return React.createElement(
238
'a',
@@ -243,7 +243,7 @@
243
label: null,
244
href: '#',
245
rel: undefined,
246
- onClick: function() {},
246
+ onClick: function () {},
247
},
248
null,
249
React.createElement(
@@ -276,7 +276,7 @@
276
label: null,
277
href: '#',
278
rel: undefined,
279
- onClick: function() {},
279
+ onClick: function () {},
280
},
281
undefined,
282
'Remove',
@@ -290,7 +290,7 @@
290
target: '_blank',
291
href: '/ads/manage/billing.php?act=10149999073643408',
292
rel: undefined,
293
- onClick: function() {},
293
+ onClick: function () {},
294
},
295
React.createElement(XUIText29, {x: 48})
296
);
@@ -305,7 +305,7 @@
305
label: null,
306
href: '#',
307
rel: undefined,
308
- onClick: function() {},
308
+ onClick: function () {},
309
},
310
null,
311
React.createElement(
@@ -327,7 +327,7 @@
327
label: null,
328
href: '#',
329
rel: undefined,
330
- onClick: function() {},
330
+ onClick: function () {},
331
},
332
null,
333
React.createElement(
@@ -350,7 +350,7 @@
350
label: null,
351
href: '#',
352
rel: undefined,
353
- onClick: function() {},
353
+ onClick: function () {},
354
},
355
undefined,
356
'Lifetime',
@@ -360,21 +360,21 @@
360
if (props.x === 207) {
361
return React.createElement(
362
'a',
363
- {href: '#', rel: undefined, onClick: function() {}},
363
+ {href: '#', rel: undefined, onClick: function () {}},
364
'Create Ad Set'
365
);
366
}
367
if (props.x === 209) {
368
return React.createElement(
369
'a',
370
- {href: '#', rel: undefined, onClick: function() {}},
370
+ {href: '#', rel: undefined, onClick: function () {}},
371
'View Ad Set'
372
);
373
}
374
if (props.x === 241) {
375
return React.createElement(
376
'a',
377
- {href: '#', rel: undefined, onClick: function() {}},
377
+ {href: '#', rel: undefined, onClick: function () {}},
378
'Set a Limit'
379
);
380
}
@@ -388,7 +388,7 @@
388
label: null,
389
href: '#',
390
rel: undefined,
391
- onClick: function() {},
391
+ onClick: function () {},
392
},
393
null,
394
React.createElement(
@@ -402,7 +402,7 @@
402
}
403
};
404
405
- var Link2 = function(props) {
405
+ var Link2 = function (props) {
406
if (props.x === 2) {
407
return React.createElement(AbstractLink1, {x: 1});
408
}
@@ -435,7 +435,7 @@
435
}
436
};
437
438
- var AbstractButton3 = function(props) {
438
+ var AbstractButton3 = function (props) {
439
if (props.x === 3) {
440
return React.createElement(Link2, {x: 2});
441
}
@@ -444,7 +444,7 @@
444
'button',
445
{
446
className: '_5n7z _4jy0 _4jy4 _517h _51sy _42ft',
447
- onClick: function() {},
447
+ onClick: function () {},
448
label: null,
449
type: 'submit',
450
value: '1',
@@ -460,7 +460,7 @@
460
{
461
className: '_5n7z _2yak _4lj- _4jy0 _4jy4 _517h _51sy _42ft _42fr',
462
disabled: true,
463
- onClick: function() {},
463
+ onClick: function () {},
464
'data-tooltip-content': 'You have no changes to publish',
465
'data-hover': 'tooltip',
466
label: null,
@@ -480,7 +480,7 @@
480
'button',
481
{
482
className: '_u_k _4jy0 _4jy4 _517h _51sy _42ft',
483
- onClick: function() {},
483
+ onClick: function () {},
484
label: null,
485
type: 'submit',
486
value: '1',
@@ -513,7 +513,7 @@
513
'data-hover': 'tooltip',
514
className: '_d2_ _u_k noMargin _4jy0 _4jy4 _517h _51sy _42ft',
515
disabled: false,
516
- onClick: function() {},
516
+ onClick: function () {},
517
label: null,
518
type: 'submit',
519
value: '1',
@@ -547,7 +547,7 @@
547
'data-hover': 'tooltip',
548
'data-tooltip-content': 'Revert',
549
disabled: true,
550
- onClick: function() {},
550
+ onClick: function () {},
551
label: null,
552
type: 'submit',
553
value: '1',
@@ -566,7 +566,7 @@
566
'data-hover': 'tooltip',
567
'data-tooltip-content': 'Delete',
568
disabled: false,
569
- onClick: function() {},
569
+ onClick: function () {},
570
label: null,
571
type: 'submit',
572
value: '1',
@@ -585,7 +585,7 @@
585
'data-hover': 'tooltip',
586
'data-tooltip-content': 'Duplicate',
587
disabled: false,
588
- onClick: function() {},
588
+ onClick: function () {},
589
label: null,
590
type: 'submit',
591
value: '1',
@@ -603,7 +603,7 @@
603
className: '_u_k noMargin _p _4jy0 _4jy4 _517h _51sy _42ft',
604
'data-hover': 'tooltip',
605
'data-tooltip-content': 'Export & Import',
606
- onClick: function() {},
606
+ onClick: function () {},
607
label: null,
608
type: 'submit',
609
value: '1',
@@ -623,7 +623,7 @@
623
'data-tooltip-content': 'Create Report',
624
disabled: false,
625
style: {boxSizing: 'border-box', height: '28px', width: '48px'},
626
- onClick: function() {},
626
+ onClick: function () {},
627
label: null,
628
type: 'submit',
629
value: '1',
@@ -642,7 +642,7 @@
642
'data-hover': 'tooltip',
643
'data-tooltip-content': 'Campaign Tags',
644
disabled: false,
645
- onClick: function() {},
645
+ onClick: function () {},
646
label: null,
647
type: 'submit',
648
value: '1',
@@ -664,7 +664,7 @@
664
{
665
className: '_3yz9 _1t-2 _50z- _50zy _50zz _50z- _5upp _42ft',
666
size: 'small',
667
- onClick: function() {},
667
+ onClick: function () {},
668
type: 'button',
669
title: 'Remove',
670
'data-hover': undefined,
@@ -682,7 +682,7 @@
682
'button',
683
{
684
className: '_5b5u _5b5v _4jy0 _4jy3 _517h _51sy _42ft',
685
- onClick: function() {},
685
+ onClick: function () {},
686
label: null,
687
type: 'submit',
688
value: '1',
@@ -697,7 +697,7 @@
697
'button',
698
{
699
className: '_1wdf _4jy0 _517i _517h _51sy _42ft',
700
- onClick: function() {},
700
+ onClick: function () {},
701
label: null,
702
type: 'submit',
703
value: '1',
@@ -718,7 +718,7 @@
718
className: '_u_k _3c5o _1-r0 _4jy0 _4jy4 _517h _51sy _42ft',
719
'data-hover': 'tooltip',
720
'data-tooltip-content': 'List Settings',
721
- onClick: function() {},
721
+ onClick: function () {},
722
label: null,
723
type: 'submit',
724
value: '1',
@@ -739,7 +739,7 @@
739
'data-tooltip-position': 'right',
740
'data-tooltip-content': 'Campaigns',
741
'data-hover': 'tooltip',
742
- onClick: function() {},
742
+ onClick: function () {},
743
label: null,
744
type: 'submit',
745
value: '1',
@@ -763,7 +763,7 @@
763
'data-tooltip-position': 'right',
764
'data-tooltip-content': 'Ad Sets',
765
'data-hover': 'tooltip',
766
- onClick: function() {},
766
+ onClick: function () {},
767
label: null,
768
type: 'submit',
769
value: '1',
@@ -787,7 +787,7 @@
787
'data-tooltip-position': 'right',
788
'data-tooltip-content': 'Ads',
789
'data-hover': 'tooltip',
790
- onClick: function() {},
790
+ onClick: function () {},
791
label: null,
792
type: 'submit',
793
value: '1',
@@ -805,7 +805,7 @@
805
}
806
};
807
808
- var XUIButton4 = function(props) {
808
+ var XUIButton4 = function (props) {
809
if (props.x === 4) {
810
return React.createElement(AbstractButton3, {x: 3});
811
}
@@ -874,7 +874,7 @@
874
}
875
};
876
877
- var AbstractPopoverButton5 = function(props) {
877
+ var AbstractPopoverButton5 = function (props) {
878
if (props.x === 5) {
879
return React.createElement(XUIButton4, {x: 4});
880
}
@@ -889,7 +889,7 @@
889
}
890
};
891
892
- var ReactXUIPopoverButton6 = function(props) {
892
+ var ReactXUIPopoverButton6 = function (props) {
893
if (props.x === 6) {
894
return React.createElement(AbstractPopoverButton5, {x: 5});
895
}
@@ -904,7 +904,7 @@
904
}
905
};
906
907
- var BIGAdAccountSelector7 = function(props) {
907
+ var BIGAdAccountSelector7 = function (props) {
908
if (props.x === 7) {
909
return React.createElement(
910
'div',
@@ -915,13 +915,13 @@
915
}
916
};
917
918
- var FluxContainer_AdsPEBIGAdAccountSelectorContainer_8 = function(props) {
918
+ var FluxContainer_AdsPEBIGAdAccountSelectorContainer_8 = function (props) {
919
if (props.x === 8) {
920
return React.createElement(BIGAdAccountSelector7, {x: 7});
921
}
922
};
923
924
- var ErrorBoundary9 = function(props) {
924
+ var ErrorBoundary9 = function (props) {
925
if (props.x === 9) {
926
return React.createElement(
927
FluxContainer_AdsPEBIGAdAccountSelectorContainer_8,
@@ -988,7 +988,7 @@
988
}
989
};
990
991
- var AdsErrorBoundary10 = function(props) {
991
+ var AdsErrorBoundary10 = function (props) {
992
if (props.x === 10) {
993
return React.createElement(ErrorBoundary9, {x: 9});
994
}
@@ -1039,23 +1039,23 @@
1039
}
1040
};
1041
1042
- var AdsPENavigationBar11 = function(props) {
1042
+ var AdsPENavigationBar11 = function (props) {
1043
if (props.x === 11) {
1044
return React.createElement('div', {className: '_4t_9'});
1045
}
1046
};
1047
1048
- var FluxContainer_AdsPENavigationBarContainer_12 = function(props) {
1048
+ var FluxContainer_AdsPENavigationBarContainer_12 = function (props) {
1049
if (props.x === 12) {
1050
return React.createElement(AdsPENavigationBar11, {x: 11});
1051
}
1052
};
1053
1054
- var AdsPEDraftSyncStatus13 = function(props) {
1054
+ var AdsPEDraftSyncStatus13 = function (props) {
1055
if (props.x === 16) {
1056
return React.createElement(
1057
'div',
1058
- {className: '_3ut-', onClick: function() {}},
1058
+ {className: '_3ut-', onClick: function () {}},
1059
React.createElement(
1060
'span',
1061
{className: '_3uu0'},
@@ -1065,25 +1065,25 @@
1065
}
1066
};
1067
1068
- var FluxContainer_AdsPEDraftSyncStatusContainer_14 = function(props) {
1068
+ var FluxContainer_AdsPEDraftSyncStatusContainer_14 = function (props) {
1069
if (props.x === 17) {
1070
return React.createElement(AdsPEDraftSyncStatus13, {x: 16});
1071
}
1072
};
1073
1074
- var AdsPEDraftErrorsStatus15 = function(props) {
1074
+ var AdsPEDraftErrorsStatus15 = function (props) {
1075
if (props.x === 18) {
1076
return null;
1077
}
1078
};
1079
1080
- var FluxContainer_viewFn_16 = function(props) {
1080
+ var FluxContainer_viewFn_16 = function (props) {
1081
if (props.x === 19) {
1082
return React.createElement(AdsPEDraftErrorsStatus15, {x: 18});
1083
}
1084
};
1085
1086
- var AdsPEPublishButton17 = function(props) {
1086
+ var AdsPEPublishButton17 = function (props) {
1087
if (props.x === 25) {
1088
return React.createElement(
1089
'div',
@@ -1099,13 +1099,13 @@
1099
}
1100
};
1101
1102
- var FluxContainer_AdsPEPublishButtonContainer_18 = function(props) {
1102
+ var FluxContainer_AdsPEPublishButtonContainer_18 = function (props) {
1103
if (props.x === 26) {
1104
return React.createElement(AdsPEPublishButton17, {x: 25});
1105
}
1106
};
1107
1108
- var InlineBlock19 = function(props) {
1108
+ var InlineBlock19 = function (props) {
1109
if (props.x === 30) {
1110
return React.createElement(
1111
'div',
@@ -1147,7 +1147,7 @@
1147
}
1148
};
1149
1150
- var ReactPopoverMenu20 = function(props) {
1150
+ var ReactPopoverMenu20 = function (props) {
1151
if (props.x === 31) {
1152
return React.createElement(InlineBlock19, {x: 30});
1153
}
@@ -1165,7 +1165,7 @@
1165
}
1166
};
1167
1168
- var LeftRight21 = function(props) {
1168
+ var LeftRight21 = function (props) {
1169
if (props.x === 34) {
1170
return React.createElement(
1171
'div',
@@ -1296,7 +1296,7 @@
1296
}
1297
};
1298
1299
- var AdsUnifiedNavigationLocalNav22 = function(props) {
1299
+ var AdsUnifiedNavigationLocalNav22 = function (props) {
1300
if (props.x === 35) {
1301
return React.createElement(
1302
'div',
@@ -1306,13 +1306,13 @@
1306
}
1307
};
1308
1309
- var XUIDialog23 = function(props) {
1309
+ var XUIDialog23 = function (props) {
1310
if (props.x === 36) {
1311
return null;
1312
}
1313
};
1314
1315
- var AdsPEResetDialog24 = function(props) {
1315
+ var AdsPEResetDialog24 = function (props) {
1316
if (props.x === 37) {
1317
return React.createElement(
1318
'span',
@@ -1322,7 +1322,7 @@
1322
}
1323
};
1324
1325
- var AdsPETopNav25 = function(props) {
1325
+ var AdsPETopNav25 = function (props) {
1326
if (props.x === 40) {
1327
return React.createElement(
1328
'div',
@@ -1333,13 +1333,13 @@
1333
}
1334
};
1335
1336
- var FluxContainer_AdsPETopNavContainer_26 = function(props) {
1336
+ var FluxContainer_AdsPETopNavContainer_26 = function (props) {
1337
if (props.x === 41) {
1338
return React.createElement(AdsPETopNav25, {x: 40});
1339
}
1340
};
1341
1342
- var XUIAbstractGlyphButton27 = function(props) {
1342
+ var XUIAbstractGlyphButton27 = function (props) {
1343
if (props.x === 46) {
1344
return React.createElement(AbstractButton3, {x: 45});
1345
}
@@ -1348,7 +1348,7 @@
1348
}
1349
};
1350
1351
- var XUICloseButton28 = function(props) {
1351
+ var XUICloseButton28 = function (props) {
1352
if (props.x === 47) {
1353
return React.createElement(XUIAbstractGlyphButton27, {x: 46});
1354
}
@@ -1357,7 +1357,7 @@
1357
}
1358
};
1359
1360
- var XUIText29 = function(props) {
1360
+ var XUIText29 = function (props) {
1361
if (props.x === 48) {
1362
return React.createElement(
1363
'span',
@@ -1381,7 +1381,7 @@
1381
}
1382
};
1383
1384
- var XUINotice30 = function(props) {
1384
+ var XUINotice30 = function (props) {
1385
if (props.x === 51) {
1386
return React.createElement(
1387
'div',
@@ -1399,13 +1399,13 @@
1399
}
1400
};
1401
1402
- var ReactCSSTransitionGroupChild31 = function(props) {
1402
+ var ReactCSSTransitionGroupChild31 = function (props) {
1403
if (props.x === 52) {
1404
return React.createElement(XUINotice30, {x: 51});
1405
}
1406
};
1407
1408
- var ReactTransitionGroup32 = function(props) {
1408
+ var ReactTransitionGroup32 = function (props) {
1409
if (props.x === 53) {
1410
return React.createElement(
1411
'span',
@@ -1415,13 +1415,13 @@
1415
}
1416
};
1417
1418
- var ReactCSSTransitionGroup33 = function(props) {
1418
+ var ReactCSSTransitionGroup33 = function (props) {
1419
if (props.x === 54) {
1420
return React.createElement(ReactTransitionGroup32, {x: 53});
1421
}
1422
};
1423
1424
- var AdsPETopError34 = function(props) {
1424
+ var AdsPETopError34 = function (props) {
1425
if (props.x === 55) {
1426
return React.createElement(
1427
'div',
@@ -1431,19 +1431,19 @@
1431
}
1432
};
1433
1434
- var FluxContainer_AdsPETopErrorContainer_35 = function(props) {
1434
+ var FluxContainer_AdsPETopErrorContainer_35 = function (props) {
1435
if (props.x === 56) {
1436
return React.createElement(AdsPETopError34, {x: 55});
1437
}
1438
};
1439
1440
- var FluxContainer_AdsGuidanceChannel_36 = function(props) {
1440
+ var FluxContainer_AdsGuidanceChannel_36 = function (props) {
1441
if (props.x === 59) {
1442
return null;
1443
}
1444
};
1445
1446
- var ResponsiveBlock37 = function(props) {
1446
+ var ResponsiveBlock37 = function (props) {
1447
if (props.x === 62) {
1448
return React.createElement(
1449
'div',
@@ -1481,13 +1481,13 @@
1481
}
1482
};
1483
1484
- var FluxContainer_AdsBulkEditDialogContainer_38 = function(props) {
1484
+ var FluxContainer_AdsBulkEditDialogContainer_38 = function (props) {
1485
if (props.x === 63) {
1486
return null;
1487
}
1488
};
1489
1490
- var Column39 = function(props) {
1490
+ var Column39 = function (props) {
1491
if (props.x === 66) {
1492
return React.createElement(
1493
'div',
@@ -1504,7 +1504,7 @@
1504
}
1505
};
1506
1507
- var XUIButtonGroup40 = function(props) {
1507
+ var XUIButtonGroup40 = function (props) {
1508
if (props.x === 75) {
1509
return React.createElement(
1510
'div',
@@ -1544,13 +1544,13 @@
1544
}
1545
};
1546
1547
- var AdsPEEditToolbarButton41 = function(props) {
1547
+ var AdsPEEditToolbarButton41 = function (props) {
1548
if (props.x === 85) {
1549
return React.createElement(XUIButtonGroup40, {x: 84});
1550
}
1551
};
1552
1553
- var FluxContainer_AdsPEEditCampaignGroupToolbarButtonContainer_42 = function(
1553
+ var FluxContainer_AdsPEEditCampaignGroupToolbarButtonContainer_42 = function (
1554
props
1555
) {
1556
if (props.x === 86) {
@@ -1558,7 +1558,7 @@
1558
}
1559
};
1560
1561
- var FluxContainer_AdsPEEditToolbarButtonContainer_43 = function(props) {
1561
+ var FluxContainer_AdsPEEditToolbarButtonContainer_43 = function (props) {
1562
if (props.x === 87) {
1563
return React.createElement(
1564
FluxContainer_AdsPEEditCampaignGroupToolbarButtonContainer_42,
@@ -1567,31 +1567,31 @@
1567
}
1568
};
1569
1570
- var AdsPEExportImportMenu44 = function(props) {
1570
+ var AdsPEExportImportMenu44 = function (props) {
1571
if (props.x === 103) {
1572
return React.createElement(ReactPopoverMenu20, {x: 102, key: 'export'});
1573
}
1574
};
1575
1576
- var FluxContainer_AdsPECustomizeExportContainer_45 = function(props) {
1576
+ var FluxContainer_AdsPECustomizeExportContainer_45 = function (props) {
1577
if (props.x === 104) {
1578
return null;
1579
}
1580
};
1581
1582
- var AdsPEExportAsTextDialog46 = function(props) {
1582
+ var AdsPEExportAsTextDialog46 = function (props) {
1583
if (props.x === 105) {
1584
return null;
1585
}
1586
};
1587
1588
- var FluxContainer_AdsPEExportAsTextDialogContainer_47 = function(props) {
1588
+ var FluxContainer_AdsPEExportAsTextDialogContainer_47 = function (props) {
1589
if (props.x === 106) {
1590
return React.createElement(AdsPEExportAsTextDialog46, {x: 105});
1591
}
1592
};
1593
1594
- var AdsPEExportImportMenuContainer48 = function(props) {
1594
+ var AdsPEExportImportMenuContainer48 = function (props) {
1595
if (props.x === 107) {
1596
return React.createElement(
1597
'span',
@@ -1609,7 +1609,7 @@
1609
}
1610
};
1611
1612
- var Constructor49 = function(props) {
1612
+ var Constructor49 = function (props) {
1613
if (props.x === 114) {
1614
return null;
1615
}
@@ -1624,7 +1624,7 @@
1624
}
1625
};
1626
1627
- var TagSelectorPopover50 = function(props) {
1627
+ var TagSelectorPopover50 = function (props) {
1628
if (props.x === 115) {
1629
return React.createElement(
1630
'span',
@@ -1635,7 +1635,7 @@
1635
}
1636
};
1637
1638
- var AdsPECampaignGroupTagContainer51 = function(props) {
1638
+ var AdsPECampaignGroupTagContainer51 = function (props) {
1639
if (props.x === 116) {
1640
return React.createElement(TagSelectorPopover50, {
1641
x: 115,
@@ -1644,19 +1644,19 @@
1644
}
1645
};
1646
1647
- var AdsRuleToolbarMenu52 = function(props) {
1647
+ var AdsRuleToolbarMenu52 = function (props) {
1648
if (props.x === 118) {
1649
return null;
1650
}
1651
};
1652
1653
- var FluxContainer_AdsPERuleToolbarMenuContainer_53 = function(props) {
1653
+ var FluxContainer_AdsPERuleToolbarMenuContainer_53 = function (props) {
1654
if (props.x === 119) {
1655
return React.createElement(AdsRuleToolbarMenu52, {x: 118});
1656
}
1657
};
1658
1659
- var FillColumn54 = function(props) {
1659
+ var FillColumn54 = function (props) {
1660
if (props.x === 120) {
1661
return React.createElement(
1662
'div',
@@ -1684,7 +1684,7 @@
1684
}
1685
};
1686
1687
- var Layout55 = function(props) {
1687
+ var Layout55 = function (props) {
1688
if (props.x === 121) {
1689
return React.createElement(
1690
'div',
@@ -1695,7 +1695,7 @@
1695
}
1696
};
1697
1698
- var AdsPEMainPaneToolbar56 = function(props) {
1698
+ var AdsPEMainPaneToolbar56 = function (props) {
1699
if (props.x === 122) {
1700
return React.createElement(
1701
'div',
@@ -1705,13 +1705,13 @@
1705
}
1706
};
1707
1708
- var AdsPECampaignGroupToolbarContainer57 = function(props) {
1708
+ var AdsPECampaignGroupToolbarContainer57 = function (props) {
1709
if (props.x === 123) {
1710
return React.createElement(AdsPEMainPaneToolbar56, {x: 122});
1711
}
1712
};
1713
1714
- var AdsPEFiltersPopover58 = function(props) {
1714
+ var AdsPEFiltersPopover58 = function (props) {
1715
if (props.x === 144) {
1716
return React.createElement(
1717
'span',
@@ -1726,7 +1726,7 @@
1726
}
1727
};
1728
1729
- var AbstractCheckboxInput59 = function(props) {
1729
+ var AbstractCheckboxInput59 = function (props) {
1730
if (props.x === 145) {
1731
return React.createElement(
1732
'label',
@@ -1736,7 +1736,7 @@
1736
disabled: true,
1737
name: 'filterUnpublished',
1738
value: 'on',
1739
- onClick: function() {},
1739
+ onClick: function () {},
1740
className: null,
1741
id: 'js_input_label_21',
1742
type: 'checkbox',
@@ -1753,7 +1753,7 @@
1753
{className: '_4h2r _55sg _kv1'},
1754
React.createElement('input', {
1755
checked: undefined,
1756
- onChange: function() {},
1756
+ onChange: function () {},
1757
className: null,
1758
type: 'checkbox',
1759
}),
@@ -1765,7 +1765,7 @@
1765
}
1766
};
1767
1768
- var XUICheckboxInput60 = function(props) {
1768
+ var XUICheckboxInput60 = function (props) {
1769
if (props.x === 146) {
1770
return React.createElement(AbstractCheckboxInput59, {x: 145});
1771
}
@@ -1774,7 +1774,7 @@
1774
}
1775
};
1776
1777
- var InputLabel61 = function(props) {
1777
+ var InputLabel61 = function (props) {
1778
if (props.x === 147) {
1779
return React.createElement(
1780
'div',
@@ -1789,7 +1789,7 @@
1789
}
1790
};
1791
1792
- var AdsPopoverLink62 = function(props) {
1792
+ var AdsPopoverLink62 = function (props) {
1793
if (props.x === 154) {
1794
return React.createElement(
1795
'span',
@@ -1797,8 +1797,8 @@
1797
React.createElement(
1798
'span',
1799
{
1800
- onMouseEnter: function() {},
1801
- onMouseLeave: function() {},
1800
+ onMouseEnter: function () {},
1801
+ onMouseLeave: function () {},
1802
onMouseUp: undefined,
1803
},
1804
React.createElement('span', {className: '_3o_j'}),
@@ -1814,8 +1814,8 @@
1814
React.createElement(
1815
'span',
1816
{
1817
- onMouseEnter: function() {},
1818
- onMouseLeave: function() {},
1817
+ onMouseEnter: function () {},
1818
+ onMouseLeave: function () {},
1819
onMouseUp: undefined,
1820
},
1821
React.createElement('span', {className: '_3o_j'}),
@@ -1826,7 +1826,7 @@
1826
}
1827
};
1828
1829
- var AdsHelpLink63 = function(props) {
1829
+ var AdsHelpLink63 = function (props) {
1830
if (props.x === 155) {
1831
return React.createElement(AdsPopoverLink62, {x: 154});
1832
}
@@ -1835,7 +1835,7 @@
1835
}
1836
};
1837
1838
- var BUIFilterTokenInput64 = function(props) {
1838
+ var BUIFilterTokenInput64 = function (props) {
1839
if (props.x === 158) {
1840
return React.createElement(
1841
'div',
@@ -1856,7 +1856,7 @@
1856
}
1857
};
1858
1859
- var BUIFilterToken65 = function(props) {
1859
+ var BUIFilterToken65 = function (props) {
1860
if (props.x === 159) {
1861
return React.createElement(
1862
'div',
@@ -1866,7 +1866,7 @@
1866
{className: '_3yz4', 'aria-hidden': false},
1867
React.createElement(
1868
'div',
1869
- {onClick: function() {}, className: '_3yz5'},
1869
+ {onClick: function () {}, className: '_3yz5'},
1870
React.createElement(ReactImage0, {x: 148}),
1871
React.createElement('div', {className: '_3yz7'}, 'Campaigns:'),
1872
React.createElement(
@@ -1887,7 +1887,7 @@
1887
}
1888
};
1889
1890
- var BUIFilterTokenCreateButton66 = function(props) {
1890
+ var BUIFilterTokenCreateButton66 = function (props) {
1891
if (props.x === 163) {
1892
return React.createElement(
1893
'div',
@@ -1897,7 +1897,7 @@
1897
}
1898
};
1899
1900
- var BUIFilterTokenizer67 = function(props) {
1900
+ var BUIFilterTokenizer67 = function (props) {
1901
if (props.x === 164) {
1902
return React.createElement(
1903
'div',
@@ -1912,7 +1912,7 @@
1912
}
1913
};
1914
1915
- var XUIAmbientNUX68 = function(props) {
1915
+ var XUIAmbientNUX68 = function (props) {
1916
if (props.x === 165) {
1917
return null;
1918
}
@@ -1924,7 +1924,7 @@
1924
}
1925
};
1926
1927
- var XUIAmbientNUX69 = function(props) {
1927
+ var XUIAmbientNUX69 = function (props) {
1928
if (props.x === 166) {
1929
return React.createElement(XUIAmbientNUX68, {x: 165});
1930
}
@@ -1936,7 +1936,7 @@
1936
}
1937
};
1938
1939
- var AdsPEAmbientNUXMegaphone70 = function(props) {
1939
+ var AdsPEAmbientNUXMegaphone70 = function (props) {
1940
if (props.x === 167) {
1941
return React.createElement(
1942
'span',
@@ -1947,7 +1947,7 @@
1947
}
1948
};
1949
1950
- var AdsPEFilters71 = function(props) {
1950
+ var AdsPEFilters71 = function (props) {
1951
if (props.x === 168) {
1952
return React.createElement(
1953
'div',
@@ -1965,25 +1965,25 @@
1965
}
1966
};
1967
1968
- var AdsPEFilterContainer72 = function(props) {
1968
+ var AdsPEFilterContainer72 = function (props) {
1969
if (props.x === 169) {
1970
return React.createElement(AdsPEFilters71, {x: 168});
1971
}
1972
};
1973
1974
- var AdsPETablePager73 = function(props) {
1974
+ var AdsPETablePager73 = function (props) {
1975
if (props.x === 172) {
1976
return null;
1977
}
1978
};
1979
1980
- var AdsPECampaignGroupTablePagerContainer74 = function(props) {
1980
+ var AdsPECampaignGroupTablePagerContainer74 = function (props) {
1981
if (props.x === 173) {
1982
return React.createElement(AdsPETablePager73, {x: 172});
1983
}
1984
};
1985
1986
- var AdsPETablePagerContainer75 = function(props) {
1986
+ var AdsPETablePagerContainer75 = function (props) {
1987
if (props.x === 174) {
1988
return React.createElement(AdsPECampaignGroupTablePagerContainer74, {
1989
x: 173,
@@ -1991,7 +1991,7 @@
1991
}
1992
};
1993
1994
- var ReactXUIError76 = function(props) {
1994
+ var ReactXUIError76 = function (props) {
1995
if (props.x === 181) {
1996
return React.createElement(AbstractButton3, {x: 180});
1997
}
@@ -2018,10 +2018,10 @@
2018
id: undefined,
2019
maxLength: null,
2020
value: 'Test Campaign',
2021
- onBlur: function() {},
2022
- onChange: function() {},
2023
- onFocus: function() {},
2024
- onKeyDown: function() {},
2021
+ onBlur: function () {},
2022
+ onChange: function () {},
2023
+ onFocus: function () {},
2024
+ onKeyDown: function () {},
2025
}),
2026
null
2027
),
@@ -2045,13 +2045,13 @@
2045
}
2046
};
2047
2048
- var BUIPopoverButton77 = function(props) {
2048
+ var BUIPopoverButton77 = function (props) {
2049
if (props.x === 182) {
2050
return React.createElement(ReactXUIError76, {x: 181});
2051
}
2052
};
2053
2054
- var BUIDateRangePicker78 = function(props) {
2054
+ var BUIDateRangePicker78 = function (props) {
2055
if (props.x === 184) {
2056
return React.createElement(
2057
'span',
@@ -2062,13 +2062,13 @@
2062
}
2063
};
2064
2065
- var AdsPEStatsRangePicker79 = function(props) {
2065
+ var AdsPEStatsRangePicker79 = function (props) {
2066
if (props.x === 185) {
2067
return React.createElement(BUIDateRangePicker78, {x: 184});
2068
}
2069
};
2070
2071
- var AdsPEStatRange80 = function(props) {
2071
+ var AdsPEStatRange80 = function (props) {
2072
if (props.x === 191) {
2073
return React.createElement(
2074
'div',
@@ -2085,17 +2085,17 @@
2085
}
2086
};
2087
2088
- var AdsPEStatRangeContainer81 = function(props) {
2088
+ var AdsPEStatRangeContainer81 = function (props) {
2089
if (props.x === 192) {
2090
return React.createElement(AdsPEStatRange80, {x: 191});
2091
}
2092
};
2093
2094
- var AdsPESideTrayTabButton82 = function(props) {
2094
+ var AdsPESideTrayTabButton82 = function (props) {
2095
if (props.x === 196) {
2096
return React.createElement(
2097
'div',
2098
- {className: '_1-ly _59j9 _d9a', onClick: function() {}},
2098
+ {className: '_1-ly _59j9 _d9a', onClick: function () {}},
2099
React.createElement(ReactImage0, {x: 195}),
2100
React.createElement('div', {className: '_vf7'}),
2101
React.createElement('div', {className: '_vf8'})
@@ -2104,7 +2104,7 @@
2104
if (props.x === 199) {
2105
return React.createElement(
2106
'div',
2107
- {className: ' _1-lz _d9a', onClick: function() {}},
2107
+ {className: ' _1-lz _d9a', onClick: function () {}},
2108
React.createElement(ReactImage0, {x: 198}),
2109
React.createElement('div', {className: '_vf7'}),
2110
React.createElement('div', {className: '_vf8'})
@@ -2115,13 +2115,13 @@
2115
}
2116
};
2117
2118
- var AdsPEEditorTrayTabButton83 = function(props) {
2118
+ var AdsPEEditorTrayTabButton83 = function (props) {
2119
if (props.x === 197) {
2120
return React.createElement(AdsPESideTrayTabButton82, {x: 196});
2121
}
2122
};
2123
2124
- var AdsPEInsightsTrayTabButton84 = function(props) {
2124
+ var AdsPEInsightsTrayTabButton84 = function (props) {
2125
if (props.x === 202) {
2126
return React.createElement(
2127
'span',
@@ -2132,13 +2132,13 @@
2132
}
2133
};
2134
2135
- var AdsPENekoDebuggerTrayTabButton85 = function(props) {
2135
+ var AdsPENekoDebuggerTrayTabButton85 = function (props) {
2136
if (props.x === 204) {
2137
return React.createElement(AdsPESideTrayTabButton82, {x: 203});
2138
}
2139
};
2140
2141
- var AdsPEEditorChildLink86 = function(props) {
2141
+ var AdsPEEditorChildLink86 = function (props) {
2142
if (props.x === 211) {
2143
return React.createElement(
2144
'div',
@@ -2150,13 +2150,13 @@
2150
}
2151
};
2152
2153
- var AdsPEEditorChildLinkContainer87 = function(props) {
2153
+ var AdsPEEditorChildLinkContainer87 = function (props) {
2154
if (props.x === 212) {
2155
return React.createElement(AdsPEEditorChildLink86, {x: 211});
2156
}
2157
};
2158
2159
- var AdsPEHeaderSection88 = function(props) {
2159
+ var AdsPEHeaderSection88 = function (props) {
2160
if (props.x === 213) {
2161
return React.createElement(
2162
'div',
@@ -2177,25 +2177,25 @@
2177
}
2178
};
2179
2180
- var AdsPECampaignGroupHeaderSectionContainer89 = function(props) {
2180
+ var AdsPECampaignGroupHeaderSectionContainer89 = function (props) {
2181
if (props.x === 214) {
2182
return React.createElement(AdsPEHeaderSection88, {x: 213});
2183
}
2184
};
2185
2186
- var AdsEditorLoadingErrors90 = function(props) {
2186
+ var AdsEditorLoadingErrors90 = function (props) {
2187
if (props.x === 215) {
2188
return null;
2189
}
2190
};
2191
2192
- var AdsTextInput91 = function(props) {
2192
+ var AdsTextInput91 = function (props) {
2193
if (props.x === 217) {
2194
return React.createElement(ReactXUIError76, {x: 216});
2195
}
2196
};
2197
2198
- var BUIFormElement92 = function(props) {
2198
+ var BUIFormElement92 = function (props) {
2199
if (props.x === 218) {
2200
return React.createElement(
2201
'div',
@@ -2236,7 +2236,7 @@
2236
}
2237
};
2238
2239
- var BUIForm93 = function(props) {
2239
+ var BUIForm93 = function (props) {
2240
if (props.x === 219) {
2241
return React.createElement(
2242
'div',
@@ -2246,7 +2246,7 @@
2246
}
2247
};
2248
2249
- var XUICard94 = function(props) {
2249
+ var XUICard94 = function (props) {
2250
if (props.x === 220) {
2251
return React.createElement(
2252
'div',
@@ -2271,7 +2271,7 @@
2271
}
2272
};
2273
2274
- var AdsCard95 = function(props) {
2274
+ var AdsCard95 = function (props) {
2275
if (props.x === 222) {
2276
return React.createElement(ReactXUIError76, {x: 221});
2277
}
@@ -2283,13 +2283,13 @@
2283
}
2284
};
2285
2286
- var AdsEditorNameSection96 = function(props) {
2286
+ var AdsEditorNameSection96 = function (props) {
2287
if (props.x === 223) {
2288
return React.createElement(AdsCard95, {x: 222});
2289
}
2290
};
2291
2292
- var AdsCampaignGroupNameSectionContainer97 = function(props) {
2292
+ var AdsCampaignGroupNameSectionContainer97 = function (props) {
2293
if (props.x === 224) {
2294
return React.createElement(AdsEditorNameSection96, {
2295
x: 223,
@@ -2298,7 +2298,7 @@
2298
}
2299
};
2300
2301
- var _render98 = function(props) {
2301
+ var _render98 = function (props) {
2302
if (props.x === 225) {
2303
return React.createElement(AdsCampaignGroupNameSectionContainer97, {
2304
x: 224,
@@ -2306,7 +2306,7 @@
2306
}
2307
};
2308
2309
- var AdsPluginWrapper99 = function(props) {
2309
+ var AdsPluginWrapper99 = function (props) {
2310
if (props.x === 226) {
2311
return React.createElement(_render98, {x: 225});
2312
}
@@ -2324,7 +2324,7 @@
2324
}
2325
};
2326
2327
- var XUICardHeaderTitle100 = function(props) {
2327
+ var XUICardHeaderTitle100 = function (props) {
2328
if (props.x === 227) {
2329
return React.createElement(
2330
'span',
@@ -2361,7 +2361,7 @@
2361
}
2362
};
2363
2364
- var XUICardSection101 = function(props) {
2364
+ var XUICardSection101 = function (props) {
2365
if (props.x === 228) {
2366
return React.createElement(
2367
'div',
@@ -2389,19 +2389,19 @@
2389
}
2390
};
2391
2392
- var XUICardHeader102 = function(props) {
2392
+ var XUICardHeader102 = function (props) {
2393
if (props.x === 229) {
2394
return React.createElement(XUICardSection101, {x: 228});
2395
}
2396
};
2397
2398
- var AdsCardHeader103 = function(props) {
2398
+ var AdsCardHeader103 = function (props) {
2399
if (props.x === 230) {
2400
return React.createElement(XUICardHeader102, {x: 229});
2401
}
2402
};
2403
2404
- var AdsLabeledField104 = function(props) {
2404
+ var AdsLabeledField104 = function (props) {
2405
if (props.x === 231) {
2406
return React.createElement(
2407
'div',
@@ -2443,7 +2443,7 @@
2443
}
2444
};
2445
2446
- var FlexibleBlock105 = function(props) {
2446
+ var FlexibleBlock105 = function (props) {
2447
if (props.x === 233) {
2448
return React.createElement(LeftRight21, {x: 232});
2449
}
@@ -2455,7 +2455,7 @@
2455
}
2456
};
2457
2458
- var AdsBulkCampaignSpendCapField106 = function(props) {
2458
+ var AdsBulkCampaignSpendCapField106 = function (props) {
2459
if (props.x === 243) {
2460
return React.createElement(
2461
'div',
@@ -2467,25 +2467,25 @@
2467
}
2468
};
2469
2470
- var FluxContainer_AdsCampaignGroupSpendCapContainer_107 = function(props) {
2470
+ var FluxContainer_AdsCampaignGroupSpendCapContainer_107 = function (props) {
2471
if (props.x === 244) {
2472
return React.createElement(AdsBulkCampaignSpendCapField106, {x: 243});
2473
}
2474
};
2475
2476
- var AdsCardSection108 = function(props) {
2476
+ var AdsCardSection108 = function (props) {
2477
if (props.x === 248) {
2478
return React.createElement(XUICardSection101, {x: 247});
2479
}
2480
};
2481
2482
- var AdsEditorCampaignGroupDetailsSection109 = function(props) {
2482
+ var AdsEditorCampaignGroupDetailsSection109 = function (props) {
2483
if (props.x === 252) {
2484
return React.createElement(AdsCard95, {x: 251});
2485
}
2486
};
2487
2488
- var AdsEditorCampaignGroupDetailsSectionContainer110 = function(props) {
2488
+ var AdsEditorCampaignGroupDetailsSectionContainer110 = function (props) {
2489
if (props.x === 253) {
2490
return React.createElement(AdsEditorCampaignGroupDetailsSection109, {
2491
x: 252,
@@ -2494,7 +2494,7 @@
2494
}
2495
};
2496
2497
- var _render111 = function(props) {
2497
+ var _render111 = function (props) {
2498
if (props.x === 254) {
2499
return React.createElement(
2500
AdsEditorCampaignGroupDetailsSectionContainer110,
@@ -2503,7 +2503,7 @@
2503
}
2504
};
2505
2506
- var FluxContainer_AdsEditorToplineDetailsSectionContainer_112 = function(
2506
+ var FluxContainer_AdsEditorToplineDetailsSectionContainer_112 = function (
2507
props
2508
) {
2509
if (props.x === 256) {
@@ -2511,7 +2511,7 @@
2511
}
2512
};
2513
2514
- var _render113 = function(props) {
2514
+ var _render113 = function (props) {
2515
if (props.x === 257) {
2516
return React.createElement(
2517
FluxContainer_AdsEditorToplineDetailsSectionContainer_112,
@@ -2520,19 +2520,19 @@
2520
}
2521
};
2522
2523
- var AdsStickyArea114 = function(props) {
2523
+ var AdsStickyArea114 = function (props) {
2524
if (props.x === 259) {
2525
return React.createElement(
2526
'div',
2527
{},
2528
- React.createElement('div', {onWheel: function() {}})
2528
+ React.createElement('div', {onWheel: function () {}})
2529
);
2530
}
2531
if (props.x === 292) {
2532
return React.createElement(
2533
'div',
2534
{},
2535
- React.createElement('div', {onWheel: function() {}}, [
2535
+ React.createElement('div', {onWheel: function () {}}, [
2536
React.createElement(
2537
'div',
2538
{key: 'campaign_group_errors_section98010048849317'},
@@ -2543,7 +2543,7 @@
2543
}
2544
};
2545
2546
- var FluxContainer_AdsEditorColumnContainer_115 = function(props) {
2546
+ var FluxContainer_AdsEditorColumnContainer_115 = function (props) {
2547
if (props.x === 260) {
2548
return React.createElement(
2549
'div',
@@ -2584,7 +2584,7 @@
2584
}
2585
};
2586
2587
- var BUISwitch116 = function(props) {
2587
+ var BUISwitch116 = function (props) {
2588
if (props.x === 261) {
2589
return React.createElement(
2590
'div',
@@ -2595,7 +2595,7 @@
2595
'data-tooltip-position': 'below',
2596
disabled: false,
2597
value: true,
2598
- onToggle: function() {},
2598
+ onToggle: function () {},
2599
className: '_128j _128k _128n',
2600
role: 'checkbox',
2601
'aria-checked': 'true',
@@ -2604,9 +2604,9 @@
2604
'div',
2605
{
2606
className: '_128o',
2607
- onClick: function() {},
2608
- onKeyDown: function() {},
2609
- onMouseDown: function() {},
2607
+ onClick: function () {},
2608
+ onKeyDown: function () {},
2609
+ onMouseDown: function () {},
2610
tabIndex: '0',
2611
},
2612
React.createElement('div', {className: '_128p'})
@@ -2616,19 +2616,19 @@
2616
}
2617
};
2618
2619
- var AdsStatusSwitchInternal117 = function(props) {
2619
+ var AdsStatusSwitchInternal117 = function (props) {
2620
if (props.x === 262) {
2621
return React.createElement(BUISwitch116, {x: 261});
2622
}
2623
};
2624
2625
- var AdsStatusSwitch118 = function(props) {
2625
+ var AdsStatusSwitch118 = function (props) {
2626
if (props.x === 263) {
2627
return React.createElement(AdsStatusSwitchInternal117, {x: 262});
2628
}
2629
};
2630
2631
- var FluxContainer_AdsCampaignGroupStatusSwitchContainer_119 = function(
2631
+ var FluxContainer_AdsCampaignGroupStatusSwitchContainer_119 = function (
2632
props
2633
) {
2634
if (props.x === 264) {
@@ -2639,13 +2639,13 @@
2639
}
2640
};
2641
2642
- var AdsLinksMenu120 = function(props) {
2642
+ var AdsLinksMenu120 = function (props) {
2643
if (props.x === 275) {
2644
return React.createElement(ReactPopoverMenu20, {x: 274});
2645
}
2646
};
2647
2648
- var FluxContainer_AdsPluginizedLinksMenuContainer_121 = function(props) {
2648
+ var FluxContainer_AdsPluginizedLinksMenuContainer_121 = function (props) {
2649
if (props.x === 276) {
2650
return React.createElement(
2651
'div',
@@ -2656,25 +2656,27 @@
2656
}
2657
};
2658
2659
- var AdsCardLeftRightHeader122 = function(props) {
2659
+ var AdsCardLeftRightHeader122 = function (props) {
2660
if (props.x === 278) {
2661
return React.createElement(LeftRight21, {x: 277});
2662
}
2663
};
2664
2665
- var AdsPEIDSection123 = function(props) {
2665
+ var AdsPEIDSection123 = function (props) {
2666
if (props.x === 282) {
2667
return React.createElement(AdsCard95, {x: 281});
2668
}
2669
};
2670
2671
- var FluxContainer_AdsPECampaignGroupIDSectionContainer_124 = function(props) {
2671
+ var FluxContainer_AdsPECampaignGroupIDSectionContainer_124 = function (
2672
+ props
2673
+ ) {
2674
if (props.x === 283) {
2675
return React.createElement(AdsPEIDSection123, {x: 282});
2676
}
2677
};
2678
2677
- var DeferredComponent125 = function(props) {
2679
+ var DeferredComponent125 = function (props) {
2680
if (props.x === 284) {
2681
return React.createElement(
2682
FluxContainer_AdsPECampaignGroupIDSectionContainer_124,
@@ -2683,31 +2685,31 @@
2685
}
2686
};
2687
2686
- var BootloadedComponent126 = function(props) {
2688
+ var BootloadedComponent126 = function (props) {
2689
if (props.x === 285) {
2690
return React.createElement(DeferredComponent125, {x: 284});
2691
}
2692
};
2693
2692
- var _render127 = function(props) {
2694
+ var _render127 = function (props) {
2695
if (props.x === 286) {
2696
return React.createElement(BootloadedComponent126, {x: 285});
2697
}
2698
};
2699
2698
- var AdsEditorErrorsCard128 = function(props) {
2700
+ var AdsEditorErrorsCard128 = function (props) {
2701
if (props.x === 288) {
2702
return null;
2703
}
2704
};
2705
2704
- var FluxContainer_FunctionalContainer_129 = function(props) {
2706
+ var FluxContainer_FunctionalContainer_129 = function (props) {
2707
if (props.x === 289) {
2708
return React.createElement(AdsEditorErrorsCard128, {x: 288});
2709
}
2710
};
2711
2710
- var _render130 = function(props) {
2712
+ var _render130 = function (props) {
2713
if (props.x === 290) {
2714
return React.createElement(FluxContainer_FunctionalContainer_129, {
2715
x: 289,
@@ -2715,7 +2717,7 @@
2717
}
2718
};
2719
2718
- var AdsEditorMultiColumnLayout131 = function(props) {
2720
+ var AdsEditorMultiColumnLayout131 = function (props) {
2721
if (props.x === 294) {
2722
return React.createElement(
2723
'div',
@@ -2753,7 +2755,7 @@
2755
}
2756
};
2757
2756
- var AdsPECampaignGroupEditor132 = function(props) {
2758
+ var AdsPECampaignGroupEditor132 = function (props) {
2759
if (props.x === 295) {
2760
return React.createElement(
2761
'div',
@@ -2766,13 +2768,13 @@
2768
}
2769
};
2770
2769
- var AdsPECampaignGroupEditorContainer133 = function(props) {
2771
+ var AdsPECampaignGroupEditorContainer133 = function (props) {
2772
if (props.x === 296) {
2773
return React.createElement(AdsPECampaignGroupEditor132, {x: 295});
2774
}
2775
};
2776
2775
- var AdsPESideTrayTabContent134 = function(props) {
2777
+ var AdsPESideTrayTabContent134 = function (props) {
2778
if (props.x === 297) {
2779
return React.createElement(
2780
'div',
@@ -2782,13 +2784,13 @@
2784
}
2785
};
2786
2785
- var AdsPEEditorTrayTabContentContainer135 = function(props) {
2787
+ var AdsPEEditorTrayTabContentContainer135 = function (props) {
2788
if (props.x === 298) {
2789
return React.createElement(AdsPESideTrayTabContent134, {x: 297});
2790
}
2791
};
2792
2791
- var AdsPEMultiTabDrawer136 = function(props) {
2793
+ var AdsPEMultiTabDrawer136 = function (props) {
2794
if (props.x === 299) {
2795
return React.createElement(
2796
'div',
@@ -2822,13 +2824,13 @@
2824
}
2825
};
2826
2825
- var FluxContainer_AdsPEMultiTabDrawerContainer_137 = function(props) {
2827
+ var FluxContainer_AdsPEMultiTabDrawerContainer_137 = function (props) {
2828
if (props.x === 300) {
2829
return React.createElement(AdsPEMultiTabDrawer136, {x: 299});
2830
}
2831
};
2832
2831
- var AdsPESimpleOrganizer138 = function(props) {
2833
+ var AdsPESimpleOrganizer138 = function (props) {
2834
if (props.x === 309) {
2835
return React.createElement(
2836
'div',
@@ -2840,7 +2842,7 @@
2842
}
2843
};
2844
2843
- var AdsPEOrganizerContainer139 = function(props) {
2845
+ var AdsPEOrganizerContainer139 = function (props) {
2846
if (props.x === 310) {
2847
return React.createElement(
2848
'div',
@@ -2850,7 +2852,7 @@
2852
}
2853
};
2854
2853
- var FixedDataTableColumnResizeHandle140 = function(props) {
2855
+ var FixedDataTableColumnResizeHandle140 = function (props) {
2856
if (props.x === 313) {
2857
return React.createElement(
2858
'div',
@@ -2863,7 +2865,7 @@
2865
}
2866
};
2867
2866
- var AdsPETableHeader141 = function(props) {
2868
+ var AdsPETableHeader141 = function (props) {
2869
if (props.x === 315) {
2870
return React.createElement(
2871
'div',
@@ -3096,7 +3098,7 @@
3098
}
3099
};
3100
3099
- var TransitionCell142 = function(props) {
3101
+ var TransitionCell142 = function (props) {
3102
if (props.x === 316) {
3103
return React.createElement(
3104
'div',
@@ -3708,7 +3710,7 @@
3710
}
3711
};
3712
3711
- var FixedDataTableCell143 = function(props) {
3713
+ var FixedDataTableCell143 = function (props) {
3714
if (props.x === 317) {
3715
return React.createElement(
3716
'div',
@@ -3766,7 +3768,11 @@
3768
{className: '_4lg0 _4h2m', style: {height: 25, width: 400, left: 42}},
3769
React.createElement(
3770
'div',
3769
- {className: '_4lg9', style: {height: 25}, onMouseDown: function() {}},
3771
+ {
3772
+ className: '_4lg9',
3773
+ style: {height: 25},
3774
+ onMouseDown: function () {},
3775
+ },
3776
React.createElement('div', {
3777
className: '_4lga _4lgb',
3778
style: {height: 25},
@@ -3805,7 +3811,11 @@
3811
{className: '_4lg0 _4h2m', style: {height: 25, width: 150, left: 571}},
3812
React.createElement(
3813
'div',
3808
- {className: '_4lg9', style: {height: 25}, onMouseDown: function() {}},
3814
+ {
3815
+ className: '_4lg9',
3816
+ style: {height: 25},
3817
+ onMouseDown: function () {},
3818
+ },
3819
React.createElement('div', {
3820
className: '_4lga _4lgb',
3821
style: {height: 25},
@@ -3823,7 +3833,11 @@
3833
},
3834
React.createElement(
3835
'div',
3826
- {className: '_4lg9', style: {height: 25}, onMouseDown: function() {}},
3836
+ {
3837
+ className: '_4lg9',
3838
+ style: {height: 25},
3839
+ onMouseDown: function () {},
3840
+ },
3841
React.createElement('div', {
3842
className: '_4lga _4lgb',
3843
style: {height: 25},
@@ -3841,7 +3855,11 @@
3855
},
3856
React.createElement(
3857
'div',
3844
- {className: '_4lg9', style: {height: 25}, onMouseDown: function() {}},
3858
+ {
3859
+ className: '_4lg9',
3860
+ style: {height: 25},
3861
+ onMouseDown: function () {},
3862
+ },
3863
React.createElement('div', {
3864
className: '_4lga _4lgb',
3865
style: {height: 25},
@@ -3859,7 +3877,11 @@
3877
},
3878
React.createElement(
3879
'div',
3862
- {className: '_4lg9', style: {height: 25}, onMouseDown: function() {}},
3880
+ {
3881
+ className: '_4lg9',
3882
+ style: {height: 25},
3883
+ onMouseDown: function () {},
3884
+ },
3885
React.createElement('div', {
3886
className: '_4lga _4lgb',
3887
style: {height: 25},
@@ -3877,7 +3899,11 @@
3899
},
3900
React.createElement(
3901
'div',
3880
- {className: '_4lg9', style: {height: 25}, onMouseDown: function() {}},
3902
+ {
3903
+ className: '_4lg9',
3904
+ style: {height: 25},
3905
+ onMouseDown: function () {},
3906
+ },
3907
React.createElement('div', {
3908
className: '_4lga _4lgb',
3909
style: {height: 25},
@@ -3895,7 +3921,11 @@
3921
},
3922
React.createElement(
3923
'div',
3898
- {className: '_4lg9', style: {height: 25}, onMouseDown: function() {}},
3924
+ {
3925
+ className: '_4lg9',
3926
+ style: {height: 25},
3927
+ onMouseDown: function () {},
3928
+ },
3929
React.createElement('div', {
3930
className: '_4lga _4lgb',
3931
style: {height: 25},
@@ -3913,7 +3943,11 @@
3943
},
3944
React.createElement(
3945
'div',
3916
- {className: '_4lg9', style: {height: 25}, onMouseDown: function() {}},
3946
+ {
3947
+ className: '_4lg9',
3948
+ style: {height: 25},
3949
+ onMouseDown: function () {},
3950
+ },
3951
React.createElement('div', {
3952
className: '_4lga _4lgb',
3953
style: {height: 25},
@@ -3931,7 +3965,11 @@
3965
},
3966
React.createElement(
3967
'div',
3934
- {className: '_4lg9', style: {height: 25}, onMouseDown: function() {}},
3968
+ {
3969
+ className: '_4lg9',
3970
+ style: {height: 25},
3971
+ onMouseDown: function () {},
3972
+ },
3973
React.createElement('div', {
3974
className: '_4lga _4lgb',
3975
style: {height: 25},
@@ -3949,7 +3987,11 @@
3987
},
3988
React.createElement(
3989
'div',
3952
- {className: '_4lg9', style: {height: 25}, onMouseDown: function() {}},
3990
+ {
3991
+ className: '_4lg9',
3992
+ style: {height: 25},
3993
+ onMouseDown: function () {},
3994
+ },
3995
React.createElement('div', {
3996
className: '_4lga _4lgb',
3997
style: {height: 25},
@@ -3967,7 +4009,11 @@
4009
},
4010
React.createElement(
4011
'div',
3970
- {className: '_4lg9', style: {height: 25}, onMouseDown: function() {}},
4012
+ {
4013
+ className: '_4lg9',
4014
+ style: {height: 25},
4015
+ onMouseDown: function () {},
4016
+ },
4017
React.createElement('div', {
4018
className: '_4lga _4lgb',
4019
style: {height: 25},
@@ -3982,7 +4028,11 @@
4028
{className: '_4lg0 _4h2m', style: {height: 25, width: 200, left: 798}},
4029
React.createElement(
4030
'div',
3985
- {className: '_4lg9', style: {height: 25}, onMouseDown: function() {}},
4031
+ {
4032
+ className: '_4lg9',
4033
+ style: {height: 25},
4034
+ onMouseDown: function () {},
4035
+ },
4036
React.createElement('div', {
4037
className: '_4lga _4lgb',
4038
style: {height: 25},
@@ -3997,7 +4047,11 @@
4047
{className: '_4lg0 _4h2m', style: {height: 25, width: 100, left: 998}},
4048
React.createElement(
4049
'div',
4000
- {className: '_4lg9', style: {height: 25}, onMouseDown: function() {}},
4050
+ {
4051
+ className: '_4lg9',
4052
+ style: {height: 25},
4053
+ onMouseDown: function () {},
4054
+ },
4055
React.createElement('div', {
4056
className: '_4lga _4lgb',
4057
style: {height: 25},
@@ -4012,7 +4066,11 @@
4066
{className: '_4lg0 _4h2m', style: {height: 25, width: 120, left: 1098}},
4067
React.createElement(
4068
'div',
4015
- {className: '_4lg9', style: {height: 25}, onMouseDown: function() {}},
4069
+ {
4070
+ className: '_4lg9',
4071
+ style: {height: 25},
4072
+ onMouseDown: function () {},
4073
+ },
4074
React.createElement('div', {
4075
className: '_4lga _4lgb',
4076
style: {height: 25},
@@ -4027,7 +4085,11 @@
4085
{className: '_4lg0 _4h2m', style: {height: 25, width: 113, left: 1218}},
4086
React.createElement(
4087
'div',
4030
- {className: '_4lg9', style: {height: 25}, onMouseDown: function() {}},
4088
+ {
4089
+ className: '_4lg9',
4090
+ style: {height: 25},
4091
+ onMouseDown: function () {},
4092
+ },
4093
React.createElement('div', {
4094
className: '_4lga _4lgb',
4095
style: {height: 25},
@@ -4042,7 +4104,11 @@
4104
{className: '_4lg0 _4h2m', style: {height: 25, width: 113, left: 1331}},
4105
React.createElement(
4106
'div',
4045
- {className: '_4lg9', style: {height: 25}, onMouseDown: function() {}},
4107
+ {
4108
+ className: '_4lg9',
4109
+ style: {height: 25},
4110
+ onMouseDown: function () {},
4111
+ },
4112
React.createElement('div', {
4113
className: '_4lga _4lgb',
4114
style: {height: 25},
@@ -4057,7 +4123,11 @@
4123
{className: '_4lg0 _4h2m', style: {height: 25, width: 113, left: 1444}},
4124
React.createElement(
4125
'div',
4060
- {className: '_4lg9', style: {height: 25}, onMouseDown: function() {}},
4126
+ {
4127
+ className: '_4lg9',
4128
+ style: {height: 25},
4129
+ onMouseDown: function () {},
4130
+ },
4131
React.createElement('div', {
4132
className: '_4lga _4lgb',
4133
style: {height: 25},
@@ -4072,7 +4142,11 @@
4142
{className: '_4lg0 _4h2m', style: {height: 25, width: 113, left: 1557}},
4143
React.createElement(
4144
'div',
4075
- {className: '_4lg9', style: {height: 25}, onMouseDown: function() {}},
4145
+ {
4146
+ className: '_4lg9',
4147
+ style: {height: 25},
4148
+ onMouseDown: function () {},
4149
+ },
4150
React.createElement('div', {
4151
className: '_4lga _4lgb',
4152
style: {height: 25},
@@ -4087,7 +4161,11 @@
4161
{className: '_4lg0 _4h2m', style: {height: 25, width: 150, left: 1670}},
4162
React.createElement(
4163
'div',
4090
- {className: '_4lg9', style: {height: 25}, onMouseDown: function() {}},
4164
+ {
4165
+ className: '_4lg9',
4166
+ style: {height: 25},
4167
+ onMouseDown: function () {},
4168
+ },
4169
React.createElement('div', {
4170
className: '_4lga _4lgb',
4171
style: {height: 25},
@@ -4106,7 +4184,7 @@
4184
}
4185
};
4186
4109
- var FixedDataTableCellGroupImpl144 = function(props) {
4187
+ var FixedDataTableCellGroupImpl144 = function (props) {
4188
if (props.x === 318) {
4189
return React.createElement(
4190
'div',
@@ -4202,7 +4280,7 @@
4280
}
4281
};
4282
4205
- var FixedDataTableCellGroup145 = function(props) {
4283
+ var FixedDataTableCellGroup145 = function (props) {
4284
if (props.x === 319) {
4285
return React.createElement(
4286
'div',
@@ -4233,7 +4311,7 @@
4311
}
4312
};
4313
4236
- var FixedDataTableRowImpl146 = function(props) {
4314
+ var FixedDataTableRowImpl146 = function (props) {
4315
if (props.x === 334) {
4316
return React.createElement(
4317
'div',
@@ -4296,7 +4374,7 @@
4374
}
4375
};
4376
4299
- var FixedDataTableRow147 = function(props) {
4377
+ var FixedDataTableRow147 = function (props) {
4378
if (props.x === 335) {
4379
return React.createElement(
4380
'div',
@@ -4331,11 +4409,11 @@
4409
}
4410
};
4411
4334
- var FixedDataTableAbstractSortableHeader148 = function(props) {
4412
+ var FixedDataTableAbstractSortableHeader148 = function (props) {
4413
if (props.x === 341) {
4414
return React.createElement(
4415
'div',
4338
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4416
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4417
React.createElement(
4418
'div',
4419
{className: '_2eq6'},
@@ -4347,7 +4425,7 @@
4425
if (props.x === 347) {
4426
return React.createElement(
4427
'div',
4350
- {onClick: function() {}, className: '_54_8 _1kst _4h2r _2wzx'},
4428
+ {onClick: function () {}, className: '_54_8 _1kst _4h2r _2wzx'},
4429
React.createElement(
4430
'div',
4431
{className: '_2eq6'},
@@ -4359,7 +4437,7 @@
4437
if (props.x === 353) {
4438
return React.createElement(
4439
'div',
4362
- {onClick: function() {}, className: '_54_8 _1kst _4h2r _2wzx'},
4440
+ {onClick: function () {}, className: '_54_8 _1kst _4h2r _2wzx'},
4441
React.createElement(
4442
'div',
4443
{className: '_2eq6'},
@@ -4371,7 +4449,7 @@
4449
if (props.x === 358) {
4450
return React.createElement(
4451
'div',
4374
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4452
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4453
React.createElement(
4454
'div',
4455
{className: '_2eq6'},
@@ -4383,7 +4461,7 @@
4461
if (props.x === 363) {
4462
return React.createElement(
4463
'div',
4386
- {onClick: function() {}, className: '_54_8 _54_9 _4h2r _2wzx'},
4464
+ {onClick: function () {}, className: '_54_8 _54_9 _4h2r _2wzx'},
4465
React.createElement(
4466
'div',
4467
{className: '_2eq6'},
@@ -4395,7 +4473,7 @@
4473
if (props.x === 370) {
4474
return React.createElement(
4475
'div',
4398
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4476
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4477
React.createElement(
4478
'div',
4479
{className: '_2eq6'},
@@ -4407,7 +4485,7 @@
4485
if (props.x === 375) {
4486
return React.createElement(
4487
'div',
4410
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4488
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4489
React.createElement(
4490
'div',
4491
{className: '_2eq6'},
@@ -4419,7 +4497,7 @@
4497
if (props.x === 380) {
4498
return React.createElement(
4499
'div',
4422
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4500
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4501
React.createElement(
4502
'div',
4503
{className: '_2eq6'},
@@ -4431,7 +4509,7 @@
4509
if (props.x === 385) {
4510
return React.createElement(
4511
'div',
4434
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4512
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4513
React.createElement(
4514
'div',
4515
{className: '_2eq6'},
@@ -4443,7 +4521,7 @@
4521
if (props.x === 390) {
4522
return React.createElement(
4523
'div',
4446
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4524
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4525
React.createElement(
4526
'div',
4527
{className: '_2eq6'},
@@ -4455,7 +4533,7 @@
4533
if (props.x === 395) {
4534
return React.createElement(
4535
'div',
4458
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4536
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4537
React.createElement(
4538
'div',
4539
{className: '_2eq6'},
@@ -4467,7 +4545,7 @@
4545
if (props.x === 400) {
4546
return React.createElement(
4547
'div',
4470
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4548
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4549
React.createElement(
4550
'div',
4551
{className: '_2eq6'},
@@ -4479,7 +4557,7 @@
4557
if (props.x === 405) {
4558
return React.createElement(
4559
'div',
4482
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4560
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4561
React.createElement(
4562
'div',
4563
{className: '_2eq6'},
@@ -4491,7 +4569,7 @@
4569
if (props.x === 410) {
4570
return React.createElement(
4571
'div',
4494
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4572
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4573
React.createElement(
4574
'div',
4575
{className: '_2eq6'},
@@ -4503,7 +4581,7 @@
4581
if (props.x === 415) {
4582
return React.createElement(
4583
'div',
4506
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4584
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4585
React.createElement(
4586
'div',
4587
{className: '_2eq6'},
@@ -4515,7 +4593,7 @@
4593
if (props.x === 420) {
4594
return React.createElement(
4595
'div',
4518
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4596
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4597
React.createElement(
4598
'div',
4599
{className: '_2eq6'},
@@ -4527,7 +4605,7 @@
4605
if (props.x === 425) {
4606
return React.createElement(
4607
'div',
4530
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4608
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4609
React.createElement(
4610
'div',
4611
{className: '_2eq6'},
@@ -4539,7 +4617,7 @@
4617
if (props.x === 430) {
4618
return React.createElement(
4619
'div',
4542
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4620
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4621
React.createElement(
4622
'div',
4623
{className: '_2eq6'},
@@ -4551,7 +4629,7 @@
4629
if (props.x === 435) {
4630
return React.createElement(
4631
'div',
4554
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4632
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4633
React.createElement(
4634
'div',
4635
{className: '_2eq6'},
@@ -4563,7 +4641,7 @@
4641
if (props.x === 440) {
4642
return React.createElement(
4643
'div',
4566
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4644
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4645
React.createElement(
4646
'div',
4647
{className: '_2eq6'},
@@ -4575,7 +4653,7 @@
4653
if (props.x === 445) {
4654
return React.createElement(
4655
'div',
4578
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4656
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4657
React.createElement(
4658
'div',
4659
{className: '_2eq6'},
@@ -4586,7 +4664,7 @@
4664
}
4665
};
4666
4589
- var FixedDataTableSortableHeader149 = function(props) {
4667
+ var FixedDataTableSortableHeader149 = function (props) {
4668
if (props.x === 342) {
4669
return React.createElement(FixedDataTableAbstractSortableHeader148, {
4670
x: 341,
@@ -4694,7 +4772,7 @@
4772
}
4773
};
4774
4697
- var FixedDataTableBufferedRows150 = function(props) {
4775
+ var FixedDataTableBufferedRows150 = function (props) {
4776
if (props.x === 459) {
4777
return React.createElement('div', {
4778
style: {
@@ -4707,7 +4785,7 @@
4785
}
4786
};
4787
4710
- var Scrollbar151 = function(props) {
4788
+ var Scrollbar151 = function (props) {
4789
if (props.x === 460) {
4790
return null;
4791
}
@@ -4715,11 +4793,11 @@
4793
return React.createElement(
4794
'div',
4795
{
4718
- onFocus: function() {},
4719
- onBlur: function() {},
4720
- onKeyDown: function() {},
4721
- onMouseDown: function() {},
4722
- onWheel: function() {},
4796
+ onFocus: function () {},
4797
+ onBlur: function () {},
4798
+ onKeyDown: function () {},
4799
+ onMouseDown: function () {},
4800
+ onWheel: function () {},
4801
className: '_1t0r _1t0t _4jdr _1t0u',
4802
style: {width: 1209, zIndex: 99},
4803
tabIndex: 0,
@@ -4736,7 +4814,7 @@
4814
}
4815
};
4816
4739
- var HorizontalScrollbar152 = function(props) {
4817
+ var HorizontalScrollbar152 = function (props) {
4818
if (props.x === 462) {
4819
return React.createElement(
4820
'div',
@@ -4759,13 +4837,13 @@
4837
}
4838
};
4839
4762
- var FixedDataTable153 = function(props) {
4840
+ var FixedDataTable153 = function (props) {
4841
if (props.x === 463) {
4842
return React.createElement(
4843
'div',
4844
{
4845
className: '_3h1i _1mie',
4768
- onWheel: function() {},
4846
+ onWheel: function () {},
4847
style: {height: 25, width: 1209},
4848
},
4849
React.createElement(
@@ -4791,13 +4869,13 @@
4869
}
4870
};
4871
4794
- var TransitionTable154 = function(props) {
4872
+ var TransitionTable154 = function (props) {
4873
if (props.x === 464) {
4874
return React.createElement(FixedDataTable153, {x: 463});
4875
}
4876
};
4877
4800
- var AdsSelectableFixedDataTable155 = function(props) {
4878
+ var AdsSelectableFixedDataTable155 = function (props) {
4879
if (props.x === 465) {
4880
return React.createElement(
4881
'div',
@@ -4807,27 +4885,27 @@
4885
}
4886
};
4887
4810
- var AdsDataTableKeyboardSupportDecorator156 = function(props) {
4888
+ var AdsDataTableKeyboardSupportDecorator156 = function (props) {
4889
if (props.x === 466) {
4890
return React.createElement(
4891
'div',
4814
- {className: '_5d6f', tabIndex: '0', onKeyDown: function() {}},
4892
+ {className: '_5d6f', tabIndex: '0', onKeyDown: function () {}},
4893
React.createElement(AdsSelectableFixedDataTable155, {x: 465})
4894
);
4895
}
4896
};
4897
4820
- var AdsEditableDataTableDecorator157 = function(props) {
4898
+ var AdsEditableDataTableDecorator157 = function (props) {
4899
if (props.x === 467) {
4900
return React.createElement(
4901
'div',
4824
- {onCopy: function() {}},
4902
+ {onCopy: function () {}},
4903
React.createElement(AdsDataTableKeyboardSupportDecorator156, {x: 466})
4904
);
4905
}
4906
};
4907
4830
- var AdsPEDataTableContainer158 = function(props) {
4908
+ var AdsPEDataTableContainer158 = function (props) {
4909
if (props.x === 468) {
4910
return React.createElement(
4911
'div',
@@ -4840,13 +4918,13 @@
4918
}
4919
};
4920
4843
- var AdsPECampaignGroupTableContainer159 = function(props) {
4921
+ var AdsPECampaignGroupTableContainer159 = function (props) {
4922
if (props.x === 470) {
4923
return React.createElement(ResponsiveBlock37, {x: 469});
4924
}
4925
};
4926
4849
- var AdsPEManageAdsPaneContainer160 = function(props) {
4927
+ var AdsPEManageAdsPaneContainer160 = function (props) {
4928
if (props.x === 473) {
4929
return React.createElement(
4930
'div',
@@ -4887,13 +4965,13 @@
4965
}
4966
};
4967
4890
- var AdsPEContentContainer161 = function(props) {
4968
+ var AdsPEContentContainer161 = function (props) {
4969
if (props.x === 474) {
4970
return React.createElement(AdsPEManageAdsPaneContainer160, {x: 473});
4971
}
4972
};
4973
4896
- var FluxContainer_AdsPEWorkspaceContainer_162 = function(props) {
4974
+ var FluxContainer_AdsPEWorkspaceContainer_162 = function (props) {
4975
if (props.x === 477) {
4976
return React.createElement(
4977
'div',
@@ -4905,37 +4983,37 @@
4983
}
4984
};
4985
4908
- var FluxContainer_AdsSessionExpiredDialogContainer_163 = function(props) {
4986
+ var FluxContainer_AdsSessionExpiredDialogContainer_163 = function (props) {
4987
if (props.x === 478) {
4988
return null;
4989
}
4990
};
4991
4914
- var FluxContainer_AdsPEUploadDialogLazyContainer_164 = function(props) {
4992
+ var FluxContainer_AdsPEUploadDialogLazyContainer_164 = function (props) {
4993
if (props.x === 479) {
4994
return null;
4995
}
4996
};
4997
4920
- var FluxContainer_DialogContainer_165 = function(props) {
4998
+ var FluxContainer_DialogContainer_165 = function (props) {
4999
if (props.x === 480) {
5000
return null;
5001
}
5002
};
5003
4926
- var AdsBugReportContainer166 = function(props) {
5004
+ var AdsBugReportContainer166 = function (props) {
5005
if (props.x === 481) {
5006
return React.createElement('span', null);
5007
}
5008
};
5009
4932
- var AdsPEAudienceSplittingDialog167 = function(props) {
5010
+ var AdsPEAudienceSplittingDialog167 = function (props) {
5011
if (props.x === 482) {
5012
return null;
5013
}
5014
};
5015
4938
- var AdsPEAudienceSplittingDialogContainer168 = function(props) {
5016
+ var AdsPEAudienceSplittingDialogContainer168 = function (props) {
5017
if (props.x === 483) {
5018
return React.createElement(
5019
'div',
@@ -4945,25 +5023,25 @@
5023
}
5024
};
5025
4948
- var FluxContainer_AdsRuleDialogBootloadContainer_169 = function(props) {
5026
+ var FluxContainer_AdsRuleDialogBootloadContainer_169 = function (props) {
5027
if (props.x === 484) {
5028
return null;
5029
}
5030
};
5031
4954
- var FluxContainer_AdsPECFTrayContainer_170 = function(props) {
5032
+ var FluxContainer_AdsPECFTrayContainer_170 = function (props) {
5033
if (props.x === 485) {
5034
return null;
5035
}
5036
};
5037
4960
- var FluxContainer_AdsPEDeleteDraftContainer_171 = function(props) {
5038
+ var FluxContainer_AdsPEDeleteDraftContainer_171 = function (props) {
5039
if (props.x === 486) {
5040
return null;
5041
}
5042
};
5043
4966
- var FluxContainer_AdsPEInitialDraftPublishDialogContainer_172 = function(
5044
+ var FluxContainer_AdsPEInitialDraftPublishDialogContainer_172 = function (
5045
props
5046
) {
5047
if (props.x === 487) {
@@ -4971,33 +5049,32 @@
5049
}
5050
};
5051
4974
- var FluxContainer_AdsPEReachFrequencyStatusTransitionDialogBootloadContainer_173 = function(
4975
- props
4976
- ) {
4977
- if (props.x === 488) {
4978
- return null;
4979
- }
4980
- };
5052
+ var FluxContainer_AdsPEReachFrequencyStatusTransitionDialogBootloadContainer_173 =
5053
+ function (props) {
5054
+ if (props.x === 488) {
5055
+ return null;
5056
+ }
5057
+ };
5058
4982
- var FluxContainer_AdsPEPurgeArchiveDialogContainer_174 = function(props) {
5059
+ var FluxContainer_AdsPEPurgeArchiveDialogContainer_174 = function (props) {
5060
if (props.x === 489) {
5061
return null;
5062
}
5063
};
5064
4988
- var AdsPECreateDialogContainer175 = function(props) {
5065
+ var AdsPECreateDialogContainer175 = function (props) {
5066
if (props.x === 490) {
5067
return React.createElement('span', null);
5068
}
5069
};
5070
4994
- var FluxContainer_AdsPEModalStatusContainer_176 = function(props) {
5071
+ var FluxContainer_AdsPEModalStatusContainer_176 = function (props) {
5072
if (props.x === 491) {
5073
return null;
5074
}
5075
};
5076
5000
- var FluxContainer_AdsBrowserExtensionErrorDialogContainer_177 = function(
5077
+ var FluxContainer_AdsBrowserExtensionErrorDialogContainer_177 = function (
5078
props
5079
) {
5080
if (props.x === 492) {
@@ -5005,19 +5082,19 @@
5082
}
5083
};
5084
5008
- var FluxContainer_AdsPESortByErrorTipContainer_178 = function(props) {
5085
+ var FluxContainer_AdsPESortByErrorTipContainer_178 = function (props) {
5086
if (props.x === 493) {
5087
return null;
5088
}
5089
};
5090
5014
- var LeadDownloadDialogSelector179 = function(props) {
5091
+ var LeadDownloadDialogSelector179 = function (props) {
5092
if (props.x === 494) {
5093
return null;
5094
}
5095
};
5096
5020
- var FluxContainer_AdsPELeadDownloadDialogContainerClass_180 = function(
5097
+ var FluxContainer_AdsPELeadDownloadDialogContainerClass_180 = function (
5098
props
5099
) {
5100
if (props.x === 495) {
@@ -5025,7 +5102,7 @@
5102
}
5103
};
5104
5028
- var AdsPEContainer181 = function(props) {
5105
+ var AdsPEContainer181 = function (props) {
5106
if (props.x === 496) {
5107
return React.createElement(
5108
'div',
@@ -5088,7 +5165,7 @@
5165
}
5166
};
5167
5091
- var Benchmark = function(props) {
5168
+ var Benchmark = function (props) {
5169
if (props.x === undefined) {
5170
return React.createElement(AdsPEContainer181, {x: 496});
5171
}
scripts/bench/benchmarks/pe-no-components/benchmark.js
+360
-285
@@ -1,7 +1,7 @@
1
-(function() {
1
+(function () {
2
'use strict';
3
4
- var ReactImage0 = function(x) {
4
+ var ReactImage0 = function (x) {
5
if (x === 0) {
6
return React.createElement('i', {
7
alt: '',
@@ -232,7 +232,7 @@
232
}
233
};
234
235
- var AbstractLink1 = function(x) {
235
+ var AbstractLink1 = function (x) {
236
if (x === 1) {
237
return React.createElement(
238
'a',
@@ -243,7 +243,7 @@
243
label: null,
244
href: '#',
245
rel: undefined,
246
- onClick: function() {},
246
+ onClick: function () {},
247
},
248
null,
249
React.createElement(
@@ -276,7 +276,7 @@
276
label: null,
277
href: '#',
278
rel: undefined,
279
- onClick: function() {},
279
+ onClick: function () {},
280
},
281
undefined,
282
'Remove',
@@ -290,7 +290,7 @@
290
target: '_blank',
291
href: '/ads/manage/billing.php?act=10149999073643408',
292
rel: undefined,
293
- onClick: function() {},
293
+ onClick: function () {},
294
},
295
XUIText29(48)
296
);
@@ -305,7 +305,7 @@
305
label: null,
306
href: '#',
307
rel: undefined,
308
- onClick: function() {},
308
+ onClick: function () {},
309
},
310
null,
311
React.createElement(
@@ -327,7 +327,7 @@
327
label: null,
328
href: '#',
329
rel: undefined,
330
- onClick: function() {},
330
+ onClick: function () {},
331
},
332
null,
333
React.createElement(
@@ -350,7 +350,7 @@
350
label: null,
351
href: '#',
352
rel: undefined,
353
- onClick: function() {},
353
+ onClick: function () {},
354
},
355
undefined,
356
'Lifetime',
@@ -360,21 +360,21 @@
360
if (x === 207) {
361
return React.createElement(
362
'a',
363
- {href: '#', rel: undefined, onClick: function() {}},
363
+ {href: '#', rel: undefined, onClick: function () {}},
364
'Create Ad Set'
365
);
366
}
367
if (x === 209) {
368
return React.createElement(
369
'a',
370
- {href: '#', rel: undefined, onClick: function() {}},
370
+ {href: '#', rel: undefined, onClick: function () {}},
371
'View Ad Set'
372
);
373
}
374
if (x === 241) {
375
return React.createElement(
376
'a',
377
- {href: '#', rel: undefined, onClick: function() {}},
377
+ {href: '#', rel: undefined, onClick: function () {}},
378
'Set a Limit'
379
);
380
}
@@ -388,7 +388,7 @@
388
label: null,
389
href: '#',
390
rel: undefined,
391
- onClick: function() {},
391
+ onClick: function () {},
392
},
393
null,
394
React.createElement(
@@ -402,7 +402,7 @@
402
}
403
};
404
405
- var Link2 = function(x) {
405
+ var Link2 = function (x) {
406
if (x === 2) {
407
return AbstractLink1(1);
408
}
@@ -435,7 +435,7 @@
435
}
436
};
437
438
- var AbstractButton3 = function(x) {
438
+ var AbstractButton3 = function (x) {
439
if (x === 3) {
440
return Link2(2);
441
}
@@ -444,7 +444,7 @@
444
'button',
445
{
446
className: '_5n7z _4jy0 _4jy4 _517h _51sy _42ft',
447
- onClick: function() {},
447
+ onClick: function () {},
448
label: null,
449
type: 'submit',
450
value: '1',
@@ -460,7 +460,7 @@
460
{
461
className: '_5n7z _2yak _4lj- _4jy0 _4jy4 _517h _51sy _42ft _42fr',
462
disabled: true,
463
- onClick: function() {},
463
+ onClick: function () {},
464
'data-tooltip-content': 'You have no changes to publish',
465
'data-hover': 'tooltip',
466
label: null,
@@ -480,7 +480,7 @@
480
'button',
481
{
482
className: '_u_k _4jy0 _4jy4 _517h _51sy _42ft',
483
- onClick: function() {},
483
+ onClick: function () {},
484
label: null,
485
type: 'submit',
486
value: '1',
@@ -513,7 +513,7 @@
513
'data-hover': 'tooltip',
514
className: '_d2_ _u_k noMargin _4jy0 _4jy4 _517h _51sy _42ft',
515
disabled: false,
516
- onClick: function() {},
516
+ onClick: function () {},
517
label: null,
518
type: 'submit',
519
value: '1',
@@ -547,7 +547,7 @@
547
'data-hover': 'tooltip',
548
'data-tooltip-content': 'Revert',
549
disabled: true,
550
- onClick: function() {},
550
+ onClick: function () {},
551
label: null,
552
type: 'submit',
553
value: '1',
@@ -566,7 +566,7 @@
566
'data-hover': 'tooltip',
567
'data-tooltip-content': 'Delete',
568
disabled: false,
569
- onClick: function() {},
569
+ onClick: function () {},
570
label: null,
571
type: 'submit',
572
value: '1',
@@ -585,7 +585,7 @@
585
'data-hover': 'tooltip',
586
'data-tooltip-content': 'Duplicate',
587
disabled: false,
588
- onClick: function() {},
588
+ onClick: function () {},
589
label: null,
590
type: 'submit',
591
value: '1',
@@ -603,7 +603,7 @@
603
className: '_u_k noMargin _p _4jy0 _4jy4 _517h _51sy _42ft',
604
'data-hover': 'tooltip',
605
'data-tooltip-content': 'Export & Import',
606
- onClick: function() {},
606
+ onClick: function () {},
607
label: null,
608
type: 'submit',
609
value: '1',
@@ -623,7 +623,7 @@
623
'data-tooltip-content': 'Create Report',
624
disabled: false,
625
style: {boxSizing: 'border-box', height: '28px', width: '48px'},
626
- onClick: function() {},
626
+ onClick: function () {},
627
label: null,
628
type: 'submit',
629
value: '1',
@@ -642,7 +642,7 @@
642
'data-hover': 'tooltip',
643
'data-tooltip-content': 'Campaign Tags',
644
disabled: false,
645
- onClick: function() {},
645
+ onClick: function () {},
646
label: null,
647
type: 'submit',
648
value: '1',
@@ -664,7 +664,7 @@
664
{
665
className: '_3yz9 _1t-2 _50z- _50zy _50zz _50z- _5upp _42ft',
666
size: 'small',
667
- onClick: function() {},
667
+ onClick: function () {},
668
type: 'button',
669
title: 'Remove',
670
'data-hover': undefined,
@@ -682,7 +682,7 @@
682
'button',
683
{
684
className: '_5b5u _5b5v _4jy0 _4jy3 _517h _51sy _42ft',
685
- onClick: function() {},
685
+ onClick: function () {},
686
label: null,
687
type: 'submit',
688
value: '1',
@@ -697,7 +697,7 @@
697
'button',
698
{
699
className: '_1wdf _4jy0 _517i _517h _51sy _42ft',
700
- onClick: function() {},
700
+ onClick: function () {},
701
label: null,
702
type: 'submit',
703
value: '1',
@@ -718,7 +718,7 @@
718
className: '_u_k _3c5o _1-r0 _4jy0 _4jy4 _517h _51sy _42ft',
719
'data-hover': 'tooltip',
720
'data-tooltip-content': 'List Settings',
721
- onClick: function() {},
721
+ onClick: function () {},
722
label: null,
723
type: 'submit',
724
value: '1',
@@ -739,7 +739,7 @@
739
'data-tooltip-position': 'right',
740
'data-tooltip-content': 'Campaigns',
741
'data-hover': 'tooltip',
742
- onClick: function() {},
742
+ onClick: function () {},
743
label: null,
744
type: 'submit',
745
value: '1',
@@ -763,7 +763,7 @@
763
'data-tooltip-position': 'right',
764
'data-tooltip-content': 'Ad Sets',
765
'data-hover': 'tooltip',
766
- onClick: function() {},
766
+ onClick: function () {},
767
label: null,
768
type: 'submit',
769
value: '1',
@@ -787,7 +787,7 @@
787
'data-tooltip-position': 'right',
788
'data-tooltip-content': 'Ads',
789
'data-hover': 'tooltip',
790
- onClick: function() {},
790
+ onClick: function () {},
791
label: null,
792
type: 'submit',
793
value: '1',
@@ -805,7 +805,7 @@
805
}
806
};
807
808
- var XUIButton4 = function(x) {
808
+ var XUIButton4 = function (x) {
809
if (x === 4) {
810
return AbstractButton3(3);
811
}
@@ -874,7 +874,7 @@
874
}
875
};
876
877
- var AbstractPopoverButton5 = function(x) {
877
+ var AbstractPopoverButton5 = function (x) {
878
if (x === 5) {
879
return XUIButton4(4);
880
}
@@ -889,7 +889,7 @@
889
}
890
};
891
892
- var ReactXUIPopoverButton6 = function(x) {
892
+ var ReactXUIPopoverButton6 = function (x) {
893
if (x === 6) {
894
return AbstractPopoverButton5(5);
895
}
@@ -904,19 +904,19 @@
904
}
905
};
906
907
- var BIGAdAccountSelector7 = function(x) {
907
+ var BIGAdAccountSelector7 = function (x) {
908
if (x === 7) {
909
return React.createElement('div', null, ReactXUIPopoverButton6(6), null);
910
}
911
};
912
913
- var FluxContainer_AdsPEBIGAdAccountSelectorContainer_8 = function(x) {
913
+ var FluxContainer_AdsPEBIGAdAccountSelectorContainer_8 = function (x) {
914
if (x === 8) {
915
return BIGAdAccountSelector7(7);
916
}
917
};
918
919
- var ErrorBoundary9 = function(x) {
919
+ var ErrorBoundary9 = function (x) {
920
if (x === 9) {
921
return FluxContainer_AdsPEBIGAdAccountSelectorContainer_8(8);
922
}
@@ -967,7 +967,7 @@
967
}
968
};
969
970
- var AdsErrorBoundary10 = function(x) {
970
+ var AdsErrorBoundary10 = function (x) {
971
if (x === 10) {
972
return ErrorBoundary9(9);
973
}
@@ -1018,47 +1018,47 @@
1018
}
1019
};
1020
1021
- var AdsPENavigationBar11 = function(x) {
1021
+ var AdsPENavigationBar11 = function (x) {
1022
if (x === 11) {
1023
return React.createElement('div', {className: '_4t_9'});
1024
}
1025
};
1026
1027
- var FluxContainer_AdsPENavigationBarContainer_12 = function(x) {
1027
+ var FluxContainer_AdsPENavigationBarContainer_12 = function (x) {
1028
if (x === 12) {
1029
return AdsPENavigationBar11(11);
1030
}
1031
};
1032
1033
- var AdsPEDraftSyncStatus13 = function(x) {
1033
+ var AdsPEDraftSyncStatus13 = function (x) {
1034
if (x === 16) {
1035
return React.createElement(
1036
'div',
1037
- {className: '_3ut-', onClick: function() {}},
1037
+ {className: '_3ut-', onClick: function () {}},
1038
React.createElement('span', {className: '_3uu0'}, ReactImage0(15))
1039
);
1040
}
1041
};
1042
1043
- var FluxContainer_AdsPEDraftSyncStatusContainer_14 = function(x) {
1043
+ var FluxContainer_AdsPEDraftSyncStatusContainer_14 = function (x) {
1044
if (x === 17) {
1045
return AdsPEDraftSyncStatus13(16);
1046
}
1047
};
1048
1049
- var AdsPEDraftErrorsStatus15 = function(x) {
1049
+ var AdsPEDraftErrorsStatus15 = function (x) {
1050
if (x === 18) {
1051
return null;
1052
}
1053
};
1054
1055
- var FluxContainer_viewFn_16 = function(x) {
1055
+ var FluxContainer_viewFn_16 = function (x) {
1056
if (x === 19) {
1057
return AdsPEDraftErrorsStatus15(18);
1058
}
1059
};
1060
1061
- var AdsPEPublishButton17 = function(x) {
1061
+ var AdsPEPublishButton17 = function (x) {
1062
if (x === 25) {
1063
return React.createElement(
1064
'div',
@@ -1072,13 +1072,13 @@
1072
}
1073
};
1074
1075
- var FluxContainer_AdsPEPublishButtonContainer_18 = function(x) {
1075
+ var FluxContainer_AdsPEPublishButtonContainer_18 = function (x) {
1076
if (x === 26) {
1077
return AdsPEPublishButton17(25);
1078
}
1079
};
1080
1081
- var InlineBlock19 = function(x) {
1081
+ var InlineBlock19 = function (x) {
1082
if (x === 30) {
1083
return React.createElement(
1084
'div',
@@ -1120,7 +1120,7 @@
1120
}
1121
};
1122
1123
- var ReactPopoverMenu20 = function(x) {
1123
+ var ReactPopoverMenu20 = function (x) {
1124
if (x === 31) {
1125
return InlineBlock19(30);
1126
}
@@ -1138,7 +1138,7 @@
1138
}
1139
};
1140
1141
- var LeftRight21 = function(x) {
1141
+ var LeftRight21 = function (x) {
1142
if (x === 34) {
1143
return React.createElement(
1144
'div',
@@ -1263,25 +1263,25 @@
1263
}
1264
};
1265
1266
- var AdsUnifiedNavigationLocalNav22 = function(x) {
1266
+ var AdsUnifiedNavigationLocalNav22 = function (x) {
1267
if (x === 35) {
1268
return React.createElement('div', {className: '_34_i'}, LeftRight21(34));
1269
}
1270
};
1271
1272
- var XUIDialog23 = function(x) {
1272
+ var XUIDialog23 = function (x) {
1273
if (x === 36) {
1274
return null;
1275
}
1276
};
1277
1278
- var AdsPEResetDialog24 = function(x) {
1278
+ var AdsPEResetDialog24 = function (x) {
1279
if (x === 37) {
1280
return React.createElement('span', null, XUIDialog23(36));
1281
}
1282
};
1283
1284
- var AdsPETopNav25 = function(x) {
1284
+ var AdsPETopNav25 = function (x) {
1285
if (x === 40) {
1286
return React.createElement(
1287
'div',
@@ -1292,13 +1292,13 @@
1292
}
1293
};
1294
1295
- var FluxContainer_AdsPETopNavContainer_26 = function(x) {
1295
+ var FluxContainer_AdsPETopNavContainer_26 = function (x) {
1296
if (x === 41) {
1297
return AdsPETopNav25(40);
1298
}
1299
};
1300
1301
- var XUIAbstractGlyphButton27 = function(x) {
1301
+ var XUIAbstractGlyphButton27 = function (x) {
1302
if (x === 46) {
1303
return AbstractButton3(45);
1304
}
@@ -1307,7 +1307,7 @@
1307
}
1308
};
1309
1310
- var XUICloseButton28 = function(x) {
1310
+ var XUICloseButton28 = function (x) {
1311
if (x === 47) {
1312
return XUIAbstractGlyphButton27(46);
1313
}
@@ -1316,7 +1316,7 @@
1316
}
1317
};
1318
1319
- var XUIText29 = function(x) {
1319
+ var XUIText29 = function (x) {
1320
if (x === 48) {
1321
return React.createElement(
1322
'span',
@@ -1340,7 +1340,7 @@
1340
}
1341
};
1342
1343
- var XUINotice30 = function(x) {
1343
+ var XUINotice30 = function (x) {
1344
if (x === 51) {
1345
return React.createElement(
1346
'div',
@@ -1358,13 +1358,13 @@
1358
}
1359
};
1360
1361
- var ReactCSSTransitionGroupChild31 = function(x) {
1361
+ var ReactCSSTransitionGroupChild31 = function (x) {
1362
if (x === 52) {
1363
return XUINotice30(51);
1364
}
1365
};
1366
1367
- var ReactTransitionGroup32 = function(x) {
1367
+ var ReactTransitionGroup32 = function (x) {
1368
if (x === 53) {
1369
return React.createElement(
1370
'span',
@@ -1374,13 +1374,13 @@
1374
}
1375
};
1376
1377
- var ReactCSSTransitionGroup33 = function(x) {
1377
+ var ReactCSSTransitionGroup33 = function (x) {
1378
if (x === 54) {
1379
return ReactTransitionGroup32(53);
1380
}
1381
};
1382
1383
- var AdsPETopError34 = function(x) {
1383
+ var AdsPETopError34 = function (x) {
1384
if (x === 55) {
1385
return React.createElement(
1386
'div',
@@ -1390,19 +1390,19 @@
1390
}
1391
};
1392
1393
- var FluxContainer_AdsPETopErrorContainer_35 = function(x) {
1393
+ var FluxContainer_AdsPETopErrorContainer_35 = function (x) {
1394
if (x === 56) {
1395
return AdsPETopError34(55);
1396
}
1397
};
1398
1399
- var FluxContainer_AdsGuidanceChannel_36 = function(x) {
1399
+ var FluxContainer_AdsGuidanceChannel_36 = function (x) {
1400
if (x === 59) {
1401
return null;
1402
}
1403
};
1404
1405
- var ResponsiveBlock37 = function(x) {
1405
+ var ResponsiveBlock37 = function (x) {
1406
if (x === 62) {
1407
return React.createElement(
1408
'div',
@@ -1437,13 +1437,13 @@
1437
}
1438
};
1439
1440
- var FluxContainer_AdsBulkEditDialogContainer_38 = function(x) {
1440
+ var FluxContainer_AdsBulkEditDialogContainer_38 = function (x) {
1441
if (x === 63) {
1442
return null;
1443
}
1444
};
1445
1446
- var Column39 = function(x) {
1446
+ var Column39 = function (x) {
1447
if (x === 66) {
1448
return React.createElement(
1449
'div',
@@ -1460,7 +1460,7 @@
1460
}
1461
};
1462
1463
- var XUIButtonGroup40 = function(x) {
1463
+ var XUIButtonGroup40 = function (x) {
1464
if (x === 75) {
1465
return React.createElement(
1466
'div',
@@ -1497,13 +1497,13 @@
1497
}
1498
};
1499
1500
- var AdsPEEditToolbarButton41 = function(x) {
1500
+ var AdsPEEditToolbarButton41 = function (x) {
1501
if (x === 85) {
1502
return XUIButtonGroup40(84);
1503
}
1504
};
1505
1506
- var FluxContainer_AdsPEEditCampaignGroupToolbarButtonContainer_42 = function(
1506
+ var FluxContainer_AdsPEEditCampaignGroupToolbarButtonContainer_42 = function (
1507
x
1508
) {
1509
if (x === 86) {
@@ -1511,37 +1511,37 @@
1511
}
1512
};
1513
1514
- var FluxContainer_AdsPEEditToolbarButtonContainer_43 = function(x) {
1514
+ var FluxContainer_AdsPEEditToolbarButtonContainer_43 = function (x) {
1515
if (x === 87) {
1516
return FluxContainer_AdsPEEditCampaignGroupToolbarButtonContainer_42(86);
1517
}
1518
};
1519
1520
- var AdsPEExportImportMenu44 = function(x) {
1520
+ var AdsPEExportImportMenu44 = function (x) {
1521
if (x === 103) {
1522
return ReactPopoverMenu20(102);
1523
}
1524
};
1525
1526
- var FluxContainer_AdsPECustomizeExportContainer_45 = function(x) {
1526
+ var FluxContainer_AdsPECustomizeExportContainer_45 = function (x) {
1527
if (x === 104) {
1528
return null;
1529
}
1530
};
1531
1532
- var AdsPEExportAsTextDialog46 = function(x) {
1532
+ var AdsPEExportAsTextDialog46 = function (x) {
1533
if (x === 105) {
1534
return null;
1535
}
1536
};
1537
1538
- var FluxContainer_AdsPEExportAsTextDialogContainer_47 = function(x) {
1538
+ var FluxContainer_AdsPEExportAsTextDialogContainer_47 = function (x) {
1539
if (x === 106) {
1540
return AdsPEExportAsTextDialog46(105);
1541
}
1542
};
1543
1544
- var AdsPEExportImportMenuContainer48 = function(x) {
1544
+ var AdsPEExportImportMenuContainer48 = function (x) {
1545
if (x === 107) {
1546
return React.createElement(
1547
'span',
@@ -1555,7 +1555,7 @@
1555
}
1556
};
1557
1558
- var Constructor49 = function(x) {
1558
+ var Constructor49 = function (x) {
1559
if (x === 114) {
1560
return null;
1561
}
@@ -1570,7 +1570,7 @@
1570
}
1571
};
1572
1573
- var TagSelectorPopover50 = function(x) {
1573
+ var TagSelectorPopover50 = function (x) {
1574
if (x === 115) {
1575
return React.createElement(
1576
'span',
@@ -1581,25 +1581,25 @@
1581
}
1582
};
1583
1584
- var AdsPECampaignGroupTagContainer51 = function(x) {
1584
+ var AdsPECampaignGroupTagContainer51 = function (x) {
1585
if (x === 116) {
1586
return TagSelectorPopover50(115);
1587
}
1588
};
1589
1590
- var AdsRuleToolbarMenu52 = function(x) {
1590
+ var AdsRuleToolbarMenu52 = function (x) {
1591
if (x === 118) {
1592
return null;
1593
}
1594
};
1595
1596
- var FluxContainer_AdsPERuleToolbarMenuContainer_53 = function(x) {
1596
+ var FluxContainer_AdsPERuleToolbarMenuContainer_53 = function (x) {
1597
if (x === 119) {
1598
return AdsRuleToolbarMenu52(118);
1599
}
1600
};
1601
1602
- var FillColumn54 = function(x) {
1602
+ var FillColumn54 = function (x) {
1603
if (x === 120) {
1604
return React.createElement(
1605
'div',
@@ -1622,7 +1622,7 @@
1622
}
1623
};
1624
1625
- var Layout55 = function(x) {
1625
+ var Layout55 = function (x) {
1626
if (x === 121) {
1627
return React.createElement(
1628
'div',
@@ -1633,7 +1633,7 @@
1633
}
1634
};
1635
1636
- var AdsPEMainPaneToolbar56 = function(x) {
1636
+ var AdsPEMainPaneToolbar56 = function (x) {
1637
if (x === 122) {
1638
return React.createElement(
1639
'div',
@@ -1643,13 +1643,13 @@
1643
}
1644
};
1645
1646
- var AdsPECampaignGroupToolbarContainer57 = function(x) {
1646
+ var AdsPECampaignGroupToolbarContainer57 = function (x) {
1647
if (x === 123) {
1648
return AdsPEMainPaneToolbar56(122);
1649
}
1650
};
1651
1652
- var AdsPEFiltersPopover58 = function(x) {
1652
+ var AdsPEFiltersPopover58 = function (x) {
1653
if (x === 144) {
1654
return React.createElement(
1655
'span',
@@ -1661,7 +1661,7 @@
1661
}
1662
};
1663
1664
- var AbstractCheckboxInput59 = function(x) {
1664
+ var AbstractCheckboxInput59 = function (x) {
1665
if (x === 145) {
1666
return React.createElement(
1667
'label',
@@ -1671,7 +1671,7 @@
1671
disabled: true,
1672
name: 'filterUnpublished',
1673
value: 'on',
1674
- onClick: function() {},
1674
+ onClick: function () {},
1675
className: null,
1676
id: 'js_input_label_21',
1677
type: 'checkbox',
@@ -1688,7 +1688,7 @@
1688
{className: '_4h2r _55sg _kv1'},
1689
React.createElement('input', {
1690
checked: undefined,
1691
- onChange: function() {},
1691
+ onChange: function () {},
1692
className: null,
1693
type: 'checkbox',
1694
}),
@@ -1700,7 +1700,7 @@
1700
}
1701
};
1702
1703
- var XUICheckboxInput60 = function(x) {
1703
+ var XUICheckboxInput60 = function (x) {
1704
if (x === 146) {
1705
return AbstractCheckboxInput59(145);
1706
}
@@ -1709,7 +1709,7 @@
1709
}
1710
};
1711
1712
- var InputLabel61 = function(x) {
1712
+ var InputLabel61 = function (x) {
1713
if (x === 147) {
1714
return React.createElement(
1715
'div',
@@ -1724,7 +1724,7 @@
1724
}
1725
};
1726
1727
- var AdsPopoverLink62 = function(x) {
1727
+ var AdsPopoverLink62 = function (x) {
1728
if (x === 154) {
1729
return React.createElement(
1730
'span',
@@ -1732,8 +1732,8 @@
1732
React.createElement(
1733
'span',
1734
{
1735
- onMouseEnter: function() {},
1736
- onMouseLeave: function() {},
1735
+ onMouseEnter: function () {},
1736
+ onMouseLeave: function () {},
1737
onMouseUp: undefined,
1738
},
1739
React.createElement('span', {className: '_3o_j'}),
@@ -1749,8 +1749,8 @@
1749
React.createElement(
1750
'span',
1751
{
1752
- onMouseEnter: function() {},
1753
- onMouseLeave: function() {},
1752
+ onMouseEnter: function () {},
1753
+ onMouseLeave: function () {},
1754
onMouseUp: undefined,
1755
},
1756
React.createElement('span', {className: '_3o_j'}),
@@ -1761,7 +1761,7 @@
1761
}
1762
};
1763
1764
- var AdsHelpLink63 = function(x) {
1764
+ var AdsHelpLink63 = function (x) {
1765
if (x === 155) {
1766
return AdsPopoverLink62(154);
1767
}
@@ -1770,7 +1770,7 @@
1770
}
1771
};
1772
1773
- var BUIFilterTokenInput64 = function(x) {
1773
+ var BUIFilterTokenInput64 = function (x) {
1774
if (x === 158) {
1775
return React.createElement(
1776
'div',
@@ -1791,7 +1791,7 @@
1791
}
1792
};
1793
1794
- var BUIFilterToken65 = function(x) {
1794
+ var BUIFilterToken65 = function (x) {
1795
if (x === 159) {
1796
return React.createElement(
1797
'div',
@@ -1801,7 +1801,7 @@
1801
{className: '_3yz4', 'aria-hidden': false},
1802
React.createElement(
1803
'div',
1804
- {onClick: function() {}, className: '_3yz5'},
1804
+ {onClick: function () {}, className: '_3yz5'},
1805
ReactImage0(148),
1806
React.createElement('div', {className: '_3yz7'}, 'Campaigns:'),
1807
React.createElement(
@@ -1822,13 +1822,13 @@
1822
}
1823
};
1824
1825
- var BUIFilterTokenCreateButton66 = function(x) {
1825
+ var BUIFilterTokenCreateButton66 = function (x) {
1826
if (x === 163) {
1827
return React.createElement('div', {className: '_1tc'}, XUIButton4(162));
1828
}
1829
};
1830
1831
- var BUIFilterTokenizer67 = function(x) {
1831
+ var BUIFilterTokenizer67 = function (x) {
1832
if (x === 164) {
1833
return React.createElement(
1834
'div',
@@ -1843,7 +1843,7 @@
1843
}
1844
};
1845
1846
- var XUIAmbientNUX68 = function(x) {
1846
+ var XUIAmbientNUX68 = function (x) {
1847
if (x === 165) {
1848
return null;
1849
}
@@ -1855,7 +1855,7 @@
1855
}
1856
};
1857
1858
- var XUIAmbientNUX69 = function(x) {
1858
+ var XUIAmbientNUX69 = function (x) {
1859
if (x === 166) {
1860
return XUIAmbientNUX68(165);
1861
}
@@ -1867,7 +1867,7 @@
1867
}
1868
};
1869
1870
- var AdsPEAmbientNUXMegaphone70 = function(x) {
1870
+ var AdsPEAmbientNUXMegaphone70 = function (x) {
1871
if (x === 167) {
1872
return React.createElement(
1873
'span',
@@ -1878,7 +1878,7 @@
1878
}
1879
};
1880
1881
- var AdsPEFilters71 = function(x) {
1881
+ var AdsPEFilters71 = function (x) {
1882
if (x === 168) {
1883
return React.createElement(
1884
'div',
@@ -1892,31 +1892,31 @@
1892
}
1893
};
1894
1895
- var AdsPEFilterContainer72 = function(x) {
1895
+ var AdsPEFilterContainer72 = function (x) {
1896
if (x === 169) {
1897
return AdsPEFilters71(168);
1898
}
1899
};
1900
1901
- var AdsPETablePager73 = function(x) {
1901
+ var AdsPETablePager73 = function (x) {
1902
if (x === 172) {
1903
return null;
1904
}
1905
};
1906
1907
- var AdsPECampaignGroupTablePagerContainer74 = function(x) {
1907
+ var AdsPECampaignGroupTablePagerContainer74 = function (x) {
1908
if (x === 173) {
1909
return AdsPETablePager73(172);
1910
}
1911
};
1912
1913
- var AdsPETablePagerContainer75 = function(x) {
1913
+ var AdsPETablePagerContainer75 = function (x) {
1914
if (x === 174) {
1915
return AdsPECampaignGroupTablePagerContainer74(173);
1916
}
1917
};
1918
1919
- var ReactXUIError76 = function(x) {
1919
+ var ReactXUIError76 = function (x) {
1920
if (x === 181) {
1921
return AbstractButton3(180);
1922
}
@@ -1943,10 +1943,10 @@
1943
id: undefined,
1944
maxLength: null,
1945
value: 'Test Campaign',
1946
- onBlur: function() {},
1947
- onChange: function() {},
1948
- onFocus: function() {},
1949
- onKeyDown: function() {},
1946
+ onBlur: function () {},
1947
+ onChange: function () {},
1948
+ onFocus: function () {},
1949
+ onKeyDown: function () {},
1950
}),
1951
null
1952
),
@@ -1970,13 +1970,13 @@
1970
}
1971
};
1972
1973
- var BUIPopoverButton77 = function(x) {
1973
+ var BUIPopoverButton77 = function (x) {
1974
if (x === 182) {
1975
return ReactXUIError76(181);
1976
}
1977
};
1978
1979
- var BUIDateRangePicker78 = function(x) {
1979
+ var BUIDateRangePicker78 = function (x) {
1980
if (x === 184) {
1981
return React.createElement('span', null, BUIPopoverButton77(182), [
1982
Constructor49(183),
@@ -1984,13 +1984,13 @@
1984
}
1985
};
1986
1987
- var AdsPEStatsRangePicker79 = function(x) {
1987
+ var AdsPEStatsRangePicker79 = function (x) {
1988
if (x === 185) {
1989
return BUIDateRangePicker78(184);
1990
}
1991
};
1992
1993
- var AdsPEStatRange80 = function(x) {
1993
+ var AdsPEStatRange80 = function (x) {
1994
if (x === 191) {
1995
return React.createElement(
1996
'div',
@@ -2007,17 +2007,17 @@
2007
}
2008
};
2009
2010
- var AdsPEStatRangeContainer81 = function(x) {
2010
+ var AdsPEStatRangeContainer81 = function (x) {
2011
if (x === 192) {
2012
return AdsPEStatRange80(191);
2013
}
2014
};
2015
2016
- var AdsPESideTrayTabButton82 = function(x) {
2016
+ var AdsPESideTrayTabButton82 = function (x) {
2017
if (x === 196) {
2018
return React.createElement(
2019
'div',
2020
- {className: '_1-ly _59j9 _d9a', onClick: function() {}},
2020
+ {className: '_1-ly _59j9 _d9a', onClick: function () {}},
2021
ReactImage0(195),
2022
React.createElement('div', {className: '_vf7'}),
2023
React.createElement('div', {className: '_vf8'})
@@ -2026,7 +2026,7 @@
2026
if (x === 199) {
2027
return React.createElement(
2028
'div',
2029
- {className: ' _1-lz _d9a', onClick: function() {}},
2029
+ {className: ' _1-lz _d9a', onClick: function () {}},
2030
ReactImage0(198),
2031
React.createElement('div', {className: '_vf7'}),
2032
React.createElement('div', {className: '_vf8'})
@@ -2037,13 +2037,13 @@
2037
}
2038
};
2039
2040
- var AdsPEEditorTrayTabButton83 = function(x) {
2040
+ var AdsPEEditorTrayTabButton83 = function (x) {
2041
if (x === 197) {
2042
return AdsPESideTrayTabButton82(196);
2043
}
2044
};
2045
2046
- var AdsPEInsightsTrayTabButton84 = function(x) {
2046
+ var AdsPEInsightsTrayTabButton84 = function (x) {
2047
if (x === 202) {
2048
return React.createElement(
2049
'span',
@@ -2054,13 +2054,13 @@
2054
}
2055
};
2056
2057
- var AdsPENekoDebuggerTrayTabButton85 = function(x) {
2057
+ var AdsPENekoDebuggerTrayTabButton85 = function (x) {
2058
if (x === 204) {
2059
return AdsPESideTrayTabButton82(203);
2060
}
2061
};
2062
2063
- var AdsPEEditorChildLink86 = function(x) {
2063
+ var AdsPEEditorChildLink86 = function (x) {
2064
if (x === 211) {
2065
return React.createElement(
2066
'div',
@@ -2072,13 +2072,13 @@
2072
}
2073
};
2074
2075
- var AdsPEEditorChildLinkContainer87 = function(x) {
2075
+ var AdsPEEditorChildLinkContainer87 = function (x) {
2076
if (x === 212) {
2077
return AdsPEEditorChildLink86(211);
2078
}
2079
};
2080
2081
- var AdsPEHeaderSection88 = function(x) {
2081
+ var AdsPEHeaderSection88 = function (x) {
2082
if (x === 213) {
2083
return React.createElement(
2084
'div',
@@ -2095,25 +2095,25 @@
2095
}
2096
};
2097
2098
- var AdsPECampaignGroupHeaderSectionContainer89 = function(x) {
2098
+ var AdsPECampaignGroupHeaderSectionContainer89 = function (x) {
2099
if (x === 214) {
2100
return AdsPEHeaderSection88(213);
2101
}
2102
};
2103
2104
- var AdsEditorLoadingErrors90 = function(x) {
2104
+ var AdsEditorLoadingErrors90 = function (x) {
2105
if (x === 215) {
2106
return null;
2107
}
2108
};
2109
2110
- var AdsTextInput91 = function(x) {
2110
+ var AdsTextInput91 = function (x) {
2111
if (x === 217) {
2112
return ReactXUIError76(216);
2113
}
2114
};
2115
2116
- var BUIFormElement92 = function(x) {
2116
+ var BUIFormElement92 = function (x) {
2117
if (x === 218) {
2118
return React.createElement(
2119
'div',
@@ -2151,7 +2151,7 @@
2151
}
2152
};
2153
2154
- var BUIForm93 = function(x) {
2154
+ var BUIForm93 = function (x) {
2155
if (x === 219) {
2156
return React.createElement(
2157
'div',
@@ -2161,7 +2161,7 @@
2161
}
2162
};
2163
2164
- var XUICard94 = function(x) {
2164
+ var XUICard94 = function (x) {
2165
if (x === 220) {
2166
return React.createElement(
2167
'div',
@@ -2186,7 +2186,7 @@
2186
}
2187
};
2188
2189
- var AdsCard95 = function(x) {
2189
+ var AdsCard95 = function (x) {
2190
if (x === 222) {
2191
return ReactXUIError76(221);
2192
}
@@ -2198,25 +2198,25 @@
2198
}
2199
};
2200
2201
- var AdsEditorNameSection96 = function(x) {
2201
+ var AdsEditorNameSection96 = function (x) {
2202
if (x === 223) {
2203
return AdsCard95(222);
2204
}
2205
};
2206
2207
- var AdsCampaignGroupNameSectionContainer97 = function(x) {
2207
+ var AdsCampaignGroupNameSectionContainer97 = function (x) {
2208
if (x === 224) {
2209
return AdsEditorNameSection96(223);
2210
}
2211
};
2212
2213
- var _render98 = function(x) {
2213
+ var _render98 = function (x) {
2214
if (x === 225) {
2215
return AdsCampaignGroupNameSectionContainer97(224);
2216
}
2217
};
2218
2219
- var AdsPluginWrapper99 = function(x) {
2219
+ var AdsPluginWrapper99 = function (x) {
2220
if (x === 226) {
2221
return _render98(225);
2222
}
@@ -2234,7 +2234,7 @@
2234
}
2235
};
2236
2237
- var XUICardHeaderTitle100 = function(x) {
2237
+ var XUICardHeaderTitle100 = function (x) {
2238
if (x === 227) {
2239
return React.createElement(
2240
'span',
@@ -2268,7 +2268,7 @@
2268
}
2269
};
2270
2271
- var XUICardSection101 = function(x) {
2271
+ var XUICardSection101 = function (x) {
2272
if (x === 228) {
2273
return React.createElement(
2274
'div',
@@ -2296,19 +2296,19 @@
2296
}
2297
};
2298
2299
- var XUICardHeader102 = function(x) {
2299
+ var XUICardHeader102 = function (x) {
2300
if (x === 229) {
2301
return XUICardSection101(228);
2302
}
2303
};
2304
2305
- var AdsCardHeader103 = function(x) {
2305
+ var AdsCardHeader103 = function (x) {
2306
if (x === 230) {
2307
return XUICardHeader102(229);
2308
}
2309
};
2310
2311
- var AdsLabeledField104 = function(x) {
2311
+ var AdsLabeledField104 = function (x) {
2312
if (x === 231) {
2313
return React.createElement(
2314
'div',
@@ -2350,7 +2350,7 @@
2350
}
2351
};
2352
2353
- var FlexibleBlock105 = function(x) {
2353
+ var FlexibleBlock105 = function (x) {
2354
if (x === 233) {
2355
return LeftRight21(232);
2356
}
@@ -2362,7 +2362,7 @@
2362
}
2363
};
2364
2365
- var AdsBulkCampaignSpendCapField106 = function(x) {
2365
+ var AdsBulkCampaignSpendCapField106 = function (x) {
2366
if (x === 243) {
2367
return React.createElement(
2368
'div',
@@ -2374,61 +2374,61 @@
2374
}
2375
};
2376
2377
- var FluxContainer_AdsCampaignGroupSpendCapContainer_107 = function(x) {
2377
+ var FluxContainer_AdsCampaignGroupSpendCapContainer_107 = function (x) {
2378
if (x === 244) {
2379
return AdsBulkCampaignSpendCapField106(243);
2380
}
2381
};
2382
2383
- var AdsCardSection108 = function(x) {
2383
+ var AdsCardSection108 = function (x) {
2384
if (x === 248) {
2385
return XUICardSection101(247);
2386
}
2387
};
2388
2389
- var AdsEditorCampaignGroupDetailsSection109 = function(x) {
2389
+ var AdsEditorCampaignGroupDetailsSection109 = function (x) {
2390
if (x === 252) {
2391
return AdsCard95(251);
2392
}
2393
};
2394
2395
- var AdsEditorCampaignGroupDetailsSectionContainer110 = function(x) {
2395
+ var AdsEditorCampaignGroupDetailsSectionContainer110 = function (x) {
2396
if (x === 253) {
2397
return AdsEditorCampaignGroupDetailsSection109(252);
2398
}
2399
};
2400
2401
- var _render111 = function(x) {
2401
+ var _render111 = function (x) {
2402
if (x === 254) {
2403
return AdsEditorCampaignGroupDetailsSectionContainer110(253);
2404
}
2405
};
2406
2407
- var FluxContainer_AdsEditorToplineDetailsSectionContainer_112 = function(x) {
2407
+ var FluxContainer_AdsEditorToplineDetailsSectionContainer_112 = function (x) {
2408
if (x === 256) {
2409
return null;
2410
}
2411
};
2412
2413
- var _render113 = function(x) {
2413
+ var _render113 = function (x) {
2414
if (x === 257) {
2415
return FluxContainer_AdsEditorToplineDetailsSectionContainer_112(256);
2416
}
2417
};
2418
2419
- var AdsStickyArea114 = function(x) {
2419
+ var AdsStickyArea114 = function (x) {
2420
if (x === 259) {
2421
return React.createElement(
2422
'div',
2423
{},
2424
- React.createElement('div', {onWheel: function() {}})
2424
+ React.createElement('div', {onWheel: function () {}})
2425
);
2426
}
2427
if (x === 292) {
2428
return React.createElement(
2429
'div',
2430
{},
2431
- React.createElement('div', {onWheel: function() {}}, [
2431
+ React.createElement('div', {onWheel: function () {}}, [
2432
React.createElement(
2433
'div',
2434
{key: 'campaign_group_errors_section98010048849317'},
@@ -2439,7 +2439,7 @@
2439
}
2440
};
2441
2442
- var FluxContainer_AdsEditorColumnContainer_115 = function(x) {
2442
+ var FluxContainer_AdsEditorColumnContainer_115 = function (x) {
2443
if (x === 260) {
2444
return React.createElement(
2445
'div',
@@ -2480,7 +2480,7 @@
2480
}
2481
};
2482
2483
- var BUISwitch116 = function(x) {
2483
+ var BUISwitch116 = function (x) {
2484
if (x === 261) {
2485
return React.createElement(
2486
'div',
@@ -2491,7 +2491,7 @@
2491
'data-tooltip-position': 'below',
2492
disabled: false,
2493
value: true,
2494
- onToggle: function() {},
2494
+ onToggle: function () {},
2495
className: '_128j _128k _128n',
2496
role: 'checkbox',
2497
'aria-checked': 'true',
@@ -2500,9 +2500,9 @@
2500
'div',
2501
{
2502
className: '_128o',
2503
- onClick: function() {},
2504
- onKeyDown: function() {},
2505
- onMouseDown: function() {},
2503
+ onClick: function () {},
2504
+ onKeyDown: function () {},
2505
+ onMouseDown: function () {},
2506
tabIndex: '0',
2507
},
2508
React.createElement('div', {className: '_128p'})
@@ -2512,91 +2512,91 @@
2512
}
2513
};
2514
2515
- var AdsStatusSwitchInternal117 = function(x) {
2515
+ var AdsStatusSwitchInternal117 = function (x) {
2516
if (x === 262) {
2517
return BUISwitch116(261);
2518
}
2519
};
2520
2521
- var AdsStatusSwitch118 = function(x) {
2521
+ var AdsStatusSwitch118 = function (x) {
2522
if (x === 263) {
2523
return AdsStatusSwitchInternal117(262);
2524
}
2525
};
2526
2527
- var FluxContainer_AdsCampaignGroupStatusSwitchContainer_119 = function(x) {
2527
+ var FluxContainer_AdsCampaignGroupStatusSwitchContainer_119 = function (x) {
2528
if (x === 264) {
2529
return AdsStatusSwitch118(263);
2530
}
2531
};
2532
2533
- var AdsLinksMenu120 = function(x) {
2533
+ var AdsLinksMenu120 = function (x) {
2534
if (x === 275) {
2535
return ReactPopoverMenu20(274);
2536
}
2537
};
2538
2539
- var FluxContainer_AdsPluginizedLinksMenuContainer_121 = function(x) {
2539
+ var FluxContainer_AdsPluginizedLinksMenuContainer_121 = function (x) {
2540
if (x === 276) {
2541
return React.createElement('div', null, null, AdsLinksMenu120(275));
2542
}
2543
};
2544
2545
- var AdsCardLeftRightHeader122 = function(x) {
2545
+ var AdsCardLeftRightHeader122 = function (x) {
2546
if (x === 278) {
2547
return LeftRight21(277);
2548
}
2549
};
2550
2551
- var AdsPEIDSection123 = function(x) {
2551
+ var AdsPEIDSection123 = function (x) {
2552
if (x === 282) {
2553
return AdsCard95(281);
2554
}
2555
};
2556
2557
- var FluxContainer_AdsPECampaignGroupIDSectionContainer_124 = function(x) {
2557
+ var FluxContainer_AdsPECampaignGroupIDSectionContainer_124 = function (x) {
2558
if (x === 283) {
2559
return AdsPEIDSection123(282);
2560
}
2561
};
2562
2563
- var DeferredComponent125 = function(x) {
2563
+ var DeferredComponent125 = function (x) {
2564
if (x === 284) {
2565
return FluxContainer_AdsPECampaignGroupIDSectionContainer_124(283);
2566
}
2567
};
2568
2569
- var BootloadedComponent126 = function(x) {
2569
+ var BootloadedComponent126 = function (x) {
2570
if (x === 285) {
2571
return DeferredComponent125(284);
2572
}
2573
};
2574
2575
- var _render127 = function(x) {
2575
+ var _render127 = function (x) {
2576
if (x === 286) {
2577
return BootloadedComponent126(285);
2578
}
2579
};
2580
2581
- var AdsEditorErrorsCard128 = function(x) {
2581
+ var AdsEditorErrorsCard128 = function (x) {
2582
if (x === 288) {
2583
return null;
2584
}
2585
};
2586
2587
- var FluxContainer_FunctionalContainer_129 = function(x) {
2587
+ var FluxContainer_FunctionalContainer_129 = function (x) {
2588
if (x === 289) {
2589
return AdsEditorErrorsCard128(288);
2590
}
2591
};
2592
2593
- var _render130 = function(x) {
2593
+ var _render130 = function (x) {
2594
if (x === 290) {
2595
return FluxContainer_FunctionalContainer_129(289);
2596
}
2597
};
2598
2599
- var AdsEditorMultiColumnLayout131 = function(x) {
2599
+ var AdsEditorMultiColumnLayout131 = function (x) {
2600
if (x === 294) {
2601
return React.createElement(
2602
'div',
@@ -2628,7 +2628,7 @@
2628
}
2629
};
2630
2631
- var AdsPECampaignGroupEditor132 = function(x) {
2631
+ var AdsPECampaignGroupEditor132 = function (x) {
2632
if (x === 295) {
2633
return React.createElement(
2634
'div',
@@ -2639,13 +2639,13 @@
2639
}
2640
};
2641
2642
- var AdsPECampaignGroupEditorContainer133 = function(x) {
2642
+ var AdsPECampaignGroupEditorContainer133 = function (x) {
2643
if (x === 296) {
2644
return AdsPECampaignGroupEditor132(295);
2645
}
2646
};
2647
2648
- var AdsPESideTrayTabContent134 = function(x) {
2648
+ var AdsPESideTrayTabContent134 = function (x) {
2649
if (x === 297) {
2650
return React.createElement(
2651
'div',
@@ -2655,13 +2655,13 @@
2655
}
2656
};
2657
2658
- var AdsPEEditorTrayTabContentContainer135 = function(x) {
2658
+ var AdsPEEditorTrayTabContentContainer135 = function (x) {
2659
if (x === 298) {
2660
return AdsPESideTrayTabContent134(297);
2661
}
2662
};
2663
2664
- var AdsPEMultiTabDrawer136 = function(x) {
2664
+ var AdsPEMultiTabDrawer136 = function (x) {
2665
if (x === 299) {
2666
return React.createElement(
2667
'div',
@@ -2683,13 +2683,13 @@
2683
}
2684
};
2685
2686
- var FluxContainer_AdsPEMultiTabDrawerContainer_137 = function(x) {
2686
+ var FluxContainer_AdsPEMultiTabDrawerContainer_137 = function (x) {
2687
if (x === 300) {
2688
return AdsPEMultiTabDrawer136(299);
2689
}
2690
};
2691
2692
- var AdsPESimpleOrganizer138 = function(x) {
2692
+ var AdsPESimpleOrganizer138 = function (x) {
2693
if (x === 309) {
2694
return React.createElement(
2695
'div',
@@ -2701,13 +2701,13 @@
2701
}
2702
};
2703
2704
- var AdsPEOrganizerContainer139 = function(x) {
2704
+ var AdsPEOrganizerContainer139 = function (x) {
2705
if (x === 310) {
2706
return React.createElement('div', null, AdsPESimpleOrganizer138(309));
2707
}
2708
};
2709
2710
- var FixedDataTableColumnResizeHandle140 = function(x) {
2710
+ var FixedDataTableColumnResizeHandle140 = function (x) {
2711
if (x === 313) {
2712
return React.createElement(
2713
'div',
@@ -2720,7 +2720,7 @@
2720
}
2721
};
2722
2723
- var AdsPETableHeader141 = function(x) {
2723
+ var AdsPETableHeader141 = function (x) {
2724
if (x === 315) {
2725
return React.createElement(
2726
'div',
@@ -2953,7 +2953,7 @@
2953
}
2954
};
2955
2956
- var TransitionCell142 = function(x) {
2956
+ var TransitionCell142 = function (x) {
2957
if (x === 316) {
2958
return React.createElement(
2959
'div',
@@ -3565,7 +3565,7 @@
3565
}
3566
};
3567
3568
- var FixedDataTableCell143 = function(x) {
3568
+ var FixedDataTableCell143 = function (x) {
3569
if (x === 317) {
3570
return React.createElement(
3571
'div',
@@ -3623,7 +3623,11 @@
3623
{className: '_4lg0 _4h2m', style: {height: 25, width: 400, left: 42}},
3624
React.createElement(
3625
'div',
3626
- {className: '_4lg9', style: {height: 25}, onMouseDown: function() {}},
3626
+ {
3627
+ className: '_4lg9',
3628
+ style: {height: 25},
3629
+ onMouseDown: function () {},
3630
+ },
3631
React.createElement('div', {
3632
className: '_4lga _4lgb',
3633
style: {height: 25},
@@ -3662,7 +3666,11 @@
3666
{className: '_4lg0 _4h2m', style: {height: 25, width: 150, left: 571}},
3667
React.createElement(
3668
'div',
3665
- {className: '_4lg9', style: {height: 25}, onMouseDown: function() {}},
3669
+ {
3670
+ className: '_4lg9',
3671
+ style: {height: 25},
3672
+ onMouseDown: function () {},
3673
+ },
3674
React.createElement('div', {
3675
className: '_4lga _4lgb',
3676
style: {height: 25},
@@ -3680,7 +3688,11 @@
3688
},
3689
React.createElement(
3690
'div',
3683
- {className: '_4lg9', style: {height: 25}, onMouseDown: function() {}},
3691
+ {
3692
+ className: '_4lg9',
3693
+ style: {height: 25},
3694
+ onMouseDown: function () {},
3695
+ },
3696
React.createElement('div', {
3697
className: '_4lga _4lgb',
3698
style: {height: 25},
@@ -3698,7 +3710,11 @@
3710
},
3711
React.createElement(
3712
'div',
3701
- {className: '_4lg9', style: {height: 25}, onMouseDown: function() {}},
3713
+ {
3714
+ className: '_4lg9',
3715
+ style: {height: 25},
3716
+ onMouseDown: function () {},
3717
+ },
3718
React.createElement('div', {
3719
className: '_4lga _4lgb',
3720
style: {height: 25},
@@ -3716,7 +3732,11 @@
3732
},
3733
React.createElement(
3734
'div',
3719
- {className: '_4lg9', style: {height: 25}, onMouseDown: function() {}},
3735
+ {
3736
+ className: '_4lg9',
3737
+ style: {height: 25},
3738
+ onMouseDown: function () {},
3739
+ },
3740
React.createElement('div', {
3741
className: '_4lga _4lgb',
3742
style: {height: 25},
@@ -3734,7 +3754,11 @@
3754
},
3755
React.createElement(
3756
'div',
3737
- {className: '_4lg9', style: {height: 25}, onMouseDown: function() {}},
3757
+ {
3758
+ className: '_4lg9',
3759
+ style: {height: 25},
3760
+ onMouseDown: function () {},
3761
+ },
3762
React.createElement('div', {
3763
className: '_4lga _4lgb',
3764
style: {height: 25},
@@ -3752,7 +3776,11 @@
3776
},
3777
React.createElement(
3778
'div',
3755
- {className: '_4lg9', style: {height: 25}, onMouseDown: function() {}},
3779
+ {
3780
+ className: '_4lg9',
3781
+ style: {height: 25},
3782
+ onMouseDown: function () {},
3783
+ },
3784
React.createElement('div', {
3785
className: '_4lga _4lgb',
3786
style: {height: 25},
@@ -3770,7 +3798,11 @@
3798
},
3799
React.createElement(
3800
'div',
3773
- {className: '_4lg9', style: {height: 25}, onMouseDown: function() {}},
3801
+ {
3802
+ className: '_4lg9',
3803
+ style: {height: 25},
3804
+ onMouseDown: function () {},
3805
+ },
3806
React.createElement('div', {
3807
className: '_4lga _4lgb',
3808
style: {height: 25},
@@ -3788,7 +3820,11 @@
3820
},
3821
React.createElement(
3822
'div',
3791
- {className: '_4lg9', style: {height: 25}, onMouseDown: function() {}},
3823
+ {
3824
+ className: '_4lg9',
3825
+ style: {height: 25},
3826
+ onMouseDown: function () {},
3827
+ },
3828
React.createElement('div', {
3829
className: '_4lga _4lgb',
3830
style: {height: 25},
@@ -3806,7 +3842,11 @@
3842
},
3843
React.createElement(
3844
'div',
3809
- {className: '_4lg9', style: {height: 25}, onMouseDown: function() {}},
3845
+ {
3846
+ className: '_4lg9',
3847
+ style: {height: 25},
3848
+ onMouseDown: function () {},
3849
+ },
3850
React.createElement('div', {
3851
className: '_4lga _4lgb',
3852
style: {height: 25},
@@ -3824,7 +3864,11 @@
3864
},
3865
React.createElement(
3866
'div',
3827
- {className: '_4lg9', style: {height: 25}, onMouseDown: function() {}},
3867
+ {
3868
+ className: '_4lg9',
3869
+ style: {height: 25},
3870
+ onMouseDown: function () {},
3871
+ },
3872
React.createElement('div', {
3873
className: '_4lga _4lgb',
3874
style: {height: 25},
@@ -3839,7 +3883,11 @@
3883
{className: '_4lg0 _4h2m', style: {height: 25, width: 200, left: 798}},
3884
React.createElement(
3885
'div',
3842
- {className: '_4lg9', style: {height: 25}, onMouseDown: function() {}},
3886
+ {
3887
+ className: '_4lg9',
3888
+ style: {height: 25},
3889
+ onMouseDown: function () {},
3890
+ },
3891
React.createElement('div', {
3892
className: '_4lga _4lgb',
3893
style: {height: 25},
@@ -3854,7 +3902,11 @@
3902
{className: '_4lg0 _4h2m', style: {height: 25, width: 100, left: 998}},
3903
React.createElement(
3904
'div',
3857
- {className: '_4lg9', style: {height: 25}, onMouseDown: function() {}},
3905
+ {
3906
+ className: '_4lg9',
3907
+ style: {height: 25},
3908
+ onMouseDown: function () {},
3909
+ },
3910
React.createElement('div', {
3911
className: '_4lga _4lgb',
3912
style: {height: 25},
@@ -3869,7 +3921,11 @@
3921
{className: '_4lg0 _4h2m', style: {height: 25, width: 120, left: 1098}},
3922
React.createElement(
3923
'div',
3872
- {className: '_4lg9', style: {height: 25}, onMouseDown: function() {}},
3924
+ {
3925
+ className: '_4lg9',
3926
+ style: {height: 25},
3927
+ onMouseDown: function () {},
3928
+ },
3929
React.createElement('div', {
3930
className: '_4lga _4lgb',
3931
style: {height: 25},
@@ -3884,7 +3940,11 @@
3940
{className: '_4lg0 _4h2m', style: {height: 25, width: 113, left: 1218}},
3941
React.createElement(
3942
'div',
3887
- {className: '_4lg9', style: {height: 25}, onMouseDown: function() {}},
3943
+ {
3944
+ className: '_4lg9',
3945
+ style: {height: 25},
3946
+ onMouseDown: function () {},
3947
+ },
3948
React.createElement('div', {
3949
className: '_4lga _4lgb',
3950
style: {height: 25},
@@ -3899,7 +3959,11 @@
3959
{className: '_4lg0 _4h2m', style: {height: 25, width: 113, left: 1331}},
3960
React.createElement(
3961
'div',
3902
- {className: '_4lg9', style: {height: 25}, onMouseDown: function() {}},
3962
+ {
3963
+ className: '_4lg9',
3964
+ style: {height: 25},
3965
+ onMouseDown: function () {},
3966
+ },
3967
React.createElement('div', {
3968
className: '_4lga _4lgb',
3969
style: {height: 25},
@@ -3914,7 +3978,11 @@
3978
{className: '_4lg0 _4h2m', style: {height: 25, width: 113, left: 1444}},
3979
React.createElement(
3980
'div',
3917
- {className: '_4lg9', style: {height: 25}, onMouseDown: function() {}},
3981
+ {
3982
+ className: '_4lg9',
3983
+ style: {height: 25},
3984
+ onMouseDown: function () {},
3985
+ },
3986
React.createElement('div', {
3987
className: '_4lga _4lgb',
3988
style: {height: 25},
@@ -3929,7 +3997,11 @@
3997
{className: '_4lg0 _4h2m', style: {height: 25, width: 113, left: 1557}},
3998
React.createElement(
3999
'div',
3932
- {className: '_4lg9', style: {height: 25}, onMouseDown: function() {}},
4000
+ {
4001
+ className: '_4lg9',
4002
+ style: {height: 25},
4003
+ onMouseDown: function () {},
4004
+ },
4005
React.createElement('div', {
4006
className: '_4lga _4lgb',
4007
style: {height: 25},
@@ -3944,7 +4016,11 @@
4016
{className: '_4lg0 _4h2m', style: {height: 25, width: 150, left: 1670}},
4017
React.createElement(
4018
'div',
3947
- {className: '_4lg9', style: {height: 25}, onMouseDown: function() {}},
4019
+ {
4020
+ className: '_4lg9',
4021
+ style: {height: 25},
4022
+ onMouseDown: function () {},
4023
+ },
4024
React.createElement('div', {
4025
className: '_4lga _4lgb',
4026
style: {height: 25},
@@ -3963,7 +4039,7 @@
4039
}
4040
};
4041
3966
- var FixedDataTableCellGroupImpl144 = function(x) {
4042
+ var FixedDataTableCellGroupImpl144 = function (x) {
4043
if (x === 318) {
4044
return React.createElement(
4045
'div',
@@ -4059,7 +4135,7 @@
4135
}
4136
};
4137
4062
- var FixedDataTableCellGroup145 = function(x) {
4138
+ var FixedDataTableCellGroup145 = function (x) {
4139
if (x === 319) {
4140
return React.createElement(
4141
'div',
@@ -4090,7 +4166,7 @@
4166
}
4167
};
4168
4093
- var FixedDataTableRowImpl146 = function(x) {
4169
+ var FixedDataTableRowImpl146 = function (x) {
4170
if (x === 334) {
4171
return React.createElement(
4172
'div',
@@ -4141,7 +4217,7 @@
4217
}
4218
};
4219
4144
- var FixedDataTableRow147 = function(x) {
4220
+ var FixedDataTableRow147 = function (x) {
4221
if (x === 335) {
4222
return React.createElement(
4223
'div',
@@ -4176,11 +4252,11 @@
4252
}
4253
};
4254
4179
- var FixedDataTableAbstractSortableHeader148 = function(x) {
4255
+ var FixedDataTableAbstractSortableHeader148 = function (x) {
4256
if (x === 341) {
4257
return React.createElement(
4258
'div',
4183
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4259
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4260
React.createElement(
4261
'div',
4262
{className: '_2eq6'},
@@ -4192,7 +4268,7 @@
4268
if (x === 347) {
4269
return React.createElement(
4270
'div',
4195
- {onClick: function() {}, className: '_54_8 _1kst _4h2r _2wzx'},
4271
+ {onClick: function () {}, className: '_54_8 _1kst _4h2r _2wzx'},
4272
React.createElement(
4273
'div',
4274
{className: '_2eq6'},
@@ -4204,7 +4280,7 @@
4280
if (x === 353) {
4281
return React.createElement(
4282
'div',
4207
- {onClick: function() {}, className: '_54_8 _1kst _4h2r _2wzx'},
4283
+ {onClick: function () {}, className: '_54_8 _1kst _4h2r _2wzx'},
4284
React.createElement(
4285
'div',
4286
{className: '_2eq6'},
@@ -4216,7 +4292,7 @@
4292
if (x === 358) {
4293
return React.createElement(
4294
'div',
4219
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4295
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4296
React.createElement(
4297
'div',
4298
{className: '_2eq6'},
@@ -4228,7 +4304,7 @@
4304
if (x === 363) {
4305
return React.createElement(
4306
'div',
4231
- {onClick: function() {}, className: '_54_8 _54_9 _4h2r _2wzx'},
4307
+ {onClick: function () {}, className: '_54_8 _54_9 _4h2r _2wzx'},
4308
React.createElement(
4309
'div',
4310
{className: '_2eq6'},
@@ -4240,7 +4316,7 @@
4316
if (x === 370) {
4317
return React.createElement(
4318
'div',
4243
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4319
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4320
React.createElement(
4321
'div',
4322
{className: '_2eq6'},
@@ -4252,7 +4328,7 @@
4328
if (x === 375) {
4329
return React.createElement(
4330
'div',
4255
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4331
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4332
React.createElement(
4333
'div',
4334
{className: '_2eq6'},
@@ -4264,7 +4340,7 @@
4340
if (x === 380) {
4341
return React.createElement(
4342
'div',
4267
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4343
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4344
React.createElement(
4345
'div',
4346
{className: '_2eq6'},
@@ -4276,7 +4352,7 @@
4352
if (x === 385) {
4353
return React.createElement(
4354
'div',
4279
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4355
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4356
React.createElement(
4357
'div',
4358
{className: '_2eq6'},
@@ -4288,7 +4364,7 @@
4364
if (x === 390) {
4365
return React.createElement(
4366
'div',
4291
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4367
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4368
React.createElement(
4369
'div',
4370
{className: '_2eq6'},
@@ -4300,7 +4376,7 @@
4376
if (x === 395) {
4377
return React.createElement(
4378
'div',
4303
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4379
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4380
React.createElement(
4381
'div',
4382
{className: '_2eq6'},
@@ -4312,7 +4388,7 @@
4388
if (x === 400) {
4389
return React.createElement(
4390
'div',
4315
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4391
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4392
React.createElement(
4393
'div',
4394
{className: '_2eq6'},
@@ -4324,7 +4400,7 @@
4400
if (x === 405) {
4401
return React.createElement(
4402
'div',
4327
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4403
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4404
React.createElement(
4405
'div',
4406
{className: '_2eq6'},
@@ -4336,7 +4412,7 @@
4412
if (x === 410) {
4413
return React.createElement(
4414
'div',
4339
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4415
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4416
React.createElement(
4417
'div',
4418
{className: '_2eq6'},
@@ -4348,7 +4424,7 @@
4424
if (x === 415) {
4425
return React.createElement(
4426
'div',
4351
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4427
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4428
React.createElement(
4429
'div',
4430
{className: '_2eq6'},
@@ -4360,7 +4436,7 @@
4436
if (x === 420) {
4437
return React.createElement(
4438
'div',
4363
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4439
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4440
React.createElement(
4441
'div',
4442
{className: '_2eq6'},
@@ -4372,7 +4448,7 @@
4448
if (x === 425) {
4449
return React.createElement(
4450
'div',
4375
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4451
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4452
React.createElement(
4453
'div',
4454
{className: '_2eq6'},
@@ -4384,7 +4460,7 @@
4460
if (x === 430) {
4461
return React.createElement(
4462
'div',
4387
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4463
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4464
React.createElement(
4465
'div',
4466
{className: '_2eq6'},
@@ -4396,7 +4472,7 @@
4472
if (x === 435) {
4473
return React.createElement(
4474
'div',
4399
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4475
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4476
React.createElement(
4477
'div',
4478
{className: '_2eq6'},
@@ -4408,7 +4484,7 @@
4484
if (x === 440) {
4485
return React.createElement(
4486
'div',
4411
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4487
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4488
React.createElement(
4489
'div',
4490
{className: '_2eq6'},
@@ -4420,7 +4496,7 @@
4496
if (x === 445) {
4497
return React.createElement(
4498
'div',
4423
- {onClick: function() {}, className: '_54_8 _4h2r _2wzx'},
4499
+ {onClick: function () {}, className: '_54_8 _4h2r _2wzx'},
4500
React.createElement(
4501
'div',
4502
{className: '_2eq6'},
@@ -4431,7 +4507,7 @@
4507
}
4508
};
4509
4434
- var FixedDataTableSortableHeader149 = function(x) {
4510
+ var FixedDataTableSortableHeader149 = function (x) {
4511
if (x === 342) {
4512
return FixedDataTableAbstractSortableHeader148(341);
4513
}
@@ -4497,7 +4573,7 @@
4573
}
4574
};
4575
4500
- var FixedDataTableBufferedRows150 = function(x) {
4576
+ var FixedDataTableBufferedRows150 = function (x) {
4577
if (x === 459) {
4578
return React.createElement('div', {
4579
style: {
@@ -4510,7 +4586,7 @@
4586
}
4587
};
4588
4513
- var Scrollbar151 = function(x) {
4589
+ var Scrollbar151 = function (x) {
4590
if (x === 460) {
4591
return null;
4592
}
@@ -4518,11 +4594,11 @@
4594
return React.createElement(
4595
'div',
4596
{
4521
- onFocus: function() {},
4522
- onBlur: function() {},
4523
- onKeyDown: function() {},
4524
- onMouseDown: function() {},
4525
- onWheel: function() {},
4597
+ onFocus: function () {},
4598
+ onBlur: function () {},
4599
+ onKeyDown: function () {},
4600
+ onMouseDown: function () {},
4601
+ onWheel: function () {},
4602
className: '_1t0r _1t0t _4jdr _1t0u',
4603
style: {width: 1209, zIndex: 99},
4604
tabIndex: 0,
@@ -4539,7 +4615,7 @@
4615
}
4616
};
4617
4542
- var HorizontalScrollbar152 = function(x) {
4618
+ var HorizontalScrollbar152 = function (x) {
4619
if (x === 462) {
4620
return React.createElement(
4621
'div',
@@ -4562,13 +4638,13 @@
4638
}
4639
};
4640
4565
- var FixedDataTable153 = function(x) {
4641
+ var FixedDataTable153 = function (x) {
4642
if (x === 463) {
4643
return React.createElement(
4644
'div',
4645
{
4646
className: '_3h1i _1mie',
4571
- onWheel: function() {},
4647
+ onWheel: function () {},
4648
style: {height: 25, width: 1209},
4649
},
4650
React.createElement(
@@ -4591,13 +4667,13 @@
4667
}
4668
};
4669
4594
- var TransitionTable154 = function(x) {
4670
+ var TransitionTable154 = function (x) {
4671
if (x === 464) {
4672
return FixedDataTable153(463);
4673
}
4674
};
4675
4600
- var AdsSelectableFixedDataTable155 = function(x) {
4676
+ var AdsSelectableFixedDataTable155 = function (x) {
4677
if (x === 465) {
4678
return React.createElement(
4679
'div',
@@ -4607,27 +4683,27 @@
4683
}
4684
};
4685
4610
- var AdsDataTableKeyboardSupportDecorator156 = function(x) {
4686
+ var AdsDataTableKeyboardSupportDecorator156 = function (x) {
4687
if (x === 466) {
4688
return React.createElement(
4689
'div',
4614
- {className: '_5d6f', tabIndex: '0', onKeyDown: function() {}},
4690
+ {className: '_5d6f', tabIndex: '0', onKeyDown: function () {}},
4691
AdsSelectableFixedDataTable155(465)
4692
);
4693
}
4694
};
4695
4620
- var AdsEditableDataTableDecorator157 = function(x) {
4696
+ var AdsEditableDataTableDecorator157 = function (x) {
4697
if (x === 467) {
4698
return React.createElement(
4699
'div',
4624
- {onCopy: function() {}},
4700
+ {onCopy: function () {}},
4701
AdsDataTableKeyboardSupportDecorator156(466)
4702
);
4703
}
4704
};
4705
4630
- var AdsPEDataTableContainer158 = function(x) {
4706
+ var AdsPEDataTableContainer158 = function (x) {
4707
if (x === 468) {
4708
return React.createElement(
4709
'div',
@@ -4640,13 +4716,13 @@
4716
}
4717
};
4718
4643
- var AdsPECampaignGroupTableContainer159 = function(x) {
4719
+ var AdsPECampaignGroupTableContainer159 = function (x) {
4720
if (x === 470) {
4721
return ResponsiveBlock37(469);
4722
}
4723
};
4724
4649
- var AdsPEManageAdsPaneContainer160 = function(x) {
4725
+ var AdsPEManageAdsPaneContainer160 = function (x) {
4726
if (x === 473) {
4727
return React.createElement(
4728
'div',
@@ -4687,13 +4763,13 @@
4763
}
4764
};
4765
4690
- var AdsPEContentContainer161 = function(x) {
4766
+ var AdsPEContentContainer161 = function (x) {
4767
if (x === 474) {
4768
return AdsPEManageAdsPaneContainer160(473);
4769
}
4770
};
4771
4696
- var FluxContainer_AdsPEWorkspaceContainer_162 = function(x) {
4772
+ var FluxContainer_AdsPEWorkspaceContainer_162 = function (x) {
4773
if (x === 477) {
4774
return React.createElement(
4775
'div',
@@ -4705,37 +4781,37 @@
4781
}
4782
};
4783
4708
- var FluxContainer_AdsSessionExpiredDialogContainer_163 = function(x) {
4784
+ var FluxContainer_AdsSessionExpiredDialogContainer_163 = function (x) {
4785
if (x === 478) {
4786
return null;
4787
}
4788
};
4789
4714
- var FluxContainer_AdsPEUploadDialogLazyContainer_164 = function(x) {
4790
+ var FluxContainer_AdsPEUploadDialogLazyContainer_164 = function (x) {
4791
if (x === 479) {
4792
return null;
4793
}
4794
};
4795
4720
- var FluxContainer_DialogContainer_165 = function(x) {
4796
+ var FluxContainer_DialogContainer_165 = function (x) {
4797
if (x === 480) {
4798
return null;
4799
}
4800
};
4801
4726
- var AdsBugReportContainer166 = function(x) {
4802
+ var AdsBugReportContainer166 = function (x) {
4803
if (x === 481) {
4804
return React.createElement('span', null);
4805
}
4806
};
4807
4732
- var AdsPEAudienceSplittingDialog167 = function(x) {
4808
+ var AdsPEAudienceSplittingDialog167 = function (x) {
4809
if (x === 482) {
4810
return null;
4811
}
4812
};
4813
4738
- var AdsPEAudienceSplittingDialogContainer168 = function(x) {
4814
+ var AdsPEAudienceSplittingDialogContainer168 = function (x) {
4815
if (x === 483) {
4816
return React.createElement(
4817
'div',
@@ -4745,81 +4821,80 @@
4821
}
4822
};
4823
4748
- var FluxContainer_AdsRuleDialogBootloadContainer_169 = function(x) {
4824
+ var FluxContainer_AdsRuleDialogBootloadContainer_169 = function (x) {
4825
if (x === 484) {
4826
return null;
4827
}
4828
};
4829
4754
- var FluxContainer_AdsPECFTrayContainer_170 = function(x) {
4830
+ var FluxContainer_AdsPECFTrayContainer_170 = function (x) {
4831
if (x === 485) {
4832
return null;
4833
}
4834
};
4835
4760
- var FluxContainer_AdsPEDeleteDraftContainer_171 = function(x) {
4836
+ var FluxContainer_AdsPEDeleteDraftContainer_171 = function (x) {
4837
if (x === 486) {
4838
return null;
4839
}
4840
};
4841
4766
- var FluxContainer_AdsPEInitialDraftPublishDialogContainer_172 = function(x) {
4842
+ var FluxContainer_AdsPEInitialDraftPublishDialogContainer_172 = function (x) {
4843
if (x === 487) {
4844
return null;
4845
}
4846
};
4847
4772
- var FluxContainer_AdsPEReachFrequencyStatusTransitionDialogBootloadContainer_173 = function(
4773
- x
4774
- ) {
4775
- if (x === 488) {
4776
- return null;
4777
- }
4778
- };
4848
+ var FluxContainer_AdsPEReachFrequencyStatusTransitionDialogBootloadContainer_173 =
4849
+ function (x) {
4850
+ if (x === 488) {
4851
+ return null;
4852
+ }
4853
+ };
4854
4780
- var FluxContainer_AdsPEPurgeArchiveDialogContainer_174 = function(x) {
4855
+ var FluxContainer_AdsPEPurgeArchiveDialogContainer_174 = function (x) {
4856
if (x === 489) {
4857
return null;
4858
}
4859
};
4860
4786
- var AdsPECreateDialogContainer175 = function(x) {
4861
+ var AdsPECreateDialogContainer175 = function (x) {
4862
if (x === 490) {
4863
return React.createElement('span', null);
4864
}
4865
};
4866
4792
- var FluxContainer_AdsPEModalStatusContainer_176 = function(x) {
4867
+ var FluxContainer_AdsPEModalStatusContainer_176 = function (x) {
4868
if (x === 491) {
4869
return null;
4870
}
4871
};
4872
4798
- var FluxContainer_AdsBrowserExtensionErrorDialogContainer_177 = function(x) {
4873
+ var FluxContainer_AdsBrowserExtensionErrorDialogContainer_177 = function (x) {
4874
if (x === 492) {
4875
return null;
4876
}
4877
};
4878
4804
- var FluxContainer_AdsPESortByErrorTipContainer_178 = function(x) {
4879
+ var FluxContainer_AdsPESortByErrorTipContainer_178 = function (x) {
4880
if (x === 493) {
4881
return null;
4882
}
4883
};
4884
4810
- var LeadDownloadDialogSelector179 = function(x) {
4885
+ var LeadDownloadDialogSelector179 = function (x) {
4886
if (x === 494) {
4887
return null;
4888
}
4889
};
4890
4816
- var FluxContainer_AdsPELeadDownloadDialogContainerClass_180 = function(x) {
4891
+ var FluxContainer_AdsPELeadDownloadDialogContainerClass_180 = function (x) {
4892
if (x === 495) {
4893
return LeadDownloadDialogSelector179(494);
4894
}
4895
};
4896
4822
- var AdsPEContainer181 = function(x) {
4897
+ var AdsPEContainer181 = function (x) {
4898
if (x === 496) {
4899
return React.createElement(
4900
'div',
@@ -4854,7 +4929,7 @@
4929
}
4930
};
4931
4857
- var Benchmark = function(x) {
4932
+ var Benchmark = function (x) {
4933
if (x === undefined) {
4934
return AdsPEContainer181(496);
4935
}
scripts/error-codes/Types.js
+1
-2
@@ -8,5 +8,4 @@
8
*/
9
'use strict';
10
11
-/*:: export type ErrorMap = { [id: string]: string, ... }; */
12
-
11
+export type ErrorMap = {[id: string]: string, ...};
scripts/error-codes/invertObject.js
+1
-5
@@ -3,20 +3,16 @@
3
*
4
* This source code is licensed under the MIT license found in the
5
* LICENSE file in the root directory of this source tree.
6
- *
7
- * @flow
6
*/
7
'use strict';
8
11
-/*:: import type { ErrorMap } from './Types' */
12
-
9
/**
10
* turns
11
* { 'MUCH ERROR': '0', 'SUCH WRONG': '1' }
12
* into
13
* { 0: 'MUCH ERROR', 1: 'SUCH WRONG' }
14
*/
19
-function invertObject(targetObj /*: ErrorMap */) /*: ErrorMap */ {
15
+function invertObject(targetObj) {
16
const result /*: {[string]: string} */ = {};
17
const mapKeys = Object.keys(targetObj);
18
scripts/error-codes/transform-error-messages.js
+1
-1
@@ -17,7 +17,7 @@ const errorMap = invertObject(
17
18
const SEEN_SYMBOL = Symbol('transform-error-messages.seen');
19
20
-module.exports = function(babel) {
20
+module.exports = function (babel) {
21
const t = babel.types;
22
23
function ErrorCallExpression(path, file) {
scripts/eslint-rules/__tests__/no-to-warn-dev-within-to-throw-test.internal.js
+1
-2
@@ -20,8 +20,7 @@ ruleTester.run('eslint-rules/no-to-warn-dev-within-to-throw', rule, {
20
],
21
invalid: [
22
{
23
- code:
24
- 'expect(function() { expect(callback).toWarnDev("warning") }).toThrow("error");',
23
+ code: 'expect(function() { expect(callback).toWarnDev("warning") }).toThrow("error");',
24
errors: [
25
{
26
message: 'toWarnDev() matcher should not be nested',
scripts/eslint-rules/__tests__/safe-string-coercion-test.internal.js
+1
-2
@@ -139,8 +139,7 @@ ruleTester.run('eslint-rules/safe-string-coercion', rule, {
139
],
140
},
141
{
142
- code:
143
- "if (typeof obj === 'string') { } else if (typeof obj === 'object') {'' + obj}",
142
+ code: "if (typeof obj === 'string') { } else if (typeof obj === 'object') {'' + obj}",
143
errors: [
144
{
145
message: missingDevCheckMessage + '\n' + message,
scripts/eslint-rules/no-production-logging.js
+3
-3
@@ -14,7 +14,7 @@ module.exports = {
14
fixable: 'code',
15
schema: [],
16
},
17
- create: function(context) {
17
+ create: function (context) {
18
function isInDEVBlock(node) {
19
let done = false;
20
while (!done) {
@@ -43,7 +43,7 @@ module.exports = {
43
data: {
44
identifier: node.property.name,
45
},
46
- fix: function(fixer) {
46
+ fix: function (fixer) {
47
return [
48
fixer.insertTextBefore(node.parent, `if (__DEV__) {`),
49
fixer.insertTextAfter(node.parent, '}'),
@@ -60,7 +60,7 @@ module.exports = {
60
}
61
62
return {
63
- MemberExpression: function(node) {
63
+ MemberExpression: function (node) {
64
if (
65
node.object.type === 'Identifier' &&
66
node.object.name === 'console' &&
scripts/eslint-rules/warning-args.js
+1
-1
@@ -44,7 +44,7 @@ module.exports = {
44
}
45
46
return {
47
- CallExpression: function(node) {
47
+ CallExpression: function (node) {
48
// This could be a little smarter by checking context.getScope() to see
49
// how warning/invariant was defined.
50
const isWarning =
scripts/flow/environment.js
+1
-3
@@ -120,9 +120,7 @@ declare module 'fs/promises' {
120
) => Promise<mixed>;
121
}
122
declare module 'pg' {
123
- declare var Pool: (
124
- options: mixed,
125
- ) => {
123
+ declare var Pool: (options: mixed) => {
124
query: (query: string, values?: Array<mixed>) => void,
125
};
126
}
scripts/flow/runFlow.js
+1
-1
@@ -67,7 +67,7 @@ async function runFlow(renderer, args) {
67
spawn(cmd, args, {
68
// Allow colors to pass through:
69
stdio: 'inherit',
70
- }).on('close', function(code) {
70
+ }).on('close', function (code) {
71
if (code !== 0) {
72
console.error(
73
'Flow failed for the ' + chalk.red(renderer) + ' renderer',
scripts/jest/devtools/setupEnv.js
+6
-3
@@ -21,11 +21,14 @@ if (!global.hasOwnProperty('localStorage')) {
21
global.__DEV__ = process.env.NODE_ENV !== 'production';
22
global.__TEST__ = true;
23
24
-global.process.env.DARK_MODE_DIMMED_WARNING_COLOR = DARK_MODE_DIMMED_WARNING_COLOR;
24
+global.process.env.DARK_MODE_DIMMED_WARNING_COLOR =
25
+ DARK_MODE_DIMMED_WARNING_COLOR;
26
global.process.env.DARK_MODE_DIMMED_ERROR_COLOR = DARK_MODE_DIMMED_ERROR_COLOR;
27
global.process.env.DARK_MODE_DIMMED_LOG_COLOR = DARK_MODE_DIMMED_LOG_COLOR;
27
-global.process.env.LIGHT_MODE_DIMMED_WARNING_COLOR = LIGHT_MODE_DIMMED_WARNING_COLOR;
28
-global.process.env.LIGHT_MODE_DIMMED_ERROR_COLOR = LIGHT_MODE_DIMMED_ERROR_COLOR;
28
+global.process.env.LIGHT_MODE_DIMMED_WARNING_COLOR =
29
+ LIGHT_MODE_DIMMED_WARNING_COLOR;
30
+global.process.env.LIGHT_MODE_DIMMED_ERROR_COLOR =
31
+ LIGHT_MODE_DIMMED_ERROR_COLOR;
32
global.process.env.LIGHT_MODE_DIMMED_LOG_COLOR = LIGHT_MODE_DIMMED_LOG_COLOR;
33
34
global._test_react_version = (range, testName, callback) => {
scripts/jest/matchers/toWarnDev.js
+1
-1
@@ -15,7 +15,7 @@ function normalizeCodeLocInfo(str) {
15
// at Component (/path/filename.js:123:45)
16
// React format:
17
// in Component (at filename.js:123)
18
- return str.replace(/\n +(?:at|in) ([\S]+)[^\n]*/g, function(m, name) {
18
+ return str.replace(/\n +(?:at|in) ([\S]+)[^\n]*/g, function (m, name) {
19
return '\n in ' + name + ' (at **)';
20
});
21
}
scripts/jest/preprocessor.js
+1
-1
@@ -57,7 +57,7 @@ const babelOptions = {
57
};
58
59
module.exports = {
60
- process: function(src, filePath) {
60
+ process: function (src, filePath) {
61
if (filePath.match(/\.css$/)) {
62
// Don't try to parse CSS modules; they aren't needed for tests anyway.
63
return '';
scripts/jest/setupEnvironment.js
+2
-2
@@ -22,7 +22,7 @@ global.__EXPERIMENTAL__ =
22
global.__VARIANT__ = !!process.env.VARIANT;
23
24
if (typeof window !== 'undefined') {
25
- global.requestIdleCallback = function(callback) {
25
+ global.requestIdleCallback = function (callback) {
26
return setTimeout(() => {
27
callback({
28
timeRemaining() {
@@ -32,7 +32,7 @@ if (typeof window !== 'undefined') {
32
});
33
};
34
35
- global.cancelIdleCallback = function(callbackID) {
35
+ global.cancelIdleCallback = function (callbackID) {
36
clearTimeout(callbackID);
37
};
38
}
scripts/jest/setupTests.js
+5
-5
@@ -19,14 +19,14 @@ if (process.env.REACT_CLASS_EQUIVALENCE_TEST) {
19
const isSpy = spy => spy.calls && typeof spy.calls.count === 'function';
20
21
const spyOn = global.spyOn;
22
- const noop = function() {};
22
+ const noop = function () {};
23
24
// Spying on console methods in production builds can mask errors.
25
// This is why we added an explicit spyOnDev() helper.
26
// It's too easy to accidentally use the more familiar spyOn() helper though,
27
// So we disable it entirely.
28
// Spying on both dev and prod will require using both spyOnDev() and spyOnProd().
29
- global.spyOn = function() {
29
+ global.spyOn = function () {
30
throw new Error(
31
'Do not use spyOn(). ' +
32
'It can accidentally hide unexpected errors in production builds. ' +
@@ -69,7 +69,7 @@ if (process.env.REACT_CLASS_EQUIVALENCE_TEST) {
69
// TODO: Consider consolidating this with `yieldValue`. In both cases, tests
70
// should not be allowed to exit without asserting on the entire log.
71
const patchConsoleMethod = (methodName, unexpectedConsoleCallStacks) => {
72
- const newMethod = function(format, ...args) {
72
+ const newMethod = function (format, ...args) {
73
// Ignore uncaught errors reported by jsdom
74
// and React addendums because they're too noisy.
75
if (methodName === 'error' && shouldIgnoreConsoleError(format, args)) {
@@ -167,7 +167,7 @@ if (process.env.REACT_CLASS_EQUIVALENCE_TEST) {
167
// also proxies error instances with `proxyErrorInstance`.
168
// 2. `proxyErrorInstance` decodes error messages when the `message`
169
// property is changed.
170
- const decodeErrorMessage = function(message) {
170
+ const decodeErrorMessage = function (message) {
171
if (!message) {
172
return message;
173
}
@@ -190,7 +190,7 @@ if (process.env.REACT_CLASS_EQUIVALENCE_TEST) {
190
// V8's Error.captureStackTrace (used in Jest) fails if the error object is
191
// a Proxy, so we need to pass it the unproxied instance.
192
const originalErrorInstances = new WeakMap();
193
- const captureStackTrace = function(error, ...args) {
193
+ const captureStackTrace = function (error, ...args) {
194
return OriginalError.captureStackTrace.call(
195
this,
196
originalErrorInstances.get(error) ||
scripts/jest/spec-equivalence-reporter/setupTests.js
+4
-4
@@ -11,7 +11,7 @@ const expect = global.expect;
11
12
let numExpectations = 0;
13
14
-global.expect = function() {
14
+global.expect = function () {
15
numExpectations += 1;
16
return expect.apply(this, arguments);
17
};
@@ -23,7 +23,7 @@ const spyOn = global.spyOn;
23
// It's too easy to accidentally use the more familiar spyOn() helper though,
24
// So we disable it entirely.
25
// Spying on both dev and prod will require using both spyOnDev() and spyOnProd().
26
-global.spyOn = function() {
26
+global.spyOn = function () {
27
throw new Error(
28
'Do not use spyOn(). ' +
29
'It can accidentally hide unexpected errors in production builds. ' +
@@ -31,7 +31,7 @@ global.spyOn = function() {
31
);
32
};
33
34
-global.spyOnDev = function(...args) {
34
+global.spyOnDev = function (...args) {
35
if (__DEV__) {
36
return spyOn(...args);
37
}
@@ -39,7 +39,7 @@ global.spyOnDev = function(...args) {
39
40
global.spyOnDevAndProd = spyOn;
41
42
-global.spyOnProd = function(...args) {
42
+global.spyOnProd = function (...args) {
43
if (!__DEV__) {
44
return spyOn(...args);
45
}
scripts/jest/typescript/preprocessor.js
+2
-1
@@ -42,7 +42,8 @@ function compile(content, contentFilename) {
42
let source;
43
const libRegex = /lib\.(.+\.)?d\.ts$/;
44
const jestRegex = /jest\.d\.ts/;
45
- const reactRegex = /(?:React|ReactDOM|ReactDOMClient|ReactInternalAct|PropTypes)(?:\.d)?\.ts$/;
45
+ const reactRegex =
46
+ /(?:React|ReactDOM|ReactDOMClient|ReactInternalAct|PropTypes)(?:\.d)?\.ts$/;
47
48
// `path.normalize` is used to turn forward slashes in
49
// the file path into backslashes on Windows.
scripts/prettier/index.js
+1
-1
@@ -37,7 +37,7 @@ const files = glob
37
.filter(f => !onlyChanged || changedFiles.has(f));
38
39
if (!files.length) {
40
- return;
40
+ process.exit(0);
41
}
42
43
files.forEach(file => {
scripts/print-warnings/print-warnings.js
+3
-7
@@ -32,7 +32,7 @@ const parserOptions = {
32
const warnings = new Set();
33
34
function transform(file, enc, cb) {
35
- fs.readFile(file.path, 'utf8', function(err, source) {
35
+ fs.readFile(file.path, 'utf8', function (err, source) {
36
if (err) {
37
cb(err);
38
return;
@@ -48,7 +48,7 @@ function transform(file, enc, cb) {
48
49
traverse(ast, {
50
CallExpression: {
51
- exit: function(astPath) {
51
+ exit: function (astPath) {
52
const callee = astPath.get('callee');
53
if (
54
callee.matchesPattern('console.warn') ||
@@ -91,11 +91,7 @@ gs([
91
'!**/node_modules/**/*.js',
92
]).pipe(
93
through.obj(transform, cb => {
94
- process.stdout.write(
95
- Array.from(warnings)
96
- .sort()
97
- .join('\n') + '\n'
98
- );
94
+ process.stdout.write(Array.from(warnings).sort().join('\n') + '\n');
95
cb();
96
})
97
);
scripts/release/build-release-locally.js
+2
-7
@@ -24,13 +24,8 @@ const updateVersionNumbers = require('./build-release-locally-commands/update-ve
24
const run = async () => {
25
try {
26
const cwd = join(__dirname, '..', '..');
27
- const {
28
- branch,
29
- checksum,
30
- commit,
31
- reactVersion,
32
- version,
33
- } = await getBuildInfo();
27
+ const {branch, checksum, commit, reactVersion, version} =
28
+ await getBuildInfo();
29
const tempDirectory = join(tmpdir(), `react-${commit}`);
30
const params = {
31
branch,
scripts/release/build-release.js
+2
-7
@@ -24,13 +24,8 @@ const updateVersionNumbers = require('./build-release-locally-commands/update-ve
24
const run = async () => {
25
try {
26
const cwd = join(__dirname, '..', '..');
27
- const {
28
- branch,
29
- checksum,
30
- commit,
31
- reactVersion,
32
- version,
33
- } = await getBuildInfo();
27
+ const {branch, checksum, commit, reactVersion, version} =
28
+ await getBuildInfo();
29
const tempDirectory = join(tmpdir(), `react-${commit}`);
30
const params = {
31
branch,
scripts/release/prepare-release-from-npm-commands/update-stable-version-numbers.js
+7
-8
@@ -38,8 +38,8 @@ const run = async ({cwd, packages, version}, versionsMap) => {
38
// We compare source packages to determine what the new scheduler dependency constraint should be.
39
// To do this, we look at both the local version of the scheduler (e.g. 0.11.0),
40
// and the dependency constraint in the local version of react-dom (e.g. scheduler@^0.11.0).
41
- const sourceDependencyVersion = sourcePackageJSONs.get(dependencyName)
42
- .version;
41
+ const sourceDependencyVersion =
42
+ sourcePackageJSONs.get(dependencyName).version;
43
const sourceDependencyConstraint = sourceDependencies[dependencyName];
44
45
// If the source dependency's version and the constraint match,
@@ -52,12 +52,11 @@ const run = async ({cwd, packages, version}, versionsMap) => {
52
sourceDependencyVersion ===
53
sourceDependencyConstraint.replace(/^[\^\~]/, '')
54
) {
55
- targetDependencies[
56
- dependencyName
57
- ] = sourceDependencyConstraint.replace(
58
- sourceDependencyVersion,
59
- versionsMap.get(dependencyName)
60
- );
55
+ targetDependencies[dependencyName] =
56
+ sourceDependencyConstraint.replace(
57
+ sourceDependencyVersion,
58
+ versionsMap.get(dependencyName)
59
+ );
60
} else {
61
targetDependencies[dependencyName] = sourceDependencyConstraint;
62
}
scripts/release/publish.js
+3
-2
@@ -23,8 +23,9 @@ const run = async () => {
23
try {
24
const params = parseParams();
25
26
- const version = readJsonSync('./build/node_modules/react/package.json')
27
- .version;
26
+ const version = readJsonSync(
27
+ './build/node_modules/react/package.json'
28
+ ).version;
29
const isExperimental = version.includes('experimental');
30
31
params.cwd = join(__dirname, '..', '..');
scripts/release/shared-commands/test-packaging-fixture.js
+2
-3
@@ -26,9 +26,8 @@ const validate = async () => {
26
for (let i = 0; i < iframes.length; i++) {
27
const iframe = iframes[i];
28
// Don't include the <script> Babel tag
29
- const container = iframe.contentDocument.body.getElementsByTagName(
30
- 'div'
31
- )[0];
29
+ const container =
30
+ iframe.contentDocument.body.getElementsByTagName('div')[0];
31
if (container.textContent !== 'Hello World!') {
32
return `Unexpected fixture content, "${container.textContent}"`;
33
}
scripts/rollup/build.js
+1
-1
@@ -402,7 +402,7 @@ function getPlugins(
402
// Add the whitespace back if necessary.
403
shouldStayReadable &&
404
prettier({
405
- parser: 'babel',
405
+ parser: 'flow',
406
singleQuote: false,
407
trailingComma: 'none',
408
bracketSpacing: true,
scripts/rollup/bundles.js
+1
-1
@@ -933,7 +933,7 @@ const bundles = [
933
// Based on deep-freeze by substack (public domain)
934
function deepFreeze(o) {
935
Object.freeze(o);
936
- Object.getOwnPropertyNames(o).forEach(function(prop) {
936
+ Object.getOwnPropertyNames(o).forEach(function (prop) {
937
if (
938
o[prop] !== null &&
939
(typeof o[prop] === 'object' || typeof o[prop] === 'function') &&
scripts/rollup/modules.js
+2
-1
@@ -14,7 +14,8 @@ const importSideEffects = Object.freeze({
14
path: HAS_NO_SIDE_EFFECTS_ON_IMPORT,
15
stream: HAS_NO_SIDE_EFFECTS_ON_IMPORT,
16
'prop-types/checkPropTypes': HAS_NO_SIDE_EFFECTS_ON_IMPORT,
17
- 'react-native/Libraries/ReactPrivate/ReactNativePrivateInterface': HAS_NO_SIDE_EFFECTS_ON_IMPORT,
17
+ 'react-native/Libraries/ReactPrivate/ReactNativePrivateInterface':
18
+ HAS_NO_SIDE_EFFECTS_ON_IMPORT,
19
scheduler: HAS_NO_SIDE_EFFECTS_ON_IMPORT,
20
react: HAS_NO_SIDE_EFFECTS_ON_IMPORT,
21
'react-dom/server': HAS_NO_SIDE_EFFECTS_ON_IMPORT,
scripts/rollup/plugins/closure-plugin.js
+1
-1
@@ -9,7 +9,7 @@ const writeFileAsync = promisify(fs.writeFile);
9
function compile(flags) {
10
return new Promise((resolve, reject) => {
11
const closureCompiler = new ClosureCompiler(flags);
12
- closureCompiler.run(function(exitCode, stdOut, stdErr) {
12
+ closureCompiler.run(function (exitCode, stdOut, stdErr) {
13
if (!stdErr) {
14
resolve(stdOut);
15
} else {
scripts/rollup/shims/react-native/ReactNativeViewConfigRegistry.js
+4
-4
@@ -22,13 +22,13 @@ const customBubblingEventTypes: {
22
skipBubbling?: ?boolean,
23
}>,
24
}>,
25
- ...,
25
+ ...
26
} = {};
27
const customDirectEventTypes: {
28
[eventName: string]: $ReadOnly<{
29
registrationName: string,
30
}>,
31
- ...,
31
+ ...
32
} = {};
33
34
exports.customBubblingEventTypes = customBubblingEventTypes;
@@ -75,7 +75,7 @@ function processEventTypes(viewConfig: ViewConfig): void {
75
* A callback is provided to load the view config from UIManager.
76
* The callback is deferred until the view is actually rendered.
77
*/
78
-exports.register = function(name: string, callback: () => ViewConfig): string {
78
+exports.register = function (name: string, callback: () => ViewConfig): string {
79
invariant(
80
!viewConfigCallbacks.has(name),
81
'Tried to register two views with the same name %s',
@@ -96,7 +96,7 @@ exports.register = function(name: string, callback: () => ViewConfig): string {
96
* If this is the first time the view has been used,
97
* This configuration will be lazy-loaded from UIManager.
98
*/
99
-exports.get = function(name: string): ViewConfig {
99
+exports.get = function (name: string): ViewConfig {
100
let viewConfig;
101
if (!viewConfigs.has(name)) {
102
const callback = viewConfigCallbacks.get(name);
scripts/rollup/shims/react-native/createReactNativeComponentClass.js
+1
-1
@@ -23,7 +23,7 @@ const {register} = ReactNativeViewConfigRegistry;
23
* @param {string} config iOS View configuration.
24
* @private
25
*/
26
-const createReactNativeComponentClass = function(
26
+const createReactNativeComponentClass = function (
27
name: string,
28
callback: () => ViewConfig,
29
): string {
scripts/rollup/wrappers.js
+1
-3
@@ -43,9 +43,7 @@ function registerInternalModuleStop(globalName) {
43
44
// Remove the 'use strict' directive from the footer.
45
// This directive is only meaningful when it is the first statement in a file or function.
46
- return String(file)
47
- .replace(USE_STRICT_HEADER_REGEX, '')
48
- .trim();
46
+ return String(file).replace(USE_STRICT_HEADER_REGEX, '').trim();
47
}
48
49
const license = ` * Copyright (c) Meta Platforms, Inc. and affiliates.
scripts/shared/evalToString.js
+4
-4
@@ -8,7 +8,7 @@
8
*/
9
'use strict';
10
11
-function evalStringConcat(ast /* : Object */) /* : string */ {
11
+function evalStringConcat(ast /*: Object */) /*: string */ {
12
switch (ast.type) {
13
case 'StringLiteral':
14
case 'Literal': // ESLint
@@ -25,9 +25,9 @@ function evalStringConcat(ast /* : Object */) /* : string */ {
25
exports.evalStringConcat = evalStringConcat;
26
27
function evalStringAndTemplateConcat(
28
- ast /* : Object */,
29
- args /* : Array<mixed> */
30
-) /* : string */ {
28
+ ast /*: Object */,
29
+ args /*: Array<mixed> */
30
+) /*: string */ {
31
switch (ast.type) {
32
case 'StringLiteral':
33
return ast.value;
scripts/shared/listChangedFiles.js
+1
-5
@@ -19,11 +19,7 @@ const exec = (command, args) => {
19
return execFileSync(command, args, options);
20
};
21
22
-const execGitCmd = args =>
23
- exec('git', args)
24
- .trim()
25
- .toString()
26
- .split('\n');
22
+const execGitCmd = args => exec('git', args).trim().toString().split('\n');
23
24
const listChangedFiles = () => {
25
const mergeBase = execGitCmd(['merge-base', 'HEAD', 'main']);
scripts/tasks/danger.js
+1
-1
@@ -28,7 +28,7 @@ spawn(
28
DANGER_GITHUB_API_TOKEN: token,
29
},
30
}
31
-).on('close', function(code) {
31
+).on('close', function (code) {
32
if (code !== 0) {
33
console.error('Danger failed');
34
} else {
scripts/tasks/version-check.js
+5
-5
@@ -16,15 +16,15 @@ const reactVersion = /export default '([^']+)';/.exec(ReactVersionSrc)[1];
16
const versions = {
17
'packages/react/package.json': require('../../packages/react/package.json')
18
.version,
19
- 'packages/react-dom/package.json': require('../../packages/react-dom/package.json')
20
- .version,
21
- 'packages/react-test-renderer/package.json': require('../../packages/react-test-renderer/package.json')
22
- .version,
19
+ 'packages/react-dom/package.json':
20
+ require('../../packages/react-dom/package.json').version,
21
+ 'packages/react-test-renderer/package.json':
22
+ require('../../packages/react-test-renderer/package.json').version,
23
'packages/shared/ReactVersion.js': reactVersion,
24
};
25
26
let allVersionsMatch = true;
27
-Object.keys(versions).forEach(function(name) {
27
+Object.keys(versions).forEach(function (name) {
28
const version = versions[name];
29
if (version !== reactVersion) {
30
allVersionsMatch = false;
yarn.lock
+26
-21
@@ -2792,6 +2792,11 @@
2792
resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e"
2793
integrity sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==
2794
2795
+"@types/prettier@^1.0.0 || ^2.0.0":
2796
+ version "2.7.2"
2797
+ resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.2.tgz#6c2324641cc4ba050a8c710b2b251b377581fbf0"
2798
+ integrity sha512-KufADq8uQqo1pYKVIYzfKbJfBAc0sOeXqGbFaSpv8MRmC/zXgowNZmFcbngndGk922QDmOASEXUZCaY48gs4cg==
2799
+
2800
"@types/prettier@^2.0.0":
2801
version "2.2.3"
2802
resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.2.3.tgz#ef65165aea2924c9359205bf748865b8881753c0"
@@ -6368,10 +6373,10 @@ diff-sequences@^27.0.6:
6373
resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.0.6.tgz#3305cb2e55a033924054695cc66019fd7f8e5723"
6374
integrity sha512-ag6wfpBFyNXZ0p8pcuIDS//D8H062ZQJ3fzYxjpmeKjnz8W4pekL3AI8VohmyZmsWW2PWaHgjsmqR6L13101VQ==
6375
6371
-diff@4.0.1:
6372
- version "4.0.1"
6373
- resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.1.tgz#0c667cb467ebbb5cea7f14f135cc2dba7780a8ff"
6374
- integrity sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q==
6376
+diff@5.1.0:
6377
+ version "5.1.0"
6378
+ resolved "https://registry.yarnpkg.com/diff/-/diff-5.1.0.tgz#bc52d298c5ea8df9194800224445ed43ffc87e40"
6379
+ integrity sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw==
6380
6381
diff@^4.0.1:
6382
version "4.0.2"
@@ -11331,12 +11336,12 @@ magic-string@0.19.1:
11336
dependencies:
11337
vlq "^0.2.1"
11338
11334
-magic-string@0.25.1:
11335
- version "0.25.1"
11336
- resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.1.tgz#b1c248b399cd7485da0fe7385c2fc7011843266e"
11337
- integrity sha512-sCuTz6pYom8Rlt4ISPFn6wuFodbKMIHUMv4Qko9P17dpxb7s52KJTmRuZZqHdGmLCK9AOcDare039nRIcfdkEg==
11339
+magic-string@0.26.7:
11340
+ version "0.26.7"
11341
+ resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.26.7.tgz#caf7daf61b34e9982f8228c4527474dac8981d6f"
11342
+ integrity sha512-hX9XH3ziStPoPhJxLq1syWuZMxbDvGNbVchfrdCtanC7D13888bMFow61x8axrx+GfHLtVeAx2kxL7tTGRl+Ow==
11343
dependencies:
11339
- sourcemap-codec "^1.4.1"
11344
+ sourcemap-codec "^1.4.8"
11345
11346
magic-string@^0.25.2:
11347
version "0.25.6"
@@ -13368,10 +13373,10 @@ preserve@^0.2.0:
13373
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
13374
integrity sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=
13375
13371
-prettier@1.19.1, prettier@^1.0.0:
13372
- version "1.19.1"
13373
- resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb"
13374
- integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==
13376
+prettier@2.8.3:
13377
+ version "2.8.3"
13378
+ resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.3.tgz#ab697b1d3dd46fb4626fbe2f543afe0cc98d8632"
13379
+ integrity sha512-tJ/oJ4amDihPoufT5sM0Z1SKEuKay8LfVAMlbbhnnkvt6BUserZylqo2PN+p9KeljLr0OHa2rXHU1T8reeoTrw==
13380
13381
pretty-error@^2.1.1:
13382
version "2.1.1"
@@ -14439,18 +14444,18 @@ rollup-plugin-node-resolve@^2.1.1:
14444
builtin-modules "^1.1.0"
14445
resolve "^1.1.6"
14446
14442
-rollup-plugin-prettier@^0.6.0:
14443
- version "0.6.0"
14444
- resolved "https://registry.yarnpkg.com/rollup-plugin-prettier/-/rollup-plugin-prettier-0.6.0.tgz#3b53b4ac2def23f150f496cff9106f4042a4ade1"
14445
- integrity sha512-BgfyZ1biKcAaRNzfUyG/CeI5dFn+WsygK7kYjuXM6aL4m3t/53ZpJI2ZSMAeaKj6w2dj3CkOYbT0gulwh2SvKA==
14447
+rollup-plugin-prettier@^3.0.0:
14448
+ version "3.0.0"
14449
+ resolved "https://registry.yarnpkg.com/rollup-plugin-prettier/-/rollup-plugin-prettier-3.0.0.tgz#c208f31bc5ecef76ba69177bc9c1463667c9b19a"
14450
+ integrity sha512-E0UqeVX1F+ATrHsXKXIywddjK+iFKOeOGI/drZY/wVq/xfHPjghviIhsFz7I0Wfuzp8jeN+4L7kVwQ/X84mOBw==
14451
dependencies:
14447
- diff "4.0.1"
14452
+ "@types/prettier" "^1.0.0 || ^2.0.0"
14453
+ diff "5.1.0"
14454
lodash.hasin "4.5.2"
14455
lodash.isempty "4.4.0"
14456
lodash.isnil "4.0.0"
14457
lodash.omitby "4.6.0"
14452
- magic-string "0.25.1"
14453
- prettier "^1.0.0"
14458
+ magic-string "0.26.7"
14459
14460
rollup-plugin-replace@^2.2.0:
14461
version "2.2.0"
@@ -15169,7 +15174,7 @@ source-map@^0.7.3:
15174
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383"
15175
integrity sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==
15176
15172
-sourcemap-codec@^1.4.1, sourcemap-codec@^1.4.4, sourcemap-codec@^1.4.8:
15177
+sourcemap-codec@^1.4.4, sourcemap-codec@^1.4.8:
15178
version "1.4.8"
15179
resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4"
15180
integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==