Skip to content

feat(sdk,studio): ws-1.1 — add set method to GsapTweenSpec; route addGsapAnimation(set) through sdk#1497

Open
vanceingalls wants to merge 1 commit into
06-15-feat_sdk_studio_ws-4_add_history_false_option_disable_unused_sdk_undo_in_studiofrom
06-15-feat_sdk_studio_ws-1.1_add_set_method_to_gsaptweenspec_route_addgsapanimation_set_through_sdk
Open

feat(sdk,studio): ws-1.1 — add set method to GsapTweenSpec; route addGsapAnimation(set) through sdk#1497
vanceingalls wants to merge 1 commit into
06-15-feat_sdk_studio_ws-4_add_history_false_option_disable_unused_sdk_undo_in_studiofrom
06-15-feat_sdk_studio_ws-1.1_add_set_method_to_gsaptweenspec_route_addgsapanimation_set_through_sdk

Conversation

@vanceingalls

Copy link
Copy Markdown
Collaborator

What

Brief description of the change.

Why

Why is this change needed?

How

How was this implemented? Any notable design decisions?

Test plan

How was this tested?

  • Unit tests added/updated
  • Manual testing performed
  • Documentation updated (if applicable)

…GsapAnimation(set) through sdk

Co-authored-by: Miguel Ángel <miguel07alm@protonmail.com>

vanceingalls commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@vanceingalls vanceingalls left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Summary of intent. Widens GsapTweenSpec.method from "from" | "to" | "fromTo" to also include "set", and removes the method !== "set" short-circuit that was previously routing set operations to the server. The Studio hook now also conditionally emits duration/ease/fromProperties based on method — set doesn't carry duration/ease, fromTo is the only method that ships fromProperties. Pure type-narrowing relaxation; no new logic at the SDK boundary.

PR-template flag. Boilerplate only. For nine lines of code that's fine, but the why is non-obvious without context — the original method !== "set" carve-out implied the writer couldn't handle set. A one-liner explaining "writer already supports set; the carve-out was load-bearing only on the SDK's type signature" would save the next archeologist a half-hour audit.

Dispatch chain audit (the question I was charged with). Every consumer of GsapTweenSpec.method and the underlying writer paths checked:

  • packages/sdk/src/engine/mutate.ts:611 (handleAddGsapTween) — writes method: tween.method through to addAnimationToScript. Already conditionally omits duration/ease/fromProperties when undefined, so set's missing-duration shape composes correctly.
  • packages/core/src/parsers/gsapWriterAcorn.ts:36if (anim.method !== "set" && anim.duration !== undefined). ✓ aware.
  • packages/core/src/parsers/gsapParser.ts:1285, 2050 — both gate on method === "set". ✓
  • packages/core/src/parsers/gsapSerialize.ts:12, 270, 292, 325GsapMethod already includes "set". ✓
  • packages/core/src/parsers/gsapParserAcorn.ts:24, 984, 998GSAP_METHODS includes "set"; the reader treats method === "set" as zero-duration. ✓
  • packages/core/src/lint/rules/gsap.ts:127, 182 — both rules already handle method === "set". ✓
  • packages/core/src/compiler/compositionScoping.ts:404, 435set is enumerated alongside to/from/fromTo. ✓
  • packages/core/src/studio-api/routes/files.ts:354 — server-side route's method union already includes "set". ✓

Verdict on the audit: clean. The PR is exactly what it looks like — the SDK's type was the only laggard in a corpus that already understood set from day one. Nothing downstream gets caught unaware.

One observation worth noting (not a blocker). The new conditional spread at useGsapAnimationOps.ts:138-140...(method !== "set" ? { duration, ease: "power2.out" as const } : {}) and the parallel fromProperties spread — is the right shape but introduces three method-keyed branches in a single 8-line block. If a fifth GSAP method ever arrives, this is the spot that will need a third edit. Not actionable today; flagging the surface.

CI. Preflight + preview-regression failing, presumably inherited from #1496 below. Worth confirming once the stack settles.

Verdict. Clear-with-nits, modulo CI green. The dispatch chain is genuinely uniform — this PR was the only place where set had been carved out, and the carve-out is correctly retired.

Cleared SHA: cffb15ba. Any push past that voids this review.

Review by Via

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.

1 participant