diff --git a/packages/framer-motion/src/animation/animators/MainThreadAnimation.ts b/packages/framer-motion/src/animation/animators/MainThreadAnimation.ts index a6aabcda00..20cc6d53cb 100644 --- a/packages/framer-motion/src/animation/animators/MainThreadAnimation.ts +++ b/packages/framer-motion/src/animation/animators/MainThreadAnimation.ts @@ -20,8 +20,7 @@ import { clamp } from "../../utils/clamp" import { invariant } from "../../utils/errors" import { frameloopDriver } from "./drivers/driver-frameloop" import { getFinalKeyframe } from "./waapi/utils/get-final-keyframe" -import { frameData } from "../../frameloop" -let firstOne = true + type GeneratorFactory = ( options: ValueAnimationOptions ) => KeyframeGenerator @@ -383,15 +382,6 @@ export class MainThreadAnimation< ) } - if (firstOne && this.options.name === "x") { - console.log( - state.value, - frameData.isProcessing, - frameData.timestamp - ) - firstOne = false - } - if (onUpdate) { onUpdate(state.value) } @@ -462,9 +452,8 @@ export class MainThreadAnimation< if (this.holdTime !== null) { this.startTime = now - this.holdTime } else if (!this.startTime || this.state === "finished") { - this.startTime = now + 50 + this.startTime = now } - this.options.name === "x" && console.log("start time", this.startTime) if (this.state === "finished") { this.updateFinishedPromise() diff --git a/packages/framer-motion/src/animation/optimized-appear/handoff.ts b/packages/framer-motion/src/animation/optimized-appear/handoff.ts index a35f014905..2203d6b95f 100644 --- a/packages/framer-motion/src/animation/optimized-appear/handoff.ts +++ b/packages/framer-motion/src/animation/optimized-appear/handoff.ts @@ -81,7 +81,7 @@ export function handoffOptimizedAppearAnimation( if (handoffFrameTime === undefined) { handoffFrameTime = performance.now() } - console.log("elapsed", handoffFrameTime - startTime) + /** * We use main thread timings vs those returned by Animation.currentTime as it * can be the case, particularly in Firefox, that currentTime doesn't return diff --git a/packages/framer-motion/src/render/utils/KeyframesResolver.ts b/packages/framer-motion/src/render/utils/KeyframesResolver.ts index 1eb5f3c059..5ef03b82a5 100644 --- a/packages/framer-motion/src/render/utils/KeyframesResolver.ts +++ b/packages/framer-motion/src/render/utils/KeyframesResolver.ts @@ -1,5 +1,4 @@ import { frame } from "../../frameloop" -import { microtask } from "../../frameloop/microtask" import { MotionValue } from "../../value" import type { VisualElement } from "../VisualElement" import { removeNonTranslationalTransform } from "../dom/utils/unit-conversion" @@ -152,8 +151,8 @@ export class KeyframeResolver { if (!isScheduled) { isScheduled = true - microtask.read(readAllKeyframes) - microtask.resolveKeyframes(measureAllKeyframes) + frame.read(readAllKeyframes) + frame.resolveKeyframes(measureAllKeyframes) } } else { this.readKeyframes() @@ -212,7 +211,6 @@ export class KeyframeResolver { measureEndState() {} complete() { - console.log("keyframes resolved", this.name) this.isComplete = true this.onComplete(