Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (37)
✅ Files skipped from review due to trivial changes (16)
🚧 Files skipped from review as they are similar to previous changes (20)
📝 WalkthroughWalkthroughThis PR bumps bQuery.js from v1.11.1 to v1.12.0, promoting WebSocketSendData to a public type, adding store plugin lifecycle APIs (unregisterPlugin/clearPlugins), adding a full-bundle export audit script, expanding top-level full exports, and updating docs and tests. ChangesbQuery.js v1.12.0 Release
🎯 3 (Moderate) | ⏱️ ~25 minutes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Pull request overview
This PR updates bQuery.js to 1.12.0, adding store plugin teardown APIs, promoting the reactive WebSocket payload type, and tightening /full bundle export validation.
Changes:
- Adds
unregisterPlugin()/clearPlugins()and exports them through store and full bundle entry points. - Promotes
WebSocketSendDataas a public reactive type export. - Adds
check:full-bundlevalidation plus tests and refreshes docs/guidance for the 1.12.0 release.
Reviewed changes
Copilot reviewed 36 out of 38 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/store/plugins.ts |
Adds plugin unregister/clear APIs and snapshots plugin application. |
src/store/index.ts |
Exports new store plugin teardown helpers. |
src/reactive/websocket.ts |
Makes WebSocketSendData public with TSDoc. |
src/reactive/signal.ts |
Re-exports the WebSocket payload type from the reactive barrel. |
src/reactive/index.ts |
Exposes WebSocketSendData from the public reactive entry point. |
src/full.ts |
Syncs full-bundle runtime/type exports. |
scripts/check-full-bundle.mjs |
Adds static runtime/type export drift auditing. |
package.json |
Bumps version, adds check:full-bundle, updates dev dependencies. |
bun.lock |
Updates lockfile for dependency changes. |
tests/check-full-bundle.test.ts |
Covers full-bundle audit behavior. |
tests/store.test.ts |
Adds store plugin teardown and store utility coverage. |
tests/network.test.ts |
Adds compile-time coverage for WebSocketSendData. |
tests/server.test.ts |
Adds server barrel/root/full export checks. |
tests/utils.test.ts |
Adds utility helper coverage. |
tests/security.test.ts |
Adds Trusted Types fallback/warning coverage. |
tests/platform.test.ts |
Adds Cache API fallback/delegation coverage. |
tests/motion.test.ts |
Adds easing/keyframe preset coverage. |
tests/ssr-runtime.test.ts |
Formatting-only SSR runtime test updates. |
tests/ssr-followup.test.ts |
Updates store-state inclusion test and formatting. |
src/ssr/suspense.ts |
Formatting-only suspense updates. |
src/ssr/renderer.ts |
Formatting-only SSR sanitizer updates. |
src/ssr/context.ts |
Formatting-only SSR context updates. |
src/server/types.ts |
Formatting-only server type update. |
src/server/create-server.ts |
Formatting-only server implementation updates. |
README.md |
Refreshes 1.12.0 overview and import examples. |
CHANGELOG.md |
Adds 1.12.0 release notes. |
CONTRIBUTING.md |
Documents full-bundle validation for export changes. |
AGENT.md |
Updates AI guidance to 1.12.0 APIs. |
llms.txt |
Updates compact guidance to 1.12.0. |
.github/copilot-instructions.md |
Updates Copilot guidance to 1.12.0. |
.cursorrules |
Updates Cursor guidance and import sample. |
.clinerules |
Updates Cline guidance to 1.12.0. |
docs/guide/store.md |
Documents plugin removal APIs. |
docs/guide/reactive.md |
Documents public WebSocket payload type. |
docs/guide/server.md |
Expands server public-surface docs. |
docs/guide/ssr.md |
Expands SSR import surface docs. |
docs/guide/getting-started.md |
Formatting-only browser support table update. |
docs/definition.md |
Formatting-only documentation updates. |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
package.json (1)
124-136: ⚡ Quick winAdd
check:full-bundleto the release/publish validation path.You added the script, but
prepublishOnlydoesn’t run it yet. That leaves export/type drift detectable but not release-blocking.Suggested patch
- "prepublishOnly": "bun run clean && bun run build && bun test" + "prepublishOnly": "bun run clean && bun run build && bun test && bun run check:full-bundle"🤖 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 `@package.json` around lines 124 - 136, The prepublishOnly npm script in package.json doesn't include the newly added "check:full-bundle" script, so release validation can miss full-bundle checks; update the "prepublishOnly" script to run "check:full-bundle" (e.g., include bun run check:full-bundle) alongside the existing clean, build, and test steps so that "prepublishOnly" invokes "check:full-bundle" before publishing.tests/network.test.ts (1)
16-16: ⚡ Quick winValidate the public export path in this test.
Line 16 imports
WebSocketSendDatafrom an internal file, so this test won’t catch regressions in the public reactive barrel export.Based on learnings: New public APIs and public behavior changes require tests and docs updates.🔧 Suggested change
-import type { UseEventSourceOptions, WebSocketSendData } from '../src/reactive/websocket'; +import type { UseEventSourceOptions } from '../src/reactive/websocket'; +import type { WebSocketSendData } from '../src/reactive/index';🤖 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/network.test.ts` at line 16, The test imports WebSocketSendData from the internal module '../src/reactive/websocket' which bypasses the public barrel; update the import in tests/network.test.ts to import WebSocketSendData (and UseEventSourceOptions if needed) from the public reactive barrel export instead of the internal 'websocket' file so the test exercises the public API surface (replace the current import statement that references 'websocket' with one that references the public reactive export).
🤖 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/reactive.md`:
- Around line 761-765: The docs table incorrectly states that the `data` field
is `Signal<TReceive>` but `useWebSocket()` actually returns `Signal<TReceive |
undefined>`; update the table entry for the `data` field to `Signal<TReceive |
undefined>` (or equivalent wording indicating optionality) so it matches the
return type of `useWebSocket()` and references the same generic `TReceive`.
---
Nitpick comments:
In `@package.json`:
- Around line 124-136: The prepublishOnly npm script in package.json doesn't
include the newly added "check:full-bundle" script, so release validation can
miss full-bundle checks; update the "prepublishOnly" script to run
"check:full-bundle" (e.g., include bun run check:full-bundle) alongside the
existing clean, build, and test steps so that "prepublishOnly" invokes
"check:full-bundle" before publishing.
In `@tests/network.test.ts`:
- Line 16: The test imports WebSocketSendData from the internal module
'../src/reactive/websocket' which bypasses the public barrel; update the import
in tests/network.test.ts to import WebSocketSendData (and UseEventSourceOptions
if needed) from the public reactive barrel export instead of the internal
'websocket' file so the test exercises the public API surface (replace the
current import statement that references 'websocket' with one that references
the public reactive export).
🪄 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: 2782b9e0-c5d8-46f6-8eb1-c7ab33775608
⛔ Files ignored due to path filters (1)
bun.lockis excluded by!**/*.lock
📒 Files selected for processing (37)
.clinerules.cursorrules.github/copilot-instructions.mdAGENT.mdCHANGELOG.mdCONTRIBUTING.mdREADME.mddocs/definition.mddocs/guide/getting-started.mddocs/guide/reactive.mddocs/guide/server.mddocs/guide/ssr.mddocs/guide/store.mdllms.txtpackage.jsonscripts/check-full-bundle.mjssrc/full.tssrc/reactive/index.tssrc/reactive/signal.tssrc/reactive/websocket.tssrc/server/create-server.tssrc/server/types.tssrc/ssr/context.tssrc/ssr/renderer.tssrc/ssr/suspense.tssrc/store/index.tssrc/store/plugins.tstests/check-full-bundle.test.tstests/motion.test.tstests/network.test.tstests/platform.test.tstests/security.test.tstests/server.test.tstests/ssr-followup.test.tstests/ssr-runtime.test.tstests/store.test.tstests/utils.test.ts
| | Field | Type | Description | | ||
| | -------------------- | ----------------------------------- | ------------------------------------------------- | | ||
| | `status` | `readonly Signal` | `'CONNECTING' \| 'OPEN' \| 'CLOSING' \| 'CLOSED'` | | ||
| | `data` | `Signal<TReceive>` | Last received message (deserialized) | | ||
| | `error` | `Signal<Event \| null>` | Last error event | |
There was a problem hiding this comment.
Fix data optionality in the returned-state table.
Line 764 currently documents data as always present, but useWebSocket() returns Signal<TReceive | undefined>.
🛠️ Suggested doc fix
-| `data` | `Signal<TReceive>` | Last received message (deserialized) |
+| `data` | `Signal<TReceive \| undefined>` | Last received message (deserialized) |📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| | Field | Type | Description | | |
| | -------------------- | ----------------------------------- | ------------------------------------------------- | | |
| | `status` | `readonly Signal` | `'CONNECTING' \| 'OPEN' \| 'CLOSING' \| 'CLOSED'` | | |
| | `data` | `Signal<TReceive>` | Last received message (deserialized) | | |
| | `error` | `Signal<Event \| null>` | Last error event | | |
| | Field | Type | Description | | |
| | -------------------- | ----------------------------------- | ------------------------------------------------- | | |
| | `status` | `readonly Signal` | `'CONNECTING' \| 'OPEN' \| 'CLOSING' \| 'CLOSED'` | | |
| | `data` | `Signal<TReceive \| undefined>` | Last received message (deserialized) | | |
| | `error` | `Signal<Event \| null>` | Last error event | |
🤖 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 `@docs/guide/reactive.md` around lines 761 - 765, The docs table incorrectly
states that the `data` field is `Signal<TReceive>` but `useWebSocket()` actually
returns `Signal<TReceive | undefined>`; update the table entry for the `data`
field to `Signal<TReceive | undefined>` (or equivalent wording indicating
optionality) so it matches the return type of `useWebSocket()` and references
the same generic `TReceive`.
There was a problem hiding this comment.
@copilot fix this comment
There was a problem hiding this comment.
Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!
There was a problem hiding this comment.
@copilot
at reactive.md:
Fix data optionality in the returned-state table.
Line 764 currently documents data as always present, but useWebSocket() returns Signal<TReceive | undefined>.
|
@copilot apply changes based on the comments in this thread |
Fixed in the latest commit — the redeclared |
* chore(tooling): sync src/full.ts with module barrels and add drift audit Add the missing core utility named exports (debounce, throttle, clone, merge, isArray, ...) plus DebouncedFn/ThrottledFn types and view.clearExpressionCache to the CDN/full bundle so it matches src/index.ts and the module barrels. Introduce scripts/check-full-bundle.mjs and a bun run check:full-bundle script that imports every documented public module barrel and verifies every runtime export is re-exported from src/full.ts (with explicit allow-list for the documented a11y.prefersReducedMotion vs motion.prefersReducedMotion naming clash). * feat: enhance WebSocket support and add new types - Added WebSocketSendData type to support various payloads for WebSocket.send(). - Introduced new configurations for Bquery, including BqueryAnnouncerConfig, BqueryComponentLibraryConfig, and others. - Enhanced store plugin functionality with clearPlugins and unregisterPlugin methods. - Implemented tests for new features and ensured existing functionality remains intact. - Improved utility functions for array, number, and string manipulations. - Added tests for trusted types policy and cache storage API fallbacks. * chore: update version to 1.12.0 and enhance SSR features - Updated package version to 1.12.0 in package.json and llms.txt. - Added new SSR utilities and improved existing SSR context handling. - Enhanced server capabilities with new WebSocket route handling. - Improved code formatting and consistency across various files. - Added tests for new server module exports and SSR hydration strategies. - Updated documentation to reflect new features and changes. * test(store): fix plugin extension typings in store tests Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/860e1510-72e8-4438-afa7-945df800e5cc Co-authored-by: JosunLP <[email protected]> * test(store): clarify plugin-augmented store variable names Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/860e1510-72e8-4438-afa7-945df800e5cc Co-authored-by: JosunLP <[email protected]> * fix(store): stabilize plugin application and full bundle audit Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/34646686-5591-411b-bc7d-b368464f14ff Co-authored-by: JosunLP <[email protected]> * fix(tooling): avoid unreachable returns in bundle audit main Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/34646686-5591-411b-bc7d-b368464f14ff Co-authored-by: JosunLP <[email protected]> * refactor(tooling): simplify full bundle audit test typing Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/34646686-5591-411b-bc7d-b368464f14ff Co-authored-by: JosunLP <[email protected]> * fix(tooling): resolve bundle audit entrypoint paths Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/02749e9f-0dce-48ba-b0e0-e56c0e32e389 Co-authored-by: JosunLP <[email protected]> * fix(tooling): detect bundle export collisions by source Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/3ca84fe4-a03b-4cd3-9cec-0e5e06964f08 Co-authored-by: JosunLP <[email protected]> * refactor(tooling): clarify full bundle audit typing Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/3ca84fe4-a03b-4cd3-9cec-0e5e06964f08 Co-authored-by: JosunLP <[email protected]> * docs(tooling): document full bundle source normalization Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/3ca84fe4-a03b-4cd3-9cec-0e5e06964f08 Co-authored-by: JosunLP <[email protected]> * fix(tooling): harden unknown export source fallback Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/3ca84fe4-a03b-4cd3-9cec-0e5e06964f08 Co-authored-by: JosunLP <[email protected]> * fix(tooling): throw on unresolved export source Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/3ca84fe4-a03b-4cd3-9cec-0e5e06964f08 Co-authored-by: JosunLP <[email protected]> * refactor(tooling): clarify source normalization errors Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/3ca84fe4-a03b-4cd3-9cec-0e5e06964f08 Co-authored-by: JosunLP <[email protected]> * test(ssr): scope async store snapshot fixture Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/bdbd1584-da20-4197-afce-e4e4363c5cd6 Co-authored-by: JosunLP <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]>
|
@copilot apply changes based on the comments in this thread |
Agent-Logs-Url: https://github.com/bQuery/bQuery/sessions/489ceb02-3c8a-419c-b860-0f58b96b6cbc Co-authored-by: JosunLP <[email protected]>
Applied in |
This pull request updates the bQuery.js project to version 1.12.0, introducing new teardown APIs for store plugins, promoting a WebSocket payload type to public, and improving bundle/type export validation. Documentation and guidance files have been updated to reflect these changes, and import samples now include the new APIs and types.
New APIs and Type Exports:
unregisterPlugin()andclearPlugins()to@bquery/bquery/storefor removing or resetting registered plugins, supporting test isolation and runtime plugin reloads. (F82d88d1L77R77, [1] [2] [3] [4]WebSocketSendDatato a public type-only export from@bquery/bquery/reactive, making it available for custom serializers and matching the server-side union. (F82d88d1L77R77, [1] [2] [3] [4]Bundle and Tooling Improvements:
/fullbundle now re-exports all public type-only module exports from platform, a11y, and media barrels. Thebun run check:full-bundlescript now statically validates both runtime and type export drift before release. (F82d88d1L77R77, [1] [2]Documentation and Guidance Updates:
README.md,AGENT.md,.clinerules,.cursorrules,.github/copilot-instructions.md,CHANGELOG.md) have been updated to reflect the new APIs, public types, and validation requirements. [1] [2] [3] [4] [5] [6] [7]WebSocketSendData,unregisterPlugin, andclearPluginswhere relevant. [1] [2] [3] [4]Changelog and Metadata:
Release Process:
bun run check:full-bundlewhen public exports change, ensuring full alignment before release.These changes ensure better testability, clearer API boundaries, and more robust type export validation for bQuery.js.
Summary by CodeRabbit
New Features
Documentation
Chores
Tests