Conversation
…est files - Refactored test cases in `ssr-runtime.test.ts` for better readability by aligning parameters and breaking long lines. - Updated `ssr-stable.test.ts` to enhance clarity by formatting multi-line function calls. - Cleaned up `storybook.test.ts` by consolidating assertions into single lines. - Simplified `testing-extensions.test.ts` by streamlining error expectations. - Enhanced `utils-array-extras.test.ts` and `utils-function-extras.test.ts` for better visual structure. - Improved `utils-misc-extras.test.ts` and `utils-object-extras.test.ts` by formatting complex assertions. - Refined `view-1-14.test.ts` and `view-compiler.test.ts` for consistency in line breaks and indentation. - Added new tests in `view-process-order.test.ts` to cover directive processing order and subscription hygiene. - Updated `view-stable.test.ts` and `view-transitions.test.ts` for better readability and consistency in test structure. - Enhanced `view.test.ts` for clarity in handler invocation tests.
|
Important Review skippedToo many files! This PR contains 187 files, which is 87 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (187)
You can disable this status message by setting the 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 |
Signed-off-by: Jonas Pfalzgraf <[email protected]>
…bscribe onReducedMotionChange flushed pending value changes before ensuring the matchMedia subscription existed. When a baseline (lastDispatchedValue) was left behind by setReducedMotion() without an active subscription — a state CI's test-file ordering produced — the flush issued a one-off matchMedia call and ensure() then subscribed again, so a freshly mocked matchMedia saw two calls instead of one. Establish the subscription first so evaluation reads the cached media query; add a deterministic regression test for the baseline-without-subscription state. Co-Authored-By: Claude Fable 5 <[email protected]>
JosunLP
left a comment
There was a problem hiding this comment.
Code review (workflow-assisted, high effort): 8 findings — 5 confirmed against the code, 3 plausible. Ranked by severity in the inline comments. The two computed.ts issues can permanently freeze subscribers and look like release blockers for 1.16.0.
Correctness: - computed: markDirty no longer early-returns on an already-dirty computed. A compute that threw (or a revalidate dropped by a flush-pass overflow) left dirty=true with no pending revalidate, so every later dependency change was ignored and subscribers stayed frozen. - computed: rebase the notified-value baseline when a subscriber joins a previously empty set, so a change made while nobody was subscribed followed by a revert is no longer swallowed by the equality check. Adds a stale-baseline guard for readers that observe an un-notified value. - view/process: restore the children snapshot in processChildren. The live nextElementSibling walk silently dropped every remaining sibling once a directive handler removed the node it was standing on. - view/text: only skip the write when the element already is exactly that single text node. Comparing el.textContent alone left server-rendered markup (<b>Hel</b>lo) in place instead of flattening it. - view/if,show: resolve transitions inside the effect again so attributes added or changed after mount take effect (bq-if resolves per flip). - core/shared: count delegated registrations so one owner's undelegate() cannot detach a delegation another owner still holds. Efficiency: - view/process: bound the parseDirective memo like the expression caches so generated attribute names cannot grow it without eviction. Co-Authored-By: Claude Opus 5 <[email protected]>
tsconfig.component-test.json targets a lib without es2022 array methods, so `.at(-1)` failed the test type-check in CI. Co-Authored-By: Claude Opus 5 <[email protected]>
Release 1.16.0 — Quality & performance pass
Promotes
devtomainfor the 1.16.0 minor release. A full audit of the framework's three hot paths — the reactive core, the DOM core, and the view layer — drove measurable speed-ups and surfaced several real correctness bugs, all fixed here. The release also folds in the previously staged follow-up to the 1.15.1 security review, plus a documentation-wide accuracy pass.No breaking changes. No module status transitions. The only new API is the additive
trailingoption onwatchThrottle.Performance (benchmarked old vs. new)
batch()keeps the batch open while flushing; transitive updates coalesce, re-queued observers drain in follow-up passes (bounded at 100)Computedre-validates and notifies subscribers only when the value actually changed (Object.is)computedbool under 20k writes: 20k effect runs → 2replaceWith(string)sanitizes once per call;empty()→replaceChildren();children()/siblings()/index()/unwrap()/css(object)/data()shed per-element allocationsbq-forreconcilesCorrectness fixes
undelegate()from a fresh wrapper (the documented usage) was a silent no-op leaking the listener — registry is now module-level,delegate()idempotent per (element, event, selector, handler); delegated dispatcher tolerates non-Elementtargetswrap(element)over multi-element collections no longer clones previously wrapped elements into later wrappersbq-foron the same element no longer bind to the discarded template elementbq-once/bq-memo/bq-initevaluate untracked — they no longer subscribe the enclosingbq-forreconcilerbq-modelno longer resets the caret while typing (skips the write-back when the input already holds the value)bq-html/bq-html-safeare no longer directive-bound (effects kept running against replaced markup)batch()no longer double-executes observers; a throwingcomputedstays dirty and retries instead of serving a stale cacheonReducedMotionChangere-binds to the currentwindow.matchMediaon subscribe and flushes changes that happened without achangeevent (also fixes two order-dependent motion tests)deepClonespecial-cases only the dangerous__proto__key; properties merely namedconstructor/prototypeclone normally againSyntaxErrorsSecurity (1.15.1 follow-up)
with-scope evaluator hardening closes a residual member-access escape (items.constructor.constructor('…')()) via the sharedhasDangerousMemberAccess()guard, applied to both the runtime evaluator and the AOT compiler (#168, #202).Additive API (backwards-compatible)
watchThrottle(source, cb, interval, { trailing: true })— delivers the last value of a burst once the interval elapses; default stays leading-edge-only (WatchThrottleOptions,@bquery/bquery/reactive).Behavioral notes (no opt-out needed)
delegate()no longer stacks duplicate listeners for the same handler tuple.Documentation accuracy pass
.set()/cloneDeep/bq-attrremoved,bq-memo/bq-error/bq-modeldescribed as implemented, broken examples repaired).check:doc-exportsnow reports 100 % export coverage for all 21 modules.Release chores
package.json: 1.15.1 → 1.16.0 (the staged 1.15.2 patch was folded into this minor)CHANGELOG.md: new[1.16.0]section (Added/Changed/Fixed/Security) and TOC entryrelease-notes/1.16page, nav + index entries, version-history entries in the affected guidesValidation
bun test: 3056 pass / 0 fail (8 new regression tests)tsc --noEmit(src + component-test config): cleanbun run build(ESM + UMD + types) andbun run docs:build: succeedcheck:stability,check:full-bundle,check:ai-guidance,check:doc-exports(21/21 modules at 100 %): pass🤖 Generated with Claude Code