Chore/sibujs hardening#37
Merged
Merged
Conversation
…on stamp; bench harness (3.3.2)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Continues the duplicate-runtime hardening from 3.3.1 by sweeping the remaining coordination singletons that fragment when a bundler loads the module twice, plus two tooling fixes. Released as 3.3.2.
createId()— shared counter. Duplicate copies each counted from 0 and handed out colliding ids (sibu-1from both), breaking a11y pairing (aria-labelledby,for+id) and SSR hydration. The counter now lives on aglobalThisholder (same first-copy-wins approach as the 3.3.1 reactive-core fix).ssr-context— shared SSR flag/context. The AsyncLocalStorage instance + fallback store are now shared, soenableSSR()in one copy is observed byisSSR()in another — preventing client-only effects running during a server render or per-request state bleeding across copies.__SIBU_VERSION__define. Addedtsup.config.tsthat stamps the package version, so the duplicate-runtime dev warning prints real versions (active: 3.3.2, …) instead ofdev.Create 10,000 effectsbench (was a single un-warmediterations: 1shot swinging ~10→20 ms) to measure create-only cost, warmed and averaged over 12 rounds with disposal outside the timed region (~14% spread, under the gate), and regenerated the stalebench-baseline.jsonsobench:checkis trustworthy again.Also audited and confirmed safe:
context()(instance-owned signal) and the devtools hook (globalThis). TherouterglobalRoutersingleton is fragile in principle but left as a documented follow-up (largepluginsmodule, least-likely scenario).Regression tests added to
tests/duplicate-instance.test.ts(both fail before the fix, pass after). Version bumped 3.3.1 → 3.3.2 with CHANGELOG and docs-site version badges.Related Issue
Closes #
Type of Change
Checklist