Skip to content

Conversation

@Ephem
Copy link
Owner

@Ephem Ephem commented Sep 6, 2019

Closes #15

This PR merges the React repo master of a couple of days back. I tried merging the v16.9.0 tag but got a lot of very weird issues and unrelated failing tests. I never figured out why.

Should be safe to merge master directly, most ongoing work there is behind feature flags or very unlikely to conflict with the serverside renderer here.

Merging master might also enable the possibility on building on PR-16383 which got merged after 16.9.0 to add support for React.lazy.

philipp-spiess and others added 30 commits July 28, 2019 08:40
This change adds support for element inspecting within `<iframe/>`s.

The iframes are kept in a Set so that we only append listeners once and
clean them up properly. I’ve run a few tests and it seems to behave as
expected.

The fixture includes a cross-origin iframe to make sure we do not error
in this case.
* Add a failing test for refs and remounting

* Transfer ref when remounting
Long press will move to a separate responder.
Moving working with delays into user-space.
Moving working with delays into user-space.
… scheduler (facebook#16207)

Concurrent/Batched mode tests should always be run with a mocked scheduler (v17 or not). This PR adds a warning for the same. I'll put up a separate PR to the docs with a page detailing how to mock the scheduler.
In this PR, for tests (specifically, code inside an `act()` scope), we immediately trigger work that would have otherwise required a timeout. This makes it simpler to tests loading/spinner states, and makes tests resilient to changes in React.

For some of our tests(specifically, ReactSuspenseWithNoopRenderer-test.internal), we _don't_ want fallbacks to immediately trigger, because we're testing intermediate states and such. Added a feature flag `flushSuspenseFallbacksInTests` to disable this behaviour on a per case basis.
…ok#16257)

* Bugfix: Priority when effects are flushed early

The priority of passive effects is supposed to be the same as the
priority of the render. This fixes a bug where the priority is sometimes
wrong if the effects are flushed early.

But the priority should really never be higher than Normal Priority.
I'll change that in the next commit.

* Effects never have higher than normal priority

Effects currently have the same priority as the render that spawns them.
This changes the behavior so that effects always have normal priority,
or lower if the render priority is lower (e.g. offscreen prerendering).

The implementation is a bit awkward because of the way `renderRoot`,
`commitRoot`, and `flushPassiveEffects` are split. This is a known
factoring problem that I'm planning to address once 16.9 is released.
* [act] Wrap IsThisRendererActing in DEV check

So that it doesn't leak into the production bundle. Follow-up to facebook#16240.

* Disable Suspense fallback test in prod
The unmocked Scheduler warning doesn't actually check if Scheduler
is mocked.
This dialog is shown in the browser extension the first time a user views v4. It is off by default for the standalone extension, but can be enabled via a public API.
This wasn't reliable because of browser extension API limitations and required serious throttling to avoid harming performance, so I've decided to just remove it entirely for now.
Changed truncation to be CSS-driven, and enabled double-click selection of text, so that long keys could be copied from within the tree.
* Add a feature flag to disable legacy context

* Address review

- invariant -> warning
- Make this.context and context argument actually undefined

* Increase test coverage for lifecycles

* Also disable it on the server is flag is on

* Make this.context {} when disabled, but function context is undefined

* Move checks inside
…16278)

If there are adjacent updates we bail out of rendering the suspense list
at all but we may still complete the node. We need to reset the render
state in that case.

I restructured so that this is in the same code path so we don't forget it
in the future.
The clean-up function of a passive effect (`useEffect`) usually fires
in a post-commit task, after the browser has painted. However, there is
an exception when the component (or its parent) is deleted from the
tree. In that case, we fire the clean-up function during the
synchronous commit phase, the same phase we use for layout effects.

This is a concession to implementation complexity. Calling it in the
passive effect phase would require either traversing the children of the
deleted fiber again, or including unmount effects as part of the fiber
effect list.

Because the functions are called during the sync phase in this case,
the Scheduler priority is Immediate (the one used for layout) instead
of Normal. We may want to reconsider this trade off later.
necolas and others added 29 commits August 27, 2019 15:45
* Better simulation for pointercancel
* Fix pressure values for different pointers
* Add describe/test helpers for pointer events
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 change the JSX transform from targeting React.createElement(type, props, children) to React.jsx(type, props, key). This modifies the existing @babel/plugin-transform-react-jsx (and helper) babel plugin to support React.jsx and React.jsxDEV.

The main differences between React.jsx/React.jsxDEV and React.createElement are:
1.) key is now passed as an explicit argument rather than through props
3.) children are now passed through props rather than as an explicit argument
4.) props must always be an object
5.) __source and and __self are now passed as separate arguments into React.jsxDEV rather than through props

Part of the rationale for this change is that we want to deprecate key spread through props because this is an expensive dynamic comparison operation. We want users instead always explicitly pass key as a prop. However, in the interim, we need a way to distinguish between <div {...props} key={foo} /> and <div key={foo} {...props} />. Therefore, until we completely deprecate key spreading, we will use React.createElement to transform <div {...props} key="Hi" /> and React.jsx to transform everything else.
Imports the entire React DevTools v4 git repository (with history).
In order to foster healthy open source communities, we're adopting the
[Contributor Covenant](https://www.contributor-covenant.org/). It has been
built by open source community members and represents a shared understanding of
what is expected from a healthy community.
@Ephem Ephem merged commit 9067aa6 into lightyear Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Try syncing upstream changes