Conversation
…95) Co-authored-by: JosunLP <[email protected]> Co-authored-by: Jonas Pfalzgraf <[email protected]> Co-authored-by: copilot-swe-agent[bot] <[email protected]> fix: address PR #95 review thread issues
* feat(motion): massively expand easings, tweens, timeline, effects, stagger, reduced-motion Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/e016b22c-96d6-4b8b-a7df-3a36ae4c02de Co-authored-by: JosunLP <[email protected]> * feat(utils): expand array/function/object/string/number/misc/type-guards utilities Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/e016b22c-96d6-4b8b-a7df-3a36ae4c02de Co-authored-by: JosunLP <[email protected]> * fix: address all review comments on animation and utility code - tween.ts: fix JSDoc description (resolves to `to` not `from` under reduced motion) - tween.ts: store AbortSignal handler ref and remove it on natural completion/stop - function.ts: schedule trailing timer on first call when leading:false, trailing:true - string.ts: guard randomString() against empty charset with RangeError - misc.ts: check signal.aborted before scheduling next poll tick - reduced-motion.ts: make reducedMotionSignal() a module-level singleton - stagger.ts: remove unused actualTotal variable and void statement - timeline.ts: remove no-op void currentIteration statement" Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/d8084c03-fbb8-4fa9-9fff-d05430c20b98 Co-authored-by: JosunLP <[email protected]> * fix: address remaining PR review comments Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/ba0e3ad6-6111-40b9-a0ab-1ce5c8fea82f Co-authored-by: JosunLP <[email protected]> * fix(motion): address latest PR review comments Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/1aa75647-f677-465e-aab9-209f490383e1 Co-authored-by: JosunLP <[email protected]> * docs(motion): clarify scrollProgress compatibility options Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/1aa75647-f677-465e-aab9-209f490383e1 Co-authored-by: JosunLP <[email protected]> * fix(motion): address review feedback on loops and stagger Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/a1111d86-d2b6-4311-8729-43ddfbe84ada Co-authored-by: JosunLP <[email protected]> * fix(motion,core): address review comments - flush/stagger/effects cleanup - debounce.flush() is now a no-op when trailing is false or no trailing timer is active, preventing unexpected extra calls for leading-only debounced functions - grid+random stagger mode now blends with 0.5 weights on both eased and random contributions so randomized delay never exceeds maxDistance - remove unused easeInOutCubic import and void dead-code from effects.ts" Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/95064e3b-5703-4073-8cc8-49b926698865 Co-authored-by: JosunLP <[email protected]> * fix(core,motion): address latest review feedback Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/90f62f96-990c-4315-bd0c-024b02c04948 Co-authored-by: JosunLP <[email protected]> * fix(core): address latest review comments Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/97d901b3-ab93-4ff4-83e6-65e46f07efa3 Co-authored-by: JosunLP <[email protected]> * test: fix CI typecheck failures Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/70d19787-df98-4b55-a7b4-241345dceb74 Co-authored-by: JosunLP <[email protected]> * fix(motion): address latest review feedback Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/d89d97db-cdd0-4a22-9e2f-78faa0dff168 Co-authored-by: JosunLP <[email protected]> * test(motion): cover timeline update loop guards Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/c29ef8d3-a230-4161-b8e0-2dd0b8a9587a Co-authored-by: JosunLP <[email protected]> * fix(motion): address latest review thread Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/d5d1ce6d-eb0e-4c32-a9d6-a9c101f3235c Co-authored-by: JosunLP <[email protected]> * fix(motion): honor reversed reduced-motion tween start Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/7ebb3414-15bc-40b6-924c-d47a343fcc04 Co-authored-by: JosunLP <[email protected]> * fix(motion): address latest review feedback Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/5ddabfb4-b771-4d0c-be44-09b0193e6bed Co-authored-by: JosunLP <[email protected]> * fix(motion): address review feedback Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/d7eb7ffa-a2f6-44f4-98b8-482f1fadd0dc Co-authored-by: JosunLP <[email protected]> * fix(exports): resolve compose collision Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/5009c270-cc38-4729-8ab4-6810f88294c0 Co-authored-by: JosunLP <[email protected]> * fix(motion): address latest review feedback Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/4a5e4621-27a9-47b3-93ed-629d262e2f78 Co-authored-by: JosunLP <[email protected]> * fix(motion): address latest review thread feedback Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/3826232b-fbda-4b7f-8d76-ca0a23fda25c Co-authored-by: JosunLP <[email protected]> * fix(motion): address remaining review thread feedback Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/df88b8a5-c465-4131-8b3e-492a676ca894 Co-authored-by: JosunLP <[email protected]> * fix(core,motion): address latest review comments Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/c756f55e-aa3c-4f95-afab-129059fba20c Co-authored-by: JosunLP <[email protected]> * fix(core,motion): address latest review feedback Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/1879914a-77dd-4e87-a969-ae2eb1e365ac Co-authored-by: JosunLP <[email protected]> * fix(motion): address latest review thread Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/b7cfd132-105c-4dca-bfda-5223a4316a51 Co-authored-by: JosunLP <[email protected]> * test(motion): fix reduced-motion MQL test typing in CI Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/55019ba2-aeb1-43a4-b7d9-97922c108527 Co-authored-by: JosunLP <[email protected]> * fix(core,motion): address review thread feedback Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/4c69739e-229e-4d34-a441-4f9abb10d5fe Co-authored-by: JosunLP <[email protected]> * fix(motion): preserve timeline at type hints Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/e02d79db-f57a-46ee-81c2-279addfc1b00 Co-authored-by: JosunLP <[email protected]> * fix(core): handle safeAssign fallback for locked props Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/24798ec3-f7ce-494a-b690-4710538e13f0 Co-authored-by: JosunLP <[email protected]> * fix(core): avoid dynamic fallback writes in safeAssign Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/24798ec3-f7ce-494a-b690-4710538e13f0 Co-authored-by: JosunLP <[email protected]> * fix(motion): address latest review feedback Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/e01b7fe1-b4bb-4675-a9ca-ddd35bd25cb2 Co-authored-by: JosunLP <[email protected]> * fix(core): preserve debounce trailing args and setter semantics Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/341d3775-d78d-4c49-a871-21a72619497b Co-authored-by: JosunLP <[email protected]> * fix(core): tighten safeAssign prototype guard Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/341d3775-d78d-4c49-a871-21a72619497b Co-authored-by: JosunLP <[email protected]> * fix(core): preserve safeAssign accessor semantics Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/341d3775-d78d-4c49-a871-21a72619497b Co-authored-by: JosunLP <[email protected]> * test(core): fix object utility typecheck compatibility Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/7f985a0a-50ad-46e6-b1d7-c022f31f14ef Co-authored-by: JosunLP <[email protected]> * fix: address review comments on safeAssign, tween JSDoc, interpolation, and playbackRate Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/dce551f8-62bb-46e3-827d-36d9a97602a5 Co-authored-by: JosunLP <[email protected]> * fix(motion): remove unused tween interpolate helper Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/287b6814-bad7-4b6a-b09a-24b73d7e9f9f Co-authored-by: JosunLP <[email protected]> * fix(motion): rAF-throttle magnetic/tilt pointermove handlers and pre-allocate record interpolator output Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/6a54e495-6635-439a-b52c-241df04ffdb4 Co-authored-by: JosunLP <[email protected]> * fix(docs): address PR review feedback Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/1c468754-fb34-4074-b8c0-cb7df9735846 Co-authored-by: JosunLP <[email protected]> * fix(motion): add safeRaf/safeCaf guards to magnetic() and tilt() effects Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/d39c75c2-1e3f-47a4-be4e-70990160dfb4 Co-authored-by: JosunLP <[email protected]> * fix: address latest PR review thread feedback Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/539e3b31-182a-43be-9ce1-331fbde76be7 Co-authored-by: JosunLP <[email protected]> * fix(tween,function): address PR review feedback Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/322c05f2-0ec1-4748-a782-45339630ca35 Co-authored-by: JosunLP <[email protected]> * fix: address PR #94 motion and object review comments Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/eee78581-7919-46df-80e0-82c966e08e1a Co-authored-by: JosunLP <[email protected]> * fix(core): address PR #94 review comments on object/string utils Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/5e7d035d-0785-4f81-8240-6c59d7c36fca Co-authored-by: JosunLP <[email protected]> * fix: address PR review thread feedback for nextTick docs and springVector subscriptions Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/37a2972e-c815-4036-847a-44a79f6ac4b2 Co-authored-by: JosunLP <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: JosunLP <[email protected]>
* docs: prepare 1.13.0 release — fold motion + utils into 1.13.0 changelog and refresh AI guidance Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/b40036a6-ac4b-41d5-86e1-5989628a0568 Co-authored-by: JosunLP <[email protected]> * docs: clarify release guidance wording Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/e24f029d-b66f-4036-a7b8-0ea9d15e4958 Co-authored-by: JosunLP <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: JosunLP <[email protected]>
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughRepository-wide 1.13.0 update: expands Core utilities, Component APIs (CSS, events, DI, async, slots/refs), Forms engine (validators, bindings, schema, SSR, arrays), and Motion features (easing, tween, timeline, effects, reduced-motion). Updates exports ( ChangesFramework 1.13.0 repository-wide update
Estimated code review effort Possibly related PRs
Suggested labels Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
|
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> Signed-off-by: Jonas Pfalzgraf <[email protected]>
There was a problem hiding this comment.
Pull request overview
This PR bumps bQuery.js to v1.13.0 and delivers a large, cross-module feature expansion (forms “batteries-included” tier, component ergonomics, and major motion enhancements), while updating docs/guidance and adding broad test coverage for the new utilities and motion surfaces.
Changes:
- Version baseline update to 1.13.0 across package metadata, changelog, docs, and AI/dev guidance.
- Major new/expanded APIs in forms, component, motion, and core utils, with corresponding exports wired into module barrels.
- Significant test additions for new utilities and motion behaviors (tweens/easing/effects/scroll progress, etc.).
Reviewed changes
Copilot reviewed 74 out of 75 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/utils-type-guards-extras.test.ts | Adds coverage for newly introduced core type guards. |
| tests/utils-string-extras.test.ts | Adds coverage for new string utilities (case transforms, template, stripHtml, etc.). |
| tests/utils-object-extras.test.ts | Adds coverage for new object utilities (deep get/set/has, deepEqual, freeze, defaults, typed keys/entries). |
| tests/utils-number-extras.test.ts | Adds coverage for new number utilities (formatBytes, lerp/mapRange, stats, etc.). |
| tests/utils-misc-extras.test.ts | Adds coverage for misc utilities (uuid, tryCatch, pollUntil, nextFrame/nextTick, etc.). |
| tests/utils-function-extras.test.ts | Adds coverage for function utilities (memoize, retry, debounce/throttle options/flush). |
| tests/utils-array-extras.test.ts | Adds coverage for array utilities (groupBy/keyBy, sortBy, range, move, etc.). |
| tests/motion.test.ts | Extends motion tests for animate() abort/playbackRate, animateTo(), timeline commitStyles behavior, stagger fallbacks. |
| tests/motion-tween.test.ts | New test suite for tween() and animateValue() controls and reduced-motion behavior. |
| tests/motion-scroll-progress.test.ts | New tests for scrollProgress() and inView() including cleanup and DOM-less fallbacks. |
| tests/motion-effects.test.ts | New tests for micro-interactions (magnetic/tilt/shake/pulse/countUp) and reduced-motion behavior. |
| tests/motion-easing.test.ts | New tests for expanded Penner easings plus cubicBezier, steps, mix, chain. |
| tests/forms.test.ts | Updates/extends forms tests (field validating state reset; silent setValue vs explicit validation; subscription assertions). |
| src/motion/types.ts | Expands motion public types (spring vector, timeline labels/at, animate signal/playbackRate, richer stagger options). |
| src/motion/stagger.ts | Implements grid/axis/randomized stagger behavior and non-finite from fallbacks. |
| src/motion/spring.ts | Adds spring velocity/set APIs and introduces springVector() plus new presets. |
| src/motion/scroll-progress.ts | Introduces scrollProgress() and inView() primitives with cleanup/SSR-friendly handling. |
| src/motion/reduced-motion.ts | Adds change subscription API (onReducedMotionChange) with matchMedia lifecycle management. |
| src/motion/reduced-motion-signal.ts | Adds a reactive singleton wrapper (reducedMotionSignal()) over reduced-motion preference. |
| src/motion/index.ts | Re-exports the expanded motion surface (easings, tween, effects, scroll helpers, types). |
| src/motion/animate.ts | Adds AbortSignal + playbackRate support to animate() and introduces animateTo() helper. |
| src/index.ts | Refactors root exports for forms to avoid compose collision with core compose. |
| src/forms/use-field.ts | Enriches field state (focused/disabled/dirtySince) and adds setValue/setError/clearError and blur/focus helpers. |
| src/forms/ssr.ts | Adds SSR serialization/hydration helpers for forms using shared SSR escaping. |
| src/forms/schema.ts | Adds fluent field() + schema() helpers to build form field configs. |
| src/forms/index.ts | Expands forms module exports (field arrays, schema, bindings, SSR, composables, validator suite). |
| src/forms/field-array.ts | Introduces dynamic field arrays (createFieldArray) with mutation helpers and validation. |
| src/forms/composables.ts | Adds component-scope-aware wrappers (useForm, useField, useFieldArray). |
| src/core/utils/type-guards.ts | Adds new type guards (Error/Map/Set/RegExp/Symbol/BigInt/iterables/nullish/defined, etc.). |
| src/core/utils/number.ts | Adds number utilities (round/roundTo, lerp/mapRange, formatBytes, stats, angle conversion). |
| src/core/utils/misc.ts | Adds misc utilities (uuid, tryCatch, times, pollUntil, nextFrame/nextTick). |
| src/core/index.ts | Re-exports the enlarged utils surface + associated utility types. |
| src/component/types.ts | Expands component definition/element types (setProp/getProp, styles payload type, beforeUnmount, errorBoundary). |
| src/component/slots.ts | Adds reactive slot helpers (useSlot, hasSlot, slotText). |
| src/component/scope.ts | Adds render-phase guard wiring (setCurrentScopeIsRendering) and enforces hook usage outside render. |
| src/component/refs.ts | Introduces useRef() for element refs. |
| src/component/keyed-list.ts | Adds keyedList string helper and reconcileKeyed DOM reordering utility. |
| src/component/inject.ts | Adds provide/inject DI primitives and typed injection keys (incl. formContextKey). |
| src/component/index.ts | Re-exports new component helpers (refs/slots/events/DI/async/css/keyed lists) and additional types. |
| src/component/events.ts | Adds delegated event system (on* helpers + bindDelegatedEvents) and handler cleanup helper. |
| src/component/css.ts | Adds css tagged template + adoptable stylesheet integration and escaping. |
| src/component/component.ts | Integrates adopted styles, delegated handler cleanup, render-phase scoping, beforeUnmount, and errorBoundary. |
| src/component/async.ts | Adds whenIdle() and useAsync() lifecycle-aware async helpers. |
| scripts/check-full-bundle.mjs | Records an intentional omission for forms:compose due to /full collision with core.compose. |
| README.md | Updates “New in …” release highlights to 1.13.0 feature set. |
| package.json | Bumps package version to 1.13.0. |
| llms.txt | Updates version + adds 1.13.0 highlight summary for AI-friendly repo overview. |
| docs/index.md | Updates landing page “New in …” section to 1.13.0 summary. |
| docs/guide/motion.md | Documents new motion APIs (reduced-motion subscription, easing factories, tween, animateTo, labels, scroll helpers, effects, stagger). |
| docs/guide/forms.md | Adds 1.13.0 “batteries-included” section documenting new forms APIs. |
| docs/guide/components.md | Adds 1.13.0 section documenting new component primitives and patterns. |
| docs/guide/api-core.md | Updates core API guide with the expanded utils catalog. |
| CHANGELOG.md | Adds the 1.13.0 release entry with detailed module-level additions/changes. |
| bun.lock | Updates dependency lock to newer versions associated with this release. |
| AGENT.md | Bumps baseline and documents 1.13.0 highlights and validation expectations. |
| .github/copilot-instructions.md | Updates Copilot guidance baseline and documents 1.13.0 module expansions. |
| .cursorrules | Updates Cursor snapshot baseline and 1.13.0 API notes. |
| .clinerules | Updates Cline snapshot baseline and 1.13.0 release summary. |
Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/f984b350-87fe-4212-8807-8b0c854ad447 Co-authored-by: JosunLP <[email protected]>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Actionable comments posted: 7
🧹 Nitpick comments (6)
src/forms/bind.ts (1)
13-20: ⚡ Quick winMark internal helpers with
@internalJSDoc.These non-exported helper functions are currently undocumented as internal utilities, which violates the repo rule for
src/**/*.ts.As per coding guidelines: "Use
@internalJSDoc tag for non-public helper functions and internal utilities."Also applies to: 22-90, 189-200
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/forms/bind.ts` around lines 13 - 20, Add `@internal` JSDoc tags to the non-exported helper type-guard functions so they are marked as internal utilities: add a short JSDoc block with `@internal` above isInput, isTextarea, isSelect, and isButton, and likewise add `@internal` to the other non-exported helpers in the file (the ones around lines 22-90 and 189-200) so all internal, non-public functions comply with the repo rule; keep the JSDoc minimal (description optional) and place it immediately above each function declaration.src/forms/ssr.ts (2)
41-60: 💤 Low valueAdd
@exampleblock toreadSerializedFormState.Per coding guidelines, public APIs should carry JSDoc with
@examplewhere helpful. This function would benefit from a usage example showing the client-side hydration pattern.📝 Suggested addition
/** * Read a previously-serialized form snapshot from the DOM. Returns `undefined` * if no matching `<script data-bq-form="...">` is found. * * `@param` id - The id used when calling {`@link` serializeFormState} * `@returns` The decoded snapshot or `undefined` + * + * `@example` + * ```ts + * import { readSerializedFormState } from '`@bquery/bquery/forms`'; + * + * const snapshot = readSerializedFormState<MyFormValues>('register'); + * if (snapshot) { + * form.restore(snapshot); + * } + * ``` */As per coding guidelines:
src/**/*.ts: Add JSDoc comments with@exampleblocks for all public APIs.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/forms/ssr.ts` around lines 41 - 60, The JSDoc for the public function readSerializedFormState is missing an `@example` usage; update the comment block above the exported readSerializedFormState<T> function to include an `@example` that demonstrates importing readSerializedFormState, calling it with a typed id (e.g. readSerializedFormState<MyFormValues>('register')), checking the returned FormSnapshot<T> and restoring a form (e.g. form.restore(snapshot)); keep the text concise, use TypeScript fenced code example, and ensure it references FormSnapshot and the id string so consumers see the client-side hydration pattern.
62-71: 💤 Low valueAdd
@exampleblock tohydrateForm.Per coding guidelines, public APIs should carry JSDoc with
@examplewhere helpful.📝 Suggested addition
/** * Convenience: hydrate a {`@link` Form} from a previously-serialized snapshot. * Returns `true` when state was applied. + * + * `@param` form - The form instance to hydrate + * `@param` id - The id used when calling {`@link` serializeFormState} + * `@returns` `true` if snapshot was found and applied, `false` otherwise + * + * `@example` + * ```ts + * import { createForm, hydrateForm } from '`@bquery/bquery/forms`'; + * + * const form = createForm({ fields: { ... } }); + * if (!hydrateForm(form, 'register')) { + * // No serialized state found, use defaults + * } + * ``` */As per coding guidelines:
src/**/*.ts: Add JSDoc comments with@exampleblocks for all public APIs.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/forms/ssr.ts` around lines 62 - 71, Add a JSDoc `@example` block to the hydrateForm function's comment that demonstrates importing createForm and hydrateForm, creating a form instance, calling hydrateForm(form, 'register'), and handling the false return (no serialized state found) — update the comment above hydrateForm (referencing hydrateForm, Form, and readSerializedFormState) to include that illustrative example following the project's JSDoc style.src/motion/effects.ts (2)
42-105: 💤 Low valueAdd
@exampleblock tomagnetic()JSDoc.Per coding guidelines, public APIs should carry JSDoc including
@examplewhere helpful. Themagneticfunction would benefit from a usage example showing typical integration.📝 Suggested JSDoc addition
/** * Apply a pointer-following micro-interaction to an element. The element * is translated toward the pointer when it is within `radius` pixels of * the element's center. * * `@returns` Cleanup function that detaches listeners and resets transforms. + * + * `@example` + * ```ts + * const cleanup = magnetic(button, { strength: 0.4, radius: 100 }); + * // Later: cleanup(); + * ``` */As per coding guidelines: "Public APIs should carry JSDoc, including
@examplewhere helpful."🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/motion/effects.ts` around lines 42 - 105, Add an `@example` block to the JSDoc for the exported magnetic function showing typical usage and cleanup: update the comment above export const magnetic(...) to include a short code snippet (e.g., obtaining an element, calling magnetic(element, { strength: 0.4, radius: 100 }), and later calling the returned cleanup()) so consumers see how to integrate and tear down the effect.
107-196: 💤 Low valueAdd
@exampleblock totilt()JSDoc.Same as above—
tilt()is a public API missing an example.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/motion/effects.ts` around lines 107 - 196, The JSDoc for the exported tilt function lacks an `@example` showing how to call it; add an `@example` block to the tilt(...) JSDoc that demonstrates typical usage (import/selection of an element, calling tilt(el, { max, perspective, scale, respectReducedMotion }) and handling the returned cleanup function). Update the comment above export const tilt so it references the TiltOptions shape and shows a minimal real-world example (including calling the returned EffectCleanup to detach listeners) to help consumers understand usage.tests/motion-timeline-extras.test.ts (1)
12-26: ⚡ Quick winStandardize DOM lifecycle cleanup in this helper.
Tests created through this helper don’t follow the repository’s preferred DOM pattern (append + explicit remove), which can leave state hanging across tests when cases evolve.
As per coding guidelines
tests/**/*.test.ts: "Create DOM elements inline in tests, append to document.body, then call .remove() to clean up after testing."🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/motion-timeline-extras.test.ts` around lines 12 - 26, The helper createElement currently creates a detached element (el) and mock animation (anim) but does not follow the repo pattern of appending and explicit removal; update createElement to append the created el to document.body before returning and expose a clear way to remove it (either return the el so callers can call el.remove(), or return a cleanup function as part of the result), leaving anim and the mocked animate implementation intact; this ensures tests using createElement follow the "append to document.body, then call .remove()" lifecycle and avoid DOM state leakage.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/guide/forms.md`:
- Around line 353-364: The example uses createForm but the import only lists
schema and field; update the import statement to include createForm so the
snippet compiles — e.g., add createForm to the named imports alongside schema
and field in the top import (refer to createForm, schema, and field in the
example).
In `@src/component/component.ts`:
- Around line 212-218: setProp currently assigns the value directly which can
leave required prop tracking stale and skips validator logic; update setProp
(and use existing helpers like cloneProps, missingRequiredProps,
definition.props) to: 1) run the prop validator if
definition.props[name]?.validator exists and only accept the value if it passes
(or coerce/normalize as your attribute path does), 2) if the prop was previously
in missingRequiredProps and a valid value is now provided remove that name from
missingRequiredProps and, if missingRequiredProps becomes empty, allow the
initial mount to proceed, and 3) still call this.render(true, previousProps,
undefined, true) after successful validation/mutations so behavior matches
attribute-driven updates.
In `@src/component/slots.ts`:
- Around line 68-73: The code attaches 'slotchange' only to the initially found
slot, so if the <slot> element is replaced the new element is never observed;
update useSlot/finding logic (the block that calls schedule -> findSlot(host,
name) -> slot.addEventListener('slotchange', update)) to detect slot
replacements: track the currentSlot element, and whenever you call findSlot
re-check if it's different, remove the old listener from currentSlot, attach the
'slotchange' listener to the new slot, and store currentSlot; ensure this
cleanup happens when disposed (remove listener and disconnect any observer).
Apply the same change to the other identical block (the second scheduled
findSlot block) so both code paths rebind listeners when the slot node is
replaced.
In `@src/core/utils/object.ts`:
- Around line 517-528: The Map/Set branches in deep equality (compare) use
identity checks (right.has / right.has(value)) which fails for structurally
equal but non-identical objects; update the Map handling in the compare function
to iterate left entries and for each key/value perform recursive comparison
against right's entries (use compare for keys and compare for values rather than
right.has/right.get identity checks), and update the Set handling to, for each
value in left, search through right's elements and use compare to find a
structurally equal match (removing matched elements or tracking matches to
respect multiplicity), ensuring both Map and Set use recursive compare for keys
and values instead of identity membership.
In `@src/forms/schema.ts`:
- Around line 131-137: The type guard isFieldConfig currently treats any object
with an own 'initialValue' property as FieldConfig, so raw initial-value objects
like { initialValue: 'x', other: 1 } are misclassified; update isFieldConfig to
check for 'initialValue' plus at least one other known FieldConfig-specific key
(e.g., 'validate', 'disabled', or whatever keys are defined on the
FieldConfig<T> interface) or validate that the object shape exactly matches
FieldConfig (import/compare against the FieldConfig type keys), so only true
config objects (not ordinary objects that happen to have an initialValue key)
return true; adjust the guard logic in isFieldConfig to reference those
FieldConfig keys (and update any uses in the same module such as where initial
values are stored) so object-shaped initial values are preserved.
In `@tests/motion-timeline-extras.test.ts`:
- Around line 107-109: The current assertion
expect(updates.length).toBeGreaterThanOrEqual(0) is tautological; change it to
assert the expected reduced-motion behavior by checking that no updates occurred
(e.g., expect(updates).toHaveLength(0) or expect(updates).toEqual([])). Locate
the test that builds the updates array (variable updates in this test block) and
replace the length check with a direct behavioral assertion, ensuring the test
sets the reduced-motion preference before running the timeline so the no-updates
expectation is valid.
In `@tests/motion.test.ts`:
- Around line 511-526: The test sets global reduced-motion state via
setReducedMotion(true) but resets it at the end unprotected, risking leakage if
an assertion throws; modify the test around the call to animateTo/expect
assertions to ensure setReducedMotion(null) runs in a finally block (e.g., wrap
the body after setReducedMotion(true) in try { ... } finally {
setReducedMotion(null); }) so reduced-motion is always cleared; reference
setReducedMotion and animateTo in the change.
---
Nitpick comments:
In `@src/forms/bind.ts`:
- Around line 13-20: Add `@internal` JSDoc tags to the non-exported helper
type-guard functions so they are marked as internal utilities: add a short JSDoc
block with `@internal` above isInput, isTextarea, isSelect, and isButton, and
likewise add `@internal` to the other non-exported helpers in the file (the ones
around lines 22-90 and 189-200) so all internal, non-public functions comply
with the repo rule; keep the JSDoc minimal (description optional) and place it
immediately above each function declaration.
In `@src/forms/ssr.ts`:
- Around line 41-60: The JSDoc for the public function readSerializedFormState
is missing an `@example` usage; update the comment block above the exported
readSerializedFormState<T> function to include an `@example` that demonstrates
importing readSerializedFormState, calling it with a typed id (e.g.
readSerializedFormState<MyFormValues>('register')), checking the returned
FormSnapshot<T> and restoring a form (e.g. form.restore(snapshot)); keep the
text concise, use TypeScript fenced code example, and ensure it references
FormSnapshot and the id string so consumers see the client-side hydration
pattern.
- Around line 62-71: Add a JSDoc `@example` block to the hydrateForm function's
comment that demonstrates importing createForm and hydrateForm, creating a form
instance, calling hydrateForm(form, 'register'), and handling the false return
(no serialized state found) — update the comment above hydrateForm (referencing
hydrateForm, Form, and readSerializedFormState) to include that illustrative
example following the project's JSDoc style.
In `@src/motion/effects.ts`:
- Around line 42-105: Add an `@example` block to the JSDoc for the exported
magnetic function showing typical usage and cleanup: update the comment above
export const magnetic(...) to include a short code snippet (e.g., obtaining an
element, calling magnetic(element, { strength: 0.4, radius: 100 }), and later
calling the returned cleanup()) so consumers see how to integrate and tear down
the effect.
- Around line 107-196: The JSDoc for the exported tilt function lacks an
`@example` showing how to call it; add an `@example` block to the tilt(...) JSDoc
that demonstrates typical usage (import/selection of an element, calling
tilt(el, { max, perspective, scale, respectReducedMotion }) and handling the
returned cleanup function). Update the comment above export const tilt so it
references the TiltOptions shape and shows a minimal real-world example
(including calling the returned EffectCleanup to detach listeners) to help
consumers understand usage.
In `@tests/motion-timeline-extras.test.ts`:
- Around line 12-26: The helper createElement currently creates a detached
element (el) and mock animation (anim) but does not follow the repo pattern of
appending and explicit removal; update createElement to append the created el to
document.body before returning and expose a clear way to remove it (either
return the el so callers can call el.remove(), or return a cleanup function as
part of the result), leaving anim and the mocked animate implementation intact;
this ensures tests using createElement follow the "append to document.body, then
call .remove()" lifecycle and avoid DOM state leakage.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 2abd3892-a9bb-4588-8221-dbbd0b26cdf9
⛔ Files ignored due to path filters (1)
bun.lockis excluded by!**/*.lock
📒 Files selected for processing (74)
.clinerules.cursorrules.github/copilot-instructions.mdAGENT.mdCHANGELOG.mdREADME.mddocs/guide/api-core.mddocs/guide/components.mddocs/guide/forms.mddocs/guide/motion.mddocs/index.mdllms.txtpackage.jsonscripts/check-full-bundle.mjssrc/component/async.tssrc/component/component.tssrc/component/css.tssrc/component/events.tssrc/component/index.tssrc/component/inject.tssrc/component/keyed-list.tssrc/component/refs.tssrc/component/scope.tssrc/component/slots.tssrc/component/types.tssrc/core/index.tssrc/core/utils/array.tssrc/core/utils/function.tssrc/core/utils/index.tssrc/core/utils/misc.tssrc/core/utils/number.tssrc/core/utils/object.tssrc/core/utils/string.tssrc/core/utils/type-guards.tssrc/forms/bind.tssrc/forms/composables.tssrc/forms/create-form.tssrc/forms/field-array.tssrc/forms/index.tssrc/forms/schema.tssrc/forms/ssr.tssrc/forms/types.tssrc/forms/use-field.tssrc/forms/validators.tssrc/full.tssrc/index.tssrc/motion/animate.tssrc/motion/easing.tssrc/motion/effects.tssrc/motion/index.tssrc/motion/reduced-motion-signal.tssrc/motion/reduced-motion.tssrc/motion/scroll-progress.tssrc/motion/spring.tssrc/motion/stagger.tssrc/motion/timeline.tssrc/motion/tween.tssrc/motion/types.tstests/component-extensions.test.tstests/forms-extensions.test.tstests/forms.test.tstests/motion-easing.test.tstests/motion-effects.test.tstests/motion-scroll-progress.test.tstests/motion-timeline-extras.test.tstests/motion-tween.test.tstests/motion.test.tstests/utils-array-extras.test.tstests/utils-function-extras.test.tstests/utils-misc-extras.test.tstests/utils-number-extras.test.tstests/utils-object-extras.test.tstests/utils-string-extras.test.tstests/utils-type-guards-extras.test.ts
|
@copilot fix the code rabbit comments |
Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/61b3de18-ae40-403d-a21d-c20b293c8798 Co-authored-by: JosunLP <[email protected]>
Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/61b3de18-ae40-403d-a21d-c20b293c8798 Co-authored-by: JosunLP <[email protected]>
Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/61b3de18-ae40-403d-a21d-c20b293c8798 Co-authored-by: JosunLP <[email protected]>
Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/61b3de18-ae40-403d-a21d-c20b293c8798 Co-authored-by: JosunLP <[email protected]>
Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/fb1780c8-78e3-4afb-ab23-7fb18107b67d Co-authored-by: JosunLP <[email protected]>
Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/a6be3f9f-d66b-45e4-8595-6877081ae5cc Co-authored-by: JosunLP <[email protected]>
Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/92863354-4dae-4d98-a39b-1c1b35ac56f4 Co-authored-by: JosunLP <[email protected]>
This pull request updates the project to version 1.13.0, introducing major new features and enhancements across several core modules, and updates all relevant documentation and guidance files to reflect the new release. The highlights include a significant expansion of the forms, component, motion, and core utilities APIs, as well as new validation and developer guidance for the updated version.
Release and Documentation Updates:
1.12.0to1.13.0in all metadata, documentation, and guidance files, includingAGENT.md,.github/copilot-instructions.md,.clinerules, and.cursorrules. [1] [2] [3] [4]Major Feature Expansions:
Forms API:
@bquery/bquery/formsis now batteries-included, with many new validators and combinators, enriched field and form state, dynamic field arrays, schema-based declaration, two-way DOM bindings, scope-aware composables, and SSR helpers. [1] [2] [3]Component API:
@bquery/bquery/componentadds slot/ref/async/lifecycle/DI primitives, delegated event helpers, adoptable stylesheet support, and keyed list rendering utilities. [1] [2] [3]Motion API:
@bquery/bquery/motionreceives a major expansion, including full Penner easings, new interpolation and animation controls, timeline enhancements, new primitives (e.g.,scrollProgress,inView), and improved stagger and reduced-motion support. [1] [2] [3]Core Utilities:
@bquery/bquery/coreadds a deep suite of new helpers for arrays, functions, objects, strings, numbers, miscellaneous utilities, and additional type guards. [1] [2] [3]Changelog and Guidance:
CHANGELOG.md, summarizing the new features and changes.These updates ensure that all documentation, developer guidance, and metadata accurately reflect the new capabilities and requirements introduced in version 1.13.0.
Summary by CodeRabbit
New Features
Documentation
Tests
Chores