dillon1000/react

Commit

Add ScrollTimeline Polyfill for Swipe Recognizer using a new CustomTimeline protocol (#33501)

The React API is just that we now accept this protocol as an alternative
to a native `AnimationTimeline` to be passed to
`startGestureTransition`. This is specifically the DOM version.

```js
interface CustomTimeline {
  currentTime: number;
  animate(animation: Animation): void | (() => void);
}
```

Instead, of passing this to the `Animation` that we start to control the
View Transition keyframes, we instead inverse the control and pass the
`Animation` to this one. It lets any custom implementation drive the
updates. It can do so by updating the time every frame or letting it run
a time based animation (such as momentum scroll).

In this case I added a basic polyfill for `ScrollTimeline` in the
example but we'll need a better one.
Browse files
Changed paths12 files
First-parent comparison
M .eslintrc.js ModifiedA fixtures/view-transition/loader/package.json AddedA fixtures/view-transition/loader/server.js AddedM fixtures/view-transition/package.json ModifiedM fixtures/view-transition/server/index.js ModifiedM fixtures/view-transition/server/render.js ModifiedM fixtures/view-transition/src/components/App.js ModifiedM fixtures/view-transition/src/components/Page.js ModifiedM fixtures/view-transition/src/components/SwipeRecognizer.js ModifiedM fixtures/view-transition/src/index.js ModifiedM fixtures/view-transition/yarn.lock ModifiedM packages/react-dom-bindings/src/client/ReactFiberConfigDOM.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…