2017-04-05 16:47:29 +01:00
|
|
|
'use strict';
|
|
|
|
|
|
2020-05-27 19:43:08 -07:00
|
|
|
const RELEASE_CHANNEL = process.env.RELEASE_CHANNEL;
|
|
|
|
|
|
|
|
|
|
const __EXPERIMENTAL__ =
|
|
|
|
|
typeof RELEASE_CHANNEL === 'string'
|
|
|
|
|
? RELEASE_CHANNEL === 'experimental'
|
|
|
|
|
: true;
|
|
|
|
|
|
2017-04-05 16:47:29 +01:00
|
|
|
const bundleTypes = {
|
2020-05-28 15:56:34 -07:00
|
|
|
NODE_ES2015: 'NODE_ES2015',
|
2020-11-13 08:57:45 -05:00
|
|
|
NODE_ESM: 'NODE_ESM',
|
2017-04-05 16:47:29 +01:00
|
|
|
UMD_DEV: 'UMD_DEV',
|
|
|
|
|
UMD_PROD: 'UMD_PROD',
|
2018-09-13 17:44:08 -07:00
|
|
|
UMD_PROFILING: 'UMD_PROFILING',
|
2017-04-05 16:47:29 +01:00
|
|
|
NODE_DEV: 'NODE_DEV',
|
|
|
|
|
NODE_PROD: 'NODE_PROD',
|
2018-06-11 13:16:27 -07:00
|
|
|
NODE_PROFILING: 'NODE_PROFILING',
|
2018-04-18 13:16:50 -07:00
|
|
|
FB_WWW_DEV: 'FB_WWW_DEV',
|
|
|
|
|
FB_WWW_PROD: 'FB_WWW_PROD',
|
2018-06-26 13:28:41 -07:00
|
|
|
FB_WWW_PROFILING: 'FB_WWW_PROFILING',
|
2018-04-18 13:16:50 -07:00
|
|
|
RN_OSS_DEV: 'RN_OSS_DEV',
|
|
|
|
|
RN_OSS_PROD: 'RN_OSS_PROD',
|
2018-06-11 13:16:27 -07:00
|
|
|
RN_OSS_PROFILING: 'RN_OSS_PROFILING',
|
2018-04-18 13:16:50 -07:00
|
|
|
RN_FB_DEV: 'RN_FB_DEV',
|
|
|
|
|
RN_FB_PROD: 'RN_FB_PROD',
|
2018-06-26 13:28:41 -07:00
|
|
|
RN_FB_PROFILING: 'RN_FB_PROFILING',
|
2017-04-05 16:47:29 +01:00
|
|
|
};
|
|
|
|
|
|
2019-04-25 17:24:01 +02:00
|
|
|
const {
|
2020-05-28 15:56:34 -07:00
|
|
|
NODE_ES2015,
|
2020-11-13 08:57:45 -05:00
|
|
|
NODE_ESM,
|
2019-04-25 17:24:01 +02:00
|
|
|
UMD_DEV,
|
|
|
|
|
UMD_PROD,
|
|
|
|
|
UMD_PROFILING,
|
|
|
|
|
NODE_DEV,
|
|
|
|
|
NODE_PROD,
|
|
|
|
|
NODE_PROFILING,
|
|
|
|
|
FB_WWW_DEV,
|
|
|
|
|
FB_WWW_PROD,
|
|
|
|
|
FB_WWW_PROFILING,
|
|
|
|
|
RN_OSS_DEV,
|
|
|
|
|
RN_OSS_PROD,
|
|
|
|
|
RN_OSS_PROFILING,
|
|
|
|
|
RN_FB_DEV,
|
|
|
|
|
RN_FB_PROD,
|
|
|
|
|
RN_FB_PROFILING,
|
|
|
|
|
} = bundleTypes;
|
2017-04-05 16:47:29 +01:00
|
|
|
|
2017-10-11 14:29:26 -04:00
|
|
|
const moduleTypes = {
|
2019-04-25 17:24:01 +02:00
|
|
|
// React
|
2017-10-11 14:29:26 -04:00
|
|
|
ISOMORPHIC: 'ISOMORPHIC',
|
2019-04-25 17:24:01 +02:00
|
|
|
// Individual renderers. They bundle the reconciler. (e.g. ReactDOM)
|
2017-10-11 14:29:26 -04:00
|
|
|
RENDERER: 'RENDERER',
|
2019-04-25 17:24:01 +02:00
|
|
|
// Helper packages that access specific renderer's internals. (e.g. TestUtils)
|
Reorganize code structure (#11288)
* Move files and tests to more meaningful places
* Fix the build
Now that we import reconciler via react-reconciler, I needed to make a few tweaks.
* Update sizes
* Move @preventMunge directive to FB header
* Revert unintentional change
* Fix Flow coverage
I forgot to @flow-ify those files. This uncovered some issues.
* Prettier, I love you but you're bringing me down
Prettier, I love you but you're bringing me down
Like a rat in a cage
Pulling minimum wage
Prettier, I love you but you're bringing me down
Prettier, you're safer and you're wasting my time
Our records all show you were filthy but fine
But they shuttered your stores
When you opened the doors
To the cops who were bored once they'd run out of crime
Prettier, you're perfect, oh, please don't change a thing
Your mild billionaire mayor's now convinced he's a king
So the boring collect
I mean all disrespect
In the neighborhood bars I'd once dreamt I would drink
Prettier, I love you but you're freaking me out
There's a ton of the twist but we're fresh out of shout
Like a death in the hall
That you hear through your wall
Prettier, I love you but you're freaking me out
Prettier, I love you but you're bringing me down
Prettier, I love you but you're bringing me down
Like a death of the heart
Jesus, where do I start?
But you're still the one pool where I'd happily drown
And oh! Take me off your mailing list
For kids who think it still exists
Yes, for those who think it still exists
Maybe I'm wrong and maybe you're right
Maybe I'm wrong and maybe you're right
Maybe you're right, maybe I'm wrong
And just maybe you're right
And oh! Maybe mother told you true
And there'll always be somebody there for you
And you'll never be alone
But maybe she's wrong and maybe I'm right
And just maybe she's wrong
Maybe she's wrong and maybe I'm right
And if so, here's this song!
2017-10-19 19:50:24 +01:00
|
|
|
RENDERER_UTILS: 'RENDERER_UTILS',
|
2019-04-25 17:24:01 +02:00
|
|
|
// Standalone reconciler for third-party renderers.
|
2017-10-11 14:29:26 -04:00
|
|
|
RECONCILER: 'RECONCILER',
|
|
|
|
|
};
|
|
|
|
|
|
2021-06-14 15:54:30 -04:00
|
|
|
const {ISOMORPHIC, RENDERER, RENDERER_UTILS, RECONCILER} = moduleTypes;
|
2017-10-11 14:29:26 -04:00
|
|
|
|
2017-04-05 16:47:29 +01:00
|
|
|
const bundles = [
|
|
|
|
|
/******* Isomorphic *******/
|
|
|
|
|
{
|
2018-04-18 13:16:50 -07:00
|
|
|
bundleTypes: [
|
|
|
|
|
UMD_DEV,
|
|
|
|
|
UMD_PROD,
|
2018-09-13 17:44:08 -07:00
|
|
|
UMD_PROFILING,
|
2018-04-18 13:16:50 -07:00
|
|
|
NODE_DEV,
|
|
|
|
|
NODE_PROD,
|
|
|
|
|
FB_WWW_DEV,
|
|
|
|
|
FB_WWW_PROD,
|
2018-09-01 12:00:00 -07:00
|
|
|
FB_WWW_PROFILING,
|
2020-05-29 15:32:38 -07:00
|
|
|
RN_FB_DEV,
|
|
|
|
|
RN_FB_PROD,
|
|
|
|
|
RN_FB_PROFILING,
|
2018-04-18 13:16:50 -07:00
|
|
|
],
|
2017-10-11 14:29:26 -04:00
|
|
|
moduleType: ISOMORPHIC,
|
2017-10-25 02:55:00 +03:00
|
|
|
entry: 'react',
|
|
|
|
|
global: 'React',
|
|
|
|
|
externals: [],
|
2017-04-05 16:47:29 +01:00
|
|
|
},
|
|
|
|
|
|
2020-12-10 02:14:50 +00:00
|
|
|
/******* Isomorphic Shared Subset *******/
|
2020-11-20 11:47:13 -05:00
|
|
|
{
|
|
|
|
|
bundleTypes: [NODE_DEV, NODE_PROD],
|
|
|
|
|
moduleType: ISOMORPHIC,
|
2020-12-10 02:14:50 +00:00
|
|
|
entry: 'react/unstable-shared-subset',
|
2020-11-20 11:47:13 -05:00
|
|
|
global: 'React',
|
|
|
|
|
externals: [],
|
|
|
|
|
},
|
|
|
|
|
|
2020-03-17 13:22:19 -07:00
|
|
|
/******* React JSX Runtime *******/
|
|
|
|
|
{
|
|
|
|
|
bundleTypes: [
|
|
|
|
|
NODE_DEV,
|
|
|
|
|
NODE_PROD,
|
|
|
|
|
NODE_PROFILING,
|
2020-05-01 16:07:36 +01:00
|
|
|
// TODO: use on WWW.
|
2020-05-29 15:32:38 -07:00
|
|
|
RN_FB_DEV,
|
|
|
|
|
RN_FB_PROD,
|
|
|
|
|
RN_FB_PROFILING,
|
2020-03-17 13:22:19 -07:00
|
|
|
],
|
|
|
|
|
moduleType: ISOMORPHIC,
|
|
|
|
|
entry: 'react/jsx-runtime',
|
|
|
|
|
global: 'JSXRuntime',
|
|
|
|
|
externals: ['react'],
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/******* React JSX DEV Runtime *******/
|
|
|
|
|
{
|
|
|
|
|
bundleTypes: [
|
|
|
|
|
NODE_DEV,
|
|
|
|
|
NODE_PROD,
|
|
|
|
|
NODE_PROFILING,
|
|
|
|
|
FB_WWW_DEV,
|
|
|
|
|
FB_WWW_PROD,
|
|
|
|
|
FB_WWW_PROFILING,
|
2020-05-29 15:32:38 -07:00
|
|
|
RN_FB_DEV,
|
|
|
|
|
RN_FB_PROD,
|
|
|
|
|
RN_FB_PROFILING,
|
2020-03-17 13:22:19 -07:00
|
|
|
],
|
|
|
|
|
moduleType: ISOMORPHIC,
|
|
|
|
|
entry: 'react/jsx-dev-runtime',
|
|
|
|
|
global: 'JSXDEVRuntime',
|
|
|
|
|
externals: ['react'],
|
|
|
|
|
},
|
|
|
|
|
|
2020-05-12 12:21:45 -04:00
|
|
|
/******* React Fetch Browser (experimental, new) *******/
|
2020-04-29 19:14:15 +01:00
|
|
|
{
|
2020-05-28 16:12:37 -07:00
|
|
|
bundleTypes: [NODE_DEV, NODE_PROD],
|
2020-04-29 19:14:15 +01:00
|
|
|
moduleType: ISOMORPHIC,
|
2020-05-12 12:21:45 -04:00
|
|
|
entry: 'react-fetch/index.browser',
|
|
|
|
|
global: 'ReactFetch',
|
|
|
|
|
externals: ['react'],
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/******* React Fetch Node (experimental, new) *******/
|
|
|
|
|
{
|
|
|
|
|
bundleTypes: [NODE_DEV, NODE_PROD],
|
|
|
|
|
moduleType: ISOMORPHIC,
|
|
|
|
|
entry: 'react-fetch/index.node',
|
|
|
|
|
global: 'ReactFetch',
|
|
|
|
|
externals: ['react', 'http', 'https'],
|
2020-04-29 19:14:15 +01:00
|
|
|
},
|
|
|
|
|
|
2020-12-09 02:37:29 +00:00
|
|
|
/******* React FS Browser (experimental, new) *******/
|
|
|
|
|
{
|
|
|
|
|
bundleTypes: [NODE_DEV, NODE_PROD],
|
|
|
|
|
moduleType: ISOMORPHIC,
|
2020-12-10 06:15:37 +00:00
|
|
|
entry: 'react-fs/index.browser.server',
|
2020-12-09 02:37:29 +00:00
|
|
|
global: 'ReactFilesystem',
|
|
|
|
|
externals: [],
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/******* React FS Node (experimental, new) *******/
|
|
|
|
|
{
|
|
|
|
|
bundleTypes: [NODE_DEV, NODE_PROD],
|
|
|
|
|
moduleType: ISOMORPHIC,
|
2020-12-10 06:15:37 +00:00
|
|
|
entry: 'react-fs/index.node.server',
|
2020-12-09 02:37:29 +00:00
|
|
|
global: 'ReactFilesystem',
|
|
|
|
|
externals: ['react', 'fs/promises', 'path'],
|
|
|
|
|
},
|
|
|
|
|
|
2020-12-04 17:27:33 +00:00
|
|
|
/******* React PG Browser (experimental, new) *******/
|
|
|
|
|
{
|
|
|
|
|
bundleTypes: [NODE_DEV, NODE_PROD],
|
|
|
|
|
moduleType: ISOMORPHIC,
|
2020-12-10 06:15:37 +00:00
|
|
|
entry: 'react-pg/index.browser.server',
|
2020-12-04 17:27:33 +00:00
|
|
|
global: 'ReactPostgres',
|
|
|
|
|
externals: [],
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/******* React PG Node (experimental, new) *******/
|
|
|
|
|
{
|
|
|
|
|
bundleTypes: [NODE_DEV, NODE_PROD],
|
|
|
|
|
moduleType: ISOMORPHIC,
|
2020-12-10 06:15:37 +00:00
|
|
|
entry: 'react-pg/index.node.server',
|
2020-12-04 17:27:33 +00:00
|
|
|
global: 'ReactPostgres',
|
|
|
|
|
externals: ['react', 'pg'],
|
|
|
|
|
},
|
|
|
|
|
|
2017-04-05 16:47:29 +01:00
|
|
|
/******* React DOM *******/
|
|
|
|
|
{
|
2018-04-18 13:16:50 -07:00
|
|
|
bundleTypes: [
|
|
|
|
|
UMD_DEV,
|
|
|
|
|
UMD_PROD,
|
2018-09-13 17:44:08 -07:00
|
|
|
UMD_PROFILING,
|
2018-04-18 13:16:50 -07:00
|
|
|
NODE_DEV,
|
|
|
|
|
NODE_PROD,
|
2018-06-11 13:16:27 -07:00
|
|
|
NODE_PROFILING,
|
2018-04-18 13:16:50 -07:00
|
|
|
FB_WWW_DEV,
|
|
|
|
|
FB_WWW_PROD,
|
2018-06-26 13:28:41 -07:00
|
|
|
FB_WWW_PROFILING,
|
2018-04-18 13:16:50 -07:00
|
|
|
],
|
2017-10-11 14:29:26 -04:00
|
|
|
moduleType: RENDERER,
|
2017-10-25 02:55:00 +03:00
|
|
|
entry: 'react-dom',
|
|
|
|
|
global: 'ReactDOM',
|
2018-09-01 12:00:00 -07:00
|
|
|
externals: ['react'],
|
2017-04-19 16:45:31 -07:00
|
|
|
},
|
2017-10-25 02:55:00 +03:00
|
|
|
|
2020-03-12 11:38:32 -07:00
|
|
|
/******* React DOM - www - Uses forked reconciler *******/
|
|
|
|
|
{
|
|
|
|
|
moduleType: RENDERER,
|
|
|
|
|
bundleTypes: [FB_WWW_DEV, FB_WWW_PROD, FB_WWW_PROFILING],
|
|
|
|
|
entry: 'react-dom',
|
|
|
|
|
global: 'ReactDOMForked',
|
|
|
|
|
enableNewReconciler: true,
|
|
|
|
|
externals: ['react'],
|
|
|
|
|
},
|
|
|
|
|
|
2018-11-30 11:52:34 +00:00
|
|
|
/******* Test Utils *******/
|
2017-04-19 16:45:31 -07:00
|
|
|
{
|
Reorganize code structure (#11288)
* Move files and tests to more meaningful places
* Fix the build
Now that we import reconciler via react-reconciler, I needed to make a few tweaks.
* Update sizes
* Move @preventMunge directive to FB header
* Revert unintentional change
* Fix Flow coverage
I forgot to @flow-ify those files. This uncovered some issues.
* Prettier, I love you but you're bringing me down
Prettier, I love you but you're bringing me down
Like a rat in a cage
Pulling minimum wage
Prettier, I love you but you're bringing me down
Prettier, you're safer and you're wasting my time
Our records all show you were filthy but fine
But they shuttered your stores
When you opened the doors
To the cops who were bored once they'd run out of crime
Prettier, you're perfect, oh, please don't change a thing
Your mild billionaire mayor's now convinced he's a king
So the boring collect
I mean all disrespect
In the neighborhood bars I'd once dreamt I would drink
Prettier, I love you but you're freaking me out
There's a ton of the twist but we're fresh out of shout
Like a death in the hall
That you hear through your wall
Prettier, I love you but you're freaking me out
Prettier, I love you but you're bringing me down
Prettier, I love you but you're bringing me down
Like a death of the heart
Jesus, where do I start?
But you're still the one pool where I'd happily drown
And oh! Take me off your mailing list
For kids who think it still exists
Yes, for those who think it still exists
Maybe I'm wrong and maybe you're right
Maybe I'm wrong and maybe you're right
Maybe you're right, maybe I'm wrong
And just maybe you're right
And oh! Maybe mother told you true
And there'll always be somebody there for you
And you'll never be alone
But maybe she's wrong and maybe I'm right
And just maybe she's wrong
Maybe she's wrong and maybe I'm right
And if so, here's this song!
2017-10-19 19:50:24 +01:00
|
|
|
moduleType: RENDERER_UTILS,
|
2018-04-18 13:16:50 -07:00
|
|
|
bundleTypes: [FB_WWW_DEV, NODE_DEV, NODE_PROD, UMD_DEV, UMD_PROD],
|
2017-10-25 02:55:00 +03:00
|
|
|
entry: 'react-dom/test-utils',
|
|
|
|
|
global: 'ReactTestUtils',
|
|
|
|
|
externals: ['react', 'react-dom'],
|
2017-04-05 16:47:29 +01:00
|
|
|
},
|
2017-10-25 02:55:00 +03:00
|
|
|
|
2020-02-03 23:31:31 +00:00
|
|
|
/******* React DOM - www - Testing *******/
|
|
|
|
|
{
|
|
|
|
|
moduleType: RENDERER,
|
2020-05-01 16:07:36 +01:00
|
|
|
bundleTypes: [FB_WWW_DEV, FB_WWW_PROD],
|
2020-02-03 23:31:31 +00:00
|
|
|
entry: 'react-dom/testing',
|
|
|
|
|
global: 'ReactDOMTesting',
|
|
|
|
|
externals: ['react'],
|
|
|
|
|
},
|
|
|
|
|
|
2017-04-05 16:47:29 +01:00
|
|
|
/******* React DOM Server *******/
|
2017-05-17 17:19:11 -07:00
|
|
|
{
|
2021-04-22 19:54:29 -04:00
|
|
|
bundleTypes: __EXPERIMENTAL__
|
|
|
|
|
? [UMD_DEV, UMD_PROD, NODE_DEV, NODE_PROD]
|
|
|
|
|
: [UMD_DEV, UMD_PROD, NODE_DEV, NODE_PROD, FB_WWW_DEV, FB_WWW_PROD],
|
2021-06-14 15:54:30 -04:00
|
|
|
moduleType: RENDERER,
|
2021-06-14 19:23:19 -04:00
|
|
|
entry: 'react-dom/src/server/ReactDOMLegacyServerBrowser',
|
|
|
|
|
name: 'react-dom-server-legacy.browser',
|
2017-10-25 02:55:00 +03:00
|
|
|
global: 'ReactDOMServer',
|
2018-09-01 12:00:00 -07:00
|
|
|
externals: ['react'],
|
2019-08-08 17:46:35 -07:00
|
|
|
babel: opts =>
|
|
|
|
|
Object.assign({}, opts, {
|
|
|
|
|
plugins: opts.plugins.concat([
|
|
|
|
|
[require.resolve('@babel/plugin-transform-classes'), {loose: true}],
|
|
|
|
|
]),
|
|
|
|
|
}),
|
2017-04-05 16:47:29 +01:00
|
|
|
},
|
2017-06-24 22:31:42 -07:00
|
|
|
{
|
2017-06-28 16:13:58 -07:00
|
|
|
bundleTypes: [NODE_DEV, NODE_PROD],
|
2021-06-14 15:54:30 -04:00
|
|
|
moduleType: RENDERER,
|
2021-06-14 19:23:19 -04:00
|
|
|
entry: 'react-dom/src/server/ReactDOMLegacyServerNode',
|
|
|
|
|
name: 'react-dom-server-legacy.node',
|
2018-09-01 12:00:00 -07:00
|
|
|
externals: ['react', 'stream'],
|
2019-08-08 17:46:35 -07:00
|
|
|
babel: opts =>
|
|
|
|
|
Object.assign({}, opts, {
|
|
|
|
|
plugins: opts.plugins.concat([
|
|
|
|
|
[require.resolve('@babel/plugin-transform-classes'), {loose: true}],
|
|
|
|
|
]),
|
|
|
|
|
}),
|
2017-06-24 22:31:42 -07:00
|
|
|
},
|
|
|
|
|
|
2018-11-30 11:38:22 -08:00
|
|
|
/******* React DOM Fizz Server *******/
|
|
|
|
|
{
|
2021-06-02 16:13:19 +01:00
|
|
|
bundleTypes: [NODE_DEV, NODE_PROD, UMD_DEV, UMD_PROD],
|
2018-11-30 11:38:22 -08:00
|
|
|
moduleType: RENDERER,
|
2021-06-14 19:23:19 -04:00
|
|
|
entry: 'react-dom/src/server/ReactDOMFizzServerBrowser',
|
|
|
|
|
name: 'react-dom-server.browser',
|
|
|
|
|
global: 'ReactDOMServer',
|
|
|
|
|
externals: ['react'],
|
2018-11-30 11:38:22 -08:00
|
|
|
},
|
|
|
|
|
{
|
2021-06-02 16:13:19 +01:00
|
|
|
bundleTypes: [NODE_DEV, NODE_PROD],
|
2018-11-30 11:38:22 -08:00
|
|
|
moduleType: RENDERER,
|
2021-06-14 19:23:19 -04:00
|
|
|
entry: 'react-dom/src/server/ReactDOMFizzServerNode',
|
|
|
|
|
name: 'react-dom-server.node',
|
|
|
|
|
global: 'ReactDOMServer',
|
|
|
|
|
externals: ['react'],
|
2018-11-30 11:38:22 -08:00
|
|
|
},
|
2021-04-22 19:54:29 -04:00
|
|
|
{
|
|
|
|
|
bundleTypes: __EXPERIMENTAL__ ? [FB_WWW_DEV, FB_WWW_PROD] : [],
|
|
|
|
|
moduleType: RENDERER,
|
|
|
|
|
entry: 'react-server-dom-relay/src/ReactDOMServerFB',
|
|
|
|
|
global: 'ReactDOMServer',
|
2021-06-14 19:23:19 -04:00
|
|
|
externals: ['react'],
|
2021-04-22 19:54:29 -04:00
|
|
|
},
|
2018-11-30 11:38:22 -08:00
|
|
|
|
2020-12-08 08:08:57 -05:00
|
|
|
/******* React Server DOM Webpack Writer *******/
|
2019-10-29 14:45:47 -07:00
|
|
|
{
|
|
|
|
|
bundleTypes: [NODE_DEV, NODE_PROD, UMD_DEV, UMD_PROD],
|
|
|
|
|
moduleType: RENDERER,
|
2020-12-08 08:08:57 -05:00
|
|
|
entry: 'react-server-dom-webpack/writer.browser.server',
|
|
|
|
|
global: 'ReactServerDOMWriter',
|
2021-06-14 19:23:19 -04:00
|
|
|
externals: ['react'],
|
2019-10-29 14:45:47 -07:00
|
|
|
},
|
|
|
|
|
{
|
2020-02-19 17:59:42 +00:00
|
|
|
bundleTypes: [NODE_DEV, NODE_PROD],
|
2019-10-29 14:45:47 -07:00
|
|
|
moduleType: RENDERER,
|
2020-12-08 08:08:57 -05:00
|
|
|
entry: 'react-server-dom-webpack/writer.node.server',
|
|
|
|
|
global: 'ReactServerDOMWriter',
|
2021-06-14 19:23:19 -04:00
|
|
|
externals: ['react'],
|
2019-10-29 14:45:47 -07:00
|
|
|
},
|
|
|
|
|
|
2020-12-08 08:08:57 -05:00
|
|
|
/******* React Server DOM Webpack Reader *******/
|
2019-10-29 14:45:47 -07:00
|
|
|
{
|
2020-02-19 17:59:42 +00:00
|
|
|
bundleTypes: [NODE_DEV, NODE_PROD, UMD_DEV, UMD_PROD],
|
2019-10-29 14:45:47 -07:00
|
|
|
moduleType: RENDERER,
|
2020-12-08 08:08:57 -05:00
|
|
|
entry: 'react-server-dom-webpack',
|
|
|
|
|
global: 'ReactServerDOMReader',
|
2019-10-29 14:45:47 -07:00
|
|
|
externals: ['react'],
|
|
|
|
|
},
|
|
|
|
|
|
2020-12-08 08:08:57 -05:00
|
|
|
/******* React Server DOM Webpack Plugin *******/
|
2020-04-03 14:04:56 -07:00
|
|
|
{
|
2020-05-28 15:56:34 -07:00
|
|
|
bundleTypes: [NODE_ES2015],
|
2020-04-03 14:04:56 -07:00
|
|
|
moduleType: RENDERER_UTILS,
|
2020-12-08 08:08:57 -05:00
|
|
|
entry: 'react-server-dom-webpack/plugin',
|
|
|
|
|
global: 'ReactServerWebpackPlugin',
|
2020-12-07 12:10:18 -05:00
|
|
|
externals: ['fs', 'path', 'url', 'neo-async'],
|
2020-04-03 14:04:56 -07:00
|
|
|
},
|
|
|
|
|
|
2020-12-08 08:08:57 -05:00
|
|
|
/******* React Server DOM Webpack Node.js Loader *******/
|
2020-11-16 23:46:27 -05:00
|
|
|
{
|
|
|
|
|
bundleTypes: [NODE_ESM],
|
|
|
|
|
moduleType: RENDERER_UTILS,
|
2020-12-08 08:08:57 -05:00
|
|
|
entry: 'react-server-dom-webpack/node-loader',
|
|
|
|
|
global: 'ReactServerWebpackNodeLoader',
|
2020-11-30 17:37:27 -05:00
|
|
|
externals: ['acorn'],
|
2020-11-16 23:46:27 -05:00
|
|
|
},
|
|
|
|
|
|
2020-12-08 08:08:57 -05:00
|
|
|
/******* React Server DOM Webpack Node.js CommonJS Loader *******/
|
2020-11-16 23:46:27 -05:00
|
|
|
{
|
|
|
|
|
bundleTypes: [NODE_ES2015],
|
|
|
|
|
moduleType: RENDERER_UTILS,
|
2020-12-08 08:08:57 -05:00
|
|
|
entry: 'react-server-dom-webpack/node-register',
|
2020-11-16 23:46:27 -05:00
|
|
|
global: 'ReactFlightWebpackNodeRegister',
|
2020-11-30 17:25:56 -05:00
|
|
|
externals: ['url', 'module'],
|
2020-11-16 23:46:27 -05:00
|
|
|
},
|
|
|
|
|
|
2020-12-08 08:08:57 -05:00
|
|
|
/******* React Server DOM Relay Writer *******/
|
2020-03-07 11:23:30 -08:00
|
|
|
{
|
|
|
|
|
bundleTypes: [FB_WWW_DEV, FB_WWW_PROD],
|
|
|
|
|
moduleType: RENDERER,
|
2020-12-08 08:08:57 -05:00
|
|
|
entry: 'react-server-dom-relay/server',
|
|
|
|
|
global: 'ReactFlightDOMRelayServer', // TODO: Rename to Writer
|
2020-03-10 14:55:04 -07:00
|
|
|
externals: [
|
|
|
|
|
'react',
|
|
|
|
|
'ReactFlightDOMRelayServerIntegration',
|
2020-10-29 20:57:31 -04:00
|
|
|
'JSResourceReference',
|
2020-03-10 14:55:04 -07:00
|
|
|
],
|
2020-03-07 11:23:30 -08:00
|
|
|
},
|
|
|
|
|
|
2020-12-08 08:08:57 -05:00
|
|
|
/******* React Server DOM Relay Reader *******/
|
2020-03-07 11:23:30 -08:00
|
|
|
{
|
|
|
|
|
bundleTypes: [FB_WWW_DEV, FB_WWW_PROD],
|
|
|
|
|
moduleType: RENDERER,
|
2020-12-08 08:08:57 -05:00
|
|
|
entry: 'react-server-dom-relay',
|
|
|
|
|
global: 'ReactFlightDOMRelayClient', // TODO: Rename to Reader
|
2020-10-29 20:57:31 -04:00
|
|
|
externals: [
|
|
|
|
|
'react',
|
|
|
|
|
'ReactFlightDOMRelayClientIntegration',
|
|
|
|
|
'JSResourceReference',
|
|
|
|
|
],
|
2020-03-07 11:23:30 -08:00
|
|
|
},
|
|
|
|
|
|
2020-12-08 08:08:57 -05:00
|
|
|
/******* React Server Native Relay Writer *******/
|
2020-11-02 21:49:48 -05:00
|
|
|
{
|
|
|
|
|
bundleTypes: [RN_FB_DEV, RN_FB_PROD],
|
|
|
|
|
moduleType: RENDERER,
|
2020-12-08 08:08:57 -05:00
|
|
|
entry: 'react-server-native-relay/server',
|
|
|
|
|
global: 'ReactFlightNativeRelayServer', // TODO: Rename to Writer
|
2020-11-02 21:49:48 -05:00
|
|
|
externals: [
|
|
|
|
|
'react',
|
|
|
|
|
'ReactFlightNativeRelayServerIntegration',
|
|
|
|
|
'JSResourceReferenceImpl',
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
|
2020-12-08 08:08:57 -05:00
|
|
|
/******* React Server Native Relay Reader *******/
|
2020-11-02 21:49:48 -05:00
|
|
|
{
|
|
|
|
|
bundleTypes: [RN_FB_DEV, RN_FB_PROD],
|
|
|
|
|
moduleType: RENDERER,
|
2020-12-08 08:08:57 -05:00
|
|
|
entry: 'react-server-native-relay',
|
|
|
|
|
global: 'ReactFlightNativeRelayClient', // TODO: Rename to Reader
|
2020-11-02 21:49:48 -05:00
|
|
|
externals: [
|
|
|
|
|
'react',
|
|
|
|
|
'ReactFlightNativeRelayClientIntegration',
|
|
|
|
|
'JSResourceReferenceImpl',
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
|
2020-12-03 03:44:56 +00:00
|
|
|
/******* React Suspense Test Utils *******/
|
|
|
|
|
{
|
|
|
|
|
bundleTypes: [NODE_ES2015],
|
|
|
|
|
moduleType: RENDERER_UTILS,
|
|
|
|
|
entry: 'react-suspense-test-utils',
|
|
|
|
|
global: 'ReactSuspenseTestUtils',
|
|
|
|
|
externals: ['react'],
|
|
|
|
|
},
|
|
|
|
|
|
2017-04-05 16:47:29 +01:00
|
|
|
/******* React ART *******/
|
|
|
|
|
{
|
2018-04-18 13:16:50 -07:00
|
|
|
bundleTypes: [
|
|
|
|
|
UMD_DEV,
|
|
|
|
|
UMD_PROD,
|
|
|
|
|
NODE_DEV,
|
|
|
|
|
NODE_PROD,
|
|
|
|
|
FB_WWW_DEV,
|
|
|
|
|
FB_WWW_PROD,
|
|
|
|
|
],
|
2017-10-11 14:29:26 -04:00
|
|
|
moduleType: RENDERER,
|
2017-10-25 02:55:00 +03:00
|
|
|
entry: 'react-art',
|
|
|
|
|
global: 'ReactART',
|
|
|
|
|
externals: ['react'],
|
|
|
|
|
babel: opts =>
|
|
|
|
|
Object.assign({}, opts, {
|
|
|
|
|
// Include JSX
|
2019-08-08 17:46:35 -07:00
|
|
|
presets: opts.presets.concat([
|
|
|
|
|
require.resolve('@babel/preset-react'),
|
|
|
|
|
require.resolve('@babel/preset-flow'),
|
|
|
|
|
]),
|
|
|
|
|
plugins: opts.plugins.concat([
|
|
|
|
|
[require.resolve('@babel/plugin-transform-classes'), {loose: true}],
|
|
|
|
|
]),
|
2017-10-25 02:55:00 +03:00
|
|
|
}),
|
2017-04-05 16:47:29 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/******* React Native *******/
|
2018-04-18 13:16:50 -07:00
|
|
|
{
|
2020-05-28 15:04:25 -07:00
|
|
|
bundleTypes: __EXPERIMENTAL__
|
2020-07-20 17:15:06 -04:00
|
|
|
? []
|
|
|
|
|
: [RN_FB_DEV, RN_FB_PROD, RN_FB_PROFILING],
|
2018-04-18 13:16:50 -07:00
|
|
|
moduleType: RENDERER,
|
|
|
|
|
entry: 'react-native-renderer',
|
|
|
|
|
global: 'ReactNativeRenderer',
|
2019-05-23 00:23:54 -07:00
|
|
|
externals: ['react-native'],
|
2019-08-08 17:46:35 -07:00
|
|
|
babel: opts =>
|
|
|
|
|
Object.assign({}, opts, {
|
|
|
|
|
plugins: opts.plugins.concat([
|
|
|
|
|
[require.resolve('@babel/plugin-transform-classes'), {loose: true}],
|
|
|
|
|
]),
|
|
|
|
|
}),
|
2018-04-18 13:16:50 -07:00
|
|
|
},
|
2017-04-05 16:47:29 +01:00
|
|
|
{
|
2018-06-11 13:16:27 -07:00
|
|
|
bundleTypes: [RN_OSS_DEV, RN_OSS_PROD, RN_OSS_PROFILING],
|
2017-10-25 02:55:00 +03:00
|
|
|
moduleType: RENDERER,
|
|
|
|
|
entry: 'react-native-renderer',
|
|
|
|
|
global: 'ReactNativeRenderer',
|
2019-05-23 00:23:54 -07:00
|
|
|
externals: ['react-native'],
|
2019-08-08 17:46:35 -07:00
|
|
|
babel: opts =>
|
|
|
|
|
Object.assign({}, opts, {
|
|
|
|
|
plugins: opts.plugins.concat([
|
|
|
|
|
[require.resolve('@babel/plugin-transform-classes'), {loose: true}],
|
|
|
|
|
]),
|
|
|
|
|
}),
|
2017-04-05 16:47:29 +01:00
|
|
|
},
|
|
|
|
|
|
2018-01-22 09:58:35 -08:00
|
|
|
/******* React Native Fabric *******/
|
2018-04-18 13:16:50 -07:00
|
|
|
{
|
2020-05-28 15:04:25 -07:00
|
|
|
bundleTypes: __EXPERIMENTAL__
|
2020-07-20 17:15:06 -04:00
|
|
|
? []
|
|
|
|
|
: [RN_FB_DEV, RN_FB_PROD, RN_FB_PROFILING],
|
2018-04-18 13:16:50 -07:00
|
|
|
moduleType: RENDERER,
|
|
|
|
|
entry: 'react-native-renderer/fabric',
|
|
|
|
|
global: 'ReactFabric',
|
2019-05-23 00:23:54 -07:00
|
|
|
externals: ['react-native'],
|
2019-08-08 17:46:35 -07:00
|
|
|
babel: opts =>
|
|
|
|
|
Object.assign({}, opts, {
|
|
|
|
|
plugins: opts.plugins.concat([
|
|
|
|
|
[require.resolve('@babel/plugin-transform-classes'), {loose: true}],
|
|
|
|
|
]),
|
|
|
|
|
}),
|
2018-04-18 13:16:50 -07:00
|
|
|
},
|
2018-01-22 09:58:35 -08:00
|
|
|
{
|
2018-06-11 13:16:27 -07:00
|
|
|
bundleTypes: [RN_OSS_DEV, RN_OSS_PROD, RN_OSS_PROFILING],
|
2018-01-22 09:58:35 -08:00
|
|
|
moduleType: RENDERER,
|
|
|
|
|
entry: 'react-native-renderer/fabric',
|
|
|
|
|
global: 'ReactFabric',
|
2019-05-23 00:23:54 -07:00
|
|
|
externals: ['react-native'],
|
2019-08-08 17:46:35 -07:00
|
|
|
babel: opts =>
|
|
|
|
|
Object.assign({}, opts, {
|
|
|
|
|
plugins: opts.plugins.concat([
|
|
|
|
|
[require.resolve('@babel/plugin-transform-classes'), {loose: true}],
|
|
|
|
|
]),
|
|
|
|
|
}),
|
2018-01-22 09:58:35 -08:00
|
|
|
},
|
|
|
|
|
|
2017-04-05 16:47:29 +01:00
|
|
|
/******* React Test Renderer *******/
|
|
|
|
|
{
|
2020-05-29 15:32:38 -07:00
|
|
|
bundleTypes: [
|
|
|
|
|
FB_WWW_DEV,
|
|
|
|
|
NODE_DEV,
|
|
|
|
|
NODE_PROD,
|
|
|
|
|
UMD_DEV,
|
|
|
|
|
UMD_PROD,
|
|
|
|
|
RN_FB_DEV,
|
2020-07-20 17:15:06 -04:00
|
|
|
RN_FB_PROD,
|
|
|
|
|
RN_FB_PROFILING,
|
2020-05-29 15:32:38 -07:00
|
|
|
],
|
2017-10-11 14:29:26 -04:00
|
|
|
moduleType: RENDERER,
|
2017-10-25 02:55:00 +03:00
|
|
|
entry: 'react-test-renderer',
|
|
|
|
|
global: 'ReactTestRenderer',
|
2019-02-28 12:54:47 -08:00
|
|
|
externals: ['react', 'scheduler', 'scheduler/unstable_mock'],
|
2019-08-08 17:46:35 -07:00
|
|
|
babel: opts =>
|
|
|
|
|
Object.assign({}, opts, {
|
|
|
|
|
plugins: opts.plugins.concat([
|
|
|
|
|
[require.resolve('@babel/plugin-transform-classes'), {loose: true}],
|
|
|
|
|
]),
|
|
|
|
|
}),
|
2017-04-19 16:45:31 -07:00
|
|
|
},
|
2017-04-05 16:47:29 +01:00
|
|
|
|
2017-11-23 17:44:58 +00:00
|
|
|
/******* React Noop Renderer (used for tests) *******/
|
2017-04-05 16:47:29 +01:00
|
|
|
{
|
2017-11-23 17:44:58 +00:00
|
|
|
bundleTypes: [NODE_DEV, NODE_PROD],
|
2017-10-11 14:29:26 -04:00
|
|
|
moduleType: RENDERER,
|
2017-10-25 02:55:00 +03:00
|
|
|
entry: 'react-noop-renderer',
|
|
|
|
|
global: 'ReactNoopRenderer',
|
2019-02-28 12:54:47 -08:00
|
|
|
externals: ['react', 'scheduler', 'scheduler/unstable_mock', 'expect'],
|
2018-05-14 13:57:33 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/******* React Noop Persistent Renderer (used for tests) *******/
|
|
|
|
|
{
|
|
|
|
|
bundleTypes: [NODE_DEV, NODE_PROD],
|
|
|
|
|
moduleType: RENDERER,
|
|
|
|
|
entry: 'react-noop-renderer/persistent',
|
|
|
|
|
global: 'ReactNoopRendererPersistent',
|
2019-02-28 12:54:47 -08:00
|
|
|
externals: ['react', 'scheduler', 'expect'],
|
2017-04-05 16:47:29 +01:00
|
|
|
},
|
2017-10-11 14:29:26 -04:00
|
|
|
|
2018-11-30 11:38:22 -08:00
|
|
|
/******* React Noop Server Renderer (used for tests) *******/
|
|
|
|
|
{
|
|
|
|
|
bundleTypes: [NODE_DEV, NODE_PROD],
|
|
|
|
|
moduleType: RENDERER,
|
|
|
|
|
entry: 'react-noop-renderer/server',
|
|
|
|
|
global: 'ReactNoopRendererServer',
|
2019-02-28 12:54:47 -08:00
|
|
|
externals: ['react', 'scheduler', 'expect'],
|
2018-11-30 11:38:22 -08:00
|
|
|
},
|
|
|
|
|
|
2019-10-29 14:45:47 -07:00
|
|
|
/******* React Noop Flight Server (used for tests) *******/
|
|
|
|
|
{
|
|
|
|
|
bundleTypes: [NODE_DEV, NODE_PROD],
|
|
|
|
|
moduleType: RENDERER,
|
|
|
|
|
entry: 'react-noop-renderer/flight-server',
|
|
|
|
|
global: 'ReactNoopFlightServer',
|
2020-03-23 17:53:45 -07:00
|
|
|
externals: [
|
|
|
|
|
'react',
|
|
|
|
|
'scheduler',
|
|
|
|
|
'expect',
|
|
|
|
|
'react-noop-renderer/flight-modules',
|
|
|
|
|
],
|
2019-10-29 14:45:47 -07:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/******* React Noop Flight Client (used for tests) *******/
|
|
|
|
|
{
|
|
|
|
|
bundleTypes: [NODE_DEV, NODE_PROD],
|
|
|
|
|
moduleType: RENDERER,
|
|
|
|
|
entry: 'react-noop-renderer/flight-client',
|
|
|
|
|
global: 'ReactNoopFlightClient',
|
2020-03-23 17:53:45 -07:00
|
|
|
externals: [
|
|
|
|
|
'react',
|
|
|
|
|
'scheduler',
|
|
|
|
|
'expect',
|
|
|
|
|
'react-noop-renderer/flight-modules',
|
|
|
|
|
],
|
2019-10-29 14:45:47 -07:00
|
|
|
},
|
|
|
|
|
|
2017-10-11 14:29:26 -04:00
|
|
|
/******* React Reconciler *******/
|
|
|
|
|
{
|
2020-08-19 06:11:27 -07:00
|
|
|
bundleTypes: [NODE_DEV, NODE_PROD, NODE_PROFILING],
|
2017-10-11 14:29:26 -04:00
|
|
|
moduleType: RECONCILER,
|
2017-10-25 02:55:00 +03:00
|
|
|
entry: 'react-reconciler',
|
|
|
|
|
global: 'ReactReconciler',
|
2018-09-01 12:00:00 -07:00
|
|
|
externals: ['react'],
|
2018-02-05 16:56:21 +00:00
|
|
|
},
|
|
|
|
|
|
2019-10-29 14:45:47 -07:00
|
|
|
/******* React Server *******/
|
|
|
|
|
{
|
|
|
|
|
bundleTypes: [NODE_DEV, NODE_PROD],
|
|
|
|
|
moduleType: RECONCILER,
|
|
|
|
|
entry: 'react-server',
|
|
|
|
|
global: 'ReactServer',
|
|
|
|
|
externals: ['react'],
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/******* React Flight Server *******/
|
|
|
|
|
{
|
|
|
|
|
bundleTypes: [NODE_DEV, NODE_PROD],
|
|
|
|
|
moduleType: RECONCILER,
|
|
|
|
|
entry: 'react-server/flight',
|
|
|
|
|
global: 'ReactFlightServer',
|
|
|
|
|
externals: ['react'],
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/******* React Flight Client *******/
|
2018-11-30 11:38:22 -08:00
|
|
|
{
|
|
|
|
|
bundleTypes: [NODE_DEV, NODE_PROD],
|
|
|
|
|
moduleType: RECONCILER,
|
2020-03-07 11:23:30 -08:00
|
|
|
entry: 'react-client/flight',
|
2019-10-29 14:45:47 -07:00
|
|
|
global: 'ReactFlightClient',
|
2018-11-30 11:38:22 -08:00
|
|
|
externals: ['react'],
|
|
|
|
|
},
|
|
|
|
|
|
2021-03-24 02:13:43 +00:00
|
|
|
/******* Reconciler Reflection *******/
|
2017-11-29 00:57:22 +08:00
|
|
|
{
|
|
|
|
|
moduleType: RENDERER_UTILS,
|
|
|
|
|
bundleTypes: [NODE_DEV, NODE_PROD],
|
|
|
|
|
entry: 'react-reconciler/reflection',
|
|
|
|
|
global: 'ReactFiberTreeReflection',
|
|
|
|
|
externals: [],
|
|
|
|
|
},
|
|
|
|
|
|
2021-03-24 02:13:43 +00:00
|
|
|
/******* Reconciler Constants *******/
|
|
|
|
|
{
|
|
|
|
|
moduleType: RENDERER_UTILS,
|
|
|
|
|
bundleTypes: [NODE_DEV, NODE_PROD],
|
|
|
|
|
entry: 'react-reconciler/constants',
|
|
|
|
|
global: 'ReactReconcilerConstants',
|
|
|
|
|
externals: [],
|
|
|
|
|
},
|
|
|
|
|
|
2018-02-11 14:08:40 -08:00
|
|
|
/******* React Is *******/
|
|
|
|
|
{
|
2018-04-18 13:16:50 -07:00
|
|
|
bundleTypes: [
|
|
|
|
|
NODE_DEV,
|
|
|
|
|
NODE_PROD,
|
|
|
|
|
FB_WWW_DEV,
|
|
|
|
|
FB_WWW_PROD,
|
|
|
|
|
UMD_DEV,
|
|
|
|
|
UMD_PROD,
|
|
|
|
|
],
|
2018-02-11 14:08:40 -08:00
|
|
|
moduleType: ISOMORPHIC,
|
|
|
|
|
entry: 'react-is',
|
|
|
|
|
global: 'ReactIs',
|
|
|
|
|
externals: [],
|
|
|
|
|
},
|
2018-02-15 16:38:15 -08:00
|
|
|
|
2018-11-05 10:02:59 -08:00
|
|
|
/******* React Debug Tools *******/
|
|
|
|
|
{
|
|
|
|
|
bundleTypes: [NODE_DEV, NODE_PROD],
|
|
|
|
|
moduleType: ISOMORPHIC,
|
|
|
|
|
entry: 'react-debug-tools',
|
|
|
|
|
global: 'ReactDebugTools',
|
|
|
|
|
externals: [],
|
|
|
|
|
},
|
|
|
|
|
|
2020-04-29 19:14:15 +01:00
|
|
|
/******* React Cache (experimental, old) *******/
|
2018-02-15 16:38:15 -08:00
|
|
|
{
|
2020-05-01 16:07:36 +01:00
|
|
|
// This is only used by our own tests.
|
|
|
|
|
// We can delete it later.
|
|
|
|
|
bundleTypes: [NODE_DEV, NODE_PROD],
|
2018-02-15 16:38:15 -08:00
|
|
|
moduleType: ISOMORPHIC,
|
2018-10-01 09:07:40 -06:00
|
|
|
entry: 'react-cache',
|
2020-05-01 16:07:36 +01:00
|
|
|
global: 'ReactCacheOld',
|
2018-10-23 14:38:51 -07:00
|
|
|
externals: ['react', 'scheduler'],
|
2018-02-15 16:38:15 -08:00
|
|
|
},
|
2018-03-13 13:59:09 -07:00
|
|
|
|
2019-08-08 18:52:08 -07:00
|
|
|
/******* createComponentWithSubscriptions *******/
|
2018-03-13 13:59:09 -07:00
|
|
|
{
|
|
|
|
|
bundleTypes: [NODE_DEV, NODE_PROD],
|
|
|
|
|
moduleType: ISOMORPHIC,
|
|
|
|
|
entry: 'create-subscription',
|
|
|
|
|
global: 'createSubscription',
|
|
|
|
|
externals: ['react'],
|
2019-08-08 17:46:35 -07:00
|
|
|
babel: opts =>
|
|
|
|
|
Object.assign({}, opts, {
|
|
|
|
|
plugins: opts.plugins.concat([
|
|
|
|
|
[require.resolve('@babel/plugin-transform-classes'), {loose: true}],
|
|
|
|
|
]),
|
|
|
|
|
}),
|
2018-03-13 13:59:09 -07:00
|
|
|
},
|
2018-04-19 09:29:08 -07:00
|
|
|
|
2019-08-08 18:52:08 -07:00
|
|
|
/******* Hook for managing subscriptions safely *******/
|
|
|
|
|
{
|
|
|
|
|
bundleTypes: [NODE_DEV, NODE_PROD],
|
|
|
|
|
moduleType: ISOMORPHIC,
|
|
|
|
|
entry: 'use-subscription',
|
|
|
|
|
global: 'useSubscription',
|
|
|
|
|
externals: ['react'],
|
|
|
|
|
},
|
|
|
|
|
|
2018-04-19 09:29:08 -07:00
|
|
|
/******* React Scheduler (experimental) *******/
|
|
|
|
|
{
|
2019-08-22 21:58:12 +01:00
|
|
|
bundleTypes: [
|
|
|
|
|
NODE_DEV,
|
|
|
|
|
NODE_PROD,
|
|
|
|
|
FB_WWW_DEV,
|
|
|
|
|
FB_WWW_PROD,
|
|
|
|
|
FB_WWW_PROFILING,
|
2020-05-29 15:32:38 -07:00
|
|
|
RN_FB_DEV,
|
|
|
|
|
RN_FB_PROD,
|
|
|
|
|
RN_FB_PROFILING,
|
2019-08-22 21:58:12 +01:00
|
|
|
],
|
2018-04-19 09:29:08 -07:00
|
|
|
moduleType: ISOMORPHIC,
|
2018-09-19 01:26:28 +01:00
|
|
|
entry: 'scheduler',
|
|
|
|
|
global: 'Scheduler',
|
2018-04-19 09:29:08 -07:00
|
|
|
externals: [],
|
|
|
|
|
},
|
2018-08-17 10:16:05 -06:00
|
|
|
|
Add new mock build of Scheduler with flush, yield API (#14964)
* Add new mock build of Scheduler with flush, yield API
Test environments need a way to take control of the Scheduler queue and
incrementally flush work. Our current tests accomplish this either using
dynamic injection, or by using Jest's fake timers feature. Both of these
options are fragile and rely too much on implementation details.
In this new approach, we have a separate build of Scheduler that is
specifically designed for test environments. We mock the default
implementation like we would any other module; in our case, via Jest.
This special build has methods like `flushAll` and `yieldValue` that
control when work is flushed. These methods are based on equivalent
methods we've been using to write incremental React tests. Eventually
we may want to migrate the React tests to interact with the mock
Scheduler directly, instead of going through the host config like we
currently do.
For now, I'm using our custom static injection infrastructure to create
the two builds of Scheduler — a default build for DOM (which falls back
to a naive timer based implementation), and the new mock build. I did it
this way because it allows me to share most of the implementation, which
isn't specific to a host environment — e.g. everything related to the
priority queue. It may be better to duplicate the shared code instead,
especially considering that future environments (like React Native) may
have entirely forked implementations. I'd prefer to wait until the
implementation stabilizes before worrying about that, but I'm open to
changing this now if we decide it's important enough.
* Mock Scheduler in bundle tests, too
* Remove special case by making regex more restrictive
2019-02-26 20:51:17 -08:00
|
|
|
/******* React Scheduler Mock (experimental) *******/
|
2018-10-03 18:37:41 -06:00
|
|
|
{
|
2019-05-16 17:12:36 +01:00
|
|
|
bundleTypes: [
|
|
|
|
|
UMD_DEV,
|
|
|
|
|
UMD_PROD,
|
|
|
|
|
NODE_DEV,
|
|
|
|
|
NODE_PROD,
|
|
|
|
|
FB_WWW_DEV,
|
|
|
|
|
FB_WWW_PROD,
|
2020-05-29 15:32:38 -07:00
|
|
|
RN_FB_DEV,
|
|
|
|
|
RN_FB_PROD,
|
2019-05-16 17:12:36 +01:00
|
|
|
],
|
2018-10-03 18:37:41 -06:00
|
|
|
moduleType: ISOMORPHIC,
|
Add new mock build of Scheduler with flush, yield API (#14964)
* Add new mock build of Scheduler with flush, yield API
Test environments need a way to take control of the Scheduler queue and
incrementally flush work. Our current tests accomplish this either using
dynamic injection, or by using Jest's fake timers feature. Both of these
options are fragile and rely too much on implementation details.
In this new approach, we have a separate build of Scheduler that is
specifically designed for test environments. We mock the default
implementation like we would any other module; in our case, via Jest.
This special build has methods like `flushAll` and `yieldValue` that
control when work is flushed. These methods are based on equivalent
methods we've been using to write incremental React tests. Eventually
we may want to migrate the React tests to interact with the mock
Scheduler directly, instead of going through the host config like we
currently do.
For now, I'm using our custom static injection infrastructure to create
the two builds of Scheduler — a default build for DOM (which falls back
to a naive timer based implementation), and the new mock build. I did it
this way because it allows me to share most of the implementation, which
isn't specific to a host environment — e.g. everything related to the
priority queue. It may be better to duplicate the shared code instead,
especially considering that future environments (like React Native) may
have entirely forked implementations. I'd prefer to wait until the
implementation stabilizes before worrying about that, but I'm open to
changing this now if we decide it's important enough.
* Mock Scheduler in bundle tests, too
* Remove special case by making regex more restrictive
2019-02-26 20:51:17 -08:00
|
|
|
entry: 'scheduler/unstable_mock',
|
|
|
|
|
global: 'SchedulerMock',
|
2018-12-01 17:26:12 -08:00
|
|
|
externals: [],
|
2018-10-03 18:37:41 -06:00
|
|
|
},
|
|
|
|
|
|
2020-07-29 15:27:59 -04:00
|
|
|
/******* React Scheduler Post Task (experimental) *******/
|
2020-07-28 11:11:31 -04:00
|
|
|
{
|
2020-07-29 15:27:59 -04:00
|
|
|
bundleTypes: [
|
|
|
|
|
NODE_DEV,
|
|
|
|
|
NODE_PROD,
|
|
|
|
|
FB_WWW_DEV,
|
|
|
|
|
FB_WWW_PROD,
|
|
|
|
|
FB_WWW_PROFILING,
|
|
|
|
|
],
|
2020-07-28 11:11:31 -04:00
|
|
|
moduleType: ISOMORPHIC,
|
|
|
|
|
entry: 'scheduler/unstable_post_task',
|
|
|
|
|
global: 'SchedulerPostTask',
|
|
|
|
|
externals: [],
|
|
|
|
|
},
|
|
|
|
|
|
Add new mock build of Scheduler with flush, yield API (#14964)
* Add new mock build of Scheduler with flush, yield API
Test environments need a way to take control of the Scheduler queue and
incrementally flush work. Our current tests accomplish this either using
dynamic injection, or by using Jest's fake timers feature. Both of these
options are fragile and rely too much on implementation details.
In this new approach, we have a separate build of Scheduler that is
specifically designed for test environments. We mock the default
implementation like we would any other module; in our case, via Jest.
This special build has methods like `flushAll` and `yieldValue` that
control when work is flushed. These methods are based on equivalent
methods we've been using to write incremental React tests. Eventually
we may want to migrate the React tests to interact with the mock
Scheduler directly, instead of going through the host config like we
currently do.
For now, I'm using our custom static injection infrastructure to create
the two builds of Scheduler — a default build for DOM (which falls back
to a naive timer based implementation), and the new mock build. I did it
this way because it allows me to share most of the implementation, which
isn't specific to a host environment — e.g. everything related to the
priority queue. It may be better to duplicate the shared code instead,
especially considering that future environments (like React Native) may
have entirely forked implementations. I'd prefer to wait until the
implementation stabilizes before worrying about that, but I'm open to
changing this now if we decide it's important enough.
* Mock Scheduler in bundle tests, too
* Remove special case by making regex more restrictive
2019-02-26 20:51:17 -08:00
|
|
|
/******* Jest React (experimental) *******/
|
2018-12-01 13:03:19 -08:00
|
|
|
{
|
2020-02-19 17:59:42 +00:00
|
|
|
bundleTypes: [NODE_DEV, NODE_PROD],
|
2018-12-01 13:03:19 -08:00
|
|
|
moduleType: ISOMORPHIC,
|
Add new mock build of Scheduler with flush, yield API (#14964)
* Add new mock build of Scheduler with flush, yield API
Test environments need a way to take control of the Scheduler queue and
incrementally flush work. Our current tests accomplish this either using
dynamic injection, or by using Jest's fake timers feature. Both of these
options are fragile and rely too much on implementation details.
In this new approach, we have a separate build of Scheduler that is
specifically designed for test environments. We mock the default
implementation like we would any other module; in our case, via Jest.
This special build has methods like `flushAll` and `yieldValue` that
control when work is flushed. These methods are based on equivalent
methods we've been using to write incremental React tests. Eventually
we may want to migrate the React tests to interact with the mock
Scheduler directly, instead of going through the host config like we
currently do.
For now, I'm using our custom static injection infrastructure to create
the two builds of Scheduler — a default build for DOM (which falls back
to a naive timer based implementation), and the new mock build. I did it
this way because it allows me to share most of the implementation, which
isn't specific to a host environment — e.g. everything related to the
priority queue. It may be better to duplicate the shared code instead,
especially considering that future environments (like React Native) may
have entirely forked implementations. I'd prefer to wait until the
implementation stabilizes before worrying about that, but I'm open to
changing this now if we decide it's important enough.
* Mock Scheduler in bundle tests, too
* Remove special case by making regex more restrictive
2019-02-26 20:51:17 -08:00
|
|
|
entry: 'jest-react',
|
|
|
|
|
global: 'JestReact',
|
2018-12-01 17:26:12 -08:00
|
|
|
externals: [],
|
2018-12-01 13:03:19 -08:00
|
|
|
},
|
|
|
|
|
|
2020-02-03 23:31:31 +00:00
|
|
|
/******* ESLint Plugin for Hooks *******/
|
2018-10-23 12:35:56 -07:00
|
|
|
{
|
2019-04-25 17:24:01 +02:00
|
|
|
// TODO: it's awkward to create a bundle for this but if we don't, the package
|
|
|
|
|
// won't get copied. We also can't create just DEV bundle because it contains a
|
|
|
|
|
// NODE_ENV check inside. We should probably tweak our build process to allow
|
|
|
|
|
// "raw" packages that don't get bundled.
|
2019-09-06 16:48:07 +01:00
|
|
|
bundleTypes: [NODE_DEV, NODE_PROD],
|
2018-10-23 12:35:56 -07:00
|
|
|
moduleType: ISOMORPHIC,
|
|
|
|
|
entry: 'eslint-plugin-react-hooks',
|
2018-11-09 10:22:18 -08:00
|
|
|
global: 'ESLintPluginReactHooks',
|
2018-10-23 12:35:56 -07:00
|
|
|
externals: [],
|
|
|
|
|
},
|
2019-05-21 21:54:10 +01:00
|
|
|
|
|
|
|
|
/******* React Fresh *******/
|
|
|
|
|
{
|
|
|
|
|
bundleTypes: [NODE_DEV, NODE_PROD],
|
|
|
|
|
moduleType: ISOMORPHIC,
|
2019-06-15 19:36:46 +01:00
|
|
|
entry: 'react-refresh/babel',
|
2019-05-21 21:54:10 +01:00
|
|
|
global: 'ReactFreshBabelPlugin',
|
|
|
|
|
externals: [],
|
|
|
|
|
},
|
|
|
|
|
{
|
2019-09-06 16:48:07 +01:00
|
|
|
bundleTypes: [NODE_DEV, NODE_PROD, FB_WWW_DEV],
|
2019-05-21 21:54:10 +01:00
|
|
|
moduleType: ISOMORPHIC,
|
2019-06-15 19:36:46 +01:00
|
|
|
entry: 'react-refresh/runtime',
|
2019-05-21 21:54:10 +01:00
|
|
|
global: 'ReactFreshRuntime',
|
|
|
|
|
externals: [],
|
|
|
|
|
},
|
2017-04-05 16:47:29 +01:00
|
|
|
];
|
|
|
|
|
|
2017-09-14 01:24:31 +01:00
|
|
|
// Based on deep-freeze by substack (public domain)
|
|
|
|
|
function deepFreeze(o) {
|
|
|
|
|
Object.freeze(o);
|
|
|
|
|
Object.getOwnPropertyNames(o).forEach(function(prop) {
|
|
|
|
|
if (
|
|
|
|
|
o[prop] !== null &&
|
|
|
|
|
(typeof o[prop] === 'object' || typeof o[prop] === 'function') &&
|
|
|
|
|
!Object.isFrozen(o[prop])
|
|
|
|
|
) {
|
|
|
|
|
deepFreeze(o[prop]);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
return o;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Don't accidentally mutate config as part of the build
|
|
|
|
|
deepFreeze(bundles);
|
2019-04-25 17:24:01 +02:00
|
|
|
deepFreeze(bundleTypes);
|
|
|
|
|
deepFreeze(moduleTypes);
|
2017-09-14 01:24:31 +01:00
|
|
|
|
2020-12-09 22:47:17 +00:00
|
|
|
function getOriginalFilename(bundle, bundleType) {
|
2021-06-14 19:23:19 -04:00
|
|
|
let name = bundle.name || bundle.entry;
|
2020-05-28 15:04:25 -07:00
|
|
|
const globalName = bundle.global;
|
|
|
|
|
// we do this to replace / to -, for react-dom/server
|
|
|
|
|
name = name.replace('/index.', '.').replace('/', '-');
|
|
|
|
|
switch (bundleType) {
|
2020-05-28 15:56:34 -07:00
|
|
|
case NODE_ES2015:
|
|
|
|
|
return `${name}.js`;
|
2020-11-13 08:57:45 -05:00
|
|
|
case NODE_ESM:
|
|
|
|
|
return `${name}.js`;
|
2020-05-28 15:04:25 -07:00
|
|
|
case UMD_DEV:
|
|
|
|
|
return `${name}.development.js`;
|
|
|
|
|
case UMD_PROD:
|
|
|
|
|
return `${name}.production.min.js`;
|
|
|
|
|
case UMD_PROFILING:
|
|
|
|
|
return `${name}.profiling.min.js`;
|
|
|
|
|
case NODE_DEV:
|
|
|
|
|
return `${name}.development.js`;
|
|
|
|
|
case NODE_PROD:
|
|
|
|
|
return `${name}.production.min.js`;
|
|
|
|
|
case NODE_PROFILING:
|
|
|
|
|
return `${name}.profiling.min.js`;
|
|
|
|
|
case FB_WWW_DEV:
|
|
|
|
|
case RN_OSS_DEV:
|
|
|
|
|
case RN_FB_DEV:
|
|
|
|
|
return `${globalName}-dev.js`;
|
|
|
|
|
case FB_WWW_PROD:
|
|
|
|
|
case RN_OSS_PROD:
|
|
|
|
|
case RN_FB_PROD:
|
|
|
|
|
return `${globalName}-prod.js`;
|
|
|
|
|
case FB_WWW_PROFILING:
|
|
|
|
|
case RN_FB_PROFILING:
|
|
|
|
|
case RN_OSS_PROFILING:
|
|
|
|
|
return `${globalName}-profiling.js`;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-12-09 22:47:17 +00:00
|
|
|
function getFilename(bundle, bundleType) {
|
|
|
|
|
const originalFilename = getOriginalFilename(bundle, bundleType);
|
|
|
|
|
// Ensure .server.js or .client.js is the final suffix.
|
|
|
|
|
// This is important for the Server tooling convention.
|
|
|
|
|
if (originalFilename.indexOf('.server.') !== -1) {
|
|
|
|
|
return originalFilename
|
|
|
|
|
.replace('.server.', '.')
|
|
|
|
|
.replace('.js', '.server.js');
|
|
|
|
|
}
|
|
|
|
|
if (originalFilename.indexOf('.client.') !== -1) {
|
|
|
|
|
return originalFilename
|
|
|
|
|
.replace('.client.', '.')
|
|
|
|
|
.replace('.js', '.client.js');
|
|
|
|
|
}
|
|
|
|
|
return originalFilename;
|
|
|
|
|
}
|
|
|
|
|
|
2017-04-05 16:47:29 +01:00
|
|
|
module.exports = {
|
|
|
|
|
bundleTypes,
|
2017-10-11 14:29:26 -04:00
|
|
|
moduleTypes,
|
2017-04-05 16:47:29 +01:00
|
|
|
bundles,
|
2020-05-28 15:04:25 -07:00
|
|
|
getFilename,
|
2017-04-05 16:47:29 +01:00
|
|
|
};
|