Commit Graph
14215 Commits
Author SHA1 Message Date
Andrew Clark 5f696e4973 Allow alpha tags 2021-06-08 11:31:42 -04:00
Andrew ClarkandGitHub 98555a17c8 Update next React version (#21647)
This does not mean that a release of 18.0 is imminent, only that the
main branch includes breaking changes.

Also updates the versioning scheme of the `@next` channel to include
the upcoming semver number, as well as the word "alpha" to indicate the
stability of the release.

- Before:       0.0.0-95e03035a5
- After:        18.0.0-alpha-95e03035a5
2021-06-08 08:26:22 -07:00
ba00a3a04b Fix Issue with Undefined Lazy Imports By Refactoring Lazy Initialization Order (#21642)
* Add a DEV warning for common case

* Don't set Pending flag before we know it's a promise

* Move default exports extraction to render phase

This is really where most unwrapping happen. The resolved promise is the
module object and then we read things from it.

This way it lines up a bit closer with the Promise model too since the
promise resolving to React gets passed this same value.

If this throws, then it throws during render so it's caught properly and
you can break on it and even see it on the right stack.

* Check if the default is in the module object instead of if it's undefined

Normally we'd just check if something is undefined but in this case it's
valid to have an undefined value in the export but if you don't have a
property then you're probably importing the wrong kind of object.

* We need to check if it's uninitialized for sync resolution

Co-authored-by: Dan Abramov <[email protected]>
2021-06-07 14:47:18 -07:00
d9c2b236f9 Fix typo in comment (accumlated → accumulated) (#21637)
Co-authored-by: HuJiajie <[email protected]>
2021-06-07 08:52:49 -04:00
niexqandGitHub 918fb65d8c Fix typo in comment (environement → environment) (#21635) 2021-06-07 08:52:42 -04:00
niexqandGitHub 9c7e604c57 Fix typo in comment (satsify → satisfy) (#21629) 2021-06-05 14:02:15 -04:00
Shannon FengandGitHub 15dd81b282 fix comments: expiration time -> lanes (#21551) 2021-06-05 07:19:40 -07:00
Dan Abramov adba5957b2 Fix CSS 2021-06-04 23:12:01 +01:00
Dan Abramov 2bc857a97f Tweak fixture 2021-06-04 23:10:02 +01:00
Dan AbramovandGitHub 2fbefba6dc [Fizz] Add another fixture (#21627) 2021-06-04 23:04:06 +01:00
Dan AbramovandGitHub 6a7d01793d [Fizz] Always call flush() if it exists (#21625) 2021-06-04 20:17:57 +01:00
Ikko AshimineandGitHub 107f68d7aa Fix typo in bridge.js (#21621) 2021-06-04 11:42:09 -04:00
Sebastian MarkbågeandGitHub 95e03035a5 [Fizz] Minor Fixes for Warning Parity (#21618) 2021-06-03 19:54:31 -04:00
Sebastian MarkbågeandGitHub 7700052898 [Fizz] Implement Component Stacks in DEV for warnings (#21610)
* Implement component stacks

This uses a reverse linked list in DEV-only to keep track of where we're
currently executing.

* Fix bug that wasn't picking up the right stack at suspended boundaries

This makes it more explicit which stack we pass in to be retained by the
task.
2021-06-03 13:02:41 -07:00
Brian VaughnandGitHub 637d5ccbd9 Make enableSuspenseLayoutEffectSemantics static for www (#21617)
This has been ramped up to 80% GK so the next step is to just turn it on for 100%
2021-06-03 15:40:59 -04:00
Andrew ClarkandGitHub f0fdbd3b87 Support @latest in prepare-release-from-ci (#21616)
Since we track these versions in source, we can build `@latest`
releases in CI and store them as artifacts.

Then when it's time to release, and the build has been verified, we use
`prepare-release-from-ci` (the same script we use for `@next` and
`@experimental`) to fetch the already built and versioned packages.
2021-06-03 11:00:08 -07:00
Andrew ClarkandGitHub 3afa14908c Prepare semver (@latest) releases in CI (#21615)
Now that we track package versions in source, `@latest` builds should
be fully reproducible for a given commit. We can prepare the packages in
CI and store them as artifacts, the same way we do for `@next` and
`@experimental`.

Eventually this can replace the interactive script that we currently
use to swap out the version numbers.

The other nice thing about this approach is that we can run tests in CI
to verify that the packages are releasable, instead of waiting until
right before publish.

I named the output directory `oss-stable-semver`, to distinguish from
the `@next` prereleases that are located at `oss-stable`. I don't love
this naming. I'd prefer to use the name of the corresponding npm dist
tag. I'll do that in a follow-up, though, since the `oss-stable` name is
referenced in a handful of places.

Current naming (after this PR):

- `oss-experimental` → `@experimental`
- `oss-stable` → `@next`
- `oss-stable-semver` → `@latest`

Proposed naming (not yet implemented, requires more work):

- `oss-experimental` → `@experimental`
- `oss-next` → `@next`
- `oss-latest` → `@latest`
2021-06-03 10:26:11 -07:00
Andrew ClarkandGitHub 85b570525c Use ReactVersions module as package allowlist (#21613)
Instead of keeping a separate allowlist in sync, we use ReactVersions.js
as the source of truth for which packages get published.
2021-06-03 11:45:10 -04:00
b2844b7d9a Devtools: add feature to trigger an error boundary (#21583)
Co-authored-by: Brian Vaughn <[email protected]>
2021-06-03 11:21:44 -04:00
Sebastian MarkbågeandGitHub e9d20dfe78 Fix <select> check of defaultValue/value type (#21611) 2021-06-03 09:13:00 -04:00
Andrew Clark bc59e5d9ff Fix reference to wrong variable
Follow-up to #21608
2021-06-03 00:23:08 -04:00
Andrew ClarkandGitHub 1a8f0eaa66 Add single source of truth for package versions (#21608)
The versioning scheme for `@next` releases does not include semver
information. Like `@experimental`, the versions are based only on the
hash, i.e. `0.0.0-<commit_sha>`. The reason we do this is to prevent
the use of a tilde (~) or caret (^) to match a range of
prerelease versions.

For `@experimental`, I think this rationale still makes sense — those
releases are very unstable, with frequent breaking changes. But `@next`
is not as volatile. It represents the next stable release. So, I think
we can afford to include an actual verison number at the beginning of
the string instead of `0.0.0`.

We can also add a label that indicates readiness of the upcoming
release, like "alpha", "beta", "rc", etc.

To prepare for this the new versioning scheme, I updated the build
script. However, **this PR does not enable the new versioning scheme
yet**. I left a TODO above the line that we'll change once we're ready.

We need to specify the expected next version numbers for each package,
somewhere. These aren't encoded anywhere today — we don't specify
version numbers until right before publishing to `@latest`, using an
interactive script: `prepare-release-from-npm`.

Instead, what we can do is track these version numbers in a module. I
added `ReactVersions.js` that acts as the single source of truth for
every package's version. The build script uses this module to build the
`@next` packages.

In the future, I want to start building the `@latest` packages the same
way we do `@next` and `@experimental`. (What we do now is download a
`@next` release from npm and swap out its version numbers.) Then we
could run automated tests in CI to confirm the packages are releasable,
instead of waiting to verify that right before publish.
2021-06-02 20:54:26 -07:00
Sebastian MarkbågeandGitHub 137f4efe14 Resolve the true entry point during tests (#21505)
* Resolve the entry point for tests the same way builds do

This way the source tests, test the same entry point configuration.

* Gate test selectors on www

These are currently only exposed in www builds

* Gate createEventHandle / useFocus on www

These are enabled in both www variants but not OSS experimental.

* Temporarily disable www-modern entry point

Use the main one that has all the exports until we fix more tests.

* Remove enableCache override that's no longer correct

* Open gates for www

These used to not be covered because they used Cache which wasn't exposed.
2021-06-02 18:03:29 -07:00
Sebastian MarkbågeandGitHub 311bcf767b Convert ES6/TypeScript/CoffeeScript Tests to createRoot + act (#21598)
* Convert ES6/TypeScript CoffeeScript Tests to createRoot + act

* Change expectation for WWW+VARIANT because the deferRenderPhaseUpdateToNextBatch flag breaks this behavior
2021-06-02 11:36:59 -07:00
Sebastian MarkbågeandGitHub 92d10e1c7e Disable deferRenderPhaseUpdateToNextBatch by default (#21605)
We're still experimenting with this and it causes a breaking behavior
for setState in componentWillMount/componentWillReceiveProps atm.
2021-06-02 11:28:06 -07:00
okmttdhrandGitHub 05d2ee64df Delete an unused field (#21415) 2021-06-02 16:24:40 +01:00
Dan AbramovandGitHub 1e7277fdab Expose Fizz in stable builds (#21602) 2021-06-02 16:13:19 +01:00
c67b1e7017 [Offscreen] Mount/unmount layout effects (#21386)
* [Offscreen] Mount/unmount layout effects

Exposes the Offscreen component type and implements basic support for
mount/unmounting layout effects when the visibility is toggled.

Mostly it works the same way as hidden Suspense trees, which use the
same internal fiber type. I had to add an extra bailout, though, that
doesn't apply to the Suspense case but does apply to Offscreen
components: a hidden Offscreen tree will eventually render at low
priority, and when we it does, its `subtreeTag` will have effects
scheduled on it. So I added a check to the layout phase where, if the
subtree is hidden, we skip over the subtree entirely. An alternate
design would be to clear the subtree flags in the render phase, but I
prefer doing it this way since it's harder to mess up.

We also need an API to enable the same thing for passive effects. This
is not yet implemented.

* Add test starting from hidden

Co-authored-by: Rick Hanlon <[email protected]>
2021-06-01 12:46:08 -07:00
fe71410dad OSS feature flag updates (#21597)
Co-authored-by: Dan Abramov <[email protected]>
2021-06-01 13:44:10 -04:00
Sebastian MarkbågeandGitHub 35a89931fa Define global __WWW__ = true flag during www tests (#21504)
* Define global __WWW__ = true flag during www tests

We already do that for __PERSISTENT__.

* Use @gate www in ReactSuspenseCallback

This allows it to not be internal anymore. We test it against the www build.
2021-06-01 10:16:06 -07:00
Sebastian MarkbågeandGitHub 216db6f340 Fix Fizz exported types (#21596) 2021-06-01 10:02:04 -07:00
Brian VaughnandGitHub abeae6c8a3 Disable strict effects for legacy roots (again) (#21591) 2021-05-31 13:05:50 -04:00
Brian VaughnandGitHub 4324b0479f DevTools: Format error message (#21580)
To support GitHub API fuzzy issue search
2021-05-27 15:44:14 -04:00
Sebastian SilbermannandGitHub f1b4687d21 Update jest to v26 (#21574)
* Install jest 26

* jsdom env now uses 16 by default

* require.requireActual -> jest.requireActual

* deduplicate added deps
2021-05-27 16:33:57 +01:00
Brian Vaughn 0cc52724e5 Updated DevTools bug Workflow
Workflow now auto-assigns issues needing more information to the person who reported them
2021-05-27 09:49:44 -04:00
142f62731f Removed _debugID field from Fiber - Issue #21558 (#21570)
* Removed _debugID field from Fiber
* Update ReactFunctionComponent-test.js

Co-authored-by: Brian Vaughn <[email protected]>
2021-05-26 16:53:18 -04:00
Brian VaughnandGitHub 233de58c97 Fixed localhost URL check
Noticed that it missed 21568 because of a leading "/"
2021-05-26 10:43:51 -04:00
Brian VaughnandGitHub 33c46e7e09 Enable the updater-tracking feature flag in more builds (#21567) 2021-05-25 17:41:19 -04:00
Brian VaughnandGitHub 206a7facc6 Enabled Profiling feature flags for OSS release (#21565)
* Enabled Profiling feature flags for OSS release

`enableProfilerCommitHooks` and `enableProfilerNestedUpdatePhase`
2021-05-25 17:32:14 -04:00
Brian Vaughn 8ea654acd9 DevTools 4.13.4 -> 4.13.5 2021-05-25 15:18:47 -04:00
Brian VaughnandGitHub bdae1b3f4a DevTools: Support an element mounting before its owner (#21562) 2021-05-25 14:49:05 -04:00
RickyandGitHub 123787bf15 Turn on enableSyncDefaultUpdates everywhere (#21548) 2021-05-25 11:21:58 -04:00
Samuel SuslaandGitHub b5580af302 Add flag concurrent root to Fabric render function (#21552)
* Add flag concurrent root to Fabric render function

* Lint
2021-05-24 10:56:47 -04:00
Brian VaughnandGitHub 191dbf35ed Add GitHub action to check for bug repro (#21542) 2021-05-21 15:48:12 -04:00
Brian Vaughn 850e661ea7 DevTools: Add 4.13.4 changelog 2021-05-20 17:00:17 -04:00
Brian Vaughn 7e9ccdc1c0 DevTools: Add 4.10.4 to CHANGELOG 2021-05-20 16:31:18 -04:00
Brian VaughnandGitHub ae049a0dc5 DevTools: Revert force deep re-mount when Fast Refresh detected (#21539)
This reverts the most expensive part of 68db562f6 (which seems to no longer be necessary after subsequent changes).
2021-05-20 15:28:59 -04:00
Brian VaughnandGitHub 8a92b0cdf4 Update devtools_bug_report.yml 2021-05-20 14:52:08 -04:00
Brian VaughnandGitHub 992a663059 Update devtools_bug_report.yml 2021-05-20 14:51:35 -04:00
Brian Vaughn 79b229fbc8 DevTools 4.13.3 -> 4.13.4 2021-05-20 11:24:30 -04:00