Commit Graph
1313 Commits
Author SHA1 Message Date
RickyandGitHub b741ff63f2 Generate RN renderers for stable builds (#19421)
* Generate RN renderers for experimental builds

* Don't generate FB builds for experimental channels
2020-07-20 17:15:06 -04:00
Sebastian MarkbågeandGitHub a610d6a78d isFBBundle should be true if it's FB for www or FB for RN (#19420)
This ensures that the .fb.js override files kick in for RN. Otherwise we
won't have FB specific exports in the isomorphic modules.
2020-07-20 10:37:04 -07:00
RickyandGitHub 40adf8ea46 Use jest-environment-jsdom-sixteen (#19288)
* Use jest-environment-jsdom-sixteen

* Update yarn.lock

* Dedupe new jest packages in yarn.lock

* Pull upstream changes
2020-07-16 10:17:31 -04:00
Dan Abramov c64c999ba9 Don't build shallow renderer UMD bundles 2020-07-15 16:53:02 +01:00
Dan Abramov 549d613298 Tweak wording 2020-07-10 14:56:28 +01:00
Brian VaughnandGitHub c8d62c859b Fixed test script for DevTools build config (#19295) 2020-07-09 10:49:33 -04:00
Dominic GannawayandGitHub 894eeff0ea Refactor createEventHandle signature (#19174) 2020-07-07 13:05:06 +01:00
Dominic GannawayandGitHub 4bbe79bcfa Handle test-cli failure case for CI (#19265) 2020-07-06 22:05:51 +01:00
Dan AbramovandGitHub 20a1753cee Fork legacy-events folder into react-dom and react-native (#19228) 2020-07-01 16:37:13 +01:00
Dan AbramovandGitHub d8653ee0fc Move responder tests and remove dead code (#19226) 2020-07-01 16:20:49 +01:00
Dominic GannawayandGitHub 96a726eeb4 Remove React Flare Keyboard responder (#19222) 2020-07-01 15:43:16 +01:00
Dan AbramovandGitHub 455f1bd1cc Revert "Add regression test for #18497 (#18538)" (#19215)
This reverts commit 7ef0785791.
2020-06-30 13:38:31 +01:00
Vetrivel ChinnasamyandGitHub f247ad56ad make link https (#19147) 2020-06-30 12:43:52 +01:00
Sophie AlpertandGitHub 7ef0785791 Add regression test for #18497 (#18538) 2020-06-30 12:09:05 +01:00
Brian VaughnandGitHub 62f46bed52 Fixed test script handling of unknown/additional args (#19209) 2020-06-29 15:36:45 -04:00
RickyandGitHub 8b1c33f50d Add new test cli (#19184)
* Add new test cli

* Remove --variant accidentally added to test-persist

* s/test/tests

* Updates from review

* Update package.json tests

* Missed a release channel in circle.yaml

* Update config.yml to use just run: with test commands

* Update release-channel options and add build dir checks

* Update test args to use the new release-channel options

* Fix error in circle config.yml

* Fix a wrong condition for the --variant check

* Fix a wrong condition for the --persistent check

* Prettier

* Require build check for devtool tests as well
2020-06-25 20:39:50 -04:00
Brian VaughnandGitHub bb6dff5b51 Updates the DevTools test script to make it easier to test other URLs. (#19179) 2020-06-23 11:48:35 -04:00
RickyandGitHub 7c9c5ff51c Fix spelling errors and typos (#19138) 2020-06-15 19:59:44 -04:00
Andrew ClarkandGitHub 83672c676b Land Lanes implementation in old fork (#19108)
* Add autofix to cross-fork lint rule

* replace-fork: Replaces old fork contents with new

For each file in the new fork, copies the contents into the
corresponding file of the old fork, replacing what was already there.

In contrast to merge-fork, which performs a three-way merge.

* Replace old fork contents with new fork

First I ran  `yarn replace-fork`.

Then I ran `yarn lint` with autofix enabled. There's currently no way to
do that from the command line (we should fix that), so I had to edit the
lint script file.

* Manual fix-ups

Removes dead branches, removes prefixes from internal fields.  Stuff
like that.

* Fix DevTools tests

DevTools tests only run against the old fork, which is why I didn't
catch these earlier.

There is one test that is still failing. I'm fairly certain it's related
to the layout of the Suspense fiber: we no longer conditionally wrap the
primary children. They are always wrapped in an extra fiber.

Since this has been running in www for weeks without major issues, I'll
defer fixing the remaining test to a follow up.
2020-06-11 20:05:15 -07:00
Dominic GannawayandGitHub a9f8b24b8e Remove synamic modern event system flag for FB (#19059)
* Remove synamic modern event system flag for FB
2020-06-11 19:49:45 +01:00
Sebastian MarkbågeandGitHub 41ce07f3b0 Build FB specific Isomorphic Bundles (#19049)
We need this so we can version them separately and use different
feature flags than we use for OSS RN.

I put them in a separate facebook-react-native folder which won't go
into the RN GH repo. I plan on moving the renderers there too but not yet.
2020-05-29 15:32:38 -07:00
Sebastian MarkbågeandGitHub dfba7a2c60 Upgrade Closure Compiler (#19041)
The Symbol bug has now been fixed so we can remove the hack that renames
the global variable.
2020-05-29 09:17:14 -07:00
Sebastian MarkbågeandGitHub d2de54c0ef Revert autofix lint (#19040)
I accidentally committed this since I had it on locally so I didn't have
to manually convert things to const.

However, this causes things to always pass lint since CI also runs this.
2020-05-28 20:32:34 -07:00
Sebastian MarkbågeandGitHub b5a5ca008f Remove www builds of fetch (#19038)
I don't think we'll ever use this just because we have such a unique set up
for network delivery so we'll use something custom for this case.

Also, we don't need a profiling build for this since it doesn't have an
entry point.
2020-05-28 16:12:37 -07:00
Sebastian MarkbågeandGitHub 0e5051e0b5 Add simple Node build (#19022)
The webpack plugin doesn't really need a separate prod and dev build.
It also needs to be ES2015 otherwise we can't extend native classes.
2020-05-28 15:56:34 -07:00
Sebastian MarkbågeandGitHub 7c7658de71 Lint bundles using the bundle config instead of scanning for files (#19025)
* Lint bundles using the bundle config instead of scanning for files

This ensures that we look for all the files that we expect to see there.
If something doesn't get built we wouldn't detect it.

However, this doesn't find files that aren't part of our builds such as
indirection files in the root. This will need to change with ESM anyway
since indirection files doesn't work. Everything should be built anyway.

This ensures that we can use the bundles.js config to determine special
cases instead of relying on file system conventions.

* Run lint with flag
2020-05-28 15:04:25 -07:00
Sebastian MarkbågeandGitHub 5cc3117eff Delete Entries without Build Output from package.json and the build directory (#19029)
* Gate test

* Delete entrypoints without Build Outputs from package.json and build output

If an entry point exists in bundles.js but doesn't have any bundleTypes,
I delete that entry point file from the build directory. I also remove it
from the files field in package.json if it exists.

This allows us to remove bundles from being built in the stable release
channel.
2020-05-27 19:43:08 -07:00
Sebastian MarkbågeandGitHub 71f6d45308 Remove regenerator from noop (#19024)
This isn't used and it wouldn't work anyway.
2020-05-27 16:14:46 -07:00
Sebastian MarkbågeandGitHub 75cab5defd Lint classic www build (#19023) 2020-05-27 14:13:54 -07:00
Toru KobayashiandGitHub 5f26fa73bb Fix rollup validate script (#18900)
* Revert "Revert "deps: update ESLint version to v7 (#18897)" (#18899)"

This reverts commit cb3ee55f87.

* fix rollup validate script
2020-05-27 01:19:32 +01:00
Andrew ClarkandGitHub 84c98998d6 Make LegacyHidden match semantics of old fork (#18998)
Facebook currently relies on being able to hydrate hidden HTML. So
skipping those trees is a regression.

We don't have a proper solution for this in the new API yet. So I'm
reverting it to match the old behavior.

Now the server renderer will treat LegacyHidden the same as a fragment,
with no other special behavior. We can only get away with this because
we assume that every instance of LegacyHidden is accompanied by a host
component wrapper. In the hidden mode, the host component is given a
`hidden` attribute, which ensures that the initial HTML is not visible.
To support the use of LegacyHidden as a true fragment, without an extra
DOM node, we will have to hide the initial HTML in some other way.
2020-05-25 18:16:53 -07:00
Dominic GannawayandGitHub fc738832a6 Add experimental ReactDOM.createEventHandle (#18756) 2020-05-12 20:24:25 +01:00
Dan AbramovandGitHub cb3ee55f87 Revert "deps: update ESLint version to v7 (#18897)" (#18899)
This reverts commit 7125c01655.
2020-05-12 20:06:14 +01:00
Toru KobayashiandGitHub 7125c01655 deps: update ESLint version to v7 (#18897) 2020-05-12 18:41:37 +01:00
14745fc9c5 [Blocks] Scaffolding react-fetch + first pass at node implementation (#18863)
* First pass at scaffolding out the Node implementation of react-data.

While incomplete, this patch contains some changes to the react-data
package in order to start adding support for Node.

The first part of this change accounts for splitting react-data/fetch
into two discrete entries, adding (and defaulting to) the Node
implementation.

The second part is sketching out a rough approximation of `fetch` for
Node. This implementation is not complete by any means, but provides a
starting point.

* Remove NodeFetch module and put it directly into ReactDataFetchNode.

* Replaced react-data with react-fetch.

This patch shuffles around some of the scaffolding that was in
react-data in favor of react-fetch. It also removes the additional
"fetch" package in favor of something flatter.

* Tweak package organization

* Simplify and add a test

Co-authored-by: Dan Abramov <[email protected]>
2020-05-12 17:21:45 +01:00
Andrew ClarkandGitHub 71de1b21b7 Expose LegacyHidden type and disable <div hidden /> API in new fork (#18891)
* Expose LegacyHidden type

I will use this internally at Facebook to migrate away from
<div hidden />. The end goal is to migrate to the Offscreen type, but
that has different semantics. This is an incremental step.

* Disable <div hidden /> API in new fork

Migrates to the unstable_LegacyHidden type instead. The old fork does
not support the new component type, so I updated the tests to use an
indirection that picks the correct API. I will remove this once the
LegacyHidden (and/or Offscreen) type has landed in both implementations.

* Add gated warning for `<div hidden />` API

Only exists so we can detect callers in www and migrate them to the new
API. Should not visible to anyone outside React Core team.
2020-05-11 20:02:08 -07:00
Andrew ClarkandGitHub 71a770c1a8 [Release] Follow redirect when downloading tarball (#18845)
Adds -L option to `curl` command.

See: https://curl.haxx.se/docs/manpage.html#-L
2020-05-06 10:28:49 -07:00
Brian VaughnandGitHub 9355cce3bd Experimental test selector API (#18607)
Adds several new experimental APIs to aid with automated testing.

Each of the methods below accepts an array of "selectors" that identifies a path (or paths) through a React tree. There are four basic selector types:

* Component: Matches Fibers with the specified React component type
* Role: Matches Host Instances matching the (explicit or implicit) accessibility role.
* Test name: Matches Host Instances with a data-testname attribute.
* Text: Matches Host Instances that directly contain the specified text.
* There is also a special lookahead selector type that enables further matching within a path (without actually including the path in the result). This selector type was inspired by the :has() CSS pseudo-class. It enables e.g. matching a <section> that contained a specific header text, then finding a like button within that <section>.

API
* findAllNodes(): Finds all Host Instances (e.g. HTMLElement) within a host subtree that match the specified selector criteria.
* getFindAllNodesFailureDescription(): Returns an error string describing the matched and unmatched portions of the selector query.
* findBoundingRects(): For all React components within a host subtree that match the specified selector criteria, return a set of bounding boxes that covers the bounds of the nearest (shallowed) Host Instances within those trees.
* observeVisibleRects(): For all React components within a host subtree that match the specified selector criteria, observe if it’s bounding rect is visible in the viewport and is not occluded.
* focusWithin(): For all React components within a host subtree that match the specified selector criteria, set focus within the first focusable Host Instance (as if you started before this component in the tree and moved focus forwards one step).
2020-05-05 10:37:46 -07:00
Sebastian MarkbågeandGitHub 7f98887eb4 Rename Flight to Transport (#18808)
* Rename Flight to Transport

Flight is still the codename for the implementation details (like Fiber).

However, now the public package is react-transport-... which is only
intended to be used directly by integrators.

* Rename names
2020-05-03 11:33:48 -07:00
Andrew ClarkandGitHub 7d278b1029 Initial Lanes implementation (#18796)
See PR #18796 for more information.

All of the changes I've made in this commit are behind the
`enableNewReconciler` flag. Merging this to master will not affect the
open source builds or the build that we ship to Facebook.

The only build that is affected is the `ReactDOMForked` build, which is
deployed to Facebook **behind an experimental flag (currently disabled
for all users)**. We will use this flag to gradually roll out the new
reconciler, and quickly roll it back if we find any problems.

Because we have those protections in place, what I'm aiming for with
this initial PR is the **smallest possible atomic change that lands
cleanly and doesn't rely on too many hacks**. The goal has not been to
get every single test or feature passing, and it definitely is not to
implement all the features that we intend to build on top of the new
model. When possible, I have chosen to preserve existing semantics and
defer changes to follow-up steps. (Listed in the section below.)

(I did not end up having to disable any tests, although if I had, that
should not have necessarily been a merge blocker.)

For example, even though one of the primary goals of this project is to
improve our model for parallel Suspense transitions, in this initial
implementation, I have chosen to keep the same core heuristics for
sequencing and flushing that existed in the ExpirationTimes model: low
priority updates cannot finish without also finishing high priority
ones.

Despite all these precautions, **because the scope of this refactor is
inherently large, I do expect we will find regressions.** The flip side
is that I also expect the new model to improve the stability of the
codebase and make it easier to fix bugs when they arise.
2020-05-02 17:09:31 -07:00
Dominic GannawayandGitHub 556083838f Refine experimental Scopes API (#18778)
* Refine experimental Scopes API
2020-05-01 19:01:43 +01:00
Dan AbramovandGitHub b151558ee4 Build Flight runtime for WWW (revert part of earlier change) 2020-05-01 16:44:25 +01:00
Dan Abramov 46fad5cdfa Don't build react-data for WWW 2020-05-01 16:13:11 +01:00
Dan AbramovandGitHub 94ff71932f Update bundle configs to not build some packages (#18800)
* Stop building old ReactCache for FB

* Update other bundle configs
2020-05-01 16:07:36 +01:00
Dan AbramovandGitHub d7e4b06a2b [Blocks] Initial implementation of cache and data/fetch (#18774)
* Rename ReactCache -> ReactCacheOld

We still use it in some tests so I'm going to leave it for now. I'll start making the new one in parallel in the react package.

* Add react/unstable-cache entry point

* Add react-data entry point

* Initial implementation of cache and data/fetch

* Address review
2020-04-29 19:14:15 +01:00
Brian VaughnandGitHub 40703bf187 DevTools: Improved "native" component stacks (#18656)
* DevTools console override handles new component stack format

DevTools does not attempt to mimic the default browser console format for its component stacks but it does properly detect the new format for Chrome, Firefox, and Safari.
2020-04-21 11:46:11 -07:00
Sebastian MarkbågeandGitHub 596af34e66 Avoid passing custom stacks to console.error (#18685)
* Detect double stacks in the new format in tests

* Remove unnecessary uses of getStackByFiberInDevAndProd

These all execute in the right execution context already.

* Set the debug fiber around the cases that don't have an execution context

* Remove stack detection in our console log overrides

We never pass custom stacks as part of the args anymore.

* Bonus: Don't append getStackAddendum to invariants

We print component stacks for every error anyway so this is just duplicate
information.
2020-04-21 09:22:46 -07:00
Nicolas GallagherandGitHub 5b4be236e8 ReactDOM: remove unstable-native-dependencies bundle (#18483)
This is only used by react-native-web and will be replaced by a user-space
implementation. See: https://github.com/necolas/react-native-web/issues/1568
2020-04-18 15:40:13 -07:00
Andrew ClarkandGitHub 540faf3141 Make Flow work with your editor (#18664)
We typecheck the reconciler against each one of our host configs.
`yarn flow dom` checks it against the DOM renderer, `yarn flow native`
checks it against the native renderer, and so on.

To do this, we generate separate flowconfig files.

Currently, there is no root-level host config, so running Flow
directly via `flow` CLI doesn't work. You have to use the `yarn flow`
command and pick a specific renderer.

A drawback of this design, though, is that our Flow setup doesn't work
with other tooling. Namely, editor integrations.

I think the intent of this was maybe so you don't run Flow against a
renderer than you intended, see it pass, and wrongly think you fixed
all the errors. However, since they all run in CI, I don't think this
is a big deal. In practice, I nearly always run Flow against the same
renderer (DOM), and I'm guessing that's the most common workflow for
others, too.

So what I've done in this commit is modify the `yarn flow` command to
copy the generated `.flowconfig` file into the root directory. The
editor integration will pick this up and show Flow information for
whatever was the last renderer you checked.

Everything else about the setup is the same, and all the renderers will
continue to be checked by CI.
2020-04-18 10:24:46 -07:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2a81bb3a69 Bump https-proxy-agent from 2.2.1 to 2.2.4 in /scripts/release (#18642)
Bumps [https-proxy-agent](https://github.com/TooTallNate/node-https-proxy-agent) from 2.2.1 to 2.2.4.
- [Release notes](https://github.com/TooTallNate/node-https-proxy-agent/releases)
- [Commits](https://github.com/TooTallNate/node-https-proxy-agent/compare/2.2.1...2.2.4)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-04-16 16:06:13 -07:00