Open navigation

Blog/release

v0.8.0 — Audit Resolution + Structured Logging + Blog Plugin

Five audit items resolved: structured logging, runtime-shim auto-generation, parse5 nested DSD optimization, advanced feature docs, and Playwright E2E tests. @openelement/blog ships and dogfoods.

v0.8.0 resolves all five audit items, introduces structured logging, auto-generates the runtime shim, optimizes nested DSD rendering, and ships the @openelement/blog plugin with full dogfooding.

Audit Item Resolution

# Priority Item Status
1 P0 Eliminate runtime-shim.ts manual sync risk ✅ Done
2 P0 Clarify error classification guide ✅ Done
3 P1 Optimize nested DSD rendering O(n²) ✅ Done
4 P1 Improve advanced feature docs ✅ Done
5 P1 Add integration tests ✅ Done

P0-1: Runtime Shim Auto-Generation

packages/core/scripts/generate-runtime-shim.ts uses TypeScript AST to extract functions from source files and auto-generate runtime-shim.ts. No more manual sync between source and shim — run deno task generate:runtime-shim to regenerate, verify with git diff --exit-code.

P0-2: Structured Logging + Error Classification

New @openelement/core/logger module with createLogger(scope):

import { createLogger } from '@openelement/core/logger';

const log = createLogger('ssg');
log.warn('Client build failed:', err.message);
log.info('Routes: 5 page(s), 2 API route(s), 8 island(s)');
log.debug('customElements.define("my-counter") skipped: already defined');

All framework internals migrated from raw console.* to structured logging. Scopes: core[LessJS], ssg[LessJS/SSG], blog[LessJS/Blog], signal[LessJS/Signal]. Four log levels (DEBUG/INFO/WARN/ERROR) plus SILENT. The runtime shim includes a lightweight log stub that maps to console.* with the [LessJS] prefix.

P1-3: parse5 Nested DSD Optimization

Replaced regex-based O(n²) nested custom element rendering with a parse5 AST O(n×d) approach in render-nested.ts. Bottom-up traversal, proper DSD template detection, and attribute inference. Supports complex nesting scenarios the regex approach couldn't handle.

P1-4: Advanced Feature Docs

DSD guide (/guide/dsd), deep Islands guide (/guide/islands-deep), and RPC guide (/guide/rpc) — covering the three-layer DSD model, four island strategies, and cross-island communication patterns.

P1-5: Playwright E2E Tests

10 end-to-end tests covering DSD layers and nested custom elements against the built docs site:

  • e2e/dsd-layers.spec.ts — 5 tests: HTML structure, shadow roots, styles, no raw DSD text, custom element discovery
  • e2e/nested-ce.spec.ts — 5 tests: custom elements in DOM, no raw text, LessJS components, shadow root upgrade, navigation

Core Features

Signal Native Switch

@openelement/signal adds isNativeSignal() detection. When the browser supports TC39 Signals, it uses globalThis.Signal and falls back to polyfill automatically.

Island Upgrade Manifest

@openelement/core/island-manifest generates per-page island manifests, replacing the global island entry. Each SSG page only loads the islands it actually uses.

@openelement/blog Package

New Vite plugin package for blog/content sites. lessBlog() integrates into Vite build, parseMarkdownFile() handles Markdown + frontmatter, scanPosts() + generateBlogRoutes() auto-generate routes. The docs site itself dogfoods this plugin — 5 blog posts served from /blog.

v0.8 scope: .md → routes → list/post pages. No MDX, comments, or tags system.

Architecture Improvements

  • render-dsd.ts split: 770-line monolith → 4 focused modules (core, escape, nested, barrel export). Backward-compatible.
  • UI unified to DsdLitElement: 3 components migrated to the Mixin pattern. All UI components now share the same DSD hydration mechanism.
  • insertAfterHead dedup: Moved from @openelement/ui to @openelement/core. Shared utility functions belong in core.

Bug Fixes

  • Runtime shim log undefined: Generated shim code referenced log but had no definition. Added var log = {...} stub to SHIM_BOILERPLATE.
  • island-effect cleanup leak: islandEffect() didn't properly clean up Signal effects in disconnectedCallback.
  • buildIslandChunkMap double prefix: Re-prepended islands/ prefix, causing 404s in SSG HTML.
  • Full console. migration*: All raw console.warn/error/debug calls replaced with createLogger() across core, adapter-lit, and signals packages.

Test Coverage

393 unit tests passing. 10 Playwright E2E tests passing. Zero lint warnings. Zero type errors.

What's Next

v0.8 audit resolution is complete. Next focus areas:

  • Interactive Playground for live component demos
  • Speculative Loading observability (prefetch metrics)
  • Continued @openelement/blog dogfooding and feature expansion

v0.8.0 — Audit Resolution + Structured Logging + Blog Plugin

All five audit items resolved. Structured logging unifies framework diagnostics. Runtime shim is auto-generated. @openelement/blog ships with full dogfooding.

Highlights

  • Structured Logging: createLogger(scope) with unified prefixes, four levels, SILENT mode. All internals migrated.
  • Runtime Shim Auto-Gen: TypeScript AST-based generation eliminates manual sync risk.
  • parse5 Nested DSD: O(n²) → O(n×d) for complex nesting scenarios.
  • Playwright E2E: 10 browser-level tests against SSG output.
  • @openelement/blog: Vite plugin for markdown-driven blogs, dogfooded on the docs site.

Bug Fixes

  • Runtime shim log undefined: Added log stub to generated shim boilerplate.
  • island-effect cleanup leak: Proper Signal effect cleanup on disconnect.
  • buildIslandChunkMap double prefix: Fixed 404s in SSG HTML island scripts.
  • Full console. migration*: No raw console calls remain in framework internals.

Test Coverage

393 unit + 10 E2E tests passing. Zero lint warnings. Zero type errors.