baraqex 2.0.8 → 2.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/dist/browser.js +8 -2
- package/dist/browser.js.map +2 -2
- package/dist/core/hooks.d.ts +11 -0
- package/dist/core/hooks.d.ts.map +1 -1
- package/dist/core/renderer.d.ts.map +1 -1
- package/dist/index.js +8 -2
- package/dist/index.js.map +2 -2
- package/dist/server/index.js.map +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,34 @@ All notable changes to Baraqex will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [2.0.9] - 2026-10-09
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- **Critical: infinite re-render loop on hydration / any re-render.** Component
|
|
12
|
+
ids were assigned with a counter that was never reset between render passes,
|
|
13
|
+
so hooks (`useState`, `useEffect`, …) never kept their state across
|
|
14
|
+
re-renders. Any `useEffect` that called `setState` (e.g. the fullstack
|
|
15
|
+
template's `HomePage` fetching users on load) triggered an endless
|
|
16
|
+
`render → effect → setState → render` microtask loop that starved the event
|
|
17
|
+
loop — pages only ever appeared to load (the SSR HTML stayed visible) but
|
|
18
|
+
never became interactive, kept the browser spinner spinning, and links/buttons
|
|
19
|
+
did nothing ("takes big time to load" / "loads and doesn't open").
|
|
20
|
+
Render passes now start with `beginRenderPass()`, which resets the
|
|
21
|
+
component-id counter so ids (and therefore hook state) are stable across
|
|
22
|
+
re-renders. Verified in-browser: DOMContentLoaded ~95 ms, navigation, state
|
|
23
|
+
persistence, and the Go WASM demo all work.
|
|
24
|
+
- Added regression tests (`tests/client/hooks.test.ts`) that fail without the fix.
|
|
25
|
+
|
|
26
|
+
## [2.0.8] - 2026-10-09
|
|
27
|
+
|
|
28
|
+
### Changed
|
|
29
|
+
- **Fullstack template performance:** server bundle minified in production,
|
|
30
|
+
HTML + WASM compressed by default, aggressive asset cache headers
|
|
31
|
+
(`/wasm/*` immutable, `/build/*` 1 h in prod, `no-store` in dev), `wasm_exec.js`
|
|
32
|
+
injected only on the WASM route (deferred), CSS bundled through
|
|
33
|
+
Tailwind/PostCSS with instant rebuilds, and the client no longer imports
|
|
34
|
+
the stylesheet (styles served via the server).
|
|
35
|
+
|
|
8
36
|
## [2.0.0] - 2026-01-09
|
|
9
37
|
|
|
10
38
|
### 🚀 Major Release
|
package/dist/browser.js
CHANGED
|
@@ -107,6 +107,12 @@ function prepareRender(root, componentId) {
|
|
|
107
107
|
hookIndex = 0;
|
|
108
108
|
return currentComponentId || 0;
|
|
109
109
|
}
|
|
110
|
+
function beginRenderPass(root) {
|
|
111
|
+
if (root) {
|
|
112
|
+
root.nextComponentId = 0;
|
|
113
|
+
}
|
|
114
|
+
return prepareRender(root);
|
|
115
|
+
}
|
|
110
116
|
function finishRender() {
|
|
111
117
|
currentComponentId = null;
|
|
112
118
|
}
|
|
@@ -454,7 +460,7 @@ async function render(element, container) {
|
|
|
454
460
|
rootMap.set(container, root);
|
|
455
461
|
}
|
|
456
462
|
await batchUpdates(async () => {
|
|
457
|
-
|
|
463
|
+
beginRenderPass(root);
|
|
458
464
|
try {
|
|
459
465
|
setRenderCallback(render, element, container);
|
|
460
466
|
const domNode = await createElement(element);
|
|
@@ -542,7 +548,7 @@ async function hydrate(element, container) {
|
|
|
542
548
|
rootMap.set(container, root);
|
|
543
549
|
}
|
|
544
550
|
await batchUpdates(async () => {
|
|
545
|
-
|
|
551
|
+
beginRenderPass(root);
|
|
546
552
|
try {
|
|
547
553
|
setRenderCallback(render, element, container);
|
|
548
554
|
const generator = walkElements(container);
|