Commit Graph
19463 Commits
Author SHA1 Message Date
Simen Bekkhus fa1e8df116 chore: use jest-serializer-raw for react-fresh snapshots (#15806) 2019-06-03 12:46:33 -07:00
Brian Vaughn edfc1bb2b3 Simplified background highlight style now that corner radius has been removed from selected highlight 2019-06-03 10:46:37 -07:00
Brian Vaughn 06b004b5d4 Renamed <Guideline> to <SelectedTreeHighlight> 2019-06-03 09:39:31 -07:00
Brian Vaughn fbc6e5d68a Removed outdated comment and Eslint rule ignore 2019-06-03 09:33:48 -07:00
Brian Vaughn 6ac558df2d Reset max indentation when entering/exiting the owner tree 2019-06-03 09:32:28 -07:00
Brian Vaughn a173f4eb85 Add HOC component filter 2019-06-03 08:51:50 -07:00
Brian Vaughn 78cf211286 Only shrink indentation. Don't increase it again. This avoids 'jumping'. 2019-06-03 08:01:48 -07:00
James Ide 07da821bfd [react-native] Rewrite Haste imports in RN shims and add .fb.js extension (#15786)
This commit is a follow-up to https://github.com/facebook/react/pull/15604, which explains more of the rationale behind moving React Native to path-based imports and the work needed in the React repository. In that linked PR, the generated renderers were updated but not the shims; this commit updates the shims.

The problem is that FB needs a different copy of the built renderers than the OSS versions so we need a way for FB code to import different modules than in OSS. This was previously done with Haste, but with the removal of Haste from RN, we need another mechanism. Talking with cpojer, we are using a `.fb.js` extension that Metro can be configured to prioritize over `.js`.

This commit generates FB's renderers with the `.fb.js` extension and OSS renderers with just `.js`. This way, FB can internally configure Metro to use the `.fb.js` implementations and OSS will use the `.js` ones, letting us swap out which implementation gets bundled.

Test Plan: Generated the renderers and shims with `yarn build` and then verified that the generated shims don't contain any Haste-style imports. Copied the renderers and shims into RN manually and launched the RNTester app to verify it loads end-to-end. Added `.fb.js` to the extensions in `metro.config.js` and verified that the FB-specific bundles loaded.
2019-06-03 15:58:31 +01:00
Brian Vaughn f713265a00 Cap indentation increase at a max 2019-06-02 21:01:24 -07:00
Brian Vaughn 8261a3f453 Removed Tree padding 2019-06-02 20:25:57 -07:00
Brian Vaughn dc08e80037 Cache list rows by Element ID rather than index
This is important since we are caching element sizes by DOM (in a WeakMap). Toggling (as well as insertion/deletion) might otherwise break this in some cases.
2019-06-02 20:10:30 -07:00
Jordan Rome a383c46788 [ESLint] don't warn for Flow type variables (#15804)
In Exhaustive Deps check for react-hooks don't warn if the dependency is
a Flow type variable.
2019-06-03 02:20:51 +01:00
Brian Vaughn 6b6e571c68 Added HOC badge to owners list dropdown 2019-06-02 10:50:07 -07:00
Brian Vaughn 27d4f0b24d Fixed box drawing chars comment 2019-06-02 10:40:10 -07:00
Brian Vaughn dc945f6b81 Fixed a typo in string truncation util 2019-06-02 10:06:05 -07:00
Brian Vaughn 17b04c321c Cleaned up how we measure children and adjust indentation size 2019-06-02 10:02:22 -07:00
Brian Vaughn 3f0606f3d9 Refactored badges to share code and show +count 2019-06-01 18:48:24 -07:00
Brian Vaughn 6a69a6e991 Added HOC badge to owners stack breadcrumbs 2019-06-01 18:05:59 -07:00
Brian Vaughn c1989448f4 Disable guide/group highlight in owners tree mode 2019-06-01 17:49:51 -07:00
Brian Vaughn 96dc003a70 Removed debounce+animation from indentation adjustment 2019-06-01 17:48:01 -07:00
Brian Vaughn b5f8998859 Added debounce and animation for resize 2019-06-01 11:16:18 -07:00
Brian Vaughn de9fb0a8a2 Tweaked guideline background color style 2019-06-01 09:34:39 -07:00
Brian Vaughn ab7ae78511 Tweaked a few styles 2019-06-01 09:19:32 -07:00
Brian Vaughn 2845a7883b Whoops I broke CI (updating snapshots) 2019-06-01 08:44:55 -07:00
Brian Vaughn aa87b125e7 Lots of tweaks
Remove selected guideline in favor of background color for selected subtree.
Add badges in grid format to selected elements prop panel.
Show badges beside owners list.
2019-06-01 08:24:24 -07:00
Andrew Clark 5763f1d4c4 [Events] Nested discrete events across systems
If an event in the old system is dispatched synchronously within an
event from the new system, or vice versa, and the inner event is a
discrete update, React should not flush pending discrete updates before
firing the inner event's handlers, even if the outer event is not
discrete.

Another way of saying this is that nested events should never force
React to flush discrete updates.

Arguably, if the outer event is not a discrete event, then the inner
event _should_ flush the pending events. However, that would be a
breaking change. I would argue this isn't so bad, however, given that
nested events are pretty rare. They don't fit nicely into our event
model regardless, since we don't support nested React renders. In the
future we should consider warning when events are nested.
2019-05-31 17:46:30 -07:00
Andrew Clark 7aa35ceae0 Fix casing of shouldflushDiscreteUpdates
shouldflushDiscreteUpdates -> shouldFlushDiscreteUpdates
2019-05-31 17:46:30 -07:00
Andrew Clark 91635dd483 Switch to "discrete" and "continuous" terminology
Events were previously described as "interactive" or "non-interactive".
2019-05-31 17:46:30 -07:00
Andrew Clark 73c380fca7 WorkPhase -> ExecutionContext
WorkPhase is an enum that represents the currently executing phase of
the React update -> render -> commit cycle. However, in practice, it's
hard to use because different "phases" can be nested inside each other.
For example, the commit phase can be nested inside the
"batched phase."

This replaces WorkPhase with a different concept: ExecutionContext.
ExecutionContext is a bitmask instead of an enum. It represents a stack
of React entry points. For example, when `batchedUpdates` is called
from inside an effect, the ExecutionContext is
`BatchedContext | CommitContext`.
2019-05-31 17:46:30 -07:00
Nicolas Gallagher 88b3963820 [Flare] Remove deprecated keypress event (#15795)
`keypress` is a deprecated event.
2019-05-31 14:53:09 -07:00
Brian Vaughn 19d95a1368 Revert "Re-added indent lines"
This reverts commit 33432b037f.
2019-05-31 14:41:20 -07:00
Mateusz Burzyński 63fe08eef5 React Events: allow Tab+Alt on Mac in Focus responder (#15679)
* Fix issue with Tab+alt not being considered as isGlobalFocusVisible candidate on Mac
* Add test for Tab+alt on Mac setting pointerType: "keyboard" on a focus event
2019-05-31 14:33:42 -07:00
Brian Vaughn 33432b037f Re-added indent lines 2019-05-31 13:34:55 -07:00
Brian Vaughn 5a269e7ced Initial POC for compressing horizontal offset for wide/deep trees 2019-05-31 11:24:34 -07:00
Dan Abramov 2794b92164 Add some support for reordering 2019-05-31 18:00:56 +01:00
Dan Abramov c3be085910 Remove crawling for updates
It doesn't seem necessary to crawl because mounts only happen in the context of updates.

This fixes updates to not be treated as new mounts.
2019-05-31 17:41:11 +01:00
Dan Abramov 6fd83acb1d Default to showing host nodes for legacy renderer 2019-05-31 15:39:00 +01:00
Dan Abramov 9f44251ebf Remove unnecessary code for host text as we skip it anyway 2019-05-31 14:27:22 +01:00
Sebastian Markbåge 113497cc0e [Suspense] Change Suspending and Restarting Heuristics (#15769)
* Track most recent commit time of a fallback globally

This value is going to be used to avoid committing too many fallback
states in quick succession. It doesn't really matter where in the tree
that happened.

This means that we now don't really need the concept of SuspenseState
other than has a flag. It could be made cheaper/simpler.

* Change suspense heuristic

This now eagerly commits non-delayed suspended trees, unless they're
only retries in which case they're throttled to 500ms.

* Restart early if we're going to suspend later

* Use the local variable where appropriate

* Make ReactLazy tests less specific on asserting intermediate states

They're not testing the exact states of the suspense boundaries, only
the result. I keep assertions that they're not already resolved early.

* Adjust Profiler tests to the new heuristics

* Update snapshot tests for user timing tests

I also added a blank initial render to ensuree that we cover the suspended
case.

* Adjust Suspense tests to account for new heuristics

Mostly this just means render the Suspense boundary first so that it
becomes an update instead of initial mount.

* Track whether we have a ping on the currently rendering level

If we get a ping on this level but have not yet suspended, we might
still suspend later. In that case we should still restart.

* Add comment about moving markers

We should add this to throwException so we get these markers earlier.
I've had to rewrite tests that test restarting to account for the delayed
restarting heuristic.

Ideally, we should also be able to restart from within throwException if
we're already ready to restart. Right now we wait until the next yield.

* Add test for restarting during throttled retry

* Add test that we don't restart for initial render

* Add Suspense Heuristics as a comment in Throw
2019-05-30 16:37:56 -07:00
Brian Vaughn c0f686eed9 Show indent lines preference 2019-05-30 14:30:17 -07:00
Brian Vaughn a2a468743f Remove hover guideline in favor of showing guidelines for every nesting level 2019-05-30 14:17:12 -07:00
Brian Vaughn a957031fe7 Fixed bad Bridge disconnections 2019-05-30 09:27:28 -07:00
Brian Vaughn 8f8ac358c6 Turn off pointer events for guidelines 2019-05-30 08:43:45 -07:00
Brian Vaughn ec421355bd Added selected and hovered guidelines to Components tree 2019-05-30 08:22:06 -07:00
Andrew Clark 3b2302253f Fix sizebot (#15771)
The previous naming scheme used the name of the resulting bundle file.
However, there are cases where multiple bundles have the same filename.
This meant whichever bundle finishes last overwrites the previous ones
with the same name.

The updated naming scheme is `bundle-sizes-<CI_NODE_INDEX>.json`.
Instead of generating a separate info file per bundle, it now creates
one per process.
2019-05-29 21:30:16 -07:00
Nicolas Gallagher 0f7cc2ba84 React Events: check window before using navigator (#15768) 2019-05-29 20:19:31 -07:00
Andrew Clark ad9a6df58c Move fixtures test to its own CI job
Running it in parallel to the other post-build jobs shaves ~30 seconds
off the total CI time.
2019-05-29 15:11:25 -07:00
Nicolas Gallagher 2670bc3400 React Events: support legacy browser Spacebar key value (#15766) 2019-05-29 15:00:43 -07:00
Sunil Pai 9aad17d60c using the wrong renderer's act() should warn (#15756)
* warn when using the wrong renderer's act around another renderer's updates

like it says. it uses a real object as the sigil (instead of just a boolean). specifically, it uses a renderer's flushPassiveEffects as the sigil. We also run tests for this separate from our main suite (which doesn't allow loading multiple renderers in a suite), but makes sure to run this in CI as well.

* unneeded (and wrong) comment

* run the dom fixture on CI

* update the sigil only in __DEV__

* remove the obnoxious comment

* use an explicit export for the sigil
2019-05-29 22:56:04 +01:00
Andrew Clark 8ce8b9ab81 Update name of CI job in sizebot (#15767)
Same as #15714. I moved the artifacts step to a different job, so I
need to update the name in the sizebot script to match.
2019-05-29 14:52:11 -07:00