Commit Graph
12795 Commits
Author SHA1 Message Date
Dan AbramovandGitHub 822f4cdc04 Ignore react-native-web in Flow checks (#17999) 2020-02-07 16:24:25 +00:00
Dominic GannawayandGitHub bb7eac1844 Move React Map child check to behind flags or __DEV__ (#17995) 2020-02-07 12:21:50 +00:00
cutjavascriptandGitHub 1520f7b0c4 dataForRoots.set duplicate removal (#17993)
dataForRoots.set duplicate removal
2020-02-06 11:48:02 -08:00
Dan AbramovandGitHub f49e5bfacb Fix Flow type for React Native (#17992) 2020-02-06 18:31:13 +00:00
Dominic GannawayandGitHub 985a2438fc Add feature flag for removing children Map support (#17990) 2020-02-06 13:19:35 +00:00
Dominic GannawayandGitHub d4bc2f4673 Use babel parser rather than Babylon in extract errors (#17988) 2020-02-06 12:46:32 +00:00
f2e6061ff6 Updated release script documentation and command names (#17929)
* Updated release script documentation and command names

* Update scripts/release/README.md

Co-Authored-By: Sunil Pai <[email protected]>

* Updated README

Co-authored-by: Sunil Pai <[email protected]>
2020-02-05 08:52:31 -08:00
Sunil PaiandGitHub f4618d8f91 fix sizebot - point correctly to circleci artifact (#17975)
similar to #17972, this should fix sizebot not reporting stats right now
2020-02-04 14:03:12 -08:00
Brian Vaughn de9d449430 Formatting fix (Prettier) to build script 2020-02-04 11:37:38 -08:00
Brian VaughnandGitHub 85d7397c6b Fix release scripts (#17972)
Circle CI seems to have changed the reported artifact path which broke our scripts.
2020-02-04 11:36:49 -08:00
Andrew ClarkandGitHub 16d1681f12 [Mock Scheduler] Mimic browser's advanceTime (#17967)
The mock Scheduler that we use in our tests has its own fake timer
implementation. The `unstable_advanceTime` method advances the timeline.

Currently, a call to `unstable_advanceTime` will also flush any pending
expired work. But that's not how it works in the browser: when a timer
fires, the corresponding task is added to the Scheduler queue. However,
we will still wait until the next message event before flushing it.

This commit changes `unstable_advanceTime` to more closely resemble the
browser behavior, by removing the automatic flushing of expired work.

```js
// Before this commit
Scheduler.unstable_advanceTime(ms);

// Equivalent behavior after this commit
Scheduler.unstable_advanceTime(ms);
Scheduler.unstable_flushExpired();
```

The general principle is to prefer separate APIs for scheduling tasks
and flushing them.

This change does not affect any public APIs. `unstable_advanceTime` is
only used by our own test suite. It is not used by `act`.

However, we may need to update tests in www, like Relay's.
2020-02-04 11:35:21 -08:00
edc8e52275 apply changes on editablevalue on blur feature implemented (#17062)
* apply changes on editablevalue on blur feature implemented

* Removed "Undo" button and unnecessary event.preventDefault()

Co-authored-by: Brian Vaughn <[email protected]>
2020-02-04 11:05:01 -08:00
Dan AbramovandGitHub a38d2c853e Remove Suspense priority warning (#17971)
* Remove Suspense priority warning

* Fix tests
2020-02-04 18:05:15 +00:00
Alfredo GranjaandGitHub 7b7cab0028 Fix onMouseEnter is fired on disabled buttons (#17675) 2020-02-04 14:56:55 +00:00
Hassan AlamandGitHub d0c2f8cfb5 Add dom fixture for autofilled form state (#17951) 2020-02-04 14:53:35 +00:00
Sunil PaiandGitHub c5d9782838 make testing builds for React/ReactDOM (#17915)
This PR introduces adds `react/testing` and `react-dom/testing`.
- changes infra to generate these builds
- exports act on ReactDOM in these testing builds
- uses the new test builds in fixtures/dom

In the next PR -

- I'll use the new builds for all our own tests
- I'll replace usages of TestUtils.act with ReactDOM.act.
2020-02-03 23:31:31 +00:00
Sebastian MarkbågeandGitHub a0a3cd8217 Simplify Continuous Hydration Targets (#17952)
* Simplify Continuous Hydration Targets

Let's use a constant priority for this. This helps us avoid restarting
a render when switching targets and simplifies the model.

The downside is that now we're not down-prioritizing the previous hover
target. However, we think that's ok because it'll only do one level too
much and then stop.

* Add test meant to show why it's tricky to merge both hydration levels

Having both levels co-exist works. However, if we deprioritize hydration
using a single level, we might deprioritize the wrong thing.

This adds a test that catches it if we ever try a naive deprioritization
in the future.

It also tests that we don't down-prioritize if we're changing the hover
in the middle of doing continuous priority work.
2020-02-03 12:47:14 -08:00
Brian VaughnandGitHub e6ce4508ce Flush useEffect clean up functions in the passive effects phase (#17925)
* Flush useEffect clean up functions in the passive effects phase

This is a change in behavior that may cause broken product code, so it has been added behind a killswitch (deferPassiveEffectCleanupDuringUnmount)

* Avoid scheduling unnecessary callbacks for cleanup effects

Updated enqueuePendingPassiveEffectDestroyFn() to check rootDoesHavePassiveEffects before scheduling a new callback. This way we'll only schedule (at most) one.

* Updated newly added test for added clarity.

* Cleaned up hooks effect tags

We previously used separate Mount* and Unmount* tags to track hooks work for each phase (snapshot, mutation, layout, and passive). This was somewhat complicated to trace through and there were man tag types we never even used (e.g. UnmountLayout, MountMutation, UnmountSnapshot). In addition to this, it left passive and layout hooks looking the same after renders without changed dependencies, which meant we were unable to reliably defer passive effect destroy functions until after the commit phase.

This commit reduces the effect tag types to only include Layout and Passive and differentiates between work and no-work with an HasEffect flag.

* Disabled deferred passive effects flushing in OSS builds for now

* Split up unmount and mount effects list traversal
2020-02-03 12:30:01 -08:00
EvyatarandGitHub 714f93657a Add version property to ReactDOM (#15780) 2020-02-03 11:19:04 -08:00
Dominic GannawayandGitHub 6440148970 Add beforeRemoveInstance method to ReactNoop (#17959) 2020-02-03 11:31:51 +00:00
Mark HuangandGitHub 1addaf599e Fix Cannot read property 'sub' of undefined when navigating to plain-text pages (#17848)
Update various parts of DevTools to account for the fact that the global "hook" might be undefined if DevTools didn't inject it (due to the page's `contentType`) it (due to the page's `contentType`)
2020-02-02 12:04:48 -08:00
Brian VaughnandGitHub bd9ef1ed58 Add DevTools tests for copying complex values (#17948) 2020-01-31 15:17:57 -08:00
Deniz SusmanandGitHub 1a2ab5e68e Typo fix (#17946) 2020-01-31 14:51:43 -08:00
Farhad YasirandGitHub 32428b62d8 fix: check bigint in serializeToString and change it to string (#17931) 2020-01-31 14:35:59 -08:00
Nicolas GallagherandGitHub 2e5c6a1f39 Update google-closure-compiler (#17902) 2020-01-30 17:34:03 -08:00
Brian VaughnandGitHub caa54dbabf StrictMode should call sCU twice in DEV (#17942) 2020-01-30 13:03:44 -08:00
Andrew ClarkandGitHub 5e6d2a343d Revert "Bugfix: Expiring a partially completed tree (#17926)" (#17941)
This reverts commit e7618e09a1.

* Failing test: Expiring a partially completed tree

We should not throw out a partially completed tree if it expires in the
middle of rendering. We should finish the rest of the tree without
yielding, then finish any remaining expired levels in a single batch.

* Check if there's a partial tree before restarting

If a partial render expires, we should stay in the concurrent path
(performConcurrentWorkOnRoot); we'll stop yielding, but the rest of the
behavior remains the same.

We will only revert to the sync path (performSyncWorkOnRoot) when
starting on a new level.

This approach prevents partially completed concurrent work from
being discarded.

* New test: retry after error during expired render
2020-01-30 11:14:57 -08:00
Brian VaughnandGitHub b1f09393de Remove root.unmount() callback from DevTools code (#17939) 2020-01-30 09:36:43 -08:00
Sebastian MarkbågeandGitHub f4b1fe4731 Fix Event Replaying in Flare by Eagerly Adding Active Listeners (#17933)
* Add test of Event Replaying using Flare

* Fix Event Replaying in Flare by Eagerly Adding Active Listeners

This effectively reverts part of https://github.com/facebook/react/pull/17513
2020-01-30 09:32:41 -08:00
Dominic GannawayandGitHub b7c4a16571 Ensure createRoot warning parity with ReactDOM.render (#17937) 2020-01-30 17:17:42 +00:00
Dominic GannawayandGitHub da1c610e04 Add ReactDOM.unstable_renderSubtreeIntoContainer warning flag (#17936) 2020-01-30 11:56:04 +00:00
Andrew ClarkandGitHub e7618e09a1 Bugfix: Expiring a partially completed tree (#17926)
* Failing test: Expiring a partially completed tree

We should not throw out a partially completed tree if it expires in the
middle of rendering. We should finish the rest of the tree without
yielding, then finish any remaining expired levels in a single batch.

* Check if there's a partial tree before restarting

If a partial render expires, we should stay in the concurrent path
(performConcurrentWorkOnRoot); we'll stop yielding, but the rest of the
behavior remains the same.

We will only revert to the sync path (performSyncWorkOnRoot) when
starting on a new level.

This approach prevents partially completed concurrent work from
being discarded.

* New test: retry after error during expired render
2020-01-29 12:40:18 -08:00
Dan AbramovandGitHub c6286948da Add a note about expiring OTP codes 2020-01-29 16:31:51 +00:00
Dan AbramovandGitHub 075664a3fd Use next tag for canary releases in the doc (#17923) 2020-01-29 16:09:05 +00:00
68799a9a39 Show first component stack in context warning (#17922)
* Update tests

* Show first component stack in context warning

Co-authored-by: Dominic Gannaway <[email protected]>
2020-01-29 14:57:52 +00:00
Dan AbramovandGitHub 712d1be33f Fix Jest diff call (#17921) 2020-01-29 14:38:22 +00:00
Dan AbramovandGitHub 80ad5f7fab Add semver dependency explicitly to DevTools (#17919) 2020-01-29 14:20:56 +00:00
Dominic GannawayandGitHub 332a72309c [Concurrent Mode] Add missing event plugin priorities (#17914) 2020-01-28 13:20:26 +00:00
Brian VaughnandGitHub 79db84d1cf Removed Root API callback params and added warnings (#17916) 2020-01-27 12:35:08 -08:00
Simen BekkhusandNicolas Gallagher 626c0fd9d7 Upgrade to jest 25 (#17896)
The changes to the test code relate to changes in JSDOM that come with Jest 25:

* Several JSDOM workarounds are no longer needed.
* Several tests made assertions to match incorrect JSDOM behavior (e.g. setAttribute calls) that JSDOM has now patched to match browsers.
  * https://codesandbox.io/s/resets-value-of-datetime-input-to-fix-bugs-in-ios-safari-1ppwh
* JSDOM no longer triggers default actions when dispatching click events.
  * https://codesandbox.io/s/beautiful-cdn-ugn8f
* JSDOM fixed (jsdom/jsdom#2700) a bug so that calling focus() on an already focused element does not dispatch a FocusEvent.
* JSDOM now supports passive events.
* JSDOM has improved support for custom CSS properties.
  * But requires jsdom/cssstyle#112 to land to support webkit prefixed properties.
2020-01-25 08:43:02 -08:00
Nicolas GallagherandGitHub 20bbe0701c Update to flow 0.97 (#17892) 2020-01-24 10:52:38 -08:00
Nicolas GallagherandGitHub 617cc1c4ef Remove unused modules from legacy event responders (#17907) 2020-01-24 10:50:27 -08:00
Nicolas GallagherandGitHub e08b17f487 Update various monorepo dependencies (#17901) 2020-01-24 10:28:50 -08:00
Simen BekkhusandDominic Gannaway d1d9172bc4 chore: update to latest release of babel (#17897) 2020-01-24 17:49:24 +00:00
Luna RuanandGitHub e3d465e169 add warning when owner and self are different for string refs (#17864)
When owner and self are different for string refs, we can't easily convert them to callback refs. This PR adds a warning for string refs when owner and self are different to tell users to manually update these refs.
2020-01-22 12:32:51 -08:00
Nicolas GallagherandGitHub 77f7835a5f Update to [email protected] (#17842) 2020-01-22 10:02:30 -08:00
Sebastian MarkbågeandGitHub 6dcdd6ee71 Remove dynamic GKs for selective/train (#17888)
There are shipped/shipping.
2020-01-21 19:43:35 -08:00
Dominic GannawayandGitHub b920ab6d91 Add unstable_renderSubtreeIntoContainer and unstable_createPortal feature flags (#17880) 2020-01-21 21:17:42 +00:00
Dominic GannawayandGitHub 5e5d4d82ff Add React.createFactory() deprecation warning (#17878) 2020-01-21 15:51:39 +00:00
Sebastian MarkbågeandGitHub 17c230ccad Remove FB specific build (#17875)
I moved unstable_SuspenseList internally. We don't need the FB build.
I plan on also removing the ReactDOM fb specific entry. We shouldn't add
any more FB specific internals nor APIs. If they're experimental they
should go onto the experimental builds to avoid too many permutations.
2020-01-20 16:06:01 -08:00