Skip to content

Commit 416e258

Browse files
committed
rename wrap-warning-with-env-check
1 parent 1a9b639 commit 416e258

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed

scripts/babel/__tests__/wrap-warning-with-env-check-test.js renamed to scripts/babel/__tests__/lift-warning-conditional-argument-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
'use strict';
99

1010
let babel = require('@babel/core');
11-
let wrapWarningWithEnvCheck = require('../wrap-warning-with-env-check');
11+
let wrapWarningWithEnvCheck = require('../lift-warning-conditional-argument');
1212

1313
function transform(input) {
1414
return babel.transform(input, {
@@ -23,7 +23,7 @@ function compare(input, output) {
2323

2424
let oldEnv;
2525

26-
describe('wrap-warning-with-env-check', () => {
26+
describe('lift-warning-conditional-argument', () => {
2727
beforeEach(() => {
2828
oldEnv = process.env.NODE_ENV;
2929
process.env.NODE_ENV = '';

scripts/babel/wrap-warning-with-env-check.js renamed to scripts/babel/lift-warning-conditional-argument.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,8 @@ module.exports = function(babel, options) {
3232
//
3333
// into this:
3434
//
35-
// if (__DEV__) {
36-
// if (!condition) {
37-
// warning(false, argument, argument);
38-
// }
35+
// if (!condition) {
36+
// warning(false, argument, argument);
3937
// }
4038
//
4139
// The goal is to strip out warning calls entirely in production

scripts/jest/preprocessor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const pathToBabelPluginDevWithCode = require.resolve(
1717
'../error-codes/transform-error-messages'
1818
);
1919
const pathToBabelPluginWrapWarning = require.resolve(
20-
'../babel/wrap-warning-with-env-check'
20+
'../babel/lift-warning-conditional-argument'
2121
);
2222
const pathToBabelPluginAsyncToGenerator = require.resolve(
2323
'@babel/plugin-transform-async-to-generator'

scripts/rollup/build.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ function getBabelConfig(updateBabelOptions, bundleType, filename) {
125125
// Minify invariant messages
126126
require('../error-codes/transform-error-messages'),
127127
// Wrap warning() calls in a __DEV__ check so they are stripped from production.
128-
require('../babel/wrap-warning-with-env-check'),
128+
require('../babel/lift-warning-conditional-argument'),
129129
]),
130130
});
131131
case RN_OSS_DEV:
@@ -142,7 +142,7 @@ function getBabelConfig(updateBabelOptions, bundleType, filename) {
142142
{noMinify: true},
143143
],
144144
// Wrap warning() calls in a __DEV__ check so they are stripped from production.
145-
require('../babel/wrap-warning-with-env-check'),
145+
require('../babel/lift-warning-conditional-argument'),
146146
]),
147147
});
148148
case UMD_DEV:
@@ -158,7 +158,7 @@ function getBabelConfig(updateBabelOptions, bundleType, filename) {
158158
// Minify invariant messages
159159
require('../error-codes/transform-error-messages'),
160160
// Wrap warning() calls in a __DEV__ check so they are stripped from production.
161-
require('../babel/wrap-warning-with-env-check'),
161+
require('../babel/lift-warning-conditional-argument'),
162162
]),
163163
});
164164
default:

0 commit comments

Comments
 (0)