3.6 KiB
⚠️ 历史·过程留档(已归档,2026-10-16):本文为当时记录,不代表现状;现状以
docs/standards/architecture-current-state.md为准,规则见docs/standards/。
v3.7.0 Runtime Baseline
Snapshot
- Baseline release:
v3.6.0 - Baseline commit:
8b8812a - Runtime entry:
app.jssingle browser IIFE with modular IIFE globals loaded before it - Browser runtime: React UMD +
React.createElement, no JSX/ESM/CommonJS in runtime modules - Persistence: LocalStorage compatibility keys plus IndexedDB database
iwb_web, physical version3 - Build entry:
scripts/build.js - Verification:
npm run verify
Build order
scripts/build.js copies and loads modules in this order:
- storage contract/runtime/migrations/result/local/indexeddb/workspace/groups/outputs/backup
- runtime constants and canvas store
- generation scheduler/retry
- gallery query/hydration and UI components
app.jscompatibility runtime
Every extracted module must remain an IIFE global and must have an app.js fallback.
Current runtime boundaries
Storage
Storage has modular adapters for result semantics, LocalStorage, IndexedDB, workspace, groups, outputs and backup. app.js still contains compatibility implementations and business orchestration. Existing keys, prefixes, backup formats and workspace rev behavior are compatibility constraints.
Generation
Generation uses modular scheduler/retry helpers, while app.js still builds jobs, owns node/UI state, invokes provider APIs, persists run records, handles cancellation and archives outputs.
UI and canvas
app.js owns React composition, canvas interaction, node/edge/group state, panels, settings, history, backup UI and cross-tab synchronization. src/canvas-store.js and src/ui-components.js provide low-risk extracted boundaries.
Side-effect inventory
The runtime uses global event listeners for keyboard, pointer, paste, blur, storage, beforeunload/pagehide, resize and document pointer handling. It uses timers for UI feedback, autosave, polling, delayed downloads, progress and generation lifecycle. It creates AbortControllers for network/generation operations and Blob URLs for downloads and image exports.
The first v3.7.0 migration therefore adds tracking infrastructure without immediately replacing every existing call site.
Error inventory
Errors currently cross storage, network, generation, recovery and UI boundaries. Some are converted through existing storage error helpers, while other paths catch locally, display generic messages, or intentionally ignore best-effort failures. v3.7.0 adds a non-breaking runtime error normalizer and diagnostics-safe serialization.
Compatibility locks
- Do not change LocalStorage keys.
- Do not change IndexedDB name, physical version or stores.
- Do not change
ref_/out_prefixes. - Preserve workspace optimistic-lock
revbehavior. - Preserve legacy JSON/ZIP backup recovery.
- Preserve single-file/jsdom compatibility.
- Preserve existing selectors, keyboard shortcuts and generation behavior.
- Do not serialize API keys, prompts, images or raw request payloads into diagnostics.
First implementation slice
The first slice is intentionally low risk:
- Add
runtime-error.jswith normalization, classification, retryability and redacted serialization. - Add
runtime-lifecycle.jswith reversible disposer/event/timer/AbortController/Object URL tracking. - Add focused VM tests and build-order assertions.
- Expose modules to the runtime without replacing existing behavior.
Later slices can migrate storage health, reconciliation, generation state and diagnostics one boundary at a time.