Commit Graph

109 Commits

Author SHA1 Message Date
Andrew Clark
3cd89daed9 Update error codes 2018-11-13 20:29:30 +00:00
Andrew Clark
a24d510287 Update error codes for 16.6.1 release 2018-11-06 18:28:50 -08:00
Dan Abramov
c8ade996e9 Update error codes for 16.6.0 release 2018-10-23 16:29:35 -07:00
Abdul Rauf
420001cb4e Fix babel-preset-fbjs configure link in comment (#13666) 2018-10-21 12:23:24 -05:00
Dan Abramov
101ea6b84d Update error codes for 16.6.0-alpha.8af6728 release 2018-10-10 17:18:59 +01:00
Brian Vaughn
789e714bd7 Update error codes for 16.5.2 release 2018-09-18 11:30:50 -07:00
Brian Vaughn
39f93f7987 Revert "Update error codes for 16.6.0-alpha.0 release"
This reverts commit 21ceb19ea0.
2018-09-18 11:00:04 -07:00
Brian Vaughn
21ceb19ea0 Update error codes for 16.6.0-alpha.0 release 2018-09-17 15:05:46 -07:00
Dan Abramov
cc66a1aa23 Update error codes for 16.5.1 release 2018-09-13 19:31:18 +01:00
Héctor Ramos
b87aabdfe1
Drop the year from Facebook copyright headers and the LICENSE file. (#13593) 2018-09-07 15:11:23 -07:00
Brian Vaughn
92a620e214 Update error codes for 16.5.0 release 2018-09-06 09:34:27 -07:00
Dan Abramov
aeda7b745d
Remove fbjs dependency (#13069)
* Inline fbjs/lib/invariant

* Inline fbjs/lib/warning

* Remove remaining usage of fbjs in packages/*.js

* Fix lint

* Remove fbjs from dependencies

* Protect against accidental fbjs imports

* Fix broken test mocks

* Allow transitive deps on fbjs/ for UMD bundles

* Remove fbjs from release script
2018-06-19 16:03:45 +01:00
Dan Abramov
a5957bf296 Update error codes for 16.4.1 release 2018-06-13 17:20:35 +01:00
Andrew Clark
d31e753f89 Update error codes for 16.4.0 release 2018-05-23 17:35:31 -07:00
Dan
7b19f93ab9 Record sizes 2018-05-13 21:12:25 +01:00
Dan Abramov
6494f6b6b8 Update error codes for 16.3.2 release 2018-04-16 16:23:12 +01:00
Dan Abramov
e932e321a8
facebook.github.io/react -> reactjs.org (#12545) 2018-04-04 21:20:41 +01:00
Brian Vaughn
45300e8e5b Update error codes for 16.3.0-alpha.2 release 2018-03-14 13:26:40 -07:00
Dan Abramov
467b1034ce
Disable for...of by default, rewrite cases where it matters (#12198)
* Add no-for-of lint rule

* Ignore legit use cases of for..of

* Rewrite for..of in source code
2018-02-09 16:11:22 +00:00
Brian Vaughn
4da13ec5e1 Update error codes for 16.3.0-alpha.0 release 2018-02-02 13:01:33 -08:00
Jack Hou
e8e62ebb59 use different eslint config for es6 and es5 (#11794)
* use different eslint config for es6 and es5

* remove confusing eslint/baseConfig.js & add more eslint setting for es5, es6

* more clear way to run eslint on es5 & es6 file

* seperate ESNext, ES6, ES6 path, and use different lint config

* rename eslint config file & update eslint rules

* Undo yarn.lock changes

* Rename a file

* Remove unnecessary exceptions

* Refactor a little bit

* Refactor and tweak the logic

* Minor issues
2017-12-11 15:52:46 +00:00
Gabriel Kalani
b097a34eba refactor: scripts/error-codes (#11697)
Convert scripts/error-codes to use ES6 syntax
2017-11-29 01:13:12 +00:00
Dan Abramov
0acde04377 Update error codes for 16.1.0-beta.1 release 2017-11-07 14:53:31 +00:00
Brian Vaughn
8306553301 Update error codes for 16.1.0-beta release 2017-11-02 15:34:31 -07:00
Dan Abramov
21d0c11523
Convert the Source to ES Modules (#11389)
* Update transforms to handle ES modules

* Update Jest to handle ES modules

* Convert react package to ES modules

* Convert react-art package to ES Modules

* Convert react-call-return package to ES Modules

* Convert react-test-renderer package to ES Modules

* Convert react-cs-renderer package to ES Modules

* Convert react-rt-renderer package to ES Modules

* Convert react-noop-renderer package to ES Modules

* Convert react-dom/server to ES modules

* Convert react-dom/{client,events,test-utils} to ES modules

* Convert react-dom/shared to ES modules

* Convert react-native-renderer to ES modules

* Convert react-reconciler to ES modules

* Convert events to ES modules

* Convert shared to ES modules

* Remove CommonJS support from transforms

* Move ReactDOMFB entry point code into react-dom/src

This is clearer because we can use ES imports in it.

* Fix Rollup shim configuration to work with ESM

* Fix incorrect comment

* Exclude external imports without side effects

* Fix ReactDOM FB build

* Remove TODOs I don’t intend to fix yet
2017-11-02 19:50:03 +00:00
Brian Vaughn
72ba8db504 Added unit test that would have caught the recent error code transform regression (#11356)
* Added an automated test that would have caught the recent error code transform bug

* Renamed dev-expression-with-codes test to replace-invariant-error-codes

* Formatting nit
2017-10-25 08:21:55 -07:00
Dan Abramov
1eed302d34 Drop Haste (#11303)
* Use relative paths in packages/react

* Use relative paths in packages/react-art

* Use relative paths in packages/react-cs

* Use relative paths in other packages

* Fix as many issues as I can

This uncovered an interesting problem where ./b from package/src/a would resolve to a different instantiation of package/src/b in Jest.

Either this is a showstopper or we can solve it by completely fobbidding remaining /src/.

* Fix all tests

It seems we can't use relative requires in tests anymore. Otherwise Jest becomes confused between real file and symlink.
https://github.com/facebook/jest/issues/3830

This seems bad... Except that we already *don't* want people to create tests that import individual source files.
All existing cases of us doing so are actually TODOs waiting to be fixed.

So perhaps this requirement isn't too bad because it makes bad code looks bad.

Of course, if we go with this, we'll have to lint against relative requires in tests.
It also makes moving things more painful.

* Prettier

* Remove @providesModule

* Fix remaining Haste imports I missed earlier

* Fix up paths to reflect new flat structure

* Fix Flow

* Fix CJS and UMD builds

* Fix FB bundles

* Fix RN bundles

* Prettier

* Fix lint

* Fix warning printing and error codes

* Fix buggy return

* Fix lint and Flow

* Use Yarn on CI

* Unbreak Jest

* Fix lint

* Fix aliased originals getting included in DEV

Shouldn't affect correctness (they were ignored) but fixes DEV size regression.

* Record sizes

* Fix weird version in package.json

* Tweak bundle labels

* Get rid of output option by introducing react-dom/server.node

* Reconciler should depend on prop-types

* Update sizes last time
2017-10-25 02:55:00 +03:00
Dan Abramov
793a28d698 Use simple invariant in case of missing error codes (#11350) 2017-10-24 09:11:03 -07:00
Brian Vaughn
845b1afdc5 Rollup script can now extract error codes and build in a single pass (#11291)
* Rollup build scripts can now extract error codes while building

* I can't spell ternary
2017-10-20 08:35:33 -07:00
Sebastian Markbåge
b52a5624e9 [CS] Persistent Updates (#11260)
* Update build size

* [CS] Clone container instead of new root concept

The extra "root" concept is kind of unnecessary. Instead of having a
mutable container even in the persistent mode, I'll instead make the
container be immutable too and be cloned. Then the "commit" just becomes
swapping the previous container for the new one.

* Change the signature or persistence again

We may need to clone without any updates, e.g. when the children are changed.

Passing in the previous node is not enough to recycle since it won't have the
up-to-date props and children. It's really only useful to for allocation pooling.

* Implement persistent updates

This forks the update path for host fibers. For mutation mode we mark
them as having an effect. For persistence mode, we clone the stateNode with
new props/children.

Next I'll do HostRoot and HostPortal.

* Refine protocol into a complete and commit phase

finalizeContainerChildren will get called at the complete phase.
replaceContainer will get called at commit.

Also, drop the keepChildren flag. We'll never keep children as we'll never
update a container if none of the children has changed.

* Implement persistent updates of roots and portals

These are both "containers". Normally we rely on placement/deletion effects
to deal with insertions into the containers. In the persistent mode we need
to clone the container and append all the changed children to it.

I needed somewhere to store these new containers before they're committed
so I added another field.

* Commit persistent work at the end by swapping out the container

* Unify cloneOrRecycle

Originally I tried to make the recyclable instance nullable but Flow didn't
like that and it's kind of sketchy since the instance type might not be
nullable.

However, the real difference which one we call is depending on whether they
are equal. We can just offload that to the renderer. Most of them won't
need to know about this at all since they'll always clone or just create
new.

The ones that do know now have to be careful to compare them so they don't
reuse an existing instance but that's probably fine to simplify the
implementation and API.

* Add persistent noop renderer for testing

* Add basic persistent tree test

* Test bail out

This adds a test for bailouts. This revealed a subtle bug. We don't set the
return pointer when stepping into newly created fibers because there
can only be one. However, since I'm reusing this mechanism for persistent
updates, I'll need to set the return pointer because a bailed out tree
won't have the right return pointer.

* Test persistent text nodes

Found another bug.

* Add persistent portal test

This creates a bit of an unfortunate feature testing in the unmount
branch.

That's because we want to trigger nested host deletions in portals in the
mutation mode.

* Don't consider container when determining portal identity

Basically, we can't use the container to determine if we should keep
identity and update an existing portal instead of recreate it. Because
for persistent containers, there is no permanent identity.

This makes it kind of strange to even use portals in this mode. It's
probably more ideal to have another concept that has permanent identity
rather than trying to swap out containers.

* Clear portals when the portal is deleted

When a portal gets deleted we need to create a new empty container and
replace the current one with the empty one.

* Add renderer mode flags for dead code elimination

* Simplify ReactNoop fix

* Add new type to the host config for persistent configs

We need container to stay as the persistent identity of the root atom.
So that we can refer to portals over time.

Instead, I'll introduce a new type just to temporarily hold the children
of a container until they're ready to be committed into the permanent
container. Essentially, this is just a fancy array that is not an array
so that the host can choose data structure/allocation for it.

* Implement new hooks

Now containers are singletons and instead their children swap. That way
portals can use the container as part of their identity again.

* Update build size and error codes

* Address comment

* Move new files to new location
2017-10-18 18:28:23 -07:00
skratchdot
0344f7ad55 [Gatsby] "https://facebook.github.io/react/" -> "https://reactjs.org/" (#10970) 2017-09-29 18:43:22 -07:00
Andrew Clark
7ccfbfc25d Update error codes 2017-09-26 08:44:21 -07:00
Sophie Alpert
d63249d034 Update license headers BSD+Patents -> MIT
Did find and replace in TextMate.

```
find: (?:( \*)( ))?Copyright (?:\(c\) )?(\d{4})\b.+Facebook[\s\S]+(?:this source tree|the same directory)\.$
replace: $1$2Copyright (c) $3-present, Facebook, Inc.\n$1\n$1$2This source code is licensed under the MIT license found in the\n$1$2LICENSE file in the root directory of this source tree.
```
2017-09-25 18:17:44 -07:00
Dan Abramov
07f129bec2 Update error codes 2017-09-14 13:37:26 +01:00
Flarnie Marchan
8e4654015a Update error codes and results.json (#10619)
* Update results.json

**what is the change?:**
Ran the build after updating Yarn lockfile and recorded latest build
size results.

**why make this change?:**
Let's get an idea of bundle size at this point, when we are preparing
the 16.0 RC.

**test plan:**
NA

**issue:**
https://github.com/facebook/react/issues/8854

* Update error codes

https://github.com/facebook/react/tree/master/scripts/release-manager#update-the-error-codes
2017-09-06 11:11:19 -07:00
Sasha Aickin
4d08914985 Fix for #10388. Renames renderToStream to renderToNodeStream. (#10425) 2017-08-10 12:23:00 -07:00
Brian Vaughn
c3718c48f0 16 beta 5 version bump and results JSON 2017-08-08 10:25:25 -07:00
Brian Vaughn
230d41218e Built 16.0.0 beta 3. Updated versions, results.json, and error codes 2017-08-03 16:05:28 -07:00
Brian Vaughn
f3e502c613 FB bundles wrap warning() calls in __DEV__ (#10314)
FB bundles wrap warning() calls in __DEV__

Split dev-mode transforms into separate parts:
1) umd+cjs+fb: Wrap warning calls with process.env checks
2) umd+cjs: Replace error messages with minified codes

Also updated transforms to use __DEV__ since it transforms to smaller code after stripEnvVariables is run.

Also renamed 'scripts/error-codes/dev-expression-with-codes.js' -> 'scripts/error-codes/replace-invariant-error-codes.js'
2017-08-02 14:14:26 -07:00
Michał Pierzchała
73217a74a0 Fix error-codes not updating correctly (#10348)
* Fix error-codes not updating correctly

* Revert changes to codes.json
2017-08-02 10:38:27 +01:00
Brian Vaughn
52849c94a7 Updated error codes (after merging in missing code from 15 stable) (#10290) 2017-07-26 12:18:02 -07:00
Brian Vaughn
8d5f2c4324 Regenerate error codes and update bundle size stats (#10287) 2017-07-26 11:21:43 -07:00
Brian Vaughn
e2d1bc8a71 Update pre-release instructions for generating error-codes (#10286) 2017-07-26 11:18:32 -07:00
Tom Occhino
7b5bdc14d8 Remove build time extractErrors message when error codes can't be found (#9555)
* Remove error message when error codes cannot be found

* Re-record fiber tests to fix CI
2017-05-25 17:07:55 +01:00
Ben Alpert
b1768b5a48 Prettier 1.2 (#9462) 2017-04-20 11:18:33 -07:00
Dan Abramov
398d449c48 Fix the print warnings script (#9344) 2017-04-05 18:54:48 +01:00
Dominic Gannaway
4b2eac3de7 Convert current build system to Rollup and adopt flat bundles (#9327)
* WIP

* fbjs support

* WIP

* dev/prod mode WIP

* More WIP

* builds a cjs bundle

* adding forwarding modules

* more progress on forwarding modules and FB config

* improved how certain modules get inlined for fb and cjs

* more forwarding modules

* added comments to the module aliasing code

* made ReactPerf and ReactTestUtils bundle again

* Use -core suffix for all bundles

This makes it easier to override things in www.

* Add a lazy shim for ReactPerf

This prevents a circular dependency between ReactGKJSModule and ReactDOM

* Fix forwarding module for ReactCurrentOwner

* Revert "Add a lazy shim for ReactPerf"

This reverts commit 723b402c07116a70ce8ff1e43a1f4d92052e8f43.

* Rename -core suffix to -fb for clarity

* Change forwarding modules to import from -fb

This is another, more direct fix for ReactPerf circular dependency

* should fix fb and cjs bundles for ReactCurrentOwner

* added provides module for ReactCurrentOwner

* should improve console output

* fixed typo with argument passing on functon call

* Revert "should improve console output"

This breaks the FB bundles.

This reverts commit 65f11ee64f678c387cb3cfef9a8b28b89a6272b9.

* Work around internal FB transform require() issue

* moved  ReactInstanceMap out of React and into ReactDOM and ReactDOMFiber

* Expose more internal modules to www

* Add missing modules to Stack ReactDOM to fix UFI

* Fix onlyChild module

* improved the build tool

* Add a rollup npm script

* Rename ReactDOM-fb to ReactDOMStack-fb

* Fix circular dependencies now that ReactDOM-fb is a GK switch

* Revert "Work around internal FB transform require() issue"

This reverts commit 0a50b6a90bffc59f8f5416ef36000b5e3a44d253.

* Bump rollup-plugin-commonjs to include a fix for rollup/rollup-plugin-commonjs#176

* Add more forwarding modules that are used on www

* Add even more forwarding modules that are used on www

* Add DOMProperty to hidden exports

* Externalize feature flags

This lets www specify them dynamically.

* Remove forwarding modules with implementations

Instead I'm adding them to react-fb in my diff.

* Add all injection necessary for error logging

* Add missing forwarding module (oops)

* Add ReactART builds

* Add ReactDOMServer bundle

* Fix UMD build of ReactDOMFiber

* Work in progress: start adding ReactNative bundle

* tidied up the options for bundles, so they can define what types they output and exclude

* Add a working RN build

* further improved and tidied up build process

* improved how bundles are built by exposing externals and making the process less "magical", also tidied up code and added more comments

* better handling of bundling ReactCurrentOwner and accessing it from renderer modules

* added NODE_DEV and NODE_PROD

* added NPM package creation and copying into build chain

* Improved UMD bundles, added better fixture testing and doc plus prod builds

* updated internal modules (WIP)

* removed all react/lib/* dependencies from appearing in bundles created on build

* added react-test-renderer bundles

* renamed bundles and paths

* fixed fixture path changes

* added extract-errors support

* added extractErrors warning

* moved shims to shims directory in rollup scripts

* changed pathing to use build rather than build/rollup

* updated release doc to reflect some rollup changes

* Updated ReactNative findNodeHandle() to handle number case (#9238)

* Add dynamic injection to ReactErrorUtils (#9246)

* Fix ReactErrorUtils injection (#9247)

* Fix Haste name

* Move files around

* More descriptive filenames

* Add missing ReactErrorUtils shim

* Tweak reactComponentExpect to make it standalone-ish in www

* Unflowify shims

* facebook-www shims now get copied over correctly to build

* removed unnecessary resolve

* building facebook-www/build is now all sync to prevent IO issues plus handles extra facebook-www src assets

* removed react-native-renderer package and made build make a react-native build dir instead

* 😭😭😭

* Add more SSR unit tests for elements and children. (#9221)

* Adding more SSR unit tests for elements and children.

* Some of my SSR tests were testing for react-text and react-empty elements that no longer exist in Fiber. Fixed the tests so that they expect correct markup in Fiber.

* Tweaked some test names after @gaearon review comment https://github.com/facebook/react/pull/9221#discussion_r107045673 . Also realized that one of the tests was essentially a direct copy of another, so deleted it.

* Responding to code review https://github.com/facebook/react/pull/9221#pullrequestreview-28996315 . Thanks @spicyj!

* ReactElementValidator uses temporary ReactNative View propTypes getter (#9256)

* Updating packages for 16.0.0-alpha.6 release

* Revert "😭😭😭"

This reverts commit 7dba33b2cfc67246881f6d57633a80e628ea05ec.

* Work around Jest issue with CurrentOwner shared state in www

* updated error codes

* splits FB into FB_DEV and FB_PROD

* Remove deps on specific builds from shims

* should no longer mangle FB_PROD output

* Added init() dev block to ReactTestUtils

* added shims for DEV only code so it does not get included in prod bundles

* added a __DEV__ wrapping code to FB_DEV

* added __DEV__ flag behind a footer/header

* Use right haste names

* keeps comments in prod

* added external babel helpers plugin

* fixed fixtures and updated cjs/umd paths

* Fixes Jest so it run tests correctly

* fixed an issue with stubbed modules not properly being replaced due to greedy replacement

* added a WIP solution for ReactCurrentOwner on FB DEV

* adds a FB_TEST bundle

* allows both ReactCurrentOwner and react/lib/ReactCurrentOwner

* adds -test to provides module name

* Remove TEST env

* Ensure requires stay at the top

* added basic mangle support (disbaled by default)

* per bundle property mangling added

* moved around plugin order to try and fix deadcode requires as per https://github.com/rollup/rollup/issues/855

* Fix flow issues

* removed gulp and grunt and moved tasks to standalone node script

* configured circleci to use new paths

* Fix lint

* removed gulp-extract-errors

* added test_build.sh back in

* added missing newline to flow.js

* fixed test coverage command

* changed permissions on test_build.sh

* fixed test_html_generations.sh

* temp removed html render test

* removed the warning output from test_build, the build should do this instead

* fixed test_build

* fixed broken npm script

* Remove unused ViewportMetrics shim

* better error output

* updated circleci to node 7 for async/await

* Fixes

* removed coverage test from circleci run

* circleci run tets

* removed build from circlci

* made a dedicated jest script in a new process

* moved order around of circlci tasks

* changing path to jest in more circleci tests

* re-enabled code coverage

* Add file header to prod bundles

* Remove react-dom/server.js (WIP: decide on the plan)

* Only UMD bundles need version header

* Merge with master

* disabled const evaluation by uglify for <script></script> string literal

* deal with ART modules for UMD bundles

* improved how bundle output gets printed

* fixed filesize difference reporting

* added filesize dep

* Update yarn lockfile for some reason

* now compares against the last run branch built on

* added react-dom-server

* removed un-needed comment

* results only get saved on full builds

* moved the rollup sized plugin into a plugins directory

* added a missing commonjs()

* fixed missing ignore

* Hack around to fix RN bundle

* Partially fix RN bundles

* added react-art bundle and a fixture for it

* Point UMD bundle to Fiber and add EventPluginHub to exported internals

* Make it build on Node 4

* fixed eslint error with resolve being defined in outer scope

* Tweak how build results are calculated and stored

* Tweak fixtures build to work on Node 4

* Include LICENSE/PATENTS and fix up package.json files

* Add Node bundle for react-test-renderer

* Revert "Hack around to fix RN bundle"

We'll do this later.

This reverts commit 59445a625962d7be4c7c3e98defc8a31f8761ec1.

* Revert more RN changes

We'll do them separately later

* Revert more unintentional changes

* Revert changes to error codes

* Add accidentally deleted RN externals

* added RN_DEV/RN_PROD bundles

* fixed typo where RN_DEV and RN_PROD were the wrong way around

* Delete/ignore fixture build outputs

* Format scripts/ with Prettier

* tidied up the Rollup build process and split functions into various different files to improve readability

* Copy folder before files

* updated yarn.lock

* updated results and yarn dependencies to the latest versions
2017-04-05 16:47:29 +01:00
Andrew Clark
e3f6c850c2 Merge pull request #9097 from acdlite/dontextractprodproptypeerror
Fix production propTypes test so it works with error code system
2017-03-03 11:06:04 -08:00
Andrew Clark
fc4633775a Remove destructuring, since the version of node on www doesn't support it 2017-03-02 16:44:04 -08:00
Andrew Clark
673f514f81 Fix PropTypes production test so it works with error code system 2017-03-02 16:12:50 -08:00
Andrew Clark
9c8547cc9f Add script to print out a list of warnings
We'll use this in the GH sync script to track which warnings have
changed since the last sync
2017-03-02 11:37:01 -08:00
Brandon Dail
1ccb9361fe Revert "Revert "Missing a space for error 125"" (#8995) 2017-02-13 23:15:08 +00:00
Dan Abramov
c906fecd26 Revert "Missing a space for error 125" (#8994) 2017-02-13 23:11:05 +00:00
Phil Rajchgot
6367f9fbf3 Missing a space for error 125 (#8981) 2017-02-13 16:21:15 -06:00
Sean Gransee
c16ec5df13 fix misspellings in comments and tests (#8946)
* fix misspellings in comments and tests

* revert change in docs/js/react-dom.js
2017-02-13 16:01:54 -06:00
Keyan Zhang
46609cb95c 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:20:46 +00:00
Christopher Chedeau
334b8bdf16 I wrote it live! (#7663) 2016-09-06 15:18:42 -07:00
Keyan Zhang
1abce1630c Add reactProdInvariant and corresponding babel rewrite pass (#6948) 2016-06-07 17:11:04 -07:00
Keyan Zhang
bfd1531eca Add a gulp script for extracting error codes (#6882) 2016-06-01 11:21:26 -07:00