Coralite v0.31.6 Released
Coralite v0.31.6 has been released. This version focuses on improving custom element lifecycle robustness, eliminating recursive concurrency deadlocks during HTML building, and establishing stronger end-to-end framework synchronization tests.
Preventing Premature Disconnection in Light DOM Slots #
In prior releases, the framework avoided Flash of Unstyled Content (FOUC) by clearing Light DOM slot contents using this.innerHTML = '' inside the connectedCallback phase. However, this action prematurely triggered disconnectedCallback on nested child custom elements, destroying vital state management helpers like _abortController before asynchronous initialization could run to completion.
To resolve this, v0.31.6 preserves child element attachments. Instead of emptying the inner HTML, the framework now visually conceals slot children using style.display = 'none' and clears raw text nodes. The original styling and text configurations are then restored immediately before projection inside _render(). This keeps nested declarative or imperatively injected elements fully intact throughout their setup.
Resolving Recursive HTML Build Deadlocks #
Under resource-restricted environments, such as low-concurrency continuous integration setups, the compiler pipeline could deadlock when resolving templates. This was caused by wrapping the recursive getHtmlFiles process in packages/coralite/lib/html.js with a p-limit queue wrapper, resulting in internal queue exhaustion.
The concurrency limit around the recursive file tree traversal has been removed in this version. Concurrency controls remain safely applied to individual file system reads, ensuring stable and faster build executions.
E2E Lifecycle Synchronization Tests #
To ensure nested custom elements initialize reliably under async conditions, a new E2E test suite has been added. The suite utilizes Playwright to test lifecycle race conditions, verifying that component setups synchronize correctly through the internal __coralite_ready__ hook before executing the parent render loops.
How to Upgrade #
To upgrade to the latest version, update your project dependencies:
npm install coralite@0.31.6
npm install coralite-scripts@0.31.6
