Commit Graph

14710 Commits

Author SHA1 Message Date
Moti Zilberman
c09596cc60 Add RN_FB bundles for react-is (#23101)
* Add RN_FB bundles for react-is

* Update packaging.js

* Add ReactNativeInternalFeatureFlags to externals
2022-01-12 21:53:50 +00:00
Joey Arhar
a87adefecd Allow functions to be passed to custom element setters (#23042)
This is part of the new custom element features that were implemented
here:
24dd07bd26

When a custom element has a setter for a property and passes the `in`
heuristic, the value passed to the react property should be assigned
directly to the custom element's property, regardless of the type of the
value. However, it was discovered that this isn't working with
functions. This patch makes it work with functions.

Fixes https://github.com/facebook/react/issues/23041
2022-01-12 20:12:07 +00:00
Stefan Sundin
9a7e6bf0d0 Add --no-show-signature to "git show" commands (#23038)
* Add --no-show-signature to "git show" commands.

This fixes errors if the user has configured the following in their ~/.gitconfig:
[log]
showSignature = true

* yarn prettier-all
2022-01-11 12:14:08 -05:00
Gray Zhang
2f26eb85d6 Add exports field to react-refresh's package.json (#23087)
* Add exports field to react-refresh's package.json

* Update package.json

* Add runtime to exports
2022-01-11 16:48:09 +00:00
Luna Ruan
811634762a add enableTransitionTracing feature flag (#23079)
This PR adds the enableTransitionTracing feature flag
2022-01-10 12:32:40 -08:00
Jack Works
fe905f152f Update package.json (#22954) 2022-01-07 12:59:47 -08:00
Andrew Covenant
fe419346da Console message fixed for devtools (#23067) 2022-01-05 11:45:45 -05:00
Borja Paz Rodríguez
42c30e8b12 Correct typing errors detected in several files (#22965)
* Correct spelling errors in several files
* Correct typos in devtools-shared package files
2022-01-04 10:30:07 -05:00
Brian Vaughn
9724e18004 Run DevTools e2e tests on Circle CI (#23019) 2022-01-04 10:28:03 -05:00
btea
3dc41d8a25 fix: parseExportNamesInto specifiers typo (#22537) 2021-12-23 13:08:56 -05:00
BIKI DAS
20212349ad Fix variable name (#23021) 2021-12-23 08:35:54 -05:00
BIKI DAS
a8e9bbe0fe Made the variable name more meaningful (#23017) 2021-12-22 15:58:06 -05:00
Brian Vaughn
bcd24a6706 DevTools: Only show StrictMode badge on root elements (#23012)
* DevTools: Only show StrictMode badge on root elements

Showing an inline non-compliance badge for every element in the tree is noisy. This commit changes it so that we only show inline icons for root elements (although we continue to show an icon for inspected elements regardless).
2021-12-21 15:26:42 -05:00
Vitalie
bd0a5dd682 #22988 - Fix Bug: @license header in React 18 bundles contains vundefined (#23004)
* Fix Bug: @license header in React 18 bundles contains vundefined
* Remove React version from the header comment
2021-12-21 12:27:59 -05:00
Brian Vaughn
a4ead704ba Use ReactDOM Test Selector API in DevTools e2e tests (#22978)
Builds on top of the existing Playwright tests to plug in the test selector API: https://gist.github.com/bvaughn/d3c8b8842faf2ac2439bb11773a19cec

My goals in doing this are to...
1. Experiment with the new API to see what works and what doesn't.
2. Add some test selector attributes (and remove DOM-structure based selectors).
3. Focus the tests on DevTools itself (rather than the test app).

I also took this opportunity to add a few new test cases– like named hooks, editable props, component search, and profiling- just to play around more with the Playwright API.

Relates to issue #22646
2021-12-21 11:58:04 -05:00
Sebastian Markbåge
ceee524a8f Remove unnecessary clearContainer call (#22979)
This was added when we added error recovery for hydration errors. However,
when the fix up pass happens later on, it'll still call clearContainer in
the commit phase. So this call is unnecessary.
2021-12-17 09:40:39 -08:00
Brian Vaughn
aa8f2bdbce Refactored DevTools test shell for e2e (#22968)
Fixes a regression in the e2e target and makes things easier (hopefully) going forward when adding new e2e tests.
2021-12-15 11:42:59 -05:00
Brian Vaughn
e59233aa85 react-devtools-inline README updates (#22967) 2021-12-15 10:44:14 -05:00
Brian Vaughn
5b69c94eed React DevTools 4.22.0 -> 4.22.1 (#22962) 2021-12-14 23:52:50 -05:00
Brian Vaughn
b10c378024 Revert changes to react-devtools-inline Webpack config from PR #22760 (#22961) 2021-12-14 23:45:46 -05:00
Brian Vaughn
3f45b68141 Re-added deleted files array to react-devtools package.json (#22960) 2021-12-14 23:28:57 -05:00
Sebastian Markbåge
cd1a3e9b55 Build both a partial renderer and fizz renderer of the legacy API for FB (#22933)
This lets us test how the new architecture performs without comparing it to
other infra changes related to streaming.

I renamed the streaming one to ReactDOMServerStreaming so the references
in www need to be updated.

I'll open an adhoc sync with just those files.
2021-12-14 16:19:19 -08:00
Brian Vaughn
75d34aa083 Updated DevTools changelog 2021-12-14 16:50:17 -05:00
jstejada
0229baee21 React DevTools 4.21.0 -> 4.22.0 (#22951) 2021-12-14 14:19:21 -05:00
Brian Vaughn
911f92a44d DevTools: Support mulitple DevTools instances per page (#22949)
This is being done so that we can embed DevTools within the new React (beta) docs.

The primary changes here are to `react-devtools-inline/backend`:
* Add a new `createBridge` API
* Add an option to the `activate` method to support passing in the custom bridge object.

The `react-devtools-inline` README has been updated to include these new methods.

To verify these changes, this commit also updates the test shell to add a new entry-point for multiple DevTools.

This commit also replaces two direct calls to `window.postMessage()` with `bridge.send()` (and adds the related Flow types).
2021-12-14 12:16:16 -05:00
jstejada
5757919256 DevTools: Correctly log errors reported from the store (#22950) 2021-12-13 12:02:14 -05:00
jstejada
a049aa0155 [DevTools] Log errors occurring or reported to the frontend (#22948) 2021-12-13 11:38:45 -05:00
Brian Vaughn
3b3daf5573 Advocate for StrictMode usage within Components tree (#22886)
Adds the concept of subtree modes to DevTools to bridge protocol as follows:
1. Add-root messages get two new attributes: one specifying whether the root is running in strict mode and another specifying whether the root (really the root's renderer) supports the concept of strict mode.
2. A new backend message type (TREE_OPERATION_SET_SUBTREE_MODE). This type specifies a subtree root (id) and a mode (bitmask). For now, the only mode this message deals with is strict mode.

The DevTools frontend has been updated as well to highlight non-StrictMode compliant components.

The changes to the bridge protocol require incrementing the bridge protocol version number, which will also require updating the version of react-devtools-core backend that is shipped with React Native.
2021-12-10 11:05:18 -05:00
Brian Vaughn
2c1cf5618a DevTools should inject itself for XHTML pages too (not just HTML) (#22932) 2021-12-09 15:32:11 -05:00
salazarm
f2a59df48b Remove unstableAvoidThisFallback from OSS (#22884)
* avoidThisFallbackFlag

* avoidThisFallback flag

* missed a spot

* rm gating
2021-12-08 08:21:02 -08:00
Andrew Clark
d3001fb6f1 Use next as prerelease label
Instead of `rc`, which is redundant since it's in the next version
number already.
2021-12-08 10:57:25 -05:00
Andrew Clark
29d2bef9f5 Bump beta -> rc 2021-12-08 10:51:41 -05:00
Joey Arhar
24dd07bd26 Add custom element property support behind a flag (#22184)
* custom element props

* custom element events

* use function type for on*

* tests, htmlFor

* className

* fix ReactDOMComponent-test

* started on adding feature flag

* added feature flag to all feature flag files

* everything passes

* tried to fix getPropertyInfo

* used @gate and __experimental__

* remove flag gating for test which already passes

* fix onClick test

* add __EXPERIMENTAL__ to www flags, rename eventProxy

* Add innerText and textContent to reservedProps

* Emit warning when assigning to read only properties in client

* Revert "Emit warning when assigning to read only properties in client"

This reverts commit 1a093e584ce50e2e634aa743e04f9cb8fc2b3f7d.

* Emit warning when assigning to read only properties during hydration

* yarn prettier-all

* Gate hydration warning test on flag

* Fix gating in hydration warning test

* Fix assignment to boolean properties

* Replace _listeners with random suffix matching

* Improve gating for hydration warning test

* Add outerText and outerHTML to server warning properties

* remove nameLower logic

* fix capture event listener test

* Add coverage for changing custom event listeners

* yarn prettier-all

* yarn lint --fix

* replace getCustomElementEventHandlersFromNode with getFiberCurrentPropsFromNode

* Remove previous value when adding event listener

* flow, lint, prettier

* Add dispatchEvent to make sure nothing crashes

* Add state change to reserved attribute tests

* Add missing feature flag test gate

* Reimplement SSR changes in ReactDOMServerFormatConfig

* Test hydration for objects and functions

* add missing test gate

* remove extraneous comment

* Add attribute->property test
2021-12-08 15:11:42 +00:00
Andrew Clark
72e48b8e16 Fix: Don't skip writing updated package.json
Another fix to previous commit. The special case for
use-sync-external-store still needs to write out the updated
package.json, because we also use that branch to update the
version field.
2021-12-08 02:56:43 -05:00
Andrew Clark
e39b2c8998 Fix peer deps for use-sync-external-store
Merged last PR too quickly
2021-12-08 02:45:57 -05:00
Andrew Clark
ec78b135fb Don't override use-sync-external-store peerDeps (#22882)
Usually the build script updates transitive React dependencies so that
they refer to the corresponding release version.

For use-sync-external-store, though, we also want to support older
versions of React, too. So the normal behavior of the build script
isn't sufficient.

For now, to unblock, I hardcoded a special case, but we should consider
a better way to handle this in the future.
2021-12-07 23:26:12 -08:00
Andrew Clark
06f403481f Add CI job to check npm dependencies (#22881)
Checks that if one React package depends on another, the current
version satisfies the given dependency range.

That way we don't forget to bump dependencies when we release a
new version.
2021-12-07 23:09:00 -08:00
Brian Vaughn
ad607469c5 StyleX plug-in for resolving atomic styles to values for props.xstyle (#22808)
Adds the concept of "plugins" to the inspected element payload. Also adds the first plugin, one that resolves StyleX atomic style names to their values and displays them as a unified style object (rather than a nested array of objects and booleans).

Source file names are displayed first, in dim color, followed by an ordered set of resolved style values.

For builds with the new feature flag disabled, there is no observable change.

A next step to build on top of this could be to make the style values editable, but change the logic such that editing one directly added an inline style to the item (rather than modifying the stylex class– which may be shared between multiple other components).
2021-12-07 20:04:12 -05:00
salazarm
5041c37d27 Remove hydrate option from createRoot (#22878)
* remove hydrate: true option

* remove missed comment

* lint

* warning

* circumvent flow
2021-12-07 16:10:00 -05:00
salazarm
c7917fe769 Test showing that a mismatch at the root recovers with client render but shows loading state (#22873)
* rm console.log

* gate test

* move test

* show fallback state
2021-12-06 12:36:02 -05:00
jstejada
12bffc78d8 [DevTools] Emit new event when DevTools connects in standalone app (#22848) 2021-12-06 08:49:15 -05:00
salazarm
3f9480f0f5 enable continuous replay flag (#22863) 2021-12-03 19:35:20 -05:00
Brian Vaughn
8b8817845a Timeline search (#22799)
Refactor SearchInput component (used in Components tree) to be generic DevTools component with two uses: ComponentSearchInput and TimelineSearchInput.

Refactored Timeline Suspense to more closely match other, newer Suspense patterns (e.g. inspect component, named hooks) and colocated Susepnse code in timelineCache file.

Add search by component name functionality to the Timeline. For now, searching zooms in to the component measure and you can step through each time it rendered using the next/previous arrows.
2021-12-03 16:23:48 -05:00
Andrew Clark
4729ff6d1f Implement identifierPrefix option for useId (#22855)
When an `identifierPrefix` option is given, React will add it to the
beginning of ids generated by `useId`.

The main use case is to avoid conflicts when there are multiple React
roots on a single page.

The server API already supported an `identifierPrefix` option. It's not
only used by `useId`, but also for React-generated ids that are used to
stitch together chunks of HTML, among other things. I added a
corresponding option to the client.

You must pass the same prefix option to both the server and client.
Eventually we may make this automatic by sending the prefix from the
server as part of the HTML stream.
2021-12-02 17:49:43 -08:00
Dan Abramov
71d16750c5 Replay capture phase for continuous events (#22856)
Co-authored-by: Dan Abramov <dan.abramov@me.com>

Co-authored-by: Marco Salazar <salazarm@fb.com>
2021-12-02 14:33:44 +00:00
Dan Abramov
44f99d75fa Track currently replaying event (#22853)
* Track currently replaying event

Co-authored-by: Dan Abramov <dan.abramov@me.com>

* Add warnings

Co-authored-by: Marco Salazar <salazarm@fb.com>
2021-12-02 14:11:21 +00:00
Dan Abramov
e737ea9655 Fork dispatch function based on the flag (#22852)
* Fork function based on a flag

* Prune false branches

Co-authored-by: Marco Salazar <salazarm@fb.com>
2021-12-02 14:02:49 +00:00
Dan Abramov
ea5a413602 Decouple dispatching from attemptToDispatchEvent (#22851)
* Decoupled dispatching from attemptToDispatchEvent

* Remove unnecessary field

It is unnecessary because it's only true when retval is null.
2021-12-02 13:55:57 +00:00
Dan Abramov
ed00d2c3d8 Remove unused flag (#22854) 2021-12-02 02:25:32 +00:00
jstejada
a65ceef370 DevTools: Log version in internal logger (#22825) 2021-11-30 10:48:46 -05:00