Skip to content

Commit c9cedd6

Browse files
committed
use flow-strip-types in rollup
1 parent c29471e commit c9cedd6

File tree

6 files changed

+39
-1
lines changed

6 files changed

+39
-1
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
"fbjs-scripts": "1.2.0",
6363
"filesize": "^6.0.1",
6464
"flow-bin": "^0.190.0",
65+
"flow-remove-types": "^2.196.1",
6566
"glob": "^7.1.6",
6667
"glob-stream": "^6.1.0",
6768
"google-closure-compiler": "^20200517.0.0",

packages/react-dom-bindings/src/shared/DOMNamespaces.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
*
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
6+
*
7+
* @noflow
68
*/
79

810
export const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';

packages/react-dom-bindings/src/shared/ReactControlledValuePropTypes.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
*
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
6+
*
7+
* @noflow
68
*/
79

810
const hasReadOnlyValue = {

packages/react-dom-bindings/src/shared/assertValidProps.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
*
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
6+
*
7+
* @noflow
68
*/
79

810
import voidElementTags from './voidElementTags';

scripts/rollup/build.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const rollup = require('rollup');
44
const babel = require('rollup-plugin-babel');
55
const closure = require('./plugins/closure-plugin');
66
const commonjs = require('rollup-plugin-commonjs');
7+
const flowRemoveTypes = require('flow-remove-types');
78
const prettier = require('rollup-plugin-prettier');
89
const replace = require('rollup-plugin-replace');
910
const stripBanner = require('rollup-plugin-strip-banner');
@@ -99,7 +100,6 @@ const syncWWWPath = argv['sync-www'];
99100
// Non-ES2015 stuff applied before closure compiler.
100101
const babelPlugins = [
101102
// These plugins filter out non-ES2015.
102-
'@babel/plugin-transform-flow-strip-types',
103103
['@babel/plugin-proposal-class-properties', {loose: true}],
104104
'syntax-trailing-function-commas',
105105
// These use loose mode which avoids embedding a runtime.
@@ -325,6 +325,16 @@ function getPlugins(
325325
bundleType === RN_FB_PROFILING;
326326
const shouldStayReadable = isFBWWWBundle || isRNBundle || forcePrettyOutput;
327327
return [
328+
{
329+
name: 'test-rollup',
330+
transform(code) {
331+
const transformed = flowRemoveTypes(code);
332+
return {
333+
code: transformed.toString(),
334+
map: transformed.generateMap(),
335+
};
336+
},
337+
},
328338
// Shim any modules that need forking in this environment.
329339
useForks(forks),
330340
// Ensure we don't try to bundle any fbjs modules.

yarn.lock

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7920,6 +7920,20 @@ flow-bin@^0.190.0:
79207920
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.190.0.tgz#cfc50e1474facf8150232a6c498fe66a6bb75969"
79217921
integrity sha512-Qo3bvN3cmGFXsq63ZxcHFZXQDvgx84fCuq8cXuKk5xbvuebBGwMqS+ku/rH+gEkciRrcTYrXqoSzb9b6ShcoJg==
79227922

7923+
flow-parser@^0.196.1:
7924+
version "0.196.1"
7925+
resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.196.1.tgz#3c31f102454518f0c68eeb99f57501c2a0c9bff0"
7926+
integrity sha512-V3yaKHyBWhl+LF6sxgbfqxMlwoFKs8UKh2DYTrGj1AHi9ST7Zyp+9ToF4l9eoL6l/DxdFwCNF3MAJ1vCVrgJmw==
7927+
7928+
flow-remove-types@^2.196.1:
7929+
version "2.196.1"
7930+
resolved "https://registry.yarnpkg.com/flow-remove-types/-/flow-remove-types-2.196.1.tgz#c77ab53679beb1b1ba420c16865cea714a67defc"
7931+
integrity sha512-pAEe2B/fKtV96MVGWQgmjP5Z1nLeFFe++r83ql1Zj86+p+3IujsbvwxiXCiF/SS6ObbB6TmciCxxd+FsOUyY3Q==
7932+
dependencies:
7933+
flow-parser "^0.196.1"
7934+
pirates "^3.0.2"
7935+
vlq "^0.2.1"
7936+
79237937
fluent-syntax@0.13.0:
79247938
version "0.13.0"
79257939
resolved "https://registry.yarnpkg.com/fluent-syntax/-/fluent-syntax-0.13.0.tgz#417144d99cba94ff474c422b3e6623d5a842855a"
@@ -12991,6 +13005,13 @@ pinpoint@^1.1.0:
1299113005
resolved "https://registry.yarnpkg.com/pinpoint/-/pinpoint-1.1.0.tgz#0cf7757a6977f1bf7f6a32207b709e377388e874"
1299213006
integrity sha1-DPd1eml38b9/ajIge3CeN3OI6HQ=
1299313007

13008+
pirates@^3.0.2:
13009+
version "3.0.2"
13010+
resolved "https://registry.yarnpkg.com/pirates/-/pirates-3.0.2.tgz#7e6f85413fd9161ab4e12b539b06010d85954bb9"
13011+
integrity sha512-c5CgUJq6H2k6MJz72Ak1F5sN9n9wlSlJyEnwvpm9/y3WB4E3pHBDT2c6PEiS1vyJvq2bUxUAIu0EGf8Cx4Ic7Q==
13012+
dependencies:
13013+
node-modules-regexp "^1.0.0"
13014+
1299413015
pirates@^4.0.0, pirates@^4.0.1:
1299513016
version "4.0.1"
1299613017
resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.1.tgz#643a92caf894566f91b2b986d2c66950a8e2fb87"

0 commit comments

Comments
 (0)