Commit Graph

12836 Commits

Author SHA1 Message Date
Sunil Pai
b789060dca Feature Flag for React.jsx` "spreading a key to jsx" warning (#18074)
Adds a feature flag for when React.jsx warns you about spreading a key into jsx. It's false for all builds, except as a dynamic flag for fb/www.

I also included the component name in the warning.
2020-02-20 11:30:04 +00:00
Dominic Gannaway
3f85d53ca6 Further pre-requisite changes to plugin event system (#18083) 2020-02-20 00:46:03 +00:00
Andrew Clark
ea6ed3dbbd Warn for update on different component in render (#17099)
This warning already exists for class components, but not for functions.

It does not apply to render phase updates to the same component, which
have special semantics that we do support.
2020-02-19 12:43:14 -08:00
Eli White
085d02133e [Native] Migrate focus/blur to call TextInputState with the host component (#18068) 2020-02-19 11:33:40 -08:00
Brian Vaughn
7e770dae93 Profiler tooltip tweaks (#18082)
* Moved Profiler views into Profiler folder

* Tweaked Profiler tooltip CSS styles

* Tweaked Tooltip positioning code
2020-02-19 10:58:45 -08:00
Dominic Gannaway
b6c94d636c Add guard around FocusWithin responder root events (#18080) 2020-02-19 18:32:18 +00:00
Dominic Gannaway
1000f6135e Add container to event listener signature (#18075) 2020-02-19 18:00:57 +00:00
Dan Abramov
a12dd52a4a Don't build some packages for WWW (#18078) 2020-02-19 17:59:42 +00:00
Moji Izadmehr
44e5f5e645 Add fiber summary tooltip to devtools profiling (#18048)
* Add tooltip component

* Separate logic of ProfilerWhatChanged to a component

* Add hovered Fiber info tooltip component

* Add flame graph chart tooltip

* Add commit ranked list tooltip

* Fix flow issues

* Minor improvement in filter

* Fix flickering issue

* Resolved issues on useCallbacks and mouse event listeners

* Fix lints

* Remove unnecessary useCallback
2020-02-19 09:44:31 -08:00
Dominic Gannaway
2512c309e3 Remove Flare bundles from build (#18077) 2020-02-19 17:25:41 +00:00
Sunil Pai
a8643e905e add no-restricted-globals to eslint config (#18076)
Our current lint config assumes a browser environment, which means it won't warn you if you use a variable like `name` without declaring it earlier. This imports the same list as the one used by create-react-app, and enables it against our codebase.
2020-02-19 17:14:53 +00:00
Dominic Gannaway
4912ba31e3 Add modern event system flag + rename legacy plugin module (#18073) 2020-02-19 14:36:39 +00:00
Andrew Clark
4d9f850065 Re-throw errors thrown by the renderer at the root in the complete phase (#18029)
* Re-throw errors thrown by the renderer at the root

React treats errors thrown at the root as a fatal because there's no
parent component that can capture it. (This is distinct from an
"uncaught error" that isn't wrapped in an error boundary, because in
that case we can fall back to deleting the whole tree -- not great, but
at least the error is contained to a single root, and React is left in a
consistent state.)

It turns out we didn't have a test case for this path. The only way it
can happen is if the renderer's host config throws. We had similar test
cases for host components, but none for the host root.

This adds a new test case and fixes a bug where React would keep
retrying the root because the `workInProgress` pointer was not advanced
to the next fiber. (Which in this case is `null`, since it's the root.)

We could consider in the future trying to gracefully exit from certain
types of root errors without leaving React in an inconsistent state. For
example, we should be able to gracefully exit from errors thrown in the
begin phase. For now, I'm treating it like an internal invariant and
immediately exiting.

* Add comment
2020-02-18 15:55:38 -08:00
Brian Vaughn
14afeb1033 Added missing feature flag 2020-02-18 14:49:57 -08:00
Brian Vaughn
691096c95d Split recent passive effects changes into 2 flags (#18030)
* Split recent passive effects changes into 2 flags

Separate flags can now be used to opt passive effects into:
1) Deferring destroy functions on unmount to subsequent passive effects flush
2) Running all destroy functions (for all fibers) before create functions

This allows us to test the less risky feature (2) separately from the more risky one.

* deferPassiveEffectCleanupDuringUnmount is ignored unless runAllPassiveEffectDestroysBeforeCreates is true
2020-02-18 14:19:43 -08:00
Andrew Clark
56d8a73aff [www] Disable Scheduler timeout w/ dynamic flag (#18069)
Before attempting to land an expiration times refactor, I want to see
if this particular change will impact performance (either positively
or negatively). I will test this with a GK.
2020-02-18 13:43:16 -08:00
Dominic Gannaway
1a6d8179b6 [react-interactions] Ensure onBeforeBlur fires for hideInstance (#18064) 2020-02-18 18:50:38 +00:00
Ryota Murakami
48c4867d74 Update issue templates to directly link to relevant sources (#18039)
GitHub supports linking to off-site sources for certain types of issue.
2020-02-18 10:30:00 -08:00
Brian Vaughn
90be006da8 Updated Yarn lockfile 2020-02-18 09:40:59 -08:00
Haseeb Furkhan Mohammed
d5ddc16a33 React developer tools extension for Microsoft Edge (#18041)
* Port Chrome extension to Microsoft Edge
2020-02-18 09:40:30 -08:00
Dominic Gannaway
f48a5e64e8 Further cleanup of plugin event system (#18056) 2020-02-18 13:31:59 +00:00
Dan Abramov
d533229fba Fix Prettier 2020-02-17 20:36:16 +00:00
Dan Abramov
56a8c35321 eslint-plugin-react-hooks@2.4.0 2020-02-17 20:26:56 +00:00
Will Douglas
93a229bab5 Update eslint rule exhaustive deps to use new suggestions feature (#17385)
This closes #16313
2020-02-17 20:24:27 +00:00
Dominic Gannaway
9def56ec0e Refactor DOM plugin system to single module (#18025) 2020-02-14 08:10:42 +00:00
Eli White
2d6be757df [Native] Delete NativeComponent and NativeMethodsMixin (#18036)
* [Native] Delete NativeComponent and NativeMethodsMixin

* Remove more files
2020-02-13 15:09:25 -08:00
Luna Ruan
d4f2b0379c Add Auto Import to Babel Plugin (#16626)
This babel transform is a fork of the @babel/plugin-transform-react-jsx transform and is for experimentation purposes only. We don't plan to own this code in the future, and we will upstream this to Babel at some point once we've proven out the concept.

As per the RFC to simplify element creation, we want to add the ability to auto import "react' directly from the babel plugin. This commit updates the babel plugin with two options:

1.) importSource: The React module to import from. Defaults to react.
2.) autoImport: The type of import. Defaults to none.
- none: Does not import React. JSX compiles to React.jsx etc.
- namespace: import * as _react from "react";. JSX compiles to _react.jsx etc.
- default: import _default from "react"; JSX compiles to _default.jsx etc.
- namedExports: import {jsx as _jsx} from "react"; JSX compiles to _jsx etc.
- require: var _react = _interopRequireWildcard(require("react"));. jSX compiles to _react.jsx etc.

namespace, default, and namedExports can only be used when sourceType: module and require can only be used when sourceType: script.

It also adds two pragmas (jsxAutoImport and jsxImportSource) that allow users to specify autoImport and importSource in the docblock.
2020-02-13 12:36:19 -08:00
Dan Abramov
8777b44e98 Add Modern WWW build (#18028)
* Build both stable and experimental WWW builds

* Flip already experimental WWW flags to true

* Remove FB-specific internals from modern FB builds

We think we're not going to need these.

* Disable classic features in modern WWW builds

* Disable legacy ReactDOM API for modern WWW build

* Don’t include user timing in prod

* Fix bad copy paste and add missing flags to test renderer

* Add testing WWW feature flag file

We need it because WWW has a different meaning of experimental now.
2020-02-13 20:33:53 +00:00
Sunil Pai
58b8797b73 remove "Unreleased" section from CHANGELOG (#18027)
This section is empty, and imo isn't really helpful in React's changelog. I'm honestly not sure why this is even here? Figured I'd start a discussion with a PR, or we can remove it right now.
2020-02-12 17:17:49 +00:00
Dan Abramov
a607ea4c42 Remove getIsHydrating (#18019) 2020-02-12 01:01:29 +00:00
Dominic Gannaway
988f4b14ee Do not export passiveBrowserEventsSupported from Focus responder (#18022)
Remove code
2020-02-11 15:57:37 -08:00
Brian Vaughn
f7278034de Flush all passive destroy fns before calling create fns (#17947)
* Flush all passive destroy fns before calling create fns

Previously we only flushed destroy functions for a single fiber.

The reason this is important is that interleaving destroy/create effects between sibling components might cause components to interfere with each other (e.g. a destroy function in one component may unintentionally override a ref value set by a create function in another component).

This PR builds on top of the recently added deferPassiveEffectCleanupDuringUnmount kill switch to separate passive effects flushing into two separate phases (similar to layout effects).

* Change passive effect flushing to use arrays instead of lists

This change offers a small advantage over the way we did things previous: it continues invoking destroy functions even after a previous one errored.
2020-02-11 09:52:54 -08:00
Dominic Gannaway
529e58ab0a Remove legacy www config from Rollup build (#18016) 2020-02-11 13:42:19 +00:00
Dominic Gannaway
42918f40aa Change build from babylon to babel (#18015) 2020-02-11 11:56:26 +00:00
Dominic Gannaway
df5faddcc2 Refactor commitPlacement to recursively insert nodes (#17996) 2020-02-10 23:38:24 +00:00
Dan Abramov
ab7b83a924 Stop exposing some internals on FB build (#18011) 2020-02-10 19:52:27 +00:00
Dan Abramov
517de74b0c Tweak comment wording (#18007)
* Revert "Update ReactFiberExpirationTime.js (#17825)"

This reverts commit b63cb6f6cf.

* Reword
2020-02-10 16:15:10 +00:00
haseeb
b63cb6f6cf Update ReactFiberExpirationTime.js (#17825)
replaced 'add' with 'subtract'
2020-02-10 12:37:49 +00:00
Jesse Katsumata
89c6042df3 fix: typo in test (#18005) 2020-02-10 12:34:09 +00:00
Sophie Alpert
4f71f25a34 Re-enable shorthand CSS property collision warning (#18002)
Originally added in https://github.com/facebook/react/pull/14181; disabled in https://github.com/facebook/react/pull/14245. Intention was to enable it in React 16.7 but we forgot.
2020-02-10 11:42:11 +00:00
Brian Vaughn
e05dedc415 Added $FlowFixMe to DevTools shell for module we Flow-ignore (#18001) 2020-02-07 14:36:51 -08:00
Dan Abramov
d1bfdfb861 Ignore react-native-web in Flow checks (#17999) 2020-02-07 16:24:25 +00:00
Dominic Gannaway
c55c34e46a Move React Map child check to behind flags or __DEV__ (#17995) 2020-02-07 12:21:50 +00:00
cutjavascript
901d76bc5c dataForRoots.set duplicate removal (#17993)
dataForRoots.set duplicate removal
2020-02-06 11:48:02 -08:00
Dan Abramov
3f814e7582 Fix Flow type for React Native (#17992) 2020-02-06 18:31:13 +00:00
Dominic Gannaway
256d78d11f Add feature flag for removing children Map support (#17990) 2020-02-06 13:19:35 +00:00
Dominic Gannaway
df134d31cb Use babel parser rather than Babylon in extract errors (#17988) 2020-02-06 12:46:32 +00:00
Brian Vaughn
9e158c091b 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 <threepointone@oculus.com>

* Updated README

Co-authored-by: Sunil Pai <threepointone@oculus.com>
2020-02-05 08:52:31 -08:00
Sunil Pai
d84c539b31 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
613cbd3ace Formatting fix (Prettier) to build script 2020-02-04 11:37:38 -08:00