Commit Graph
12689 Commits
Author SHA1 Message Date
Karan SharmaandBrian Vaughn cc793eb2b4 Fix various typos (#17724) 2019-12-29 13:47:51 -08:00
Chris WatsonandBrian Vaughn 2969136102 Fix for the standalone devtools not responding to clicks. (#17584) 2019-12-29 13:46:27 -08:00
Brian VaughnandGitHub cfbc83cf06 Devtools renable copy attr context menu for firefox (#17740)
* Use exportFunction() to share clipboard copy with JS running in document/page context.

* Remove no-longer-used option to disable copy operation.
2019-12-29 13:27:44 -08:00
Brian VaughnandGitHub 3bca7c17af Make DevTools check document.contentType before injecting (#17739)
It should only inject the global hook into HTML documents. This will avoid breaking syntax highlighting for e.g. XML documents.
2019-12-29 13:02:50 -08:00
Brian VaughnandGitHub f3fd36e450 Added missing Flow type coverage to DevTools context menu (#17733)
The  param should probably be a generic type, but I'm not sure how to satisfy Flow with the current top-level  Map. At least this adds basic coverage (which was missing before, oops).
2019-12-29 08:44:24 -08:00
1da38f4818 [DevTools] Display RegExp values in props/state (#17690)
Previously, when props/state contained a regexp, it was shown as an
empty object. This commit adds regexps as values in need of special
rehydration (like Symbols or TypedArrays), and display them as a user
might expect.

Co-authored-by: Zirak <[email protected]>
2019-12-22 11:49:28 -08:00
Brian VaughnandGitHub 053e8c347e Add tooltip to interaction name in DevTools Profiler sidebar (#17689) 2019-12-22 08:52:53 -08:00
171deb9ff0 Fix comments typos (#17550)
* Fix comments typos

* Fix comments typos

* Fix more typos

Co-authored-by: Brian Vaughn <[email protected]>
2019-12-22 08:44:34 -08:00
Maxime BouveronandBrian Vaughn ba33ca8a86 Add Shift+Enter to go to previous search result (#17005) 2019-12-22 08:38:14 -08:00
Dominic GannawayandGitHub 10ceb9ea3a [react-dom] Refactor event priority handling to its own module (#17678) 2019-12-20 23:15:36 +00:00
Brian Vaughn 753cf4f3df DevTools v4.2.1 -> 4.3.0 2019-12-20 09:11:37 -08:00
Nicolas GallagherandGitHub a2ad75cd4e Add unit tests to dom-event-testing-library (#17680)
Unit tests for the simple event mocks
2019-12-20 16:35:02 +00:00
Brian VaughnandGitHub 330bd02c7c Disable "copy to clipboard" and "go to definition" context menu options for Firefox addon (#17668) 2019-12-20 08:31:38 -08:00
Dominic GannawayandGitHub 5f23e0d3dc [react-interactions] Rename test + fix master (#17679) 2019-12-20 16:00:39 +00:00
Brian VaughnandGitHub 74bf965e6e Null stateNode after unmount (#17666) 2019-12-19 13:32:14 -08:00
Dan AbramovandGitHub 48685e16f7 [ESLint] Allow partial matches for custom Effect Hooks (#17663) 2019-12-19 17:04:17 +00:00
Nicolas GallagherandGitHub 66b051810c Create packages/dom-event-testing-library (#17660)
Moves the unit testing library for events into the `packages` directory so it can more easily be used in tests for other react packages, and mirrored internally to help with testing of event hooks we prototype in www.
2019-12-19 16:51:25 +00:00
Dominic GannawayandGitHub 1b526ba434 [react-interactions] Remove batchedUpdates from responder lifecycles (#17659) 2019-12-19 13:07:00 +00:00
Nicolas GallagherandGitHub c35f81403e [react-interactions] Event testing library improvements (#17614)
Introduces a state machine around pointer events to produce more accurate mock
touch events. This allows multi-touch unit tests to be written entirely in
terms of mock pointer interactions, while producing the expected
'changedTouches', 'targetTouches', and 'touches' fields for mock touch events.
2019-12-18 23:32:48 +00:00
Brian VaughnandGitHub cfbe4cbe6a DevTools build script enhancements (#17653)
* Updated DevTools local development instructions to mention experimental build step

* Added a command to download latest experimental release (for DevTools)

* Updated build instructions for clarity

* Added build-for-devtools package alias
2019-12-18 14:34:40 -08:00
Brian Vaughn c2adf8b508 Updated DevTools changelog 2019-12-18 12:51:18 -08:00
Brian VaughnandGitHub 8f25f2637f DevTools context menu (#17608)
* Added rudimentary context menu hook and menu UI

* Added backend support for copying a value at a specific path for the inspected element

* Added backend support for storing a value (at a specified path) as a global variable

* Added special casing to enable copying undefined/unserializable values to the clipboard

* Added copy and store-as-global context menu options to selected element props panel

* Store global variables separately, with auto-incremented name (like browsers do)

* Added tests for new copy and store-as-global backend functions

* Fixed some ownerDocument/contentWindow edge cases

* Refactored context menu to support dynamic options

Used this mechanism to add a conditional menu option for inspecting the current value (if it's a function)

* Renamed "safeSerialize" to "serializeToString" and added inline comment
2019-12-18 12:12:34 -08:00
Sebastian MarkbågeandGitHub 0340075a0c [Flight] Chunks API (#17398)
* Add feature flags

* Add Chunk type and constructor

* Wire up Chunk support in the reconciler

* Update reconciler to reconcile Chunks against the render method

This allows the query and args to be updated.

* Drop the ref. Chunks cannot have refs anyway.

* Add Chunk checks in more missing cases

* Rename secondArg

* Add test and fix lazy chunks

Not really a supported use case but for consistency I guess.

* Fix fragment test
2019-12-18 18:25:43 +00:00
Eli WhiteandDan Abramov f7fe9fc238 Make HostComponent inexact (#17412) 2019-12-18 18:21:42 +00:00
Sebastian MarkbågeandGitHub 3bf17a6e12 Favor fallthrough switch instead of case statements for work tags (#17648)
* Favor fallthrough switch instead of case statements for work tags

Currently we're inconsistently handling tags that are only relevant
for certain flags. We should throw if the tag is not part of the built
feature flags. This should also mean that the case statements can be
eliminated.

We can achieve this effect by putting the invariant outside of the switch
and always early return in the switch. We already do this in beginWork.
This PR makes this consistent in other places.

* Fail if fundamental/scope tags are discovered without the flag on
2019-12-18 15:53:27 +00:00
Dan AbramovandGitHub 2483430876 Add a regression test for switching from Fragment to a component (#17647)
* Add a regression test for switching from Fragment to a component

* Add a few more tests
2019-12-18 15:21:42 +00:00
Dominic GannawayandGitHub c711197b36 [react-interactions] Rename Flare APIs to deprecated and remove from RN (#17644) 2019-12-18 10:24:46 +00:00
Brian VaughnandGitHub 6a90e8396c Added more forwardRef test cases for DevTools (#17642) 2019-12-17 12:45:10 -08:00
Dan AbramovandGitHub 82a3bce9be Build FB RN targets only in experimental mode (#17641) 2019-12-17 20:22:49 +00:00
zthxxxandBrian Vaughn 5991a1e083 fix(dev-tools): fix show correct displayName with forwardRef in Dev Tools (#17613)
* fix(dev-tools): fix show correct displayName with forwardRef in Dev Tools

allow set `displayName` after `React.forwardRef()`,
makesure Dev Tools show displayName as same as `getWrappedName` in `shared/getComponentName.js`

* Removed a little unnecessary/redundant code.

* Fixed lint error (removed unused var)
2019-12-17 11:29:16 -08:00
Brian VaughnandGitHub 90d5068433 Improved selection and toggling for props/hooks/state (#17588)
1. Enable nested values to be expanded/collapsed by clicking on values as well as keys.
2. Enable keys and values to be selectable (for copy-pasting purposes)
2019-12-17 11:28:37 -08:00
伊撒尔andAndrew Clark caeb5ded76 Use zero-fill right shift instead of Math.floor (#17616)
For positive numbers, binary displacement is better.
2019-12-17 11:16:04 -08:00
Dan AbramovandGitHub a06a60bda0 Move DevTools CI job to experimental workflow (#17640) 2019-12-17 18:21:38 +00:00
Dan AbramovandGitHub e608c02fc6 Fix missing stacks in WWW warnings (#17638) 2019-12-17 15:21:18 +00:00
Dan Abramov c026dea3dd [email protected] 2019-12-17 13:50:57 +00:00
Dan AbramovandGitHub 26ed50c397 [Fast Refresh] Support injecting runtime after renderer executes (#17633) 2019-12-17 13:49:39 +00:00
Dan AbramovandGitHub 1407340157 Additional test infra changes for toErrorDev rename (#17632) 2019-12-17 13:31:47 +00:00
Dan AbramovandBrian Vaughn ccee948f06 Fix test_build_devtools CI job to run test-build-devtools (#17631)
* Skip abandoned project folders in Jest config

This fixes a problem that occurs after renaming a package.

* Fix test_build_devtools to run test-build-devtools

* Exclude console.error plugin for DevTools packages

* Use correct release channel for DevTools tests

This should fix the createRoot error.

* Fix TZ dependent test

* Change DT job dependencies
2019-12-16 16:03:12 -08:00
Dan Abramov 1c6f7c3ac3 Fix release script to ignore empty package folders 2019-12-16 19:16:58 +00:00
Dan AbramovandGitHub fa546348a0 Revert "Remove renderPhaseUpdates Map (#17484)" (#17623)
This reverts commit 7499595a8c.
2019-12-16 19:03:00 +00:00
Dan AbramovandGitHub 0809ba8020 Rename toWarnDev -> toErrorDev, toLowPriorityWarnDev -> toWarnDev (#17605)
* Rename toWarnDev -> toErrorDev in tests

* Rename toWarnDev matcher implementation to toErrorDev

* Rename toLowPriorityWarnDev -> toWarnDev in tests and implementation
2019-12-16 12:48:16 +00:00
Dan AbramovandGitHub d90d691d4a Use console directly instead of warning() modules (#17599)
* Replace all warning/lowPriWarning with console calls

* Replace console.warn/error with a custom wrapper at build time

* Fail the build for console.error/warn() where we can't read the stack
2019-12-14 18:09:25 +00:00
Dan AbramovandGitHub d9bf6c2c93 Use matching test command for equivalence tests (#17604) 2019-12-14 17:52:29 +00:00
Sebastian MarkbågeandAndrew Clark 7499595a8c Remove renderPhaseUpdates Map (#17484)
* Render phase updates can now be extracted from the pending queue

* Use a custom dispatcher for the second render pass

* Discard render phase updates if component throws

When aborting a render, we also need to throw out render phase updates.
Remove the updates from the queues so they do not persist to the next
render. We already did a single pass through the whole list of hooks, so
we know that any pending updates must have been dispatched during the
render phase. The ones that were dispatched before we started rendering
were already transferred to the current hook's queue.
2019-12-13 16:45:09 -08:00
Dominic GannawayandGitHub 35aab7c5cd [react-events] Remove lastNativeEvent in favor of SystemFlags (#17585) 2019-12-13 17:03:35 +00:00
Dan AbramovandGitHub 9463b12510 Add component stacks to (almost) all warnings (#17586) 2019-12-12 23:47:55 +00:00
Nicolas GallagherandGitHub 9d89458873 [react-interactions] Mock touchend events should use empty array for 'touches' (#17589)
The 'touches' value should be an empty array rather than 'null'
2019-12-12 22:21:30 +00:00
Brian VaughnandGitHub 023cf96871 Improved inspected element props with inline previews (#17579)
* Improved inspected element props with inline previews

This mimics the inline preview shown by the brower console and dramatically improves the UX when inspecting deep values. I also updated tests to add more coverage for this new functionality.

* Cleaned up the DataView vs typed array check

* Added early bailouts to DevTools when generating preview strings for iterables/objects/arrays, to avoid doing unnecessary work
2019-12-11 17:52:17 -08:00
Dominic GannawayandGitHub 78238afe96 [react-interactions] Remove responder root event types + revert commit phase change (#17577) 2019-12-11 16:48:46 +00:00
Laura bunsandDan Abramov 96b5edde35 Remove the condition argument from warning() (#17568)
* prep for codemod

* prep warnings

* rename lint rules

* codemod for ifs

* shim www functions

* Handle more cases in the transform

* Thanks De Morgan

* Run the codemod

* Delete the transform

* Fix up confusing conditions manually

* Fix up www shims to match expected API

* Also check for low-pri warning in the lint rule
2019-12-11 03:28:14 +00:00