Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d84332c

Browse files
committed
Revert "test this"
This reverts commit fafc2e1.
1 parent fafc2e1 commit d84332c

21 files changed

+287
-381
lines changed

packages/create-subscription/src/createSubscription.js

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,14 @@ export function createSubscription<Property, Value>(
3636
}> {
3737
const {getCurrentValue, subscribe} = config;
3838

39-
if (__DEV__) {
40-
warningWithoutStack(
41-
typeof getCurrentValue === 'function',
42-
'Subscription must specify a getCurrentValue function',
43-
);
44-
}
45-
if (__DEV__) {
46-
warningWithoutStack(
47-
typeof subscribe === 'function',
48-
'Subscription must specify a subscribe function',
49-
);
50-
}
39+
warningWithoutStack(
40+
typeof getCurrentValue === 'function',
41+
'Subscription must specify a getCurrentValue function',
42+
);
43+
warningWithoutStack(
44+
typeof subscribe === 'function',
45+
'Subscription must specify a subscribe function',
46+
);
5147

5248
type Props = {
5349
children: (value: Value) => React$Element<any>,

packages/legacy-events/SyntheticEvent.js

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -284,18 +284,16 @@ function getPooledWarningPropertyDefinition(propName, getVal) {
284284

285285
function warn(action, result) {
286286
const warningCondition = false;
287-
if (__DEV__) {
288-
warningWithoutStack(
289-
warningCondition,
290-
"This synthetic event is reused for performance reasons. If you're seeing this, " +
291-
"you're %s `%s` on a released/nullified synthetic event. %s. " +
292-
'If you must keep the original synthetic event around, use event.persist(). ' +
293-
'See https://fb.me/react-event-pooling for more information.',
294-
action,
295-
propName,
296-
result,
297-
);
298-
}
287+
warningWithoutStack(
288+
warningCondition,
289+
"This synthetic event is reused for performance reasons. If you're seeing this, " +
290+
"you're %s `%s` on a released/nullified synthetic event. %s. " +
291+
'If you must keep the original synthetic event around, use event.persist(). ' +
292+
'See https://fb.me/react-event-pooling for more information.',
293+
action,
294+
propName,
295+
result,
296+
);
299297
}
300298
}
301299

packages/react-dom/src/client/ReactDOMSelect.js

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -49,25 +49,21 @@ function checkSelectPropTypes(props) {
4949
}
5050
const isArray = Array.isArray(props[propName]);
5151
if (props.multiple && !isArray) {
52-
if (__DEV__) {
53-
warning(
54-
false,
55-
'The `%s` prop supplied to <select> must be an array if ' +
56-
'`multiple` is true.%s',
57-
propName,
58-
getDeclarationErrorAddendum(),
59-
);
60-
}
52+
warning(
53+
false,
54+
'The `%s` prop supplied to <select> must be an array if ' +
55+
'`multiple` is true.%s',
56+
propName,
57+
getDeclarationErrorAddendum(),
58+
);
6159
} else if (!props.multiple && isArray) {
62-
if (__DEV__) {
63-
warning(
64-
false,
65-
'The `%s` prop supplied to <select> must be a scalar ' +
66-
'value if `multiple` is false.%s',
67-
propName,
68-
getDeclarationErrorAddendum(),
69-
);
70-
}
60+
warning(
61+
false,
62+
'The `%s` prop supplied to <select> must be a scalar ' +
63+
'value if `multiple` is false.%s',
64+
propName,
65+
getDeclarationErrorAddendum(),
66+
);
7167
}
7268
}
7369
}

packages/react-dom/src/server/ReactPartialRenderer.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -687,14 +687,12 @@ function resolve(
687687
);
688688
}
689689
} else {
690-
if (__DEV__) {
691-
warningWithoutStack(
692-
false,
693-
'%s.getChildContext(): childContextTypes must be defined in order to ' +
694-
'use getChildContext().',
695-
getComponentName(Component) || 'Unknown',
696-
);
697-
}
690+
warningWithoutStack(
691+
false,
692+
'%s.getChildContext(): childContextTypes must be defined in order to ' +
693+
'use getChildContext().',
694+
getComponentName(Component) || 'Unknown',
695+
);
698696
}
699697
}
700698
if (childContext) {

packages/react-dom/src/server/ReactPartialRendererHooks.js

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -393,17 +393,15 @@ export function useLayoutEffect(
393393
if (__DEV__) {
394394
currentHookNameInDev = 'useLayoutEffect';
395395
}
396-
if (__DEV__) {
397-
warning(
398-
false,
399-
'useLayoutEffect does nothing on the server, because its effect cannot ' +
400-
"be encoded into the server renderer's output format. This will lead " +
401-
'to a mismatch between the initial, non-hydrated UI and the intended ' +
402-
'UI. To avoid this, useLayoutEffect should only be used in ' +
403-
'components that render exclusively on the client. ' +
404-
'See https://fb.me/react-uselayouteffect-ssr for common fixes.',
405-
);
406-
}
396+
warning(
397+
false,
398+
'useLayoutEffect does nothing on the server, because its effect cannot ' +
399+
"be encoded into the server renderer's output format. This will lead " +
400+
'to a mismatch between the initial, non-hydrated UI and the intended ' +
401+
'UI. To avoid this, useLayoutEffect should only be used in ' +
402+
'components that render exclusively on the client. ' +
403+
'See https://fb.me/react-uselayouteffect-ssr for common fixes.',
404+
);
407405
}
408406

409407
function dispatchAction<A>(

packages/react-dom/src/shared/CSSPropertyOperations.js

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -148,19 +148,17 @@ export function validateShorthandPropertyCollisionInDev(
148148
continue;
149149
}
150150
warnedAbout[warningKey] = true;
151-
if (__DEV__) {
152-
warning(
153-
false,
154-
'%s a style property during rerender (%s) when a ' +
155-
'conflicting property is set (%s) can lead to styling bugs. To ' +
156-
"avoid this, don't mix shorthand and non-shorthand properties " +
157-
'for the same value; instead, replace the shorthand with ' +
158-
'separate values.',
159-
isValueEmpty(styleUpdates[originalKey]) ? 'Removing' : 'Updating',
160-
originalKey,
161-
correctOriginalKey,
162-
);
163-
}
151+
warning(
152+
false,
153+
'%s a style property during rerender (%s) when a ' +
154+
'conflicting property is set (%s) can lead to styling bugs. To ' +
155+
"avoid this, don't mix shorthand and non-shorthand properties " +
156+
'for the same value; instead, replace the shorthand with ' +
157+
'separate values.',
158+
isValueEmpty(styleUpdates[originalKey]) ? 'Removing' : 'Updating',
159+
originalKey,
160+
correctOriginalKey,
161+
);
164162
}
165163
}
166164
}

packages/react-dom/src/shared/ReactDOMInvalidARIAHook.js

Lines changed: 31 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -31,26 +31,22 @@ function validateProperty(tagName, name) {
3131
// If this is an aria-* attribute, but is not listed in the known DOM
3232
// DOM properties, then it is an invalid aria-* attribute.
3333
if (correctName == null) {
34-
if (__DEV__) {
35-
warning(
36-
false,
37-
'Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.',
38-
name,
39-
);
40-
}
34+
warning(
35+
false,
36+
'Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.',
37+
name,
38+
);
4139
warnedProperties[name] = true;
4240
return true;
4341
}
4442
// aria-* attributes should be lowercase; suggest the lowercase version.
4543
if (name !== correctName) {
46-
if (__DEV__) {
47-
warning(
48-
false,
49-
'Invalid ARIA attribute `%s`. Did you mean `%s`?',
50-
name,
51-
correctName,
52-
);
53-
}
44+
warning(
45+
false,
46+
'Invalid ARIA attribute `%s`. Did you mean `%s`?',
47+
name,
48+
correctName,
49+
);
5450
warnedProperties[name] = true;
5551
return true;
5652
}
@@ -70,14 +66,12 @@ function validateProperty(tagName, name) {
7066
}
7167
// aria-* attributes should be lowercase; suggest the lowercase version.
7268
if (name !== standardName) {
73-
if (__DEV__) {
74-
warning(
75-
false,
76-
'Unknown ARIA attribute `%s`. Did you mean `%s`?',
77-
name,
78-
standardName,
79-
);
80-
}
69+
warning(
70+
false,
71+
'Unknown ARIA attribute `%s`. Did you mean `%s`?',
72+
name,
73+
standardName,
74+
);
8175
warnedProperties[name] = true;
8276
return true;
8377
}
@@ -101,25 +95,21 @@ function warnInvalidARIAProps(type, props) {
10195
.join(', ');
10296

10397
if (invalidProps.length === 1) {
104-
if (__DEV__) {
105-
warning(
106-
false,
107-
'Invalid aria prop %s on <%s> tag. ' +
108-
'For details, see https://fb.me/invalid-aria-prop',
109-
unknownPropString,
110-
type,
111-
);
112-
}
98+
warning(
99+
false,
100+
'Invalid aria prop %s on <%s> tag. ' +
101+
'For details, see https://fb.me/invalid-aria-prop',
102+
unknownPropString,
103+
type,
104+
);
113105
} else if (invalidProps.length > 1) {
114-
if (__DEV__) {
115-
warning(
116-
false,
117-
'Invalid aria props %s on <%s> tag. ' +
118-
'For details, see https://fb.me/invalid-aria-prop',
119-
unknownPropString,
120-
type,
121-
);
122-
}
106+
warning(
107+
false,
108+
'Invalid aria props %s on <%s> tag. ' +
109+
'For details, see https://fb.me/invalid-aria-prop',
110+
unknownPropString,
111+
type,
112+
);
123113
}
124114
}
125115

packages/react-dom/src/shared/ReactDOMNullInputValuePropHook.js

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,21 @@ export function validateProperties(type, props) {
1717
if (props != null && props.value === null && !didWarnValueNull) {
1818
didWarnValueNull = true;
1919
if (type === 'select' && props.multiple) {
20-
if (__DEV__) {
21-
warning(
22-
false,
23-
'`value` prop on `%s` should not be null. ' +
24-
'Consider using an empty array when `multiple` is set to `true` ' +
25-
'to clear the component or `undefined` for uncontrolled components.',
26-
type,
27-
);
28-
}
20+
warning(
21+
false,
22+
'`value` prop on `%s` should not be null. ' +
23+
'Consider using an empty array when `multiple` is set to `true` ' +
24+
'to clear the component or `undefined` for uncontrolled components.',
25+
type,
26+
);
2927
} else {
30-
if (__DEV__) {
31-
warning(
32-
false,
33-
'`value` prop on `%s` should not be null. ' +
34-
'Consider using an empty string to clear the component or `undefined` ' +
35-
'for uncontrolled components.',
36-
type,
37-
);
38-
}
28+
warning(
29+
false,
30+
'`value` prop on `%s` should not be null. ' +
31+
'Consider using an empty string to clear the component or `undefined` ' +
32+
'for uncontrolled components.',
33+
type,
34+
);
3935
}
4036
}
4137
}

packages/react-dom/src/shared/ReactDOMUnknownPropertyHook.js

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -267,27 +267,23 @@ const warnUnknownProperties = function(type, props, canUseEventSystem) {
267267
.map(prop => '`' + prop + '`')
268268
.join(', ');
269269
if (unknownProps.length === 1) {
270-
if (__DEV__) {
271-
warning(
272-
false,
273-
'Invalid value for prop %s on <%s> tag. Either remove it from the element, ' +
274-
'or pass a string or number value to keep it in the DOM. ' +
275-
'For details, see https://fb.me/react-attribute-behavior',
276-
unknownPropString,
277-
type,
278-
);
279-
}
270+
warning(
271+
false,
272+
'Invalid value for prop %s on <%s> tag. Either remove it from the element, ' +
273+
'or pass a string or number value to keep it in the DOM. ' +
274+
'For details, see https://fb.me/react-attribute-behavior',
275+
unknownPropString,
276+
type,
277+
);
280278
} else if (unknownProps.length > 1) {
281-
if (__DEV__) {
282-
warning(
283-
false,
284-
'Invalid values for props %s on <%s> tag. Either remove them from the element, ' +
285-
'or pass a string or number value to keep them in the DOM. ' +
286-
'For details, see https://fb.me/react-attribute-behavior',
287-
unknownPropString,
288-
type,
289-
);
290-
}
279+
warning(
280+
false,
281+
'Invalid values for props %s on <%s> tag. Either remove them from the element, ' +
282+
'or pass a string or number value to keep them in the DOM. ' +
283+
'For details, see https://fb.me/react-attribute-behavior',
284+
unknownPropString,
285+
type,
286+
);
291287
}
292288
};
293289

0 commit comments

Comments
 (0)