Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
cc07404
Remove Fiber Jest project
gaearon Aug 23, 2017
59a8a5b
Remove Stack reconciler and ReactDOMStack code
gaearon Aug 23, 2017
92d216f
Fix tests depending on Stack internals
gaearon Aug 23, 2017
746009d
Remove Stack-only DEV code
gaearon Aug 23, 2017
2d6a189
Fix lint
gaearon Aug 23, 2017
aeb0317
Fix Flow
gaearon Aug 23, 2017
27af910
Remove usage of ReactDOMFeatureFlags.useFiber, assuming true
gaearon Aug 23, 2017
7f39869
Remove findDOMNode injection and inline it
gaearon Aug 23, 2017
0168441
Remove Stack-only code in ReactGenericBatching
gaearon Aug 23, 2017
d773f15
Remove Stack-only code branches
gaearon Aug 23, 2017
5827485
Remvoe undocumented TestUtils methods that are broken in Fiber
gaearon Aug 23, 2017
651345e
Record sizes
gaearon Aug 23, 2017
a6b6e8d
Convert isomorphic package to ESM
gaearon Aug 23, 2017
7d4986d
[WIP] ReactDOM
gaearon Aug 23, 2017
08ffc6c
[WIP] More ReactDOM and event plugins
gaearon Aug 23, 2017
f56a38d
[WIP] More ReactDOM, event plugins, utils
gaearon Aug 23, 2017
cae1404
[WIP] ReactNative
gaearon Aug 23, 2017
1bc5bc7
[WIP] ReactART
gaearon Aug 23, 2017
18187a8
[WIP] Noop
gaearon Aug 23, 2017
1220c70
[WIP] Fiber Reconciler
gaearon Aug 23, 2017
3d22470
[WIP] ReactDOMServer
gaearon Aug 23, 2017
6eb9ac0
[WIP] Shared Event System
gaearon Aug 23, 2017
3bb8df1
[WIP] Misc
gaearon Aug 23, 2017
c48199b
Fix ReactDOM UMD build
gaearon Aug 23, 2017
a22de0c
Undo changes to injection API
gaearon Aug 23, 2017
0b3b16c
Fix Rollup build
gaearon Aug 23, 2017
34a5f00
Prettier
gaearon Aug 24, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 35 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,40 @@
"version-check": "node ./scripts/tasks/version-check.js"
},
"jest": {
"projects": [
"<rootDir>/scripts/jest/stack.config.json",
"<rootDir>/scripts/jest/fiber.config.json"
]
"modulePathIgnorePatterns": [
"/.module-cache/",
"<rootDir>/build/",
"<rootDir>/scripts/rollup/shims/",
"<rootDir>/scripts/bench/"
],
"transform": {
".*": "./scripts/jest/preprocessor.js"
},
"setupFiles": [
"./scripts/jest/setup.js",
"./scripts/jest/environment.js"
],
"setupTestFrameworkScriptFile": "./scripts/jest/test-framework-setup.js",
"testRegex": "/__tests__/.*(\\.js|coffee|ts)$",
"moduleFileExtensions": [
"js",
"json",
"node",
"coffee",
"ts"
],
"roots": [
"<rootDir>/eslint-rules",
"<rootDir>/mocks",
"<rootDir>/scripts",
"<rootDir>/src",
"node_modules/fbjs"
],
"collectCoverageFrom": [
"src/**/*.js",
"!src/__mocks__/vendor/third_party/*.js",
"!src/test/*.js"
],
"timers": "fake"
}
}
14 changes: 5 additions & 9 deletions scripts/babel/transform-object-assign-require.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,12 @@ module.exports = function autoImporter(babel) {
const t = babel.types;

function getAssignIdent(path, file, state) {
if (!state.id) {
state.id = path.scope.generateUidIdentifier('assign');
path.scope.getProgramParent().push({
id: state.id,
init: t.callExpression(t.identifier('require'), [
t.stringLiteral('object-assign'),
]),
});
if (state.id) {
return state.id;
}
return state.id;
const id = file.addImport('object-assign', 'default', 'assign');
state.id = id;
return id;
}

return {
Expand Down
28 changes: 13 additions & 15 deletions scripts/error-codes/replace-invariant-error-codes.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,17 @@ module.exports = function(babel) {
var SEEN_SYMBOL = Symbol('replace-invariant-error-codes.seen');

// Generate a hygienic identifier
function getProdInvariantIdentifier(path, localState) {
if (!localState.prodInvariantIdentifier) {
localState.prodInvariantIdentifier = path.scope.generateUidIdentifier(
'prodInvariant'
);
path.scope.getProgramParent().push({
id: localState.prodInvariantIdentifier,
init: t.callExpression(t.identifier('require'), [
t.stringLiteral('reactProdInvariant'),
]),
});
function getProdInvariantIdentifier(path, file, localState) {
if (localState.prodInvariantIdentifier) {
return localState.prodInvariantIdentifier;
}
return localState.prodInvariantIdentifier;
const id = file.addImport(
'reactProdInvariant',
'default',
'reactProdInvariant'
);
localState.prodInvariantIdentifier = id;
return id;
}

var DEV_EXPRESSION = t.identifier('__DEV__');
Expand All @@ -44,7 +42,7 @@ module.exports = function(babel) {

visitor: {
CallExpression: {
exit: function(path) {
exit: function(path, file) {
var node = path.node;
// Ignore if it's already been processed
if (node[SEEN_SYMBOL]) {
Expand All @@ -59,7 +57,7 @@ module.exports = function(babel) {
path.get('arguments')[0].isStringLiteral({value: 'invariant'})
) {
node[SEEN_SYMBOL] = true;
getProdInvariantIdentifier(path, this);
getProdInvariantIdentifier(path, file, this);
} else if (path.get('callee').isIdentifier({name: 'invariant'})) {
// Turns this code:
//
Expand Down Expand Up @@ -110,7 +108,7 @@ module.exports = function(babel) {

devInvariant[SEEN_SYMBOL] = true;

var localInvariantId = getProdInvariantIdentifier(path, this);
var localInvariantId = getProdInvariantIdentifier(path, file, this);
var prodInvariant = t.callExpression(
localInvariantId,
[t.stringLiteral(prodErrorId)].concat(node.arguments.slice(2))
Expand Down
38 changes: 0 additions & 38 deletions scripts/jest/fiber.config.json

This file was deleted.

2 changes: 2 additions & 0 deletions scripts/jest/preprocessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ var babelOptions = {
}),
},
],
// TODO: is this enough?
require.resolve('babel-plugin-transform-es2015-modules-commonjs'),
// Keep stacks detailed in tests.
// Don't put this in .babelrc so that we don't embed filenames
// into ReactART builds that include JSX.
Expand Down
6 changes: 0 additions & 6 deletions scripts/jest/fiber.setup.js → scripts/jest/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@

// We want to globally mock this but jest doesn't let us do that by default
// for a file that already exists. So we have to explicitly mock it.
jest.mock('ReactDOMFeatureFlags', () => {
const flags = require.requireActual('ReactDOMFeatureFlags');
return Object.assign({}, flags, {
useFiber: true,
});
});
jest.mock('ReactFeatureFlags', () => {
const flags = require.requireActual('ReactFeatureFlags');
return Object.assign({}, flags, {
Expand Down
38 changes: 0 additions & 38 deletions scripts/jest/stack.config.json

This file was deleted.

14 changes: 0 additions & 14 deletions scripts/jest/stack.setup.js

This file was deleted.

5 changes: 1 addition & 4 deletions scripts/rollup/modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,7 @@ const fbjsModules = [
];

const devOnlyFilesToStubOut = [
"'ReactDebugCurrentFrame'",
"'ReactComponentTreeHook'",
"'ReactPerf'",
"'ReactTestUtils'",
// TODO: figure out the ESM strategy
];

const legacyModules = [
Expand Down
2 changes: 1 addition & 1 deletion scripts/rollup/packaging.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const facebookWWWSrcDependencies = [
// these files need to be copied to the react-native build
const reactNativeSrcDependencies = [
// TODO: copy this to RN repository and delete from React
'src/renderers/shared/stack/PooledClass.js',
'src/renderers/native/PooledClass.js',
'src/renderers/shared/fiber/isomorphic/ReactTypes.js',
'src/renderers/native/ReactNativeTypes.js',
];
Expand Down
Loading