Commit Graph

673 Commits

Author SHA1 Message Date
Clement Hoang
dc48cc38ea Enable createRoot API in www (#11501) 2017-11-09 15:33:49 +00:00
Dan Abramov
c3a529325f Fix the release script 2017-11-09 15:16:24 +00:00
Dan Abramov
7d9b4ba35a Update bundle sizes for 16.1.0 release 2017-11-09 14:55:57 +00:00
Dan Abramov
17aa4d4682 Update bundle sizes for 16.1.0-rc release 2017-11-08 22:59:38 +00:00
Dan Abramov
c83596df65 Consolidate build process with GCC (#11483)
* Consolidate build process with GCC

* Record sizes

* Refactor header and footer wrapping

It is easier to understand if we just explicitly type them out.
2017-11-08 22:37:11 +00:00
Brian Vaughn
8a0285fb43 Release script follow-up (#11482)
* Add a timeout before querying npm right after publish

* Conditionally log some post publish steps

* Print ready-to-paste 'yarn add' instructions for CRA prerelease testing
2017-11-08 19:59:26 +00:00
Clement Hoang
94f44aeba7 Update prettier to 1.8.1 (#10785)
* Change prettier dependency in package.json version 1.8.1

* Update yarn.lock

* Apply prettier changes

* Fix ReactDOMServerIntegration-test.js

* Fix test for ReactDOMComponent-test.js
2017-11-07 18:09:33 +00:00
Dan Abramov
de48ad1646 Add react-call-return to publish list 2017-11-07 16:16:46 +00:00
Dan Abramov
0bd2c2bb3d Fix error reporting in release script 2017-11-07 15:03:08 +00:00
Dan Abramov
a653f910f8 Update bundle sizes for 16.1.0-beta.1 release 2017-11-07 14:53:31 +00:00
Dan Abramov
0acde04377 Update error codes for 16.1.0-beta.1 release 2017-11-07 14:53:31 +00:00
Kiho · Cham
acb268c577 minor typo (#11477)
concurently --> concurrently
2017-11-07 09:39:15 +00:00
Dan Abramov
2c228f15a0 Correctly replace shims using relative requires (#11472) 2017-11-06 16:53:13 +00:00
Dan Abramov
96914c98df Split static and dynamic www feature flags (#11471) 2017-11-06 16:17:43 +00:00
Dan Abramov
3b27160f82 Put perf integration behind a feature flag (#11455)
* Enable User Timing API integration with a feature flag

* Expose a way to toggle user timing flag in www

* Update ReactNativeCSFeatureFlags.js

* Update ReactFeatureFlags.js
2017-11-06 16:07:08 +00:00
Dan Abramov
699496164d Record sizes 2017-11-06 15:34:42 +00:00
Dan Abramov
46f7b0d945 Fix dead code elimination for feature flags (#11453)
* Fix dead code elimination for feature flags

Turning flags into named exports fixes dead code elimination.

This required some restructuring of how we verify that flag types match up. I used the Check<> trick combined with import typeof, as suggested by @calebmer.

For www, we can no longer re-export `require('ReactFeatureFlags')` directly, and instead destructure it. This means flags have to be known at init time. This is already the case so it's not a problem. In fact it may be better since it removes extra property access in tight paths.

For things that we *want* to be dynamic on www (currently, only performance flag) we can export a function to toggle it, and then put it on the secret exports. In fact this is better than just letting everyone mutate the flag at arbitrary times since we can provide, e.g., a ref counting interface to it.

* Record sizes
2017-11-06 14:14:48 +00:00
Dan Abramov
b6a7beefe4 Use Rollup legacy mode for www builds (#11469) 2017-11-06 13:57:15 +00:00
Joe Lim
1d1f7038ec Handle prettier error (#11466)
* handle prettier error

* error if prettier fail
2017-11-06 11:17:51 +00:00
Joe Lim
40fbed5721 Use prettier api (#11458)
* use prettier-api

* fix string to boolean

* fix eslint

* fix typo

* cleanup

* use object assign
2017-11-05 21:06:08 +00:00
Dan Abramov
92b7b172cc Use named exports in more places (#11457)
* Convert EventPlugin{Hub,Registry} to named exports

* Convert EventPluginUtils to named exports

* Convert EventPropagators to named exports

* Convert ReactControlledComponent to named exports

* Convert ReactGenericBatching to named exports

* Convert ReactDOMComponentTree to named exports

* Convert ReactNativeComponentTree to named exports

* Convert ReactNativeRTComponentTree to named exports

* Convert FallbackCompositionState to named exports

* Convert ReactEventEmitterMixin to named exports

* Convert ReactBrowserEventEmitter to named exports

* Convert ReactNativeEventEmitter to named exports

* Convert ReactDOMEventListener to named exports

* Convert DOMMarkupOperations to named exports

* Convert DOMProperty to named exports

* Add suppression for existing Flow violation

Flow didn't see it before.

* Update sizes
2017-11-05 11:58:36 +00:00
Joe Lim
7432013872 make linc script cross platform (#11447)
* make linc script cross platform

* fix typo

* attempt to fix long command error

* use eslint node api

* Update linc.js
2017-11-04 18:09:28 +00:00
Dan Abramov
646781b0b4 Tweak the bundle validation script
Exit on error, and minor nits.
2017-11-04 13:00:49 +00:00
Soo Jae Hwang
da86a4553b Validate built bundles exists (#11452) 2017-11-04 12:57:48 +00:00
Brian Vaughn
af08b5cbca Release script follow-up work after 16.1.0-beta release (#11437)
* Build script creates git tag

* Build script post instructions print better relative paths

* Pre-release (<1.0) version numbers also include pre-release suffix (eg '-beta.0')

* Post-NPM-publish step properly handles minor rev comparison check

* Release script also updates @next tag when publishing @latest

* Fixed a typo. Improved inline comment.
2017-11-03 13:19:32 -07:00
Dan Abramov
61d35ce1f3 Record sizes and fix bundle lint 2017-11-03 18:01:53 +00:00
Brian Vaughn
1298e15f84 Update bundle sizes for 16.1.0-beta release 2017-11-02 15:34:31 -07:00
Brian Vaughn
8306553301 Update error codes for 16.1.0-beta release 2017-11-02 15:34:31 -07:00
Brian Vaughn
a181ba8707 Auto-install (or update) release script Yarn deps before running (#11434) 2017-11-02 15:21:28 -07:00
Dan Abramov
c0ee8df26c Record sizes 2017-11-02 19:54:58 +00: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
Dan Abramov
fbf617a263 Update Rollup (#11427)
* Update Rollup

* Strip "use strict" in individual modules

* Record sizes
2017-11-02 16:56:12 +00:00
Dan Abramov
f302a6a334 Record sizes 2017-11-02 16:26:54 +00:00
Dan Abramov
4008f6d37d Validate built bundles with a few ESLint rules (#11432) 2017-11-02 15:50:25 +00:00
Dan Abramov
9d75a62d14 Depend on prop-types/checkPropTypes, not prop-types itself (#11420)
* Remove prop-types/checkPropTypes reimplementation

* Remove renderer dependency on top-level PropTypes

This annotation is unnecessary because we already warn for bad event listener types.

* Record sizes
2017-11-01 10:57:24 +00:00
Dan Abramov
9f2b15909a Record sizes 2017-10-31 22:14:22 +00:00
Márcio Vicente
d61af82390 Removing dot to avoid redirect to facebook.com (#11400)
* Removing dot to avoid redirect to facebook.com

* Changing phrase instead of using

* Tweak test

* Reset unrelated file
2017-10-30 14:16:18 +00:00
Sebastian Markbåge
696908f496 [CS] Implement Some Stuff (#11390)
* Implement CS first take

This is using a pure JS API. This should probably switch to native hooks
at some later point but I'll start ironing out issues at this level first.

* Use async scheduling by default

The scheduled callback gets called immediately in render with infinite
time for now. Later this will be per root and abortable.

* Fix up the type signature of the ReactNativeCSType export

* Add escape hatch for special cased children

Working around the fact that we can't map arbitrary children slots. Just
the "children" prop.

* Readd providesModule for ReactNativeCSTypes

* Fix lint

* Fix ReactNativeTypes providesModule and CI check

* Special case a parent instance that doesn't have a props object

CSCustom can be anything here. Ugly but whatevs.

* Don't forget to store stateUpdater so that we can trigger updates

* Fix test
2017-10-27 20:05:34 -07:00
Dan Abramov
707ca7f492 Update Jest and remove hacks (#11372)
* Update Jest

* Remove hacks for Jest + Workspace integration

They were fixed by https://github.com/facebook/jest/pull/4761.

* Use relative requires in tests relying on private APIs

I changed them to absolute to work around a Jest bug.
The bug has been fixed so I can revert my past changes now.
2017-10-26 15:15:24 +01:00
Brian Vaughn
c86ae4b46f Added naive scheduleDeferredCallback implementation for RN (#11362)
* Added naive scheduleDeferredCallback implementation for RN

* Fixed ReactNative shim's expected @provideModule
2017-10-25 14:13:34 -07:00
Dan Abramov
2c0a8fb99e Add react-call-return package (#11364) 2017-10-25 22:23:55 +03:00
Dan Abramov
087c48bb36 Reorder imports (#11359)
* Reorder imports

* Record sizes
2017-10-25 21:07:54 +03:00
Dan Abramov
f1c6488f1b Forbid adding new files with @providesModule (#11361)
* Forbid adding new files with @providesModule

* Turn off Haste mode in Flow config

* chmod a+x

* Try to fix bash

* Try to fix bash again
2017-10-25 19:50:34 +03: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
3ad5bd803f Expose TapEventPlugin on the www bundle (#11360) 2017-10-25 17:37:49 +03: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
Dan Abramov
d5f26b041e Rename Haste modules (#11349) 2017-10-24 17:26:07 +03:00
Dan Abramov
4ceb5a4aa0 Record sizes 2017-10-23 15:06:36 +01:00
Andrew Clark
2e4663f616 Split performWork into renderRoot and commitRoot (#11264)
* Split performWork into renderRoot and commitRoot

It turns out that the scheduler is too coupled to how the DOM renderer
works. Specifically, the requestIdleCallback model, and how roots are
committed immediately after completing. Other renderers have different
constraints for when to yield and when to commit work.

We're moving towards a model where the scheduler only works on a single
root at a time, and the render phase and commit phase are split into
distinct entry points. This gives the renderer more control over when
roots are committed, coordinating multiple roots, deferring the commit
phase, batching updates, when to yield execution, and so on.

In this initial commit, I've left the renderers alone and only changed
the scheduler. Mostly, this involved extracting logic related to
multiple roots and moving it into its own section at the bottom of the
file. The idea is that this section can be lifted pretty much as-is
into the renderers. I'll do that next.

* Remove FiberRoot scheduleAt

Isn't actually used anywhere

* Make the root schedule a linked list again

Since this still lives inside the renderer, let's just use the
FiberRoot type. The FiberRoot concept will likely be lifted out
eventually, anyway.

* commitRoot should accept a HostRoot

This way it's less reliant on the alternate model

* Unify branches

* Remove dead branch

onUncaughtError is only called while we're working on a root.

* remainingWork -> remainingExpirationTime

I was wary of leaking NoWork but mixing numbers and null is worse so
let's just do it until we think of something better.

* Rename stuff
2017-10-20 13:22:29 -07:00