Skip to content

Commit

Permalink
Externalize Scheduler in noop and test bundles
Browse files Browse the repository at this point in the history
I also noticed we don't need to regenerator runtime in noop anymore.
  • Loading branch information
acdlite committed Feb 28, 2019
1 parent cd6932c commit 79e462f
Showing 1 changed file with 5 additions and 44 deletions.
49 changes: 5 additions & 44 deletions scripts/rollup/bundles.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,15 +281,15 @@ const bundles = [
moduleType: RENDERER,
entry: 'react-test-renderer',
global: 'ReactTestRenderer',
externals: ['react'],
externals: ['react', 'scheduler'],
},

{
bundleTypes: [FB_WWW_DEV, NODE_DEV, NODE_PROD, UMD_DEV, UMD_PROD],
moduleType: NON_FIBER_RENDERER,
entry: 'react-test-renderer/shallow',
global: 'ReactShallowRenderer',
externals: ['react'],
externals: ['react', 'scheduler'],
},

/******* React Noop Renderer (used for tests) *******/
Expand All @@ -298,20 +298,7 @@ const bundles = [
moduleType: RENDERER,
entry: 'react-noop-renderer',
global: 'ReactNoopRenderer',
externals: ['react', 'expect'],
// React Noop uses generators. However GCC currently
// breaks when we attempt to use them in the output.
// So we precompile them with regenerator, and include
// it as a runtime dependency of React Noop. In practice
// this isn't an issue because React Noop is only used
// in our tests. We wouldn't want to do this for any
// public package though.
babel: opts =>
Object.assign({}, opts, {
plugins: opts.plugins.concat([
require.resolve('babel-plugin-transform-regenerator'),
]),
}),
externals: ['react', 'scheduler', 'expect'],
},

/******* React Noop Persistent Renderer (used for tests) *******/
Expand All @@ -320,20 +307,7 @@ const bundles = [
moduleType: RENDERER,
entry: 'react-noop-renderer/persistent',
global: 'ReactNoopRendererPersistent',
externals: ['react', 'expect'],
// React Noop uses generators. However GCC currently
// breaks when we attempt to use them in the output.
// So we precompile them with regenerator, and include
// it as a runtime dependency of React Noop. In practice
// this isn't an issue because React Noop is only used
// in our tests. We wouldn't want to do this for any
// public package though.
babel: opts =>
Object.assign({}, opts, {
plugins: opts.plugins.concat([
require.resolve('babel-plugin-transform-regenerator'),
]),
}),
externals: ['react', 'scheduler', 'expect'],
},

/******* React Noop Server Renderer (used for tests) *******/
Expand All @@ -342,20 +316,7 @@ const bundles = [
moduleType: RENDERER,
entry: 'react-noop-renderer/server',
global: 'ReactNoopRendererServer',
externals: ['react', 'expect'],
// React Noop uses generators. However GCC currently
// breaks when we attempt to use them in the output.
// So we precompile them with regenerator, and include
// it as a runtime dependency of React Noop. In practice
// this isn't an issue because React Noop is only used
// in our tests. We wouldn't want to do this for any
// public package though.
babel: opts =>
Object.assign({}, opts, {
plugins: opts.plugins.concat([
require.resolve('babel-plugin-transform-regenerator'),
]),
}),
externals: ['react', 'scheduler', 'expect'],
},

/******* React Reconciler *******/
Expand Down

0 comments on commit 79e462f

Please sign in to comment.