feat(ui-core,vue): inline same-origin embedding of ZK views (no iframe) - #114
Merged
Merged
Conversation
…frame - ui-core/embed: mountInline() fetches a server-rendered ZK view, injects its deduplicated head assets, appends the body re-creating scripts and tracks the desktop id announced by the response (dt:'...'); destroy() releases the desktop client- and server-side (zAu._rmDesktop). - <dynamia-embed mode="inline"> uses it (light DOM, same-origin only). - @dynamia-tools/vue: <DynamiaZkEmbed> wrapper (load/error events, loading/error slots). - docs/frontend/INLINE_ZK_EMBED.md; happy-dom devDependency for DOM tests. No backend endpoint added: the response <head> is already the bootstrap manifest. Refs #113 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GXVz2G6v1fqFdQjRSh9XZF
1 task done
marioserrano09
added a commit
that referenced
this pull request
Oct 1, 2026
* chore: bump version to 26.10.0 Includes navigation multi-desktop support (#112), inline ZK embed (#114) and localized navigation labels (#116). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * chore(cli): bump cli.properties versions to 26.10.0 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #113
What
Inline (no-iframe), same-origin embedding of server-rendered ZK views, usable from Vue.
ui-core/embed:mountInline(container, src)fetches the ZK response, injects its deduplicated<head>assets (scripts in order, shared between concurrent embeds), appends the body re-creating its<script>nodes, and waits for the desktop announced by the response (dt:'...').destroy()detaches root pages, callszAu._rmDesktopand deletes the desktop fromzk.Desktop.all.<dynamia-embed mode="inline" src="...">: uses it; content in light DOM (slotted), same-origin only,dynamia-embed:loadcarriestype: 'inline'+desktopIds.@dynamia-tools/vue:<DynamiaZkEmbed src>(load/errorevents,loading/errorslots, remount onsrcchange, cleanup on unmount). Registered by the plugin.docs/frontend/INLINE_ZK_EMBED.md, READMEs.Decision worth reviewing
No new backend endpoint. #113 planned a bootstrap endpoint under
app/metadata, but the spike showed the response<head>of any ZK view is already a per-page manifest with the versioned asset URLs./booksand/page-embed/<module>/<group>/<page>both work as-is. Nothing changes in the public API of the backend.Bug found while verifying
Attributing desktops by diffing
zk.Desktop.allbreaks with overlapping mounts (destroying one embed released the other's desktop). The id is now taken from each response's owndt:'...', unescaped (ZK writes-as\-in the JS source). Covered by tests.Verification
ui-core: 121 tests pass (inline.test.tsadded, happy-dom),tsc --noEmitclean, build OK (standalone IIFE grew ~3.5 → 9 kB min).vue:vue-tsc --noEmitclean, build OK, 13 tests pass.examples/demo-zk-books(packaged jar), using the builtdynamia-embed.global.js: two concurrent inline embeds (/books,/page-embed/library/books) → one desktop each; removing one leaves the other working (AU answers withrid) while the removed one behaves as unknown server-side; changingsrcreplaces the desktop; cross-origin rejected viadynamia-embed:error.Not verified
<DynamiaZkEmbed>in a real browser (only type-checked/built).zAu._rmDesktop,zk.Desktop.all), every access guarded; verified with ZK 10.3.0.1.Notes
happy-domas aui-coredevDependency (lockfile changed).MyBookStoreModuleProviderregistersPage("htmx", "/htmx.html?v=1"), which 404s (file is served under/static/). Not touched.🤖 Generated with Claude Code
https://claude.ai/code/session_01GXVz2G6v1fqFdQjRSh9XZF