Commit Graph
995 Commits
Author SHA1 Message Date
Brian VaughnandGitHub 85d4049b9a Prompt to include UMD build artifact links in GitHub release (#14864) 2019-02-15 10:48:20 -08:00
Brian VaughnandGitHub 6798eaffc6 Release scripts documentation (#14863)
* Improve release script process documentation
* Improved pre-publish instructions/message based on feedback
* Added reminder to attach build artifacts to GitHub release
2019-02-15 10:00:43 -08:00
Dan Abramov 0448d1f099 Release 16.8.2 2019-02-14 19:13:15 +00:00
Brian Vaughn 76783886db Tweaked publish canary message to show newly published version 2019-02-06 18:24:51 +00:00
Brian Vaughn abf2771c2b eslint-plugin-react-hooks v1.0.0 2019-02-06 10:14:57 +00:00
Brian Vaughn da0e88304b 16.8.0 2019-02-06 08:04:00 +00:00
Brian VaughnandGitHub 3068a0987b Tidy up NPM checkout process (#14631) 2019-01-18 11:40:50 -08:00
Brian VaughnandGitHub edec6e03a4 Prune NPM metadata fields from packages before re-publishing (#14617) 2019-01-17 14:34:34 -08:00
Brian VaughnandGitHub 212c45875a Rename release script fixture test scheduler->tracing (#14590) 2019-01-14 17:52:03 -08:00
Sunil PaiandGitHub d5d77f93d8 make a fork for ReactCurrentDispatcher (#14588) 2019-01-14 16:35:56 +00:00
Andrew Clark 98bb25c411 React v16.7.0 2018-12-19 17:23:14 -08:00
Andrew Clark aaf9e2e485 Move SchedulerFeatureFlags fork to src directory to fix lint 2018-12-18 11:09:44 -08:00
Andrew ClarkandGitHub 7b6aad13a8 Create separate SchedulerFeatureFlags instead of using ReactFeatureFlags (#14455) 2018-12-17 17:55:34 -08:00
Andrew ClarkandGitHub e40dd51172 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 VaughnandGitHub c6a4798993 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 VaughnandGitHub d154fa52f0 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
HeavenandBrian Vaughn f93c4d225a Remove redundant argument of getPlugins function (#14419) 2018-12-12 10:07:07 -08:00
Brian VaughnandGitHub 4890af89b5 Updated version incrementing suggestion in release script based on team discussion (#14389) 2018-12-07 09:08:39 -08:00
Brian VaughnandGitHub 8587e230cf Don't prompt to tag or create GitHub release for canary releases (#14376) 2018-12-03 09:16:17 -08:00
Brian VaughnandGitHub a67d12af38 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 VaughnandGitHub b089b42557 Removed unnecessary externals from Jest bundles (#14372) 2018-12-01 17:26:12 -08:00
Brian VaughnandGitHub 30e0e16c8b 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ågeandGitHub 8a3c3245b4 [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
Dan AbramovandGitHub 18f8bad8cd [Fire] Add initial build infrastructure (#14359) 2018-11-30 11:52:34 +00:00
Brian VaughnandGitHub 98e854df8a 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
chun shangandDan Abramov a65ba89654 Add a null type test for memo (#14325) 2018-11-27 13:25:24 +00:00
Christoph NakazawaandGitHub da880735d8 Remove usage of fbjs/lib/invariant in ReactNativeViewConfigRegistry. (#14330) 2018-11-26 21:48:08 +00:00
Brian VaughnandGitHub 0447f47f1a 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
Brian VaughnandGitHub 2f3c176a77 Add basic release script snapshot test (#14280)
Added regression test for release scripts
2018-11-23 12:53:39 -08:00
Brian VaughnandGitHub 3f246c8122 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
Andrew ClarkandDan Abramov a567910164 Update error codes 2018-11-13 20:29:30 +00:00
Brian VaughnandGitHub 6fb3376fc1 Save CI-built node_modules as build artifacts (#14205)
* Store node_modules generated by CI script as an artifact
* NPM pack artifacts before archiving
2018-11-13 11:00:30 -08:00
Maksim MarkelovandDan Abramov 854bd9becb Update Readme (#14176)
Replace core with react, dom-client with react-dom
2018-11-12 16:25:32 +00:00
Sebastian MarkbågeandGitHub 5d9dcbe13f Use unique thread ID for each partial render to access Context (#14182)
* BUG: ReactPartialRenderer / New Context polutes mutable global state

The new context API stores the provided values on the shared context instance. When used in a synchronous context, this is not an issue. However when used in an concurrent context this can cause a "push provider" from one react render to have an effect on an unrelated concurrent react render.

I've encountered this bug in production when using renderToNodeStream, which asks ReactPartialRenderer for bytes up to a high water mark before yielding. If two Node Streams are created and read from in parallel, the state of one can polute the other.

I wrote a failing test to illustrate the conditions under which this happens.

I'm also concerned that the experimental concurrent/async React rendering on the client could suffer from the same issue.

* Use unique thread ID for each partial render to access Context

This first adds an allocator that keeps track of a unique ThreadID index
for each currently executing partial renderer. IDs are not just growing
but are reused as streams are destroyed.

This ensures that IDs are kept nice and compact.

This lets us use an "array" for each Context object to store the current
values. The look up for these are fast because they're just looking up
an offset in a tightly packed "array".

I don't use an actual Array object to store the values. Instead, I rely
on that VMs (notably V8) treat storage of numeric index property access
as a separate "elements" allocation.

This lets us avoid an extra indirection.

However, we must ensure that these arrays are not holey to preserve this
feature.

To do that I store the _threadCount on each context (effectively it takes
the place of the .length property on an array).

This lets us first validate that the context has enough slots before we
access the slot. If not, we fill in the slots with the default value.
2018-11-09 15:38:20 -08:00
Andrew Clark 4ebecf3050 ESlint -> ESLint 2018-11-09 10:22:18 -08:00
Sophie AlpertandGitHub 6b16754978 Don't run danger on bad build (#14143)
sizebot comments can be confusing when not based on reality.

If results.json doesn't exist, danger will fail. This is what we want.
2018-11-09 10:21:39 -08:00
Andrew Clark 7cecc264fa Add global to ESLint plugin bundle config 2018-11-08 18:49:03 -08:00
Andrew ClarkandGitHub 28747a745f Add fb build of ESLint plugin (#14165) 2018-11-08 18:44:08 -08:00
Minh NguyenandDan Abramov 58bef64979 Refactor ESLint configuration to enable better IDE integration (#13914)
* Refactor ESLint configuration to enable better IDE integration

* Minor tweaks
2018-11-08 17:56:35 +00:00
Sebastian MarkbågeandGitHub 327f72403c Use Entry in yarn build ... Instead of Label (#14148)
* Parse build script type and package names

This ensures that `yarn build core dom` includes DOM.

It also ensures that spaces like `yarn build "core, dom"` doesn't build EVERYTHING.

* Get rid of label in bundles config

Instead we just use the name from entry using fuzzy search.

There is one special case. If you put in `/index` or `/index.js`.

That allows to build things like `react/index` to only build isomorphic
where as `react` would build everything. Or `react-dom/index` to exclude
the server renderers.

* Instead of matching `/index.js` just append it to the search string

That way things like `yarn build react/` works too.
2018-11-07 20:46:41 -08:00
Brian VaughnandGitHub 8b3f32e0f0 Release script supports interleaved stable and alpha releases (#14138) 2018-11-07 12:33:13 -08:00
Andrew Clark 7fe66572ef Update bundle sizes for 16.6.1 release 2018-11-06 18:28:50 -08:00
Andrew Clark 98eef774df Update error codes for 16.6.1 release 2018-11-06 18:28:50 -08:00
Sebastian MarkbågeandGitHub af58fb483e Add Debug Tools Package for Introspection of Hooks (#14085)
* Add debug tools package

* Add basic implementation

* Implement inspection of the current state of hooks using the fiber tree

* Support useContext hooks inspection by backtracking from the Fiber

I'm not sure this is safe because the return fibers may not be current
but close enough and it's fast.

We use this to set up the current values of the providers.

* rm copypasta

* Use lastIndexOf

Just in case. I don't know of any scenario where this can happen.

* Support ForwardRef

* Add test for memo and custom hooks

* Support defaultProps resolution
2018-11-05 10:02:59 -08:00
Keyan ZhangandDan Abramov 4e40b0cae7 update the benchmark script (#13994) 2018-11-05 15:55:46 +00:00
Caleb MeredithandAndrew Clark 2789879dd8 Add ESLint rule for React Hooks 2018-10-29 11:26:54 -07:00
Dan Abramov 315b223cf0 Update bundle sizes for 16.6.0 release 2018-10-23 16:29:35 -07:00
Dan Abramov 78bc36ff80 Update error codes for 16.6.0 release 2018-10-23 16:29:35 -07:00
Brian Vaughn 6f847464d5 Prettier 2018-10-23 15:06:58 -07:00
Brian VaughnandGitHub 27c7c98684 Add skipCI flag to release script (#13933) 2018-10-23 15:05:14 -07:00