fix(ext-view): clear cross-engine error, propagate globals across JteExtension builder chain

- BaseViewExtension: wrap the ViewRuntimeBridge provider collision with a message
  naming the real constraint (one view engine per FlashApp) instead of the generic
  "duplicate provider" error.
- BaseViewExtension/JteExtension: carry registered globals across JteExtension's
  immutable settings builders (templateRoot/serveStatics/staticPrefix/withStaticCors/
  staticCors). addGlobal() called before any of those used to be silently dropped,
  since each builder method returned a fresh instance with an empty globals list.
- Correct flash-ext-view-jte docs (README, architecture.md, model-and-globals.md):
  globals merge flat with one typed @param per key, not under a global.* namespace
  like Thymeleaf — the docs previously claimed the same reserved namespace for both
  engines, which doesn't match JteRuntime's actual merge behavior.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Zakaria El Orche
2026-09-09 13:31:21 +00:00
co-authored by Claude Sonnet 5
parent 9de2800a83
commit 4feabc45d5
7 changed files with 128 additions and 11 deletions
@@ -9,7 +9,7 @@
2. **Request-time**
- Handler builds local `ViewModel`.
- Runtime injects globals under reserved `global` namespace and merges local model.
- Runtime merges globals and local model into one flat parameter map (fails fast on key collision).
- jte renders template into `StringOutput`.
3. **Static assets (optional, enabled by default)**