Skip to content

feat(core): add GSAP keyframe + motion-path source mutations#1554

Open
miguel-heygen wants to merge 1 commit into
chore/producer-esm-dirname-shimfrom
feat/core-gsap-motion-path-mutations
Open

feat(core): add GSAP keyframe + motion-path source mutations#1554
miguel-heygen wants to merge 1 commit into
chore/producer-esm-dirname-shimfrom
feat/core-gsap-motion-path-mutations

Conversation

@miguel-heygen

@miguel-heygen miguel-heygen commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Stack: GSAP keyframe + motion-path editing — core read/write layer (#1553#1561).

What

Add core parser + writer support for keyframe and motion-path source mutations on GSAP tweens: add / remove / update keyframes, convert a flat tween to keyframes, edit motion-path waypoints, and classify tween properties into groups (position / scale / rotation / visual).

Why

The Studio keyframe/motion-path editor needs deterministic, AST-level read and write of GSAP timelines so that edits round-trip through the composition source without reformatting unrelated code.

How

  • Extend the Acorn-based GSAP writer (gsapWriterAcorn.ts) with keyframe/motion-path ops.
  • Parser surfaces keyframes, property groups, and resolved tween timing (gsapParser.ts, gsapConstants.ts).
  • Writer-vs-parser parity tests lock emitted source against what the parser reads back.

Test plan

  • Unit tests added (parser + writer parity)
  • bun run test (core) green

Array-form keyframe removal in both the recast and acorn writers, plus
update/add/remove-motion-path-point and add-motion-path. Exclude _auto and
data from tween property-group classification.
@miguel-heygen miguel-heygen force-pushed the chore/producer-esm-dirname-shim branch from 99da598 to e5e8d40 Compare June 18, 2026 15:17
@miguel-heygen miguel-heygen force-pushed the feat/core-gsap-motion-path-mutations branch from 085862a to c8aee05 Compare June 18, 2026 15:17

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved at c8aee055 per Rames D Jusso "stamp-ready with 1 nit + 1 question." Deferring his specific items (posted in his review) to Miguel for resolution inline — non-blocking from my side.

PR body is the unfilled template; please fill in even a one-paragraph description before merge so the change history names what landed (Rames D Jusso + Via both flagged this as a stack-wide process concern across all 9 PRs).

@terencecho terencecho left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test-coverage + backwards-compat axis (complementary to @rames-jusso's structural pass)

Reviewed with a narrower lens: do the new mutation APIs ship with tests, and is anything signature-broken on the existing parser/writer surface?

Verified

  • Test coverage strong on the new surface:
    • gsapParser.test.ts adds units for updateMotionPathPointInScript (4 cases), addMotionPathPointInScript (2 cases), removeMotionPathPointInScript (2 cases), addMotionPathToScript (1 case), syncPositionHoldsBeforeKeyframes (6 cases), addKeyframeToScript backfill on/off (2 cases), _auto exclusion (1 case).
    • gsapWriter.parity.test.ts adds removeKeyframeFromScript array-form parity (3 cases: implicit-% removal, collapse-on-fewer-than-2, no-op on mismatched %).
  • Writer parity scope is correct. Motion-path mutations are intentionally recast-only (live in gsapParser.ts, no acorn counterpart) because #1555 routes them through studio-api (server-side). The browser/SDK acorn writer doesn't need them — the studio calls them via HTTP. So the parity test absence for motion-path is by design, not a gap.
  • No export signature breaks: every export touched in gsapParser.ts and gsapWriterAcorn.ts is an ADDITION (verified by git diff filter on ^[-+]\s*export function — no - lines).

Note

  • The commit message describes the surface well, but the PR body is the unfilled template — see consolidated note on #1561. For the most critical PR in the stack (+651/-4 core mutations), the empty body makes the change harder to justify to a future archaeologist.

— Review by tai (pr-review)

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.

3 participants