Commit Graph

10764 Commits

Author SHA1 Message Date
Maksim Markelov a9b035b0c2 Separate Object.is polyfill (#14334)
* Separate_Object_Is_Polyfill
2019-01-08 14:21:12 +00:00
Sophie Alpert 547e059f0b
Simplify wording of key warning (#14503)
I don't think "array or iterator" is adding anything, and it may well be confusing, especially since this is one of the first and most common warnings that devs see.
2019-01-07 08:30:23 -08:00
Carl Mungazi 3494ee57e6 Update ReactUpdateQueue.js (#14521)
Fix comment typo
2019-01-02 20:53:05 +00:00
Ilja Daderko fef40c061e Allow node 11 as devEngine (#14450)
Using node 11 throws incompatibility error. This fixes it. Only test I performed was to run `yarn build -- --type=RN_OSS` everything seemed ok.
2018-12-25 17:05:31 +00:00
Carl Mungazi 659c13963e Update ReactFiberScheduler.js (#14477)
Fixed typo
2018-12-20 08:51:47 -08:00
Andrew Clark 84b86471ea Update CHANGELOG for 16.7 2018-12-19 17:29:25 -08:00
Andrew Clark c695b2384f React v16.7.0 2018-12-19 17:23:14 -08:00
Andrew Clark 1c5aa2f23a Move SchedulerFeatureFlags fork to src directory to fix lint 2018-12-18 11:09:44 -08:00
Andrew Clark 653bc582f9
Create separate SchedulerFeatureFlags instead of using ReactFeatureFlags (#14455) 2018-12-17 17:55:34 -08:00
Andrew Clark 8bfef0da55 Make scheduler debugging feature flag static 2018-12-17 16:50:38 -08:00
Andrew Clark 4a1072194f
Memoize promise listeners to prevent exponential growth (#14429)
* Memoize promise listeners to prevent exponential growth

Previously, React would attach a new listener every time a promise is
thrown, regardless of whether the same listener was already attached
during a previous render. Because React attempts to render every time
a promise resolves, the number of listeners grows quickly.

This was especially bad in synchronous mode because the renders that
happen when the promise pings are not batched together. So if a single
promise has multiple listeners for the same root, there will be multiple
renders, which in turn results in more listeners being added to the
remaining unresolved promises. This results in exponential growth in
the number of listeners with respect to the number of IO-bound
components in a single render.

Fixes #14220

* Memoize on the root and Suspense fiber instead of on the promise

* Add TODO to fix persistent mode tests
2018-12-14 11:03:23 -08:00
Brian Vaughn 535804f5c8
Removed Fabric-specific feature flag files and updated Rollup to use the (non-Fabric) React Native flag files. (#14437) 2018-12-14 07:54:46 -08:00
Brian Vaughn 2743fb7b23
Enable hooks by default for FB React Native renderer (#14435)
* Enable hooks by default for FB React Native renderer
* Updated RN+FB feature flags to make some of the dynamic ones static
2018-12-13 13:20:23 -08:00
Brian Vaughn 7325ebe4d6
Inject overrideProps() fn to DevTools (#14427)
* Inject overrideProps() fn to DevTools

This function will enable editing props for function components, host nodes, and special types like memo and forwardRef.
2018-12-13 09:40:59 -08:00
Pleun Vanderbauwhede a22880e5e5 Add support for Suspense & lazy() to the react-is package (#14423)
* Add support for lazy & Suspense to react-is
2018-12-12 10:56:52 -08:00
Heaven 947bddd5cf Remove redundant argument of getPlugins function (#14419) 2018-12-12 10:07:07 -08:00
Brian Vaughn ce43a8cd07
Updated version incrementing suggestion in release script based on team discussion (#14389) 2018-12-07 09:08:39 -08:00
Brian Vaughn f64906fba1
Dangerfile exits early if build failed (#14400)
* Dangerfile exits early (without leaving an error comment) if build failed
2018-12-07 09:06:47 -08:00
Kevin Chavez 8df4d59be5 Implement pauseExecution, continueExecution, dumpQueue for Scheduler (#14053)
* Implement pauseExecution, continueExecution, dumpQueue

* Expose firstCallbackNode. Fix tests. Revert results.json

* Put scheduler pausing behind a feature flag
2018-12-06 13:57:23 -08:00
Brian Vaughn 5bb4ad7376
Added ErrorBoundary tests for useEffect and useLayoutEffect (#14401) 2018-12-06 13:55:38 -08:00
Brian Vaughn 98eb5ae531
TestRenderer toJSON should not expose the Array wrapper Suspense uses for hidden trees (#14392) 2018-12-05 11:09:51 -08:00
Spencer Ahrens 39489e7674 Enable hooks in fabric (#14301)
because hooks are awesome.
2018-12-04 19:34:52 -08:00
Brian Vaughn 1dc108e582 Tweaked wording for v8 "performance cliff" issue 2018-12-04 07:49:33 -08:00
AGCB d9871729c8 fix spelling error: differen -> different (#14378) 2018-12-03 23:29:29 -08:00
Brian Vaughn 6bf5e85986
Fix scheduler setTimeout() re-entrancy check (#14384) 2018-12-03 10:54:01 -08:00
Brian Vaughn 7a48c900b7
Prevent a v8 deopt when profiling (#14383) 2018-12-03 09:22:46 -08:00
Brian Vaughn e382b0ba95
Don't prompt to tag or create GitHub release for canary releases (#14376) 2018-12-03 09:16:17 -08:00
Brian Vaughn 8482cbe22d
Automated fixture tests (#14370)
* Renamed snapshot test from test.js to snapshot-test.js
* Automate fixtures tests
2018-12-02 11:25:45 -08:00
Brian Vaughn f00c2755b9
Removed unnecessary externals from Jest bundles (#14372) 2018-12-01 17:26:12 -08:00
Brian Vaughn 52bea95cfc
Fixed scheduler setTimeout fallback (#14358)
* Fixed scheduler setTimeout fallback
* Moved unit-test-specific setTimeout code into a new NPM package, jest-mock-scheduler.
2018-12-01 13:03:19 -08:00
Sebastian Markbåge 1d25aa5787
[Fizz] New Server Rendering Infra (#14144)
* [Fizz] Add Flow/Jest/Rollup build infra

Add a new package for react-stream which allows for custom server renderer
outputs. I picked the name because it's a reasonable name but also
because the npm name is currently owned by a friend of the project.

The react-dom build has its own inlined server renderer under the
name `react-dom/fizz`.

There is also a noop renderer to be used for testing. At some point
we might add a public one to test-renderer but for now I don't want to have
to think about public API design for the tests.

* Add FormatConfig too

We need to separate the format (DOM, React Native, etc) from the host
running the server (Node, Browser, etc).

* Basic wiring between Node, Noop and DOM configs

The Node DOM API is pipeToNodeStream which accepts a writable stream.

* Merge host and format config in dynamic react-stream entry point

Simpler API this way but also avoids having to fork the wrapper config.

Fixes noop builds.

* Add setImmediate/Buffer globals to lint config

Used by the server renderer

* Properly include fizz.node.js

Also use forwarding to it from fizz.js in builds so that tests covers
this.

* Make react-stream private since we're not ready to publish

or even name it yet

* Rename Renderer -> Streamer

* Prefix react-dom/fizz with react-dom/unstable-fizz

* Add Fizz Browser host config

This lets Fizz render to WHATWG streams. E.g. for rendering in a
Service Worker.

I added react-dom/unstable-fizz.browser as the entry point for this.

Since we now have two configurations of DOM. I had to add another
inlinedHostConfigs configuration called `dom-browser`. The reconciler
treats this configuration the same as `dom`. For stream it checks
against the ReactFizzHostConfigBrowser instead of the Node one.

* Add Fizz Browser Fixture

This is for testing server rendering - on the client.

* Lower version number to detach it from react-reconciler version
2018-11-30 11:38:22 -08:00
Imre Osswald f1bf281605 Fix bug in cloneHook (#14364)
* Fixes #14360 and adds a test for mixed priority dispatches.

It was broken because `cloneHook` assigned `memoizedState` instead of
`baseState` from the original hook to `baseState` of the clone.

* tweak comments
2018-11-30 15:02:19 +00:00
Dan Abramov 16e120438c
[Fire] Add initial build infrastructure (#14359) 2018-11-30 11:52:34 +00:00
Dan Abramov d14ba87b1b
Validate propTypes for lazy() and memo() and warn about invalid patterns (#14298)
* Add a test for current defaultProps behavior in lazy

* Add a warning against definining defaultProps on the outer wrapper

* Warn about setting propTypes too

* Remove redundant async

* Validate propTypes for resolved lazy types

Note this only works for elements created after resolving. So it's not ideal. But it provides the best stack trace for those cases.

* Add a test for lazy(forwardRef()) propTypes check

* Validate memo() inner propTypes and warn about shadowing

* Add test verifying nested lazy is unsupported

* Change error wording to remove "Promise elements"

* Improve error message for nested lazy() and add tests

* Validate propTypes for memo in the reconciler when necessary

* Add comments for why we're calling checkPropTypes

* Fix Flow and lint

* Undo unintentional formatting changes

* Remove unnecessary case (it is handled by function code path)

* Add test coverage for memo(fn.defaultProps).propTypes

* Test should be agnostic of where resolving happens

That's an implementation detail and we might want to change it later. Let's keep it easy by making tests just check that validation happened, not at which stage.

* Unify traversal logic in createElement

This moves all type traversal into createElement. When lazy resolves, we call createElement once to re-check.

* Match prod behavior for propTypes/defaultProps shims closer

* Revert "Unify traversal logic in createElement"

This reverts commit 2e77ca47fe.

See https://github.com/facebook/react/pull/14298#issuecomment-442687775

* Undo unnecessary change to getComponentName
2018-11-29 20:06:28 +00:00
Brian Vaughn 88ada98198
Release script auto-determine the latest Canary build if none specified (#14339)
* Release script auto-determine the latest Canary build if none specified
2018-11-28 13:56:45 -08:00
Jinto Jose 4f964f09c1 Adding isMemo check to react-is package (#14313) 2018-11-28 12:51:21 -08:00
Sophie Alpert c2a2d8a539
Remove useMutationEffect (#14336)
useMutationEffect has problems (namely, refs aren't attached at the time that it runs) and we're not positive it's necessary. useLayoutEffect runs at the same time as componentDidMount/Update so it's sufficient for all existing use cases; it can be used in any case that useEffect happens too late. Until we figure out what we want to do, let's delete it.
2018-11-27 13:05:13 -08:00
chun shang 48f1e5b3ce Add a null type test for memo (#14325) 2018-11-27 13:25:24 +00:00
Dan Abramov f93f3402f7
Make useEffect(async) warning more verbose (#14327)
* Make useEffect(async) warning more verbose

* Nit
2018-11-27 13:05:10 +00:00
Pelle Wessman ee3ef3a079 Fix regression: Errors not emitted in streams (#14314)
Regression introduced in #14182 resulted in errors no longer being emitted on streams, breaking many consumers.

Co-authored-by: Elliot Jalgard <elliot.j@live.se>
2018-11-27 13:00:46 +00:00
Christoph Nakazawa 33f6f5e532
Remove usage of `fbjs/lib/invariant` in ReactNativeViewConfigRegistry. (#14330) 2018-11-26 21:48:08 +00:00
Brian Vaughn 409066a0a1
Add progress bars to longer running async release tasks (#14322)
* Add progress bars to longer running async release tasks
* Updated to 0.2 progress estimator version
2018-11-26 09:28:37 -08:00
Sunil Pai a7f270c550
update fixtures/packaging/README.md (#14320)
I had some confusion yesterday with this, figured this reads a little better.  Ran these steps locally to verify they work.
2018-11-24 21:40:56 +00:00
Brian Vaughn ed4c4a51cd
Add basic release script snapshot test (#14280)
Added regression test for release scripts
2018-11-23 12:53:39 -08:00
Brian Vaughn 686f1060ad
Publish a local release (canary or stable) to NPM (#14260)
New release scripts.

Learn more at https://github.com/facebook/react/blob/master/scripts/release/README.md
2018-11-23 12:37:18 -08:00
Dan Abramov 7475120ce7
Prevent deopts from modifying exports object in stable builds (#14309) 2018-11-23 14:10:57 +00:00
Dan Abramov 0c7189d923
Fix resolution of outer props with React.memo() (#14312)
* Add failing test for defaultProps between lazy() and memo()

* Add another regression test for defaultProps resolution order

* Resolve outer props for MemoComponent
2018-11-22 19:40:42 +00:00
Dan Abramov 14be29b2b9
Add more test coverage for nested memo() (#14311) 2018-11-22 19:30:56 +00:00
Dan Abramov dc0dd4bbff
Use |0 to coerce to number (#14297) 2018-11-22 15:44:00 +00:00
Dan Abramov dd8205cef9
List ignored types instead of included types in the stack (#14308) 2018-11-22 15:41:29 +00:00