Skip to content

Export HTMLMotionProps from the package root - #78

Open
JonathonRP wants to merge 1 commit into
mainfrom
jonathonrp-export-htmlmotionprops
Open

Export HTMLMotionProps from the package root#78
JonathonRP wants to merge 1 commit into
mainfrom
jonathonrp-export-htmlmotionprops

Conversation

@JonathonRP

Copy link
Copy Markdown
Owner

The gap

HTMLMotionProps<Tag> is declared in packages/motion-start/src/render/html/types.ts (marked @public) and is the props type behind every motion.* HTML component — but it was not re-exported from any entry point. Line 150 of src/index.ts re-exported only ForwardRefComponent from that module, so the type sat next to a public export without being one.

Confirmed against every entry declared in packages/motion-start/package.json exports (., ./dom, ./dom/mini, ./client, ./m, ./mini, ./projection, and the three ./src/* subpaths) and against the built .d.ts output — dist/index.d.ts contained export type { ForwardRefComponent } from './render/html/types.js'; and nothing else pointing at that module.

Verified from a real consumer's perspective, not just in source: I built the package and compiled a throwaway project whose node_modules/motion-start pointed at the built package, resolving through the published types condition.

  • Before the fix: error TS2724: '"motion-start"' has no exported member named 'HTMLMotionProps'. Did you mean 'MotionProps'?
  • After the fix: compiles cleanly.

The change

-export type { ForwardRefComponent } from './render/html/types.js';
+export type { ForwardRefComponent, HTMLMotionProps } from './render/html/types.js';

This matches upstream framer-motion v11.11.11, which exports exactly { HTMLMotionProps, ForwardRefComponent } from ./render/html/types, and matches how the sibling SVG types are already exported on the next line.

Audit of the other prop/type definitions

I diffed the public type surface of render/html/types.ts, render/svg/types.ts and motion/types.ts against upstream's index.ts. HTMLMotionProps was the only genuine gap — nothing else needed adding:

Type Status
ForwardRefComponent already exported
SVGMotionProps, SVGAttributesAsMotionValues already exported
MotionProps, AnimationProps, MotionAdvancedProps, MotionStyle, MotionTransform, VariantLabels already exported (identical set to upstream)
DOMMotionComponents already exported

Types I deliberately did not export, despite @public doc comments on some of them:

  • HTMLMotionComponents / SVGMotionComponents — upstream does not export these by name either; they are reachable structurally through the already-exported DOMMotionComponents = HTMLMotionComponents & SVGMotionComponents, which is what consumers actually use.
  • HTMLRenderState, TransformOrigin, SVGRenderState, SVGDimensions, UnwrapSVGFactoryElement — renderer-internal state shapes, not part of upstream's public API.
  • MakeMotion, MotionCSS, MotionCSSVariables, TransformProperties, CustomStyles, SVGPathProperties, OnUpdate, AppearOptions, TransformTemplate — building blocks of the public types rather than public types themselves; upstream keeps them internal too.

The goal here was to close a real consumer-facing hole, not to widen the API surface, so I kept it to the one type.

Regression guard

Added packages/motion-start/src/index.spec-d.ts, following the repo's existing *.spec-d.ts type-test convention (src/types.spec-d.ts, src/render/html/type.spec-d.ts, etc.), which run under vitest --typecheck. It imports HTMLMotionProps from the public entry the way a consumer would and uses it to type a wrapper component's props, so removing the export fails the type test.

Added a changeset (patch) in the existing format.

Verification

  • bun run build — passes, dist/index.d.ts now exports HTMLMotionProps
  • bun run test:types — 22 type test files pass, no type errors
  • bun run test:run — 641 pass, "Type Errors: no errors". Three Reorder production SSR tests time out at 30s under full-suite load; they pass in isolation both with and without this change, so they are pre-existing flakiness unrelated to this type-only edit.
  • bun run check:package (svelte-check) — 0 errors, 0 warnings
  • Biome — clean on both touched/added files (src/index.ts has pre-existing whole-file formatting complaints on this checkout that are unchanged by this PR)

No unrelated changes.

HTMLMotionProps<Tag> is the props type behind every motion.* HTML component and is public API upstream, but it was declared in render/html/types.ts without being re-exported from any entry point, so consumers could not name it when writing wrapper components.

Add a *.spec-d.ts type test that imports it from the public entry the way a consumer would, so the export cannot silently regress.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@changeset-bot

changeset-bot Bot commented Aug 2, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2c31a6a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
motion-start Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@JonathonRP, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 47 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: fb4e31db-07e5-4860-81ba-06a4cb1b1aa1

📥 Commits

Reviewing files that changed from the base of the PR and between 0adcef2 and 2c31a6a.

📒 Files selected for processing (3)
  • .changeset/tidy-pugs-export.md
  • packages/motion-start/src/index.spec-d.ts
  • packages/motion-start/src/index.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Aug 2, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/motion-start@78

commit: 2c31a6a

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