Commit Graph

75 Commits

Author SHA1 Message Date
Sophie Alpert
ffbc2db0e7 Merge branch '15.6-dev' into 15-stable 2017-09-25 17:06:40 -07:00
Sophie Alpert
8c3cececb7 15.x: BSD+Patents -> MIT 2017-09-25 17:02:44 -07:00
Sophie Alpert
080db9d3a7 15.x: File headers BSD+Patents -> MIT 2017-09-25 17:02:43 -07:00
Dan Abramov
86d88a07a9 Update error codes 2017-09-14 13:37:47 +01:00
Flarnie Marchan
bd92ae6efe Update error codes (#10621)
https://github.com/facebook/react/tree/master/scripts/release-manager#update-the-error-codes
2017-09-06 11:13:52 -07:00
Dan Abramov
0cce0eb946 Update codes 2017-08-04 00:35:55 +01:00
Flarnie Marchan
ab4c85ebb3 Regenerate error codes and update bundle size stats (#10287) (#10288)
* Regenerate error codes and update bundle size stats (#10287)

* Updated error codes (after merging in missing code from 15 stable) (#10290)
2017-07-26 12:23:42 -07:00
Dan Abramov
5b89c1bb2d Try to re-enable Prettier 2017-06-15 00:30:50 +01:00
Dan Abramov
d494d2d332 Temporarily disable prettier on CI 2017-06-15 00:08:14 +01:00
Dan Abramov
00917c80e8 Remove trailing commas in addons 2017-06-14 12:38:03 +01:00
Dan Abramov
f127ba6b21 Add build process for createReactClass (#9943)
* Switch trailing comma to ES5 mode in addons

* Add build process for createReactClass

* Test UMD bundles on CI

* Fix lint
2017-06-13 15:00:10 +01:00
Dan Abramov
beb370c102 Lint and test addons on CI (#9936)
* Lint addons

* Run prettier on addons

* Fix all lint issues

* Remove unused variable

* Test addons on CI
2017-06-12 21:26:56 +01:00
Flarnie Marchan
009c9f7201 Update tests to not warn due to moved PropTypes and shallowRenderer (#9486)
* Update tests to not warn due to moved PropTypes and shallowRenderer

We added some warnings in v15.5 for calling `React.PropTypes` and
calling the shallow renderer from the wrong place. These warnings were
causing test failures, and now they are fixed.

Most of these were for the `React.PropTypes` change.

* tweak from running prettier

* Final tweaks to get tests passing

**what is the change?:**
Updated 'PropTypes' and 'shallow renderer' syntax in a couple more
places to get tests passing.

**why make this change?:**
In order to verify any changes to the 15.6 and 15.* branches in general
we should have tests passing.

**test plan:**
`npm run test`

**issue:**
https://github.com/facebook/react/issues/9410
2017-04-24 18:48:20 -07:00
Andrew Clark
c5395d23e5 Merge pull request #9187 from acdlite/prettierci
Failing to run prettier should block CI
(cherry picked from commit 9549ebfae5)
2017-03-24 09:48:44 -05:00
Dan Abramov
baddb6bf42 Remove PR check from GH Pages build hook for stable branch (#9144) 2017-03-10 01:19:33 +00:00
Jack Cross
688490dfe9 Add CircleCI support to 15-stable (#8778)
* devDependencies: add core-js and es6-symbol polyfill for tests

* Update Flow and fix issues (#8006)

* Add npm v4.0.0 support (#8082)

* Add support for node v7 (#8135)

* Upgrade ESLint and dependencies, fix new lint errors, switch Travis to Yarn (#8309)

* Update ESLint to 3.10.2

Also pull in fbjs for extending properly, per @zpao. This also disables consistent-return, which has about 80 failing cases in React currently. If we'd like to turn this back on, we should do it separately and fix all the call sites properly (rather than just adding 'return undefined;' everywhere, which adds no value.

Fixes to all existing lint errors plus an update for yarn.lock to follow.

* Update yarn.lock after the eslint update.

* Fix all new eslint failures

Unfortunately I had to add three eslint-disable-next-line instances. All have explanations inline.

* Switch Travis to use yarn instead of npm

* Update all Jest packages to 17.x (#8327)

* Update all Jest packages to 17.x, cache babel-jest transforms

* Remove the caching

Looking at the other builds it doesn't seem to actually be that necessary.  The bottleneck is executors, not build time.

* Remove unnecessary package, fix fiber test runner

* Regenerate yarn lockfile

* Update Flow to 0.37.0 (#8608)

Nothing really changes.

* Update to Jest 18 (#8621)

* mockImpl -> mockImplementation

D4329549

* Fixed linting errors

* circle.yml and circleci scripts

* Update Flow and fix issues (#8006)

* Fixed flow errors

* Updated shrinkwrap

* Removed unnecessary change

* Added jest --runInBand flag

* Removed ReactDOMFiber changes
2017-01-23 18:20:50 +01:00
tomocchino
eee3bce748 Update error codes 2016-11-16 13:46:20 +00:00
Keyan Zhang
ac0c3e60fb Fix error codes (#7999)
* took codes.json from the 15-dev branch

* fixed react:extract-errors task in gulpfile

* generated error codes

* Revert "generated error codes"

This reverts commit b8f3aeed9d8f0d469edd5f6623fa6090930594d8.

* Added a README for the error code system
2016-11-08 20:26:30 +00:00
Dan Abramov
b0b1303207 Fix benchmarks (#7704)
(cherry picked from commit 3fcba2044a)
2016-10-04 14:24:24 -07:00
Ben Alpert
4f20847f8b Make benchmark script work in React 15
(cherry picked from commit cab835d3a0)
2016-10-04 14:23:45 -07:00
Ben Alpert
3e95d99fe2 Interleave trials in benchmark script
This should be more of a fair A/B test so the timings aren't affected by having different load on your system when testing the two alternatives.

(cherry picked from commit c0007d56e9)
2016-10-04 14:21:18 -07:00
Christopher Chedeau
3135f888f0 Introduce facts-tracker (#7747)
* Introduce facts-tracker

We want to be able to track various things like number of files that are flowified, number of tests passing with Fiber...

This introduces a tool that lets you do that. The API is very simple, you execute the script with a list of tuples [key value] and it's going to create a `facts` branch and put a txt file for each fact and values over time.

```
node scripts/facts-tracker/index.js \
  "flow-files" "$COUNT_WITH_FLOW/$COUNT_ALL_FILES"
```

Test Plan:
This is tricky to test because Travis only exposes the private variables (github token) when it processes a committed file and not on branches. The reason is that otherwise anyone could send a pull requests that does `echo $GITHUB_TOKEN` and steal your token.

Given this constraint, I did all the work using two of my repos:
- https://github.com/vjeux/facts-tracker
- https://github.com/vjeux/facts-tracker-test

and am sending this pull request that should work as is /fingers crossed/, but we won't be able to test it out until it is committed.

Note that once this lands, I'm going to kill those two repos.

* Update with all the suggested changes

* Branch on a flow type in travis.yml

* Use $GITHUB_TOKEN

* properly escape it

(cherry picked from commit dbd9c4b205)
2016-10-04 14:02:22 -07:00
Christopher Chedeau
26d060797c I wrote it live! (#7663)
(cherry picked from commit 334b8bdf16)
2016-10-03 17:57:02 -07:00
Christoph Pojer
96d39380fa Merge pull request #7625 from vjeux/jest15
Update to jest 15
(cherry picked from commit 1bd55c8cbd)
2016-10-03 17:31:41 -07:00
Sebastian Markbåge
21a4e7a826 Mock ReactDOM for Fiber Tests (#7206)
We currently write all our tests against the DOM implementation.
I need a way to run the Fiber tests against it. But I don't want
to take on any package dependencies on Fiber modules yet.

There's a problem with jest right now where you can't globally
mock modules that already exist. So I have to add a global call
to jest.mock.

Luckily we already have a way to test the useCreateElement paths
using a feature flag. I won't activate this flag in travis until
it passes, but the idea is to run all three variants in travis.

I'm not sure that invoking rAF and rIC synchronously is the best
way to test this since it doesn't capture the backwards
compatibility aspect. I.e. the fact that people might be relying
on the synchronous nature in real apps too. It's a start.

Ideally, jest would have these built-in.
(cherry picked from commit c06a68a10b)
2016-10-03 16:08:28 -07:00
Paul O’Shannessy
e5276bbbe7 regenerate error codes 2016-08-19 10:49:42 -07:00
Paul O’Shannessy
94dbf619d3 Regenerate error codes 2016-08-12 16:34:13 -07:00
Paul O’Shannessy
80d09bfbb3 Regenerate error codes 2016-07-13 11:50:57 -07:00
Ben Alpert
40cc8fa45f Update benchmarks to be more realistic polymorphically (#7255)
Previously, the extract-components script would create the same number of layers of composites as the page it captures, but it would output a new class for each time any composite is used (since we don't want to replicate all the component logic).

I changed the script to output a single type for each type in the input -- and each generated component takes an index for which output it should return. This should be closer to how the original code behaves, especially with respect to VM function call lookups where the amount of polymorphism makes a difference.

I re-recorded the benchmarks with the new scripts. They run significantly faster:

```
Comparing old.txt (control) vs new.txt (test)
Significant differences marked by ***
% change from control to test, with 99% CIs:

* ssr_pe_cold_ms_jsc_jit
    % change: -41.73% [-43.37%, -40.09%]  ***
    means: 39.3191 (control), 22.9127 (test)
* ssr_pe_cold_ms_jsc_nojit
    % change: -44.24% [-46.69%, -41.80%]  ***
    means: 45.8646 (control), 25.5764 (test)
* ssr_pe_cold_ms_node
    % change: -45.61% [-47.38%, -43.85%]  ***
    means: 90.1118 (control), 49.0116 (test)
```

This is probably in part due to the changes here, but also the page I captured has changed somewhat in the meantime and there seem to be slightly fewer components in the hierarchy, so they're not really comparable. But going forward we can use this benchmark which should be more accurate. I also included an identical copy that uses stateless functional components so we can test optimizations to those later.
(cherry picked from commit e5513eceff)
2016-07-13 11:44:09 -07:00
Paul O’Shannessy
ebabd2f8cd Rebuild error codes 2016-07-08 11:49:51 -07:00
Paul O’Shannessy
592abf8ee7 Update the error codes 2016-06-14 18:16:41 -07:00
Keyan Zhang
e974383cba Add reactProdInvariant and corresponding babel rewrite pass (#6948)
(cherry picked from commit 1abce1630c)
2016-06-14 15:50:38 -07:00
Ben Alpert
6080ab547d Fix function declaration in if statement (#6963)
Firefox doesn't like these and throws.
(cherry picked from commit 3c3c30a19a)
2016-06-14 15:49:50 -07:00
Dan Abramov
c8b2a3dc13 Merge pull request #6872 from gaearon/jest-cli@12
Update to Jest 12.1.1 and Jasmine 2
(cherry picked from commit c0ecde687a)
2016-06-14 15:49:43 -07:00
Paul O’Shannessy
d945077f42 Merge pull request #6804 from dmitriiabramov/update_typescript
Update typescript
(cherry picked from commit 6a3e9d583b)
2016-06-14 15:34:27 -07:00
Ben Alpert
6638d49ad9 Embed JSX filename paths relative to repo root (#6778)
Test Plan: Changed the preprocessor to log the output of babel.transform and saw

```
var _jsxFileName = 'src/isomorphic/modern/element/__tests__/ReactJSXElementValidator-test.js';
```

in the resulting output, instead of an absolute path.
(cherry picked from commit 6afd51061a)
2016-06-14 15:34:26 -07:00
Keyan Zhang
6aacfdb9ba Add a gulp script for extracting error codes (#6882)
(cherry picked from commit bfd1531eca)
2016-06-07 15:08:42 -07:00
Paul O’Shannessy
ca0c409b6f Merge pull request #6444 from zpao/re__spreadwarn
Add back React.__spread and make it warn
(cherry picked from commit 516c1d809e)
2016-04-07 17:49:05 -07:00
Paul O’Shannessy
1573baaee8 Use Object.assign directly and inject object-assign at compile 2016-04-04 09:53:25 -07:00
Sebastian McKenzie
1365498b81 Update to Babel 6 2016-02-26 16:49:32 -08:00
cpojer
383e2f938d Update to jest-cli 0.9. 2016-02-17 13:01:14 +09:00
Paul O’Shannessy
7c52b802b4 Clean up ununsed devDeps
Also removed object-assign. We only support building with node v4+ which has Object.assign.
2016-01-22 10:17:30 -08:00
Rick Beerendonk
bef45b0b1a Year-agnostic copyright message, like React Native uses, to prevent the need for yearly changes. 2015-12-29 20:20:32 +01:00
Ben Alpert
3997164418 Merge pull request #5550 from spicyj/cc-speed
Make createClass 10-15% faster on complex specs
2015-12-14 14:45:44 -08:00
Justas Brazauskas
0886273438 Fix few typos in React docs and comments 2015-12-13 16:39:07 +02:00
Ben Alpert
ba0792e72b Add createClass stress test
Running this is left as an exercise for the reader, since my measure.py isn't designed for this at present. But something like this might work:

```diff
diff --git a/scripts/bench/measure.py b/scripts/bench/measure.py
index 4cedf47..627ec97 100755
--- a/scripts/bench/measure.py
+++ b/scripts/bench/measure.py
@@ -79,15 +79,12 @@ def _measure_ssr_ms(engine, react_path, bench_name, bench_path, measure_warm):
             if (typeof React !== 'object') throw new Error('React not laoded');
             report('factory_ms', END - START);

-            globalEval(readFile(ENV.bench_path));
-            if (typeof Benchmark !== 'function') {
-              throw new Error('benchmark not loaded');
-            }
+            globalEval("bm = (function(){" + readFile("bench-createclass-madman.js") + "})");
+            bm();
             var START = now();
-            var html = React.renderToString(React.createElement(Benchmark));
-            html.charCodeAt(0);  // flatten ropes
+            bm();
             var END = now();
-            report('ssr_' + ENV.bench_name + '_cold_ms', END - START);
+            report('cc_' + ENV.bench_name + '_cold_ms', END - START);

             var warmup = ENV.measure_warm ? 80 : 0;
             var trials = ENV.measure_warm ? 40 : 0;
@@ -119,7 +116,7 @@ def _main():
         return 1
     react_path = sys.argv[1]

-    trials = 30
+    trials = 60
     sys.stderr.write("Measuring SSR for PE benchmark (%d trials)\n" % trials)
     for i in range(trials):
         for engine in [
@@ -132,7 +129,7 @@ def _main():
         sys.stderr.flush()
     sys.stderr.write("\n")

-    trials = 3
+    trials = 0#3
     sys.stderr.write("Measuring SSR for PE with warm JIT (%d slow trials)\n" % trials)
     for i in range(trials):
         for engine in [
```
2015-11-25 18:24:46 -08:00
Ben Alpert
844ca8b6b2 benchmarking: measure and analyze scripts
This uses wall-clock time (for now) so it's noisier than alternatives
(cachegrind, CPU perf-counters), but it's still valuable. In a future diff we
can make it use those.

`measure.py` outputs something that `analyze.py` can understand, but you can use `analyze.py` without `measure.py` too. The file format is simple:

```
$ cat measurements.txt
factory_ms_jsc_jit 13.580322265625
factory_ms_jsc_jit 13.659912109375
factory_ms_jsc_jit 13.67919921875
factory_ms_jsc_nojit 12.827880859375
factory_ms_jsc_nojit 13.105224609375
factory_ms_jsc_nojit 13.195068359375
factory_ms_node 40.4891400039196
factory_ms_node 40.6669420003891
factory_ms_node 43.52413299679756
ssr_pe_cold_ms_jsc_jit 43.06005859375
...
```

(The lines do not need to be sorted.)

Comparing 0.14.0 vs master:

```
$ ./measure.py react-0.14.0.min.js >014.txt
Measuring SSR for PE benchmark (30 trials)
..............................
Measuring SSR for PE with warm JIT (3 slow trials)
...
$ ./measure.py react.min.js >master.txt
Measuring SSR for PE benchmark (30 trials)
..............................
Measuring SSR for PE with warm JIT (3 slow trials)
...
$ ./analyze.py 014.txt master.txt
Comparing 014.txt (control) vs master.txt (test)
Significant differences marked by ***
% change from control to test, with 99% CIs:

* factory_ms_jsc_jit
    % change:  -0.56% [ -2.51%,  +1.39%]
    means: 14.037 (control), 13.9593 (test)
* factory_ms_jsc_nojit
    % change:  +1.23% [ -1.18%,  +3.64%]
    means: 13.2586 (control), 13.4223 (test)
* factory_ms_node
    % change:  +3.53% [ +0.29%,  +6.77%]  ***
    means: 42.0529 (control), 43.54 (test)
* ssr_pe_cold_ms_jsc_jit
    % change:  -6.84% [ -9.04%,  -4.65%]  ***
    means: 44.2444 (control), 41.2187 (test)
* ssr_pe_cold_ms_jsc_nojit
    % change: -11.81% [-14.66%,  -8.96%]  ***
    means: 52.9449 (control), 46.6953 (test)
* ssr_pe_cold_ms_node
    % change:  -2.70% [ -4.52%,  -0.88%]  ***
    means: 96.8909 (control), 94.2741 (test)
* ssr_pe_warm_ms_jsc_jit
    % change: -17.60% [-22.04%, -13.16%]  ***
    means: 13.763 (control), 11.3439 (test)
* ssr_pe_warm_ms_jsc_nojit
    % change: -20.65% [-22.62%, -18.68%]  ***
    means: 30.8829 (control), 24.5074 (test)
* ssr_pe_warm_ms_node
    % change:  -8.76% [-13.48%,  -4.03%]  ***
    means: 30.0193 (control), 27.3964 (test)
$
```
2015-11-18 16:26:01 -08:00
Ben Alpert
c525732147 Merge pull request #5023 from spicyj/jsc-perf
Add rudimentary jsc perf-counters runner
2015-10-30 17:06:30 -07:00
Paul O’Shannessy
b5d90f8c6b Merge pull request #5331 from tbroadley/typescript-test-windows
Fix for TypeScript test on Windows
2015-10-30 15:45:51 -07:00
Thomas Broadley
d77e161f99 use path library to normalize filepath 2015-10-31 07:38:47 +09:00