Export HTMLMotionProps from the package root - #78
Conversation
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 detectedLatest commit: 2c31a6a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
Warning Review limit reached
Next review available in: 47 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
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. Comment |
commit: |
The gap
HTMLMotionProps<Tag>is declared inpackages/motion-start/src/render/html/types.ts(marked@public) and is the props type behind everymotion.*HTML component — but it was not re-exported from any entry point. Line 150 ofsrc/index.tsre-exported onlyForwardRefComponentfrom that module, so the type sat next to a public export without being one.Confirmed against every entry declared in
packages/motion-start/package.jsonexports(.,./dom,./dom/mini,./client,./m,./mini,./projection, and the three./src/*subpaths) and against the built.d.tsoutput —dist/index.d.tscontainedexport 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-startpointed at the built package, resolving through the publishedtypescondition.error TS2724: '"motion-start"' has no exported member named 'HTMLMotionProps'. Did you mean 'MotionProps'?The change
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.tsandmotion/types.tsagainst upstream'sindex.ts.HTMLMotionPropswas the only genuine gap — nothing else needed adding:ForwardRefComponentSVGMotionProps,SVGAttributesAsMotionValuesMotionProps,AnimationProps,MotionAdvancedProps,MotionStyle,MotionTransform,VariantLabelsDOMMotionComponentsTypes I deliberately did not export, despite
@publicdoc comments on some of them:HTMLMotionComponents/SVGMotionComponents— upstream does not export these by name either; they are reachable structurally through the already-exportedDOMMotionComponents = 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.tstype-test convention (src/types.spec-d.ts,src/render/html/type.spec-d.ts, etc.), which run undervitest --typecheck. It importsHTMLMotionPropsfrom 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.tsnow exportsHTMLMotionPropsbun run test:types— 22 type test files pass, no type errorsbun run test:run— 641 pass, "Type Errors: no errors". ThreeReorder production SSRtests 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 warningssrc/index.tshas pre-existing whole-file formatting complaints on this checkout that are unchanged by this PR)No unrelated changes.