@ccslabs/xtend 0.1.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +65 -0
- package/LICENSE +201 -0
- package/README.md +184 -0
- package/a11y/motion-contrast-policy.d.ts +32 -0
- package/a11y/motion-contrast-policy.js +261 -0
- package/a11y/runtime-a11y-contract.d.ts +44 -0
- package/a11y/runtime-a11y-contract.js +385 -0
- package/a11y/screenreader-signals.d.ts +32 -0
- package/a11y/screenreader-signals.js +372 -0
- package/api.d.ts +168 -0
- package/api.js +864 -0
- package/catalog/catalog-public-types.d.ts +66 -0
- package/catalog/component-catalog-coverage.d.ts +20 -0
- package/catalog/component-catalog-coverage.js +377 -0
- package/catalog/component-long-tail-migration.d.ts +18 -0
- package/catalog/component-long-tail-migration.js +305 -0
- package/catalog/component-regression-priority.d.ts +20 -0
- package/catalog/component-regression-priority.js +305 -0
- package/catalog/enterprise-component-flex-release-handoff.d.ts +32 -0
- package/catalog/enterprise-component-flex-release-handoff.js +437 -0
- package/catalog/enterprise-component-style-audit.d.ts +22 -0
- package/catalog/enterprise-component-style-audit.js +353 -0
- package/catalog/enterprise-form-control-theme-a11y.d.ts +19 -0
- package/catalog/enterprise-form-control-theme-a11y.js +220 -0
- package/catalog/enterprise-icon-control-audit.d.ts +21 -0
- package/catalog/enterprise-icon-control-audit.js +258 -0
- package/catalog/enterprise-layout-display-media-tokenization.d.ts +20 -0
- package/catalog/enterprise-layout-display-media-tokenization.js +237 -0
- package/catalog/enterprise-navigation-routing-state-hardening.d.ts +20 -0
- package/catalog/enterprise-navigation-routing-state-hardening.js +255 -0
- package/catalog/enterprise-overlay-mode-token-parity.d.ts +15 -0
- package/catalog/enterprise-overlay-mode-token-parity.js +178 -0
- package/catalog/enterprise-third-party-authoring-guide.d.ts +23 -0
- package/catalog/enterprise-third-party-authoring-guide.js +310 -0
- package/catalog/enterprise-visual-dom-snapshot-matrix.d.ts +31 -0
- package/catalog/enterprise-visual-dom-snapshot-matrix.js +357 -0
- package/catalog/epic10-existing-component-metadata.d.ts +25 -0
- package/catalog/epic10-existing-component-metadata.js +534 -0
- package/catalog/epic10-p0-component-wave.d.ts +28 -0
- package/catalog/epic10-p0-component-wave.js +688 -0
- package/catalog/epic10-platform-gates.d.ts +31 -0
- package/catalog/epic10-platform-gates.js +425 -0
- package/catalog/epic10-release-handoff.d.ts +30 -0
- package/catalog/epic10-release-handoff.js +195 -0
- package/catalog/epic11-enterprise-ux-handoff.d.ts +29 -0
- package/catalog/epic11-enterprise-ux-handoff.js +403 -0
- package/catalog/epic12-docs-adoption.d.ts +29 -0
- package/catalog/epic12-docs-adoption.js +183 -0
- package/catalog/epic12-rc0-gate-matrix.d.ts +36 -0
- package/catalog/epic12-rc0-gate-matrix.js +439 -0
- package/catalog/epic12-rc0-handoff.d.ts +30 -0
- package/catalog/epic12-rc0-handoff.js +385 -0
- package/catalog/epic13-conditional-network-evidence-ci.d.ts +35 -0
- package/catalog/epic13-conditional-network-evidence-ci.js +278 -0
- package/catalog/epic13-conditional-network-evidence.d.ts +34 -0
- package/catalog/epic13-conditional-network-evidence.js +280 -0
- package/catalog/epic13-docs-rmt-production-hardening.d.ts +39 -0
- package/catalog/epic13-docs-rmt-production-hardening.js +286 -0
- package/catalog/epic13-hydration-performance-closure.d.ts +33 -0
- package/catalog/epic13-hydration-performance-closure.js +234 -0
- package/catalog/epic13-known-residual-triage.d.ts +32 -0
- package/catalog/epic13-known-residual-triage.js +339 -0
- package/catalog/epic13-package-export-lock.d.ts +41 -0
- package/catalog/epic13-package-export-lock.js +604 -0
- package/catalog/epic13-prod-browser-csp-smoke.d.ts +35 -0
- package/catalog/epic13-prod-browser-csp-smoke.js +218 -0
- package/catalog/epic13-rc1-gate-matrix-ci-handoff.d.ts +36 -0
- package/catalog/epic13-rc1-gate-matrix-ci-handoff.js +418 -0
- package/catalog/epic13-rc1-migration-notes.d.ts +36 -0
- package/catalog/epic13-rc1-migration-notes.js +271 -0
- package/catalog/epic13-rc1-readiness.d.ts +33 -0
- package/catalog/epic13-rc1-readiness.js +487 -0
- package/catalog/epic13-release-owner-acceptance.d.ts +33 -0
- package/catalog/epic13-release-owner-acceptance.js +354 -0
- package/catalog/epic13-release-report-pack-dry-run-evidence.d.ts +36 -0
- package/catalog/epic13-release-report-pack-dry-run-evidence.js +253 -0
- package/catalog/epic13-rmt-production-readiness.d.ts +35 -0
- package/catalog/epic13-rmt-production-readiness.js +314 -0
- package/catalog/epic13-trusted-dom-boundary.d.ts +36 -0
- package/catalog/epic13-trusted-dom-boundary.js +230 -0
- package/catalog/epic13-visual-owner-artifact.d.ts +35 -0
- package/catalog/epic13-visual-owner-artifact.js +233 -0
- package/catalog/epic14-lsp-handoff.d.ts +28 -0
- package/catalog/epic14-lsp-handoff.js +312 -0
- package/catalog/epic14-rmt-tooling.d.ts +33 -0
- package/catalog/epic14-rmt-tooling.js +282 -0
- package/catalog/surface-manager-adapter-runtime.d.ts +37 -0
- package/catalog/surface-manager-adapter-runtime.js +203 -0
- package/catalog/surface-manager-browser-lab.d.ts +39 -0
- package/catalog/surface-manager-browser-lab.js +225 -0
- package/catalog/surface-manager-controller.d.ts +43 -0
- package/catalog/surface-manager-controller.js +290 -0
- package/catalog/surface-manager-layout-engines.d.ts +32 -0
- package/catalog/surface-manager-layout-engines.js +161 -0
- package/catalog/surface-manager-lazy-loading.d.ts +35 -0
- package/catalog/surface-manager-lazy-loading.js +173 -0
- package/catalog/surface-manager-materialization.d.ts +37 -0
- package/catalog/surface-manager-materialization.js +202 -0
- package/catalog/surface-manager-native-rmt-surfaces.d.ts +48 -0
- package/catalog/surface-manager-native-rmt-surfaces.js +325 -0
- package/catalog/surface-manager-overlay-bridge.d.ts +42 -0
- package/catalog/surface-manager-overlay-bridge.js +247 -0
- package/catalog/surface-manager-persistence.d.ts +37 -0
- package/catalog/surface-manager-persistence.js +178 -0
- package/catalog/surface-manager-quality-gates.d.ts +48 -0
- package/catalog/surface-manager-quality-gates.js +324 -0
- package/catalog/surface-manager-release-handoff.d.ts +47 -0
- package/catalog/surface-manager-release-handoff.js +274 -0
- package/catalog/surface-manager-remote-policy.d.ts +34 -0
- package/catalog/surface-manager-remote-policy.js +199 -0
- package/catalog/surface-manager-rmt-authoring.d.ts +44 -0
- package/catalog/surface-manager-rmt-authoring.js +368 -0
- package/catalog/surface-manager-route-lifecycle.d.ts +32 -0
- package/catalog/surface-manager-route-lifecycle.js +162 -0
- package/catalog/surface-manager-runtime-release-handoff.d.ts +36 -0
- package/catalog/surface-manager-runtime-release-handoff.js +245 -0
- package/catalog/surface-manager-side-panel-runtime.d.ts +46 -0
- package/catalog/surface-manager-side-panel-runtime.js +307 -0
- package/catalog/surface-manager-stack-policy.d.ts +32 -0
- package/catalog/surface-manager-stack-policy.js +169 -0
- package/catalog/surface-manager-window-runtime.d.ts +45 -0
- package/catalog/surface-manager-window-runtime.js +285 -0
- package/catalog/surface-manager-workbench-fixture.d.ts +50 -0
- package/catalog/surface-manager-workbench-fixture.js +315 -0
- package/catalog/type-exports-api.js +236 -0
- package/catalog/type-exports-builder.js +405 -0
- package/catalog/type-exports-catalog.js +394 -0
- package/catalog/type-exports-loader.js +266 -0
- package/catalog/type-exports-policy.js +461 -0
- package/catalog/type-exports-rmt.js +407 -0
- package/catalog/type-exports-vendor.js +365 -0
- package/catalog/type-exports.js +574 -0
- package/components/icon-packs/core.js +154 -0
- package/components/icon-packs/lucide.js +136 -0
- package/components/manifest.json +44 -0
- package/components/prism.d.ts +73 -0
- package/components/prism.js +300 -0
- package/components/turndown.d.ts +34 -0
- package/components/turndown.js +107 -0
- package/components/x-rmt-lifecycle-demo-build.d.ts +78 -0
- package/components/x-rmt-lifecycle-demo-build.js +1175 -0
- package/components/x-rmt-lifecycle-demo.d.ts +83 -0
- package/components/x-rmt-lifecycle-demo.js +1175 -0
- package/components/xalert.d.ts +42 -0
- package/components/xalert.js +538 -0
- package/components/xbutton.d.ts +127 -0
- package/components/xbutton.js +612 -0
- package/components/xcalendar.d.ts +39 -0
- package/components/xcalendar.js +338 -0
- package/components/xcards.d.ts +34 -0
- package/components/xcards.js +253 -0
- package/components/xcheckbox.d.ts +48 -0
- package/components/xcheckbox.js +448 -0
- package/components/xcode.d.ts +35 -0
- package/components/xcode.js +370 -0
- package/components/xdialog.d.ts +48 -0
- package/components/xdialog.js +763 -0
- package/components/xdrawer.d.ts +61 -0
- package/components/xdrawer.js +654 -0
- package/components/xfooter.d.ts +41 -0
- package/components/xfooter.js +351 -0
- package/components/xform.d.ts +43 -0
- package/components/xform.js +456 -0
- package/components/xheader.d.ts +68 -0
- package/components/xheader.js +1253 -0
- package/components/xhero.d.ts +42 -0
- package/components/xhero.js +475 -0
- package/components/xicon.d.ts +146 -0
- package/components/xicon.js +688 -0
- package/components/xinput.d.ts +37 -0
- package/components/xinput.js +444 -0
- package/components/xlightbox.d.ts +48 -0
- package/components/xlightbox.js +571 -0
- package/components/xlink.d.ts +63 -0
- package/components/xlink.js +565 -0
- package/components/xmasonry.d.ts +35 -0
- package/components/xmasonry.js +666 -0
- package/components/xmenu.d.ts +118 -0
- package/components/xmenu.js +1005 -0
- package/components/xmodal.d.ts +64 -0
- package/components/xmodal.js +831 -0
- package/components/xplayer.d.ts +57 -0
- package/components/xplayer.js +1748 -0
- package/components/xpopover.d.ts +54 -0
- package/components/xpopover.js +466 -0
- package/components/xprogress.d.ts +40 -0
- package/components/xprogress.js +345 -0
- package/components/xradio.d.ts +50 -0
- package/components/xradio.js +474 -0
- package/components/xrouter.d.ts +244 -0
- package/components/xrouter.js +1841 -0
- package/components/xsection.d.ts +34 -0
- package/components/xsection.js +253 -0
- package/components/xselect.d.ts +46 -0
- package/components/xselect.js +463 -0
- package/components/xsidepanel.d.ts +56 -0
- package/components/xsidepanel.js +728 -0
- package/components/xspinner.d.ts +38 -0
- package/components/xspinner.js +388 -0
- package/components/xstate.d.ts +137 -0
- package/components/xstate.js +493 -0
- package/components/xstatus.d.ts +41 -0
- package/components/xstatus.js +381 -0
- package/components/xsummary.d.ts +43 -0
- package/components/xsummary.js +293 -0
- package/components/xsurfacemanager-controller.d.ts +130 -0
- package/components/xsurfacemanager-controller.js +699 -0
- package/components/xsurfacemanager.d.ts +452 -0
- package/components/xsurfacemanager.js +3775 -0
- package/components/xsurfaceoverlay-bridge.d.ts +43 -0
- package/components/xsurfaceoverlay-bridge.js +238 -0
- package/components/xsurfacewindow.d.ts +50 -0
- package/components/xsurfacewindow.js +576 -0
- package/components/xtabs.d.ts +73 -0
- package/components/xtabs.js +611 -0
- package/components/xtend-public-types.d.ts +208 -0
- package/components/xtextarea.d.ts +46 -0
- package/components/xtextarea.js +451 -0
- package/components/xtheme.d.ts +253 -0
- package/components/xtheme.js +1438 -0
- package/components/xtoast.d.ts +39 -0
- package/components/xtoast.js +389 -0
- package/components/xtooltip.d.ts +53 -0
- package/components/xtooltip.js +432 -0
- package/components/xtype.d.ts +42 -0
- package/components/xtype.js +244 -0
- package/components/xutils.d.ts +164 -0
- package/components/xutils.js +496 -0
- package/components/xwriter.d.ts +67 -0
- package/components/xwriter.js +854 -0
- package/design-tokens/themes/enterprise-light.json +40 -0
- package/design-tokens/themes/xtend-signature.json +126 -0
- package/design-tokens/xtend-design-tokens.d.ts +95 -0
- package/design-tokens/xtend-design-tokens.js +395 -0
- package/design-tokens/xtheme-token-alias-layer.d.ts +84 -0
- package/design-tokens/xtheme-token-alias-layer.js +423 -0
- package/docs/.htaccess +51 -0
- package/docs/README.md +340 -0
- package/docs/XTend-ADR.md +221 -0
- package/docs/a11y-keyboard-smokes.md +62 -0
- package/docs/about.md +18 -0
- package/docs/api.md +157 -0
- package/docs/best-practices.md +76 -0
- package/docs/component-catalog-coverage.md +58 -0
- package/docs/component-lab.md +103 -0
- package/docs/component-long-tail-migration.md +41 -0
- package/docs/component-platform.md +159 -0
- package/docs/component-ux-app-authoring.md +130 -0
- package/docs/component-ux-authoring.md +96 -0
- package/docs/component-ux-gates.md +45 -0
- package/docs/components/x-rmt-lifecycle-demo-build.md +60 -0
- package/docs/components/xalert.md +81 -0
- package/docs/components/xbutton.md +103 -0
- package/docs/components/xcalendar.md +82 -0
- package/docs/components/xcards.md +128 -0
- package/docs/components/xcheckbox.md +102 -0
- package/docs/components/xcode.md +126 -0
- package/docs/components/xdialog.md +92 -0
- package/docs/components/xdrawer.md +84 -0
- package/docs/components/xfooter.md +126 -0
- package/docs/components/xform.md +128 -0
- package/docs/components/xheader.md +308 -0
- package/docs/components/xhero.md +142 -0
- package/docs/components/xicon.md +125 -0
- package/docs/components/xinput.md +129 -0
- package/docs/components/xlightbox.md +98 -0
- package/docs/components/xlink.md +109 -0
- package/docs/components/xmasonry.md +124 -0
- package/docs/components/xmenu.md +158 -0
- package/docs/components/xmodal.md +82 -0
- package/docs/components/xplayer.md +104 -0
- package/docs/components/xpopover.md +67 -0
- package/docs/components/xprogress.md +56 -0
- package/docs/components/xradio.md +103 -0
- package/docs/components/xrouter.md +260 -0
- package/docs/components/xsection.md +125 -0
- package/docs/components/xselect.md +105 -0
- package/docs/components/xsidepanel.md +30 -0
- package/docs/components/xspinner.md +102 -0
- package/docs/components/xstate.md +148 -0
- package/docs/components/xstatus.md +55 -0
- package/docs/components/xsummary.md +78 -0
- package/docs/components/xsurfacemanager.md +27 -0
- package/docs/components/xsurfacewindow.md +21 -0
- package/docs/components/xtabs.md +160 -0
- package/docs/components/xtextarea.md +98 -0
- package/docs/components/xtheme.md +167 -0
- package/docs/components/xtoast.md +62 -0
- package/docs/components/xtooltip.md +66 -0
- package/docs/components/xtype.md +82 -0
- package/docs/components/xutils.md +144 -0
- package/docs/components/xwriter.md +94 -0
- package/docs/components.md +117 -0
- package/docs/conditional-network-evidence-ci.md +38 -0
- package/docs/conditional-network-evidence.md +50 -0
- package/docs/core-migration-guide.md +110 -0
- package/docs/design-tokens.md +116 -0
- package/docs/docs-rmt-production-hardening.md +31 -0
- package/docs/enterprise-adoption.md +411 -0
- package/docs/enterprise-component-flex-release-handoff.md +129 -0
- package/docs/epic10-platform-gates.md +62 -0
- package/docs/epic10-release-handoff.md +81 -0
- package/docs/epic11-enterprise-ux-handoff.md +70 -0
- package/docs/epic12-rc0-handoff.md +61 -0
- package/docs/existing-component-metadata.md +67 -0
- package/docs/hydration-performance-closure.md +34 -0
- package/docs/hydration-policies.md +71 -0
- package/docs/index.php +1625 -0
- package/docs/known-residual-triage.md +22 -0
- package/docs/manifest-import-policy.md +79 -0
- package/docs/manifest.md +106 -0
- package/docs/menu.json +1190 -0
- package/docs/motion-contrast.md +67 -0
- package/docs/package-export-lock.md +44 -0
- package/docs/performance-measurements.md +106 -0
- package/docs/performance-regression.md +89 -0
- package/docs/performance.md +94 -0
- package/docs/previews/README.md +17 -0
- package/docs/prod-browser-csp-smokes.md +40 -0
- package/docs/public-component-types.md +79 -0
- package/docs/quick-start-guide.md +152 -0
- package/docs/rc0-adoption-guide.md +102 -0
- package/docs/rc0-gate-matrix.md +58 -0
- package/docs/rc1-gate-matrix-ci-handoff.md +56 -0
- package/docs/rc1-migration-notes.md +69 -0
- package/docs/rc1-readiness.md +46 -0
- package/docs/release-owner-acceptance.md +56 -0
- package/docs/release-report-pack-dry-run-evidence.md +39 -0
- package/docs/rmt-dsl-authoring-polish.md +122 -0
- package/docs/rmt-first-demo-app.md +77 -0
- package/docs/rmt-first-xtend-apps.md +105 -0
- package/docs/rmt-kernel-panic-recovery-incident-handoff.md +61 -0
- package/docs/rmt-kernel-security-hardening-migration.md +50 -0
- package/docs/rmt-kernel-trusted-output-authoring.md +69 -0
- package/docs/rmt-language-server.md +177 -0
- package/docs/rmt-lifecycle-demo.md +25 -0
- package/docs/rmt-linter.md +140 -0
- package/docs/rmt-production-readiness.md +63 -0
- package/docs/rmt-tooling-release-gates.md +77 -0
- package/docs/rmt-vnext-authoring.md +60 -0
- package/docs/rmt-vnext-cross-surface-events.md +68 -0
- package/docs/rmt-vnext-enterprise-mfe-handoff.md +70 -0
- package/docs/rmt-vnext-migration-notes.md +62 -0
- package/docs/rmt-vnext-release-handoff.md +69 -0
- package/docs/rmt-vnext-remote-surfaces.md +90 -0
- package/docs/rmt-vnext-surface-registry-enterprise.md +76 -0
- package/docs/screenreader-signals.md +56 -0
- package/docs/supply-chain-gates.md +100 -0
- package/docs/surface-manager-authoring-guide.md +94 -0
- package/docs/surface-manager-browser-lab.md +45 -0
- package/docs/surface-manager-component-lab.md +43 -0
- package/docs/surface-manager-controller.md +66 -0
- package/docs/surface-manager-layout-engines.md +32 -0
- package/docs/surface-manager-lazy-hydration.md +63 -0
- package/docs/surface-manager-migration-guide.md +94 -0
- package/docs/surface-manager-native-rmt-surfaces.md +38 -0
- package/docs/surface-manager-overlay-bridge.md +53 -0
- package/docs/surface-manager-persistence.md +30 -0
- package/docs/surface-manager-quality-gates.md +51 -0
- package/docs/surface-manager-release-handoff.md +68 -0
- package/docs/surface-manager-remote-policy.md +54 -0
- package/docs/surface-manager-rmt-authoring.md +86 -0
- package/docs/surface-manager-route-lifecycle.md +59 -0
- package/docs/surface-manager-runtime-release-handoff.md +69 -0
- package/docs/surface-manager-side-panel-runtime.md +36 -0
- package/docs/surface-manager-stack-policy.md +39 -0
- package/docs/surface-manager-window-runtime.md +47 -0
- package/docs/surface-manager-workbench-fixture.md +43 -0
- package/docs/third-party-design-authoring.md +406 -0
- package/docs/trusted-dom-boundary-browser-proof.md +32 -0
- package/docs/trusted-dom-sanitizing.md +110 -0
- package/docs/type-exports.md +61 -0
- package/docs/typescript-components.md +63 -0
- package/docs/utils/fabric-runtime.js +650 -0
- package/docs/utils/pageloader.js +2823 -0
- package/docs/utils/parsedown.php +298 -0
- package/docs/visual-browser-regression.md +83 -0
- package/docs/visual-owner-artifacts.md +46 -0
- package/docs/visual-snapshot-automation.md +87 -0
- package/docs/xtend-api-types.md +55 -0
- package/docs/xtend-builder-types.md +55 -0
- package/docs/xtend-catalog-types.md +44 -0
- package/docs/xtend-fabric-rmt-lane-mapping.md +143 -0
- package/docs/xtend-fabric.md +474 -0
- package/docs/xtend-loader-types.md +58 -0
- package/docs/xtend-loader.md +265 -0
- package/docs/xtend-policy-types.md +38 -0
- package/docs/xtend-rmt-types.md +39 -0
- package/docs/xtend-vendor-types.md +36 -0
- package/docs/xtendrmt-app-dsl.md +269 -0
- package/docs/xtendrmt-migration-guide.md +235 -0
- package/docs/xtendrmt-native-authoring.md +337 -0
- package/docs/xtendrmt-overview.md +89 -0
- package/docs/xtendrmt-parsedown-docs.rmt +956 -0
- package/docs/xtendrmt-parsedown-scheduling.md +301 -0
- package/docs/xtendrmt-runtime-bridge.md +155 -0
- package/fabric/hydration-policy.d.ts +27 -0
- package/fabric/hydration-policy.js +306 -0
- package/fabric/package.json +58 -0
- package/fabric/rmt-lane-mapping.d.ts +47 -0
- package/fabric/rmt-lane-mapping.js +504 -0
- package/fabric/xtend-fabric.d.ts +81 -0
- package/fabric/xtend-fabric.js +2669 -0
- package/fabric/xtend-policy-public-types.d.ts +135 -0
- package/package.json +8225 -0
- package/security/README.md +54 -0
- package/security/manifest-import-policy.d.ts +43 -0
- package/security/manifest-import-policy.js +260 -0
- package/security/supply-chain-gate-policy.d.ts +45 -0
- package/security/supply-chain-gate-policy.js +249 -0
- package/security/trusted-dom-policy.d.ts +36 -0
- package/security/trusted-dom-policy.js +316 -0
- package/tools/package.json +77 -0
- package/tools/rmt-editor/vscode/README.md +33 -0
- package/tools/rmt-editor/vscode/extension.d.ts +9 -0
- package/tools/rmt-editor/vscode/extension.js +55 -0
- package/tools/rmt-editor/vscode/language-configuration.json +28 -0
- package/tools/rmt-editor/vscode/package.json +83 -0
- package/tools/rmt-editor/vscode/snippets/rmt.code-snippets +243 -0
- package/tools/rmt-editor/vscode/syntaxes/rmt.tmLanguage.json +13 -0
- package/tools/rmt-editor/vscode/xtend-rmt-language-0.0.0-enterprise-readiness.vsix +0 -0
- package/tools/rmt-language/code-actions.d.ts +15 -0
- package/tools/rmt-language/code-actions.js +566 -0
- package/tools/rmt-language/completions.d.ts +22 -0
- package/tools/rmt-language/completions.js +475 -0
- package/tools/rmt-language/definitions.d.ts +13 -0
- package/tools/rmt-language/definitions.js +212 -0
- package/tools/rmt-language/diagnostics.d.ts +23 -0
- package/tools/rmt-language/diagnostics.js +486 -0
- package/tools/rmt-language/format-adapter.d.ts +16 -0
- package/tools/rmt-language/format-adapter.js +270 -0
- package/tools/rmt-language/hover.d.ts +12 -0
- package/tools/rmt-language/hover.js +326 -0
- package/tools/rmt-language/kernel-escalation.d.ts +122 -0
- package/tools/rmt-language/kernel-escalation.js +427 -0
- package/tools/rmt-language/kernel-panic-monitor.d.ts +176 -0
- package/tools/rmt-language/kernel-panic-monitor.js +674 -0
- package/tools/rmt-language/kernel-policy-parity.d.ts +142 -0
- package/tools/rmt-language/kernel-policy-parity.js +629 -0
- package/tools/rmt-language/kernel-recovery.d.ts +173 -0
- package/tools/rmt-language/kernel-recovery.js +666 -0
- package/tools/rmt-language/kernel-scheduler-failure.d.ts +136 -0
- package/tools/rmt-language/kernel-scheduler-failure.js +486 -0
- package/tools/rmt-language/kernel-security-regression.d.ts +154 -0
- package/tools/rmt-language/kernel-security-regression.js +465 -0
- package/tools/rmt-language/kernel-trust-authority.d.ts +120 -0
- package/tools/rmt-language/kernel-trust-authority.js +549 -0
- package/tools/rmt-language/parser.d.ts +14 -0
- package/tools/rmt-language/parser.js +111 -0
- package/tools/rmt-language/rmt-tooling-public-types.d.ts +179 -0
- package/tools/rmt-language/rules/boundary-policy.js +81 -0
- package/tools/rmt-language/rules/document-policy.js +65 -0
- package/tools/rmt-language/rules/index.js +29 -0
- package/tools/rmt-language/rules/route-policy.js +81 -0
- package/tools/rmt-language/rules/scheduler-policy.js +66 -0
- package/tools/rmt-language/rules/template-policy.js +130 -0
- package/tools/rmt-language/semantic-graph.d.ts +18 -0
- package/tools/rmt-language/semantic-graph.js +827 -0
- package/tools/rmt-language/snippets/README.md +17 -0
- package/tools/rmt-language/snippets/index.d.ts +17 -0
- package/tools/rmt-language/snippets/index.js +417 -0
- package/tools/rmt-language/snippets/rmt.code-snippets +243 -0
- package/tools/rmt-language/source-model.d.ts +14 -0
- package/tools/rmt-language/source-model.js +731 -0
- package/tools/rmt-language/symbols.d.ts +13 -0
- package/tools/rmt-language/symbols.js +183 -0
- package/tools/rmt-language/vnext-compatibility.d.ts +28 -0
- package/tools/rmt-language/vnext-compatibility.js +675 -0
- package/tools/rmt-language/vnext-compiler.d.ts +17 -0
- package/tools/rmt-language/vnext-compiler.js +716 -0
- package/tools/rmt-language/vnext-composition.d.ts +30 -0
- package/tools/rmt-language/vnext-composition.js +595 -0
- package/tools/rmt-language/vnext-conditions.d.ts +25 -0
- package/tools/rmt-language/vnext-conditions.js +474 -0
- package/tools/rmt-language/vnext-cross-surface-events.d.ts +30 -0
- package/tools/rmt-language/vnext-cross-surface-events.js +607 -0
- package/tools/rmt-language/vnext-degradation.d.ts +23 -0
- package/tools/rmt-language/vnext-degradation.js +428 -0
- package/tools/rmt-language/vnext-enterprise-fixtures.d.ts +28 -0
- package/tools/rmt-language/vnext-enterprise-fixtures.js +487 -0
- package/tools/rmt-language/vnext-enterprise-registry.d.ts +21 -0
- package/tools/rmt-language/vnext-enterprise-registry.js +495 -0
- package/tools/rmt-language/vnext-enterprise-release.d.ts +44 -0
- package/tools/rmt-language/vnext-enterprise-release.js +472 -0
- package/tools/rmt-language/vnext-event-governance.d.ts +29 -0
- package/tools/rmt-language/vnext-event-governance.js +488 -0
- package/tools/rmt-language/vnext-events.d.ts +44 -0
- package/tools/rmt-language/vnext-events.js +680 -0
- package/tools/rmt-language/vnext-import-resolver.d.ts +28 -0
- package/tools/rmt-language/vnext-import-resolver.js +642 -0
- package/tools/rmt-language/vnext-lifecycle.d.ts +22 -0
- package/tools/rmt-language/vnext-lifecycle.js +404 -0
- package/tools/rmt-language/vnext-parser.d.ts +21 -0
- package/tools/rmt-language/vnext-parser.js +1391 -0
- package/tools/rmt-language/vnext-regression.d.ts +25 -0
- package/tools/rmt-language/vnext-regression.js +394 -0
- package/tools/rmt-language/vnext-release.d.ts +29 -0
- package/tools/rmt-language/vnext-release.js +293 -0
- package/tools/rmt-language/vnext-remote-compatibility.d.ts +33 -0
- package/tools/rmt-language/vnext-remote-compatibility.js +892 -0
- package/tools/rmt-language/vnext-remote-compiler.d.ts +14 -0
- package/tools/rmt-language/vnext-remote-compiler.js +520 -0
- package/tools/rmt-language/vnext-remote-manifest.d.ts +33 -0
- package/tools/rmt-language/vnext-remote-manifest.js +538 -0
- package/tools/rmt-language/vnext-remote-security.d.ts +27 -0
- package/tools/rmt-language/vnext-remote-security.js +380 -0
- package/tools/rmt-language/vnext-remote-tooling.d.ts +25 -0
- package/tools/rmt-language/vnext-remote-tooling.js +805 -0
- package/tools/rmt-language/vnext-scheduler.d.ts +24 -0
- package/tools/rmt-language/vnext-scheduler.js +469 -0
- package/tools/rmt-language/vnext-security.d.ts +28 -0
- package/tools/rmt-language/vnext-security.js +597 -0
- package/tools/rmt-language/vnext-streaming.d.ts +28 -0
- package/tools/rmt-language/vnext-streaming.js +593 -0
- package/tools/rmt-language/vnext-surfaces.d.ts +24 -0
- package/tools/rmt-language/vnext-surfaces.js +406 -0
- package/tools/rmt-language/vnext-tooling.d.ts +25 -0
- package/tools/rmt-language/vnext-tooling.js +728 -0
- package/tools/rmt-language-server/protocol.d.ts +22 -0
- package/tools/rmt-language-server/protocol.js +352 -0
- package/tools/rmt-language-server/server.d.ts +15 -0
- package/tools/rmt-language-server/server.js +622 -0
- package/tools/rmt-linter/cli.d.ts +14 -0
- package/tools/rmt-linter/cli.js +450 -0
- package/tools/rmt-linter/reporter.d.ts +16 -0
- package/tools/rmt-linter/reporter.js +472 -0
- package/xtend-builder/README.md +83 -0
- package/xtend-builder/a11y/README.md +42 -0
- package/xtend-builder/a11y/component-a11y-profile.d.ts +14 -0
- package/xtend-builder/a11y/component-a11y-profile.js +314 -0
- package/xtend-builder/blueprints/README.md +105 -0
- package/xtend-builder/blueprints/component-blueprint.contract.d.ts +16 -0
- package/xtend-builder/blueprints/component-blueprint.contract.js +343 -0
- package/xtend-builder/builder-public-types.d.ts +234 -0
- package/xtend-builder/extensions/README.md +26 -0
- package/xtend-builder/extensions/component-extension-points.d.ts +11 -0
- package/xtend-builder/extensions/component-extension-points.js +277 -0
- package/xtend-builder/generators/README.md +149 -0
- package/xtend-builder/generators/component-files.d.ts +5 -0
- package/xtend-builder/generators/component-files.js +769 -0
- package/xtend-builder/generators/component-plan.d.ts +4 -0
- package/xtend-builder/generators/component-plan.js +104 -0
- package/xtend-builder/generators/registry.d.ts +6 -0
- package/xtend-builder/generators/registry.js +118 -0
- package/xtend-builder/generators/rmt-build.js +738 -0
- package/xtend-builder/generators/rmt-lifecycle-demo.js +922 -0
- package/xtend-builder/lib/cli.d.ts +9 -0
- package/xtend-builder/lib/cli.js +543 -0
- package/xtend-builder/lib/layout.d.ts +6 -0
- package/xtend-builder/lib/layout.js +153 -0
- package/xtend-builder/lib/package-resolver.js +25 -0
- package/xtend-builder/package.json +90 -0
- package/xtend-builder/performance/README.md +31 -0
- package/xtend-builder/performance/component-performance-profile.d.ts +11 -0
- package/xtend-builder/performance/component-performance-profile.js +347 -0
- package/xtend-builder/performance/component-ux-performance-contract.d.ts +27 -0
- package/xtend-builder/performance/component-ux-performance-contract.js +424 -0
- package/xtend-builder/preview/README.md +61 -0
- package/xtend-builder/preview/component-lab-ux-inspector.d.ts +20 -0
- package/xtend-builder/preview/component-lab-ux-inspector.js +448 -0
- package/xtend-builder/preview/component-lab.d.ts +14 -0
- package/xtend-builder/preview/component-lab.js +278 -0
- package/xtend-builder/preview/component-preview.d.ts +5 -0
- package/xtend-builder/preview/component-preview.js +160 -0
- package/xtend-builder/scaffold.config.d.ts +4 -0
- package/xtend-builder/scaffold.config.js +2056 -0
- package/xtend-builder/scaffold.d.ts +3 -0
- package/xtend-builder/scaffold.js +11 -0
- package/xtend-builder/templates/README.md +33 -0
- package/xtend-builder/templates/component/a11y.template.ts +11 -0
- package/xtend-builder/templates/component/component-suite.template.d.ts +2 -0
- package/xtend-builder/templates/component/component-suite.template.js +108 -0
- package/xtend-builder/templates/component/contract.template.ts +10 -0
- package/xtend-builder/templates/component/demo-plan.template.md +73 -0
- package/xtend-builder/templates/component/docs.template.md +301 -0
- package/xtend-builder/templates/component/fixture-data.template.ts +28 -0
- package/xtend-builder/templates/component/fixture.template.html +37 -0
- package/xtend-builder/templates/component/manifest-plan.template.json +22 -0
- package/xtend-builder/templates/component/performance.template.ts +13 -0
- package/xtend-builder/templates/component/rmt.template.ts +12 -0
- package/xtend-builder/templates/component/source.template.d.ts +2 -0
- package/xtend-builder/templates/component/source.template.js +137 -0
- package/xtend-builder/templates/component/source.template.ts +110 -0
- package/xtend-builder/templates/component/types.template.d.ts +423 -0
- package/xtend-builder/templates/loader.d.ts +4 -0
- package/xtend-builder/templates/loader.js +51 -0
- package/xtend-builder/templates/registry.d.ts +6 -0
- package/xtend-builder/templates/registry.js +119 -0
- package/xtend-builder/typing/README.md +130 -0
- package/xtend-builder/typing/component-contract-v2.d.ts +15 -0
- package/xtend-builder/typing/component-contract-v2.js +248 -0
- package/xtend-builder/typing/component-network-contract.d.ts +22 -0
- package/xtend-builder/typing/component-network-contract.js +478 -0
- package/xtend-builder/typing/component-shell-contract.d.ts +21 -0
- package/xtend-builder/typing/component-shell-contract.js +312 -0
- package/xtend-builder/typing/component-styling-contract.d.ts +22 -0
- package/xtend-builder/typing/component-styling-contract.js +301 -0
- package/xtend-builder/typing/component-types.d.ts +10 -0
- package/xtend-builder/typing/component-types.js +551 -0
- package/xtend-builder/typing/enterprise-component-flex-hardening-contract.d.ts +20 -0
- package/xtend-builder/typing/enterprise-component-flex-hardening-contract.js +332 -0
- package/xtend-builder/typing/feedback-status-ux-contract.d.ts +25 -0
- package/xtend-builder/typing/feedback-status-ux-contract.js +347 -0
- package/xtend-builder/typing/form-controls-ux-contract.d.ts +25 -0
- package/xtend-builder/typing/form-controls-ux-contract.js +357 -0
- package/xtend-builder/typing/layout-display-media-ux-contract.d.ts +25 -0
- package/xtend-builder/typing/layout-display-media-ux-contract.js +420 -0
- package/xtend-builder/typing/navigation-routing-ux-contract.d.ts +17 -0
- package/xtend-builder/typing/navigation-routing-ux-contract.js +297 -0
- package/xtend-builder/typing/overlay-interaction-ux-contract.d.ts +25 -0
- package/xtend-builder/typing/overlay-interaction-ux-contract.js +383 -0
- package/xtend-builder/typing/rmt-dsl-authoring-polish.d.ts +27 -0
- package/xtend-builder/typing/rmt-dsl-authoring-polish.js +419 -0
- package/xtend-builder/typing/rmt-shell-authoring-contract.d.ts +26 -0
- package/xtend-builder/typing/rmt-shell-authoring-contract.js +315 -0
- package/xtend-builder/utils/README.md +8 -0
- package/xtend-builder/utils/naming.d.ts +7 -0
- package/xtend-builder/utils/naming.js +36 -0
- package/xtend-builder/utils/validation.d.ts +5 -0
- package/xtend-builder/utils/validation.js +95 -0
- package/xtend-builder/wiring/README.md +46 -0
- package/xtend-builder/wiring/features.d.ts +5 -0
- package/xtend-builder/wiring/features.js +165 -0
- package/xtend-builder/wiring/hydration.d.ts +4 -0
- package/xtend-builder/wiring/hydration.js +44 -0
- package/xtend-builder/wiring/manifest.d.ts +5 -0
- package/xtend-builder/wiring/manifest.js +48 -0
- package/xtend-builder/workflows/README.md +47 -0
- package/xtend-builder/workflows/developer-workflow.d.ts +6 -0
- package/xtend-builder/workflows/developer-workflow.js +125 -0
- package/xtend-builder/writing/manifest-patcher.d.ts +49 -0
- package/xtend-builder/writing/manifest-patcher.js +391 -0
- package/xtend-builder/writing/write-plan.d.ts +148 -0
- package/xtend-builder/writing/write-plan.js +646 -0
- package/xtend-dev.d.ts +23 -0
- package/xtend-dev.js +4 -0
- package/xtend-loader.d.ts +201 -0
- package/xtend-loader.js +1704 -0
- package/xtend.css +402 -0
- package/xtendrmt/package.json +64 -0
- package/xtendrmt/rmt-core.d.ts +4452 -0
- package/xtendrmt/rmt-core.esm.js +25793 -0
- package/xtendrmt/rmt-first-demo-app.js +265 -0
- package/xtendrmt/rmt-first-demo-app.rmt +737 -0
- package/xtendrmt/rmt-lifecycle-demo.app.js +493 -0
- package/xtendrmt/rmt-lifecycle-demo.core.json +810 -0
- package/xtendrmt/rmt-lifecycle-demo.rmt +35 -0
- package/xtendrmt/rmt-lifecycle-demo.rmt-build.app.js +153 -0
- package/xtendrmt/rmt-lifecycle-demo.rmt-build.core.json +810 -0
- package/xtendrmt/rmt-lifecycle-demo.rmt-build.scaffold.json +202 -0
- package/xtendrmt/rmt-lifecycle-demo.scaffold.json +187 -0
- package/xtendrmt/rmt-manifest.json +548 -0
- package/xtendrmt/rmt-runtime.browser.js +26183 -0
- package/xtendrmt/rmt-runtime.esm.js +26214 -0
- package/xtendrmt/rmt-vnext-enterprise-mfe-demo.core.json +849 -0
- package/xtendrmt/rmt-vnext-enterprise-mfe-demo.rmt +50 -0
- package/xtendrmt/rmt-vnext-reference-demo.core.json +1069 -0
- package/xtendrmt/rmt-vnext-reference-demo.rmt +50 -0
- package/xtendrmt/rmt.schema.json +3145 -0
- package/xtendrmt/surface-workbench.js +316 -0
- package/xtendrmt/surface-workbench.rmt +762 -0
- package/xtendrmt/xtendrmt-bestcase-demo.core.json +1187 -0
- package/xtendrmt/xtendrmt-bestcase-demo.js +1728 -0
- package/xtendrmt/xtendrmt-bestcase-demo.rmt +57 -0
|
@@ -0,0 +1,1728 @@
|
|
|
1
|
+
import { xstate } from '../components/xstate.js';
|
|
2
|
+
import {
|
|
3
|
+
createRmtFormat,
|
|
4
|
+
createRmtRuntime,
|
|
5
|
+
createRmtStateSchedulerDiagnosticsBridge,
|
|
6
|
+
createRmtXRouterAdapter,
|
|
7
|
+
createRmtXtendComponentAdapter
|
|
8
|
+
} from './rmt-runtime.esm.js';
|
|
9
|
+
|
|
10
|
+
const DEMO_DOCUMENT_URL = './xtendrmt/xtendrmt-bestcase-demo.rmt';
|
|
11
|
+
const DEMO_CORE_DOCUMENT_URL = './xtendrmt/xtendrmt-bestcase-demo.core.json';
|
|
12
|
+
const ROUTE_COMPONENTS = Object.freeze({
|
|
13
|
+
overview: 'x-rmt-route-overview',
|
|
14
|
+
scheduler: 'x-rmt-route-scheduler',
|
|
15
|
+
routing: 'x-rmt-route-routing',
|
|
16
|
+
templating: 'x-rmt-route-template-pilot',
|
|
17
|
+
adapter: 'x-rmt-route-adapter'
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
const XTEND_COMPONENT_MANIFEST = Object.freeze({
|
|
21
|
+
'x-rmt-route-overview': 'xtendrmt-bestcase-demo.js#x-rmt-route-overview',
|
|
22
|
+
'x-rmt-route-scheduler': 'xtendrmt-bestcase-demo.js#x-rmt-route-scheduler',
|
|
23
|
+
'x-rmt-route-routing': 'xtendrmt-bestcase-demo.js#x-rmt-route-routing',
|
|
24
|
+
'x-rmt-route-template-pilot': 'xtendrmt-bestcase-demo.js#x-rmt-route-template-pilot',
|
|
25
|
+
'x-rmt-route-adapter': 'xtendrmt-bestcase-demo.js#x-rmt-route-adapter',
|
|
26
|
+
'x-header': '../components/xheader.js',
|
|
27
|
+
'x-section': '../components/xsection.js',
|
|
28
|
+
'x-cards': '../components/xcards.js',
|
|
29
|
+
'x-card': '../components/xcard.js',
|
|
30
|
+
'x-tabs': '../components/xtabs.js',
|
|
31
|
+
'x-tab': '../components/xtab.js',
|
|
32
|
+
'x-button': '../components/xbutton.js',
|
|
33
|
+
'x-alert': '../components/xalert.js',
|
|
34
|
+
'x-code': '../components/xcode.js',
|
|
35
|
+
'x-modal': '../components/xmodal.js',
|
|
36
|
+
'x-router': '../components/xrouter.js',
|
|
37
|
+
'x-route': '../components/xrouter.js',
|
|
38
|
+
'x-footer': '../components/xfooter.js'
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const DEMO_ROUTE_ORDER = Object.freeze(['kernel', 'scheduler', 'routing', 'templating', 'adapter']);
|
|
42
|
+
const DEMO_ROUTE_CONFIG = Object.freeze({
|
|
43
|
+
kernel: Object.freeze({
|
|
44
|
+
path: '/',
|
|
45
|
+
title: 'XTendRMT Kernel BestCase',
|
|
46
|
+
component: ROUTE_COMPONENTS.overview,
|
|
47
|
+
template: 'demo.kernel',
|
|
48
|
+
schedule: 'route.visible.render',
|
|
49
|
+
metadata: Object.freeze({
|
|
50
|
+
metaDescription: 'RMT Kernel und XTend UI in einer Demo.'
|
|
51
|
+
})
|
|
52
|
+
}),
|
|
53
|
+
scheduler: Object.freeze({
|
|
54
|
+
path: '/scheduler',
|
|
55
|
+
title: 'XTendRMT Scheduler',
|
|
56
|
+
component: ROUTE_COMPONENTS.scheduler,
|
|
57
|
+
template: 'demo.scheduler',
|
|
58
|
+
schedule: 'route.visible.render',
|
|
59
|
+
metadata: Object.freeze({
|
|
60
|
+
metaDescription: 'RMT Scheduler Diagnostics und Endpoint-Ausfuehrung.'
|
|
61
|
+
})
|
|
62
|
+
}),
|
|
63
|
+
routing: Object.freeze({
|
|
64
|
+
path: '/routing',
|
|
65
|
+
title: 'XTendRMT Routing DSL',
|
|
66
|
+
component: ROUTE_COMPONENTS.routing,
|
|
67
|
+
template: 'demo.routing',
|
|
68
|
+
schedule: 'route.visible.render',
|
|
69
|
+
metadata: Object.freeze({
|
|
70
|
+
metaDescription: 'XRouter-Routen werden aus RMT vNext Surfaces erzeugt.'
|
|
71
|
+
})
|
|
72
|
+
}),
|
|
73
|
+
templating: Object.freeze({
|
|
74
|
+
path: '/templating',
|
|
75
|
+
title: 'RMT Template Pilot',
|
|
76
|
+
component: ROUTE_COMPONENTS.templating,
|
|
77
|
+
template: 'demo.templating.pilot',
|
|
78
|
+
schedule: 'route.visible.render',
|
|
79
|
+
metadata: Object.freeze({
|
|
80
|
+
metaDescription: 'Pilot-Flow fuer RMT-vNext-basiertes XTend-Templating mit Component Attachment.'
|
|
81
|
+
})
|
|
82
|
+
}),
|
|
83
|
+
adapter: Object.freeze({
|
|
84
|
+
path: '/adapter',
|
|
85
|
+
title: 'XTend Product Adapter',
|
|
86
|
+
component: ROUTE_COMPONENTS.adapter,
|
|
87
|
+
template: 'demo.adapter',
|
|
88
|
+
schedule: 'component.idle.hydrate',
|
|
89
|
+
metadata: Object.freeze({
|
|
90
|
+
metaDescription: 'XTend ist der First-Class Product Adapter fuer RMT.'
|
|
91
|
+
})
|
|
92
|
+
})
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
const DEMO_ADAPTERS = Object.freeze([
|
|
96
|
+
Object.freeze({
|
|
97
|
+
id: 'xtend',
|
|
98
|
+
kind: 'host_adapter',
|
|
99
|
+
runtimeSurface: Object.freeze(['esm', 'browser_classic']),
|
|
100
|
+
providedCapabilities: Object.freeze([
|
|
101
|
+
'manifest',
|
|
102
|
+
'customElements',
|
|
103
|
+
'stateBridge',
|
|
104
|
+
'hydration',
|
|
105
|
+
'schedulerEndpoints',
|
|
106
|
+
'theme',
|
|
107
|
+
'api',
|
|
108
|
+
'diagnostics'
|
|
109
|
+
]),
|
|
110
|
+
kernelVisible: false,
|
|
111
|
+
metadata: Object.freeze({
|
|
112
|
+
factory: 'host-provided',
|
|
113
|
+
boundary: 'RMT schedules host work without importing XTend.'
|
|
114
|
+
})
|
|
115
|
+
}),
|
|
116
|
+
Object.freeze({
|
|
117
|
+
id: 'xtend.component',
|
|
118
|
+
kind: 'component_adapter',
|
|
119
|
+
runtimeSurface: Object.freeze(['esm', 'browser_classic']),
|
|
120
|
+
providedCapabilities: Object.freeze([
|
|
121
|
+
'components',
|
|
122
|
+
'customElements',
|
|
123
|
+
'manifestLookup',
|
|
124
|
+
'props',
|
|
125
|
+
'attributes',
|
|
126
|
+
'slots',
|
|
127
|
+
'events',
|
|
128
|
+
'hydration',
|
|
129
|
+
'diagnostics',
|
|
130
|
+
'scheduleRefs'
|
|
131
|
+
]),
|
|
132
|
+
kernelVisible: false,
|
|
133
|
+
metadata: Object.freeze({
|
|
134
|
+
factory: 'createRmtXtendComponentAdapter',
|
|
135
|
+
contract: 'xtend.rmt.xtend-component-adapter.v1'
|
|
136
|
+
})
|
|
137
|
+
}),
|
|
138
|
+
Object.freeze({
|
|
139
|
+
id: 'xtend.template',
|
|
140
|
+
kind: 'component_adapter',
|
|
141
|
+
runtimeSurface: Object.freeze(['esm', 'browser_classic']),
|
|
142
|
+
providedCapabilities: Object.freeze(['templates', 'slots', 'events', 'hydration', 'diagnostics']),
|
|
143
|
+
kernelVisible: false,
|
|
144
|
+
metadata: Object.freeze({
|
|
145
|
+
factory: 'RMT Template API',
|
|
146
|
+
contract: 'xtend.rmt.template-authoring.v1'
|
|
147
|
+
})
|
|
148
|
+
}),
|
|
149
|
+
Object.freeze({
|
|
150
|
+
id: 'xtend.xrouter',
|
|
151
|
+
kind: 'router_adapter',
|
|
152
|
+
runtimeSurface: Object.freeze(['esm', 'browser_classic']),
|
|
153
|
+
providedCapabilities: Object.freeze(['routes', 'navigation', 'params', 'query', 'diagnostics', 'scheduleRefs']),
|
|
154
|
+
kernelVisible: false,
|
|
155
|
+
metadata: Object.freeze({
|
|
156
|
+
factory: 'createRmtXRouterAdapter',
|
|
157
|
+
contract: 'xtend.rmt.xrouter-adapter.v1'
|
|
158
|
+
})
|
|
159
|
+
}),
|
|
160
|
+
Object.freeze({
|
|
161
|
+
id: 'rmt.state-scheduler-diagnostics',
|
|
162
|
+
kind: 'scheduler_adapter',
|
|
163
|
+
runtimeSurface: Object.freeze(['esm', 'browser_classic']),
|
|
164
|
+
providedCapabilities: Object.freeze([
|
|
165
|
+
'stateBridge',
|
|
166
|
+
'schedulerEndpoints',
|
|
167
|
+
'diagnostics',
|
|
168
|
+
'adapterResults',
|
|
169
|
+
'performanceBudgets',
|
|
170
|
+
'lifecycleEvents'
|
|
171
|
+
]),
|
|
172
|
+
kernelVisible: false,
|
|
173
|
+
metadata: Object.freeze({
|
|
174
|
+
factory: 'createRmtStateSchedulerDiagnosticsBridge',
|
|
175
|
+
contract: 'xtend.rmt.state-scheduler-diagnostics-bridge.v1'
|
|
176
|
+
})
|
|
177
|
+
})
|
|
178
|
+
]);
|
|
179
|
+
|
|
180
|
+
const DEMO_STATIC_COMPONENTS = Object.freeze([
|
|
181
|
+
Object.freeze({ id: 'shell.header', tag: 'x-header', schedule: 'component.visible.mount' }),
|
|
182
|
+
Object.freeze({ id: 'kernel.cards', tag: 'x-cards', schedule: 'component.visible.mount' }),
|
|
183
|
+
Object.freeze({ id: 'code.snapshot', tag: 'x-code', schedule: 'component.idle.hydrate' }),
|
|
184
|
+
Object.freeze({ id: 'feedback.status', tag: 'x-alert', schedule: 'component.visible.mount' }),
|
|
185
|
+
Object.freeze({ id: 'pilot.shell', tag: 'x-section', schedule: 'component.visible.mount' })
|
|
186
|
+
]);
|
|
187
|
+
|
|
188
|
+
const DEMO_SCHEDULES = Object.freeze([
|
|
189
|
+
Object.freeze({
|
|
190
|
+
id: 'template.visible.inspect',
|
|
191
|
+
endpointName: 'xtendrmt.template.inspect',
|
|
192
|
+
scope: 'xtendrmt.template.pilot',
|
|
193
|
+
lane: 'visible',
|
|
194
|
+
priority: 70,
|
|
195
|
+
preferIdle: false,
|
|
196
|
+
deadlineMs: 150,
|
|
197
|
+
coalesceKey: 'template.pilot.inspect',
|
|
198
|
+
budgetClass: 'interactive'
|
|
199
|
+
}),
|
|
200
|
+
Object.freeze({
|
|
201
|
+
id: 'route.visible.render',
|
|
202
|
+
endpointName: 'xtendrmt.route.render',
|
|
203
|
+
scope: 'xtendrmt.router.current',
|
|
204
|
+
lane: 'visible',
|
|
205
|
+
priority: 88,
|
|
206
|
+
preferIdle: false,
|
|
207
|
+
deadlineMs: 120,
|
|
208
|
+
coalesceKey: 'route.current',
|
|
209
|
+
budgetClass: 'interactive'
|
|
210
|
+
}),
|
|
211
|
+
Object.freeze({
|
|
212
|
+
id: 'component.visible.mount',
|
|
213
|
+
endpointName: 'xtendrmt.component.mount',
|
|
214
|
+
scope: 'xtendrmt.component.visible',
|
|
215
|
+
lane: 'visible',
|
|
216
|
+
priority: 76,
|
|
217
|
+
preferIdle: false,
|
|
218
|
+
deadlineMs: 160,
|
|
219
|
+
coalesceKey: 'component.mount',
|
|
220
|
+
budgetClass: 'interactive'
|
|
221
|
+
}),
|
|
222
|
+
Object.freeze({
|
|
223
|
+
id: 'component.idle.hydrate',
|
|
224
|
+
endpointName: 'xtendrmt.component.hydrate',
|
|
225
|
+
scope: 'xtendrmt.component.idle',
|
|
226
|
+
lane: 'idle',
|
|
227
|
+
priority: 42,
|
|
228
|
+
preferIdle: true,
|
|
229
|
+
deadlineMs: 420,
|
|
230
|
+
coalesceKey: 'component.hydrate',
|
|
231
|
+
budgetClass: 'background'
|
|
232
|
+
}),
|
|
233
|
+
Object.freeze({
|
|
234
|
+
id: 'diagnostics.snapshot',
|
|
235
|
+
endpointName: 'xtendrmt.diagnostics.snapshot',
|
|
236
|
+
scope: 'xtendrmt.diagnostics',
|
|
237
|
+
lane: 'diagnostics',
|
|
238
|
+
priority: 34,
|
|
239
|
+
preferIdle: true,
|
|
240
|
+
deadlineMs: 260,
|
|
241
|
+
coalesceKey: 'diagnostics.snapshot',
|
|
242
|
+
budgetClass: 'background'
|
|
243
|
+
})
|
|
244
|
+
]);
|
|
245
|
+
|
|
246
|
+
const state = {
|
|
247
|
+
initialized: false,
|
|
248
|
+
document: null,
|
|
249
|
+
rawDocument: null,
|
|
250
|
+
normalizedDocument: null,
|
|
251
|
+
vnextSource: '',
|
|
252
|
+
vnextCore: null,
|
|
253
|
+
sourceSyntax: 'legacy-json',
|
|
254
|
+
rmtFormat: null,
|
|
255
|
+
registries: null,
|
|
256
|
+
metadata: {
|
|
257
|
+
adapters: [],
|
|
258
|
+
components: [],
|
|
259
|
+
routes: [],
|
|
260
|
+
schedules: [],
|
|
261
|
+
pilotFlow: null,
|
|
262
|
+
nativeDemoMigration: null
|
|
263
|
+
},
|
|
264
|
+
runtime: null,
|
|
265
|
+
stateBridge: null,
|
|
266
|
+
adapters: {
|
|
267
|
+
router: null,
|
|
268
|
+
component: null,
|
|
269
|
+
bridge: null
|
|
270
|
+
},
|
|
271
|
+
mappings: {
|
|
272
|
+
routes: null,
|
|
273
|
+
components: null
|
|
274
|
+
},
|
|
275
|
+
adapterResults: [],
|
|
276
|
+
jobs: [],
|
|
277
|
+
activeRoute: '/',
|
|
278
|
+
activeComponent: ROUTE_COMPONENTS.overview,
|
|
279
|
+
activeSchedule: 'route.visible.render',
|
|
280
|
+
completedJobs: 0,
|
|
281
|
+
failedJobs: 0,
|
|
282
|
+
lastDurationMs: 0,
|
|
283
|
+
schedulerPressure: 'normal'
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
function cloneSerializable(value, fallback = null) {
|
|
287
|
+
if (value === undefined) return fallback;
|
|
288
|
+
try {
|
|
289
|
+
return JSON.parse(JSON.stringify(value));
|
|
290
|
+
} catch (_error) {
|
|
291
|
+
return fallback;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
function asArray(value) {
|
|
296
|
+
return Array.isArray(value) ? value : [];
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
function createDemoMetadata(vnextCore = {}) {
|
|
300
|
+
return {
|
|
301
|
+
title: 'XTendRMT BestCase Demo',
|
|
302
|
+
description: 'RMT vNext beschreibt Surfaces, Lanes und Lifecycle-Operationen; die Demo projiziert diese Core-Records auf XTend und XRouter Adapter.',
|
|
303
|
+
sourceSyntax: 'rmt-vnext',
|
|
304
|
+
vNextCore: {
|
|
305
|
+
schema: vnextCore.schema || 'xtend.rmt.core-format.vnext.v1',
|
|
306
|
+
sourceUrl: DEMO_DOCUMENT_URL,
|
|
307
|
+
coreUrl: DEMO_CORE_DOCUMENT_URL,
|
|
308
|
+
surfaceCount: asArray(vnextCore.surfaces).length,
|
|
309
|
+
laneCount: asArray(vnextCore.lanes).length,
|
|
310
|
+
operationCount: asArray(vnextCore.operations).length
|
|
311
|
+
},
|
|
312
|
+
templateAuthoring: {
|
|
313
|
+
contractVersion: 'xtend.rmt.template-authoring.v1',
|
|
314
|
+
adapter: 'xtend.template',
|
|
315
|
+
componentAdapter: 'xtend.component',
|
|
316
|
+
componentRefField: 'metadata.authoring.componentRefs',
|
|
317
|
+
slotBindingMode: 'named-slot-to-template-ref',
|
|
318
|
+
eventBindingMode: 'dom-event-to-rmt-command',
|
|
319
|
+
dataBindingMode: 'explicit-props-attributes-and-slots-only',
|
|
320
|
+
kernelVisible: false,
|
|
321
|
+
sourceSyntax: 'rmt-vnext'
|
|
322
|
+
},
|
|
323
|
+
rootLifecycle: {
|
|
324
|
+
contractVersion: 'xtend.rmt.root-handshake.v1',
|
|
325
|
+
planner: 'rmt-scheduler',
|
|
326
|
+
executor: 'xtend-host-adapter',
|
|
327
|
+
phaseSequence: ['create', 'mount', 'hydrate', 'activate', 'update', 'unmount', 'diagnostics'],
|
|
328
|
+
statePolicy: 'digital-twin-ssot-xstate',
|
|
329
|
+
schedulerEndpointHints: [
|
|
330
|
+
{
|
|
331
|
+
phase: 'mount',
|
|
332
|
+
schedule: 'component.visible.mount',
|
|
333
|
+
endpointName: 'xtendrmt.component.mount',
|
|
334
|
+
lane: 'visible',
|
|
335
|
+
preferIdle: false
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
phase: 'hydrate',
|
|
339
|
+
schedule: 'component.idle.hydrate',
|
|
340
|
+
endpointName: 'xtendrmt.component.hydrate',
|
|
341
|
+
lane: 'idle',
|
|
342
|
+
preferIdle: true
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
phase: 'activate',
|
|
346
|
+
schedule: 'route.visible.render',
|
|
347
|
+
endpointName: 'xtendrmt.route.render',
|
|
348
|
+
lane: 'visible',
|
|
349
|
+
preferIdle: false
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
phase: 'diagnostics',
|
|
353
|
+
schedule: 'diagnostics.snapshot',
|
|
354
|
+
endpointName: 'xtendrmt.diagnostics.snapshot',
|
|
355
|
+
lane: 'diagnostics',
|
|
356
|
+
preferIdle: true
|
|
357
|
+
}
|
|
358
|
+
],
|
|
359
|
+
kernelVisible: false
|
|
360
|
+
},
|
|
361
|
+
hostCapabilities: {
|
|
362
|
+
contractVersion: 'xtend.rmt.host-capabilities.v1',
|
|
363
|
+
adapterId: 'xtend',
|
|
364
|
+
adapterKind: 'host_adapter',
|
|
365
|
+
requiredCapabilities: ['manifest', 'customElements', 'stateBridge', 'hydration', 'schedulerEndpoints'],
|
|
366
|
+
optionalCapabilities: ['theme', 'api', 'router', 'diagnostics'],
|
|
367
|
+
capabilityRefs: [
|
|
368
|
+
'xtend.manifest',
|
|
369
|
+
'xtend.custom-elements',
|
|
370
|
+
'xtend.state-bridge.xstate',
|
|
371
|
+
'xtend.hydration',
|
|
372
|
+
'xtend.scheduler-endpoints',
|
|
373
|
+
'xtend.theme',
|
|
374
|
+
'xtend.api',
|
|
375
|
+
'xtend.xrouter',
|
|
376
|
+
'xtend.diagnostics'
|
|
377
|
+
],
|
|
378
|
+
negotiation: {
|
|
379
|
+
missingRequiredCapability: 'diagnostic-fail-fast-before-mount',
|
|
380
|
+
missingOptionalCapability: 'degrade-or-skip-with-diagnostics'
|
|
381
|
+
},
|
|
382
|
+
kernelVisible: false
|
|
383
|
+
},
|
|
384
|
+
scaffoldCompatibility: {
|
|
385
|
+
schema: 'xtend.scaffold.rmt-compatibility-binding.v1',
|
|
386
|
+
status: 'demo-reference-only',
|
|
387
|
+
surfaces: ['typing', 'manifest-plan', 'preview-plan', 'extension-points', 'component-files'],
|
|
388
|
+
requiredContracts: [
|
|
389
|
+
'xtend.rmt.component-contract.v1',
|
|
390
|
+
'xtend.rmt.template-authoring.v1',
|
|
391
|
+
'xtend.rmt.root-handshake.v1',
|
|
392
|
+
'xtend.rmt.host-capabilities.v1'
|
|
393
|
+
],
|
|
394
|
+
minimumGate: 'node scripts/run_xtend_tests.js rmt-compatibility --json',
|
|
395
|
+
bridgeRuntime: 'reserved-for-Epic-05',
|
|
396
|
+
kernelVisible: false
|
|
397
|
+
},
|
|
398
|
+
pilotFlow: {
|
|
399
|
+
contractVersion: 'xtend.rmt.template-pilot-flow.v1',
|
|
400
|
+
status: 'reference-only',
|
|
401
|
+
templateRef: 'demo.templating.pilot',
|
|
402
|
+
routeRef: 'templating',
|
|
403
|
+
componentAttachment: {
|
|
404
|
+
adapter: 'xtend.template',
|
|
405
|
+
componentAdapter: 'xtend.component',
|
|
406
|
+
componentRefs: ['pilot.shell', 'kernel.cards', 'feedback.status'],
|
|
407
|
+
slotBindingMode: 'named-slot-to-template-ref',
|
|
408
|
+
eventBindingMode: 'dom-event-to-rmt-command',
|
|
409
|
+
dataBindingMode: 'explicit-props-attributes-and-slots-only'
|
|
410
|
+
},
|
|
411
|
+
adapterSequence: [
|
|
412
|
+
'rmt-vnext compiler emits template/surface/lane/operation Core',
|
|
413
|
+
'runtime projection maps route surfaces to XRouter records',
|
|
414
|
+
'xtend-host-adapter materializes Custom Elements',
|
|
415
|
+
'xstate records pilot diagnostics'
|
|
416
|
+
],
|
|
417
|
+
minimumGate: 'node scripts/run_xtend_tests.js rmt-compatibility --json',
|
|
418
|
+
bridgeRuntime: 'reserved-for-Epic-05',
|
|
419
|
+
kernelVisible: false
|
|
420
|
+
},
|
|
421
|
+
nativeDemoMigration: {
|
|
422
|
+
contractVersion: 'xtend.rmt.native-demo-migration.v1',
|
|
423
|
+
status: 'vnext-demo-runtime-projection',
|
|
424
|
+
usesTopLevelDomains: true,
|
|
425
|
+
sourceSyntax: 'rmt-vnext',
|
|
426
|
+
routesSource: 'vnext.surfaces',
|
|
427
|
+
componentsSource: 'vnext.operations',
|
|
428
|
+
adaptersSource: 'runtimeProjection.adapters',
|
|
429
|
+
schedulesSource: 'vnext.lanes',
|
|
430
|
+
productiveAdapters: [
|
|
431
|
+
'createRmtXRouterAdapter',
|
|
432
|
+
'createRmtXtendComponentAdapter',
|
|
433
|
+
'createRmtStateSchedulerDiagnosticsBridge'
|
|
434
|
+
],
|
|
435
|
+
kernelVisible: false
|
|
436
|
+
}
|
|
437
|
+
};
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
function createTemplateAuthoring(templateRef, componentRefs = [], extra = {}) {
|
|
441
|
+
return {
|
|
442
|
+
contractVersion: 'xtend.rmt.template-authoring.v1',
|
|
443
|
+
templateRef,
|
|
444
|
+
componentRefs,
|
|
445
|
+
slotBindingMode: 'named-slot-to-template-ref',
|
|
446
|
+
eventBindingMode: 'dom-event-to-rmt-command',
|
|
447
|
+
kernelVisible: false,
|
|
448
|
+
...extra
|
|
449
|
+
};
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
function createRuntimeTemplates() {
|
|
453
|
+
return [
|
|
454
|
+
{
|
|
455
|
+
id: 'demo.kernel',
|
|
456
|
+
mode: 'html_fragment',
|
|
457
|
+
markup: '<x-section layout="column"><x-cards columns="3"><x-card><h3>RMT Kernel</h3><p>Scheduler, roots, diagnostics and execution planning.</p></x-card><x-card><h3>XTend UI</h3><p>Visible surface is composed with XTend components.</p></x-card><x-card><h3>XRouter</h3><p>Routes are declared in RMT vNext and mounted through XRouter.</p></x-card></x-cards></x-section>',
|
|
458
|
+
metadata: {
|
|
459
|
+
route: 'kernel',
|
|
460
|
+
adapter: 'xtend.component',
|
|
461
|
+
authoring: createTemplateAuthoring('demo.kernel', ['kernel.cards'])
|
|
462
|
+
},
|
|
463
|
+
hydration: {
|
|
464
|
+
mode: 'runtime_render',
|
|
465
|
+
ownershipMode: 'managed_subtree',
|
|
466
|
+
preferInsularHydration: true
|
|
467
|
+
}
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
id: 'demo.scheduler',
|
|
471
|
+
mode: 'html_fragment',
|
|
472
|
+
markup: '<x-section layout="column"><x-cards columns="2"><x-card><h3>Visible lane</h3><p>Interactive route work.</p></x-card><x-card><h3>Idle lane</h3><p>Background hydration and diagnostics.</p></x-card></x-cards></x-section>',
|
|
473
|
+
metadata: {
|
|
474
|
+
route: 'scheduler',
|
|
475
|
+
adapter: 'xtend.component',
|
|
476
|
+
authoring: createTemplateAuthoring('demo.scheduler', ['kernel.cards'])
|
|
477
|
+
},
|
|
478
|
+
hydration: {
|
|
479
|
+
mode: 'runtime_render',
|
|
480
|
+
ownershipMode: 'managed_subtree',
|
|
481
|
+
preferInsularHydration: true
|
|
482
|
+
}
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
id: 'demo.routing',
|
|
486
|
+
mode: 'html_fragment',
|
|
487
|
+
markup: '<x-section layout="column"><x-card><h3>Routes from RMT vNext</h3><p>XRouter consumes route records projected from vNext Surfaces and Lifecycle operations.</p></x-card></x-section>',
|
|
488
|
+
metadata: {
|
|
489
|
+
route: 'routing',
|
|
490
|
+
adapter: 'xtend.xrouter',
|
|
491
|
+
authoring: createTemplateAuthoring('demo.routing', [])
|
|
492
|
+
},
|
|
493
|
+
hydration: {
|
|
494
|
+
mode: 'runtime_render',
|
|
495
|
+
ownershipMode: 'managed_subtree',
|
|
496
|
+
preferInsularHydration: true
|
|
497
|
+
}
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
id: 'demo.templating.pilot',
|
|
501
|
+
mode: 'dom_descriptor',
|
|
502
|
+
markup: '<x-section layout="column" label="RMT Template Pilot"><div slot="header"><h2 data-slot="title"></h2><p data-slot="summary"></p></div><x-cards columns="2" data-slot="cards"></x-cards><x-alert type="info" data-slot="feedback"></x-alert></x-section>',
|
|
503
|
+
props: {
|
|
504
|
+
layout: 'column'
|
|
505
|
+
},
|
|
506
|
+
slots: {
|
|
507
|
+
title: {
|
|
508
|
+
kind: 'text',
|
|
509
|
+
value: 'RMT vNext authors; XTend host materializes.'
|
|
510
|
+
},
|
|
511
|
+
summary: {
|
|
512
|
+
kind: 'text',
|
|
513
|
+
value: 'The vNext source stays declarative while XTend component attachments remain host adapter data.'
|
|
514
|
+
},
|
|
515
|
+
cards: {
|
|
516
|
+
kind: 'template',
|
|
517
|
+
template: 'demo.kernel'
|
|
518
|
+
},
|
|
519
|
+
feedback: {
|
|
520
|
+
kind: 'template',
|
|
521
|
+
markup: 'Bridge runtime stays reserved for Epic 05.'
|
|
522
|
+
}
|
|
523
|
+
},
|
|
524
|
+
events: {
|
|
525
|
+
'pilot-run': {
|
|
526
|
+
kind: 'command',
|
|
527
|
+
target: 'x-section',
|
|
528
|
+
commandName: 'xtendrmt.template.pilot.inspect',
|
|
529
|
+
payload: {
|
|
530
|
+
templateRef: 'demo.templating.pilot',
|
|
531
|
+
componentRefs: ['pilot.shell', 'kernel.cards', 'feedback.status']
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
},
|
|
535
|
+
metadata: {
|
|
536
|
+
route: 'templating',
|
|
537
|
+
adapter: 'xtend.template',
|
|
538
|
+
pilotFlow: true,
|
|
539
|
+
authoring: createTemplateAuthoring('demo.templating.pilot', ['pilot.shell', 'kernel.cards', 'feedback.status'], {
|
|
540
|
+
componentAttachment: {
|
|
541
|
+
adapter: 'xtend.template',
|
|
542
|
+
componentAdapter: 'xtend.component',
|
|
543
|
+
componentRefs: ['pilot.shell', 'kernel.cards', 'feedback.status'],
|
|
544
|
+
slotBindingMode: 'named-slot-to-template-ref',
|
|
545
|
+
eventBindingMode: 'dom-event-to-rmt-command',
|
|
546
|
+
dataBindingMode: 'explicit-props-attributes-and-slots-only'
|
|
547
|
+
},
|
|
548
|
+
dataBindingMode: 'explicit-props-attributes-and-slots-only',
|
|
549
|
+
bridgeRuntime: 'reserved-for-Epic-05'
|
|
550
|
+
})
|
|
551
|
+
},
|
|
552
|
+
hydration: {
|
|
553
|
+
mode: 'runtime_render',
|
|
554
|
+
ownershipMode: 'managed_subtree',
|
|
555
|
+
preferInsularHydration: true,
|
|
556
|
+
metadata: {
|
|
557
|
+
planner: 'rmt-scheduler',
|
|
558
|
+
executor: 'xtend-host-adapter',
|
|
559
|
+
endpointHint: 'xtendrmt.template.inspect'
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
id: 'demo.adapter',
|
|
565
|
+
mode: 'html_fragment',
|
|
566
|
+
markup: '<x-section layout="column"><x-card><h3>XTend Product Adapter</h3><p>XTend remains a product adapter; RMT remains framework-agnostic.</p></x-card></x-section>',
|
|
567
|
+
metadata: {
|
|
568
|
+
route: 'adapter',
|
|
569
|
+
adapter: 'xtend.component',
|
|
570
|
+
authoring: createTemplateAuthoring('demo.adapter', [])
|
|
571
|
+
},
|
|
572
|
+
hydration: {
|
|
573
|
+
mode: 'runtime_render',
|
|
574
|
+
ownershipMode: 'managed_subtree',
|
|
575
|
+
preferInsularHydration: true
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
];
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
function getCoreRecordById(records, id) {
|
|
582
|
+
return asArray(records).find((record) => record && record.id === id) || null;
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
function findSurfaceOperation(vnextCore, surfaceName) {
|
|
586
|
+
const surface = asArray(vnextCore.surfaces).find((entry) => entry && entry.name === surfaceName);
|
|
587
|
+
if (!surface) return null;
|
|
588
|
+
const laneRefs = asArray(surface.laneRefs);
|
|
589
|
+
const lanes = laneRefs.map((laneRef) => getCoreRecordById(vnextCore.lanes, laneRef)).filter(Boolean);
|
|
590
|
+
const operationRefs = lanes.flatMap((lane) => asArray(lane.operationRefs));
|
|
591
|
+
return operationRefs
|
|
592
|
+
.map((operationRef) => getCoreRecordById(vnextCore.operations, operationRef))
|
|
593
|
+
.find((operation) => operation && operation.target && operation.target.ref)
|
|
594
|
+
|| null;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
function createRoutesFromVNextCore(vnextCore = {}) {
|
|
598
|
+
const routes = DEMO_ROUTE_ORDER.map((routeId) => {
|
|
599
|
+
const config = DEMO_ROUTE_CONFIG[routeId];
|
|
600
|
+
const surface = asArray(vnextCore.surfaces).find((entry) => entry && entry.name === routeId);
|
|
601
|
+
const operation = findSurfaceOperation(vnextCore, routeId);
|
|
602
|
+
return {
|
|
603
|
+
id: routeId,
|
|
604
|
+
path: config.path,
|
|
605
|
+
router: 'xtend.xrouter',
|
|
606
|
+
title: config.title,
|
|
607
|
+
component: operation && operation.target && operation.target.ref ? operation.target.ref : config.component,
|
|
608
|
+
template: config.template,
|
|
609
|
+
schedule: config.schedule,
|
|
610
|
+
metadata: {
|
|
611
|
+
...cloneSerializable(config.metadata, {}),
|
|
612
|
+
sourceSyntax: 'rmt-vnext',
|
|
613
|
+
vNextSurface: surface ? surface.id : null,
|
|
614
|
+
vNextOperation: operation ? operation.id : null
|
|
615
|
+
}
|
|
616
|
+
};
|
|
617
|
+
});
|
|
618
|
+
|
|
619
|
+
routes.push({
|
|
620
|
+
id: 'not-found',
|
|
621
|
+
path: '*',
|
|
622
|
+
router: 'xtend.xrouter',
|
|
623
|
+
title: 'XTendRMT Route Fallback',
|
|
624
|
+
component: ROUTE_COMPONENTS.overview,
|
|
625
|
+
template: 'demo.kernel',
|
|
626
|
+
schedule: 'route.visible.render',
|
|
627
|
+
metadata: {
|
|
628
|
+
sourceSyntax: 'rmt-vnext',
|
|
629
|
+
fallback: true
|
|
630
|
+
}
|
|
631
|
+
});
|
|
632
|
+
|
|
633
|
+
return routes;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
function createComponentsFromVNextCore(vnextCore = {}) {
|
|
637
|
+
const routeComponents = DEMO_ROUTE_ORDER.map((routeId) => {
|
|
638
|
+
const config = DEMO_ROUTE_CONFIG[routeId];
|
|
639
|
+
const operation = findSurfaceOperation(vnextCore, routeId);
|
|
640
|
+
const id = operation && operation.target && operation.target.ref ? operation.target.ref : config.component;
|
|
641
|
+
return {
|
|
642
|
+
id,
|
|
643
|
+
adapter: 'xtend.component',
|
|
644
|
+
kind: 'custom_element',
|
|
645
|
+
tag: id,
|
|
646
|
+
schedule: routeId === 'adapter' ? 'component.idle.hydrate' : 'component.visible.mount',
|
|
647
|
+
metadata: {
|
|
648
|
+
routeComponent: true,
|
|
649
|
+
template: config.template,
|
|
650
|
+
sourceSyntax: 'rmt-vnext',
|
|
651
|
+
vNextOperation: operation ? operation.id : null
|
|
652
|
+
}
|
|
653
|
+
};
|
|
654
|
+
});
|
|
655
|
+
|
|
656
|
+
const staticComponents = DEMO_STATIC_COMPONENTS.map((component) => ({
|
|
657
|
+
id: component.id,
|
|
658
|
+
adapter: 'xtend.component',
|
|
659
|
+
kind: 'custom_element',
|
|
660
|
+
tag: component.tag,
|
|
661
|
+
schedule: component.schedule,
|
|
662
|
+
metadata: {
|
|
663
|
+
sourceSyntax: 'runtime-projection'
|
|
664
|
+
}
|
|
665
|
+
}));
|
|
666
|
+
|
|
667
|
+
return routeComponents.concat(staticComponents);
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
function createSchedulesFromVNextCore(vnextCore = {}) {
|
|
671
|
+
return DEMO_SCHEDULES.map((schedule) => {
|
|
672
|
+
const matchingLanes = asArray(vnextCore.lanes)
|
|
673
|
+
.filter((lane) => lane && lane.name === schedule.lane)
|
|
674
|
+
.map((lane) => lane.id);
|
|
675
|
+
return {
|
|
676
|
+
...cloneSerializable(schedule, {}),
|
|
677
|
+
metadata: {
|
|
678
|
+
sourceSyntax: 'rmt-vnext',
|
|
679
|
+
vNextLaneRefs: matchingLanes
|
|
680
|
+
}
|
|
681
|
+
};
|
|
682
|
+
});
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
function createRuntimeDocumentFromVNextCore(vnextCore = {}, options = {}) {
|
|
686
|
+
const manifest = vnextCore.manifest && typeof vnextCore.manifest === 'object'
|
|
687
|
+
? vnextCore.manifest
|
|
688
|
+
: {};
|
|
689
|
+
return {
|
|
690
|
+
kind: 'rmt_document',
|
|
691
|
+
version: '2.0-vnext',
|
|
692
|
+
documentId: manifest.documentId || 'xtendrmt.bestcase.demo',
|
|
693
|
+
namespace: manifest.namespace || 'xtendrmt.demo',
|
|
694
|
+
manifest: {
|
|
695
|
+
documentId: manifest.documentId || 'xtendrmt.bestcase.demo',
|
|
696
|
+
namespace: manifest.namespace || 'xtendrmt.demo',
|
|
697
|
+
contentType: 'application/vnd.xtendrmt.rmt+vnext',
|
|
698
|
+
loaderHint: 'xtendrmt-bestcase-vnext',
|
|
699
|
+
sourceUrl: options.sourceUrl || DEMO_DOCUMENT_URL,
|
|
700
|
+
metadata: createDemoMetadata(vnextCore),
|
|
701
|
+
reactivityHints: {
|
|
702
|
+
stateBridge: 'xstate',
|
|
703
|
+
schedulerSnapshot: 'xtend.rmt.scheduler.snapshot',
|
|
704
|
+
routeSnapshot: 'xtend.rmt.router.current'
|
|
705
|
+
}
|
|
706
|
+
},
|
|
707
|
+
adapters: cloneSerializable(DEMO_ADAPTERS, []),
|
|
708
|
+
components: createComponentsFromVNextCore(vnextCore),
|
|
709
|
+
routes: createRoutesFromVNextCore(vnextCore),
|
|
710
|
+
schedules: createSchedulesFromVNextCore(vnextCore),
|
|
711
|
+
templates: createRuntimeTemplates(),
|
|
712
|
+
metadata: {
|
|
713
|
+
sourceSyntax: 'rmt-vnext',
|
|
714
|
+
coreSchema: vnextCore.schema || null
|
|
715
|
+
}
|
|
716
|
+
};
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
function ensureXTendNamespace() {
|
|
720
|
+
window.XTend = window.XTend || {};
|
|
721
|
+
window.XTend.rmt = window.XTend.rmt || {};
|
|
722
|
+
return window.XTend;
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
function byId(id) {
|
|
726
|
+
const router = document.getElementById('rmt-demo-router');
|
|
727
|
+
return document.getElementById(id)
|
|
728
|
+
|| (router && router.shadowRoot && router.shadowRoot.getElementById(id))
|
|
729
|
+
|| null;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
function setText(id, value) {
|
|
733
|
+
const element = byId(id);
|
|
734
|
+
if (element) {
|
|
735
|
+
element.textContent = String(value);
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
function setStatus(message, type = 'info') {
|
|
740
|
+
const status = byId('demo-status');
|
|
741
|
+
if (!status) return;
|
|
742
|
+
status.setAttribute('type', type);
|
|
743
|
+
status.innerHTML = `<span class="status-dot"></span>${message}`;
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
function setXCode(id, value, lang = 'json') {
|
|
747
|
+
const code = byId(id);
|
|
748
|
+
if (!code) return;
|
|
749
|
+
let template = code.querySelector('template');
|
|
750
|
+
if (!template) {
|
|
751
|
+
template = document.createElement('template');
|
|
752
|
+
code.appendChild(template);
|
|
753
|
+
}
|
|
754
|
+
template.textContent = typeof value === 'string' ? value : JSON.stringify(value, null, 2);
|
|
755
|
+
code.setAttribute('lang', lang);
|
|
756
|
+
if (typeof code._render === 'function') {
|
|
757
|
+
code._render();
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
function getRmtFormat() {
|
|
762
|
+
if (!state.rmtFormat) {
|
|
763
|
+
state.rmtFormat = createRmtFormat();
|
|
764
|
+
}
|
|
765
|
+
return state.rmtFormat;
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
function recordAdapterResult(result, options = {}) {
|
|
769
|
+
if (!result || typeof result !== 'object') return null;
|
|
770
|
+
state.adapterResults.push(result);
|
|
771
|
+
if (state.adapterResults.length > 20) {
|
|
772
|
+
state.adapterResults.splice(0, state.adapterResults.length - 20);
|
|
773
|
+
}
|
|
774
|
+
if (state.adapters.bridge && typeof state.adapters.bridge.recordAdapterResult === 'function') {
|
|
775
|
+
return state.adapters.bridge.recordAdapterResult(result, options);
|
|
776
|
+
}
|
|
777
|
+
return null;
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
function findRouteFromDetail(detail = {}) {
|
|
781
|
+
const routeId = detail.routeId || detail.id || '';
|
|
782
|
+
return state.metadata.routes.find((candidate) => candidate.id === routeId)
|
|
783
|
+
|| state.metadata.routes.find((candidate) => candidate.component === detail.component)
|
|
784
|
+
|| state.metadata.routes.find((candidate) => candidate.path === detail.path)
|
|
785
|
+
|| state.metadata.routes[0]
|
|
786
|
+
|| null;
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
function findSchedule(scheduleId) {
|
|
790
|
+
return state.metadata.schedules.find((schedule) => schedule.id === scheduleId)
|
|
791
|
+
|| state.metadata.schedules[0]
|
|
792
|
+
|| {
|
|
793
|
+
id: scheduleId || 'host.fallback',
|
|
794
|
+
endpointName: scheduleId || 'host.fallback',
|
|
795
|
+
scope: 'xtendrmt.demo',
|
|
796
|
+
lane: 'visible',
|
|
797
|
+
priority: 50,
|
|
798
|
+
preferIdle: false,
|
|
799
|
+
deadlineMs: 160,
|
|
800
|
+
budgetClass: 'interactive'
|
|
801
|
+
};
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
function findTemplate(templateRef) {
|
|
805
|
+
const templates = state.document && Array.isArray(state.document.templates)
|
|
806
|
+
? state.document.templates
|
|
807
|
+
: [];
|
|
808
|
+
return templates.find((template) => template.id === templateRef || template.templateId === templateRef)
|
|
809
|
+
|| null;
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
function readPilotFlowSnapshot() {
|
|
813
|
+
const pilot = state.metadata.pilotFlow || {};
|
|
814
|
+
const templateRef = pilot.templateRef || 'demo.templating.pilot';
|
|
815
|
+
const template = findTemplate(templateRef) || {};
|
|
816
|
+
const authoring = template.metadata && template.metadata.authoring
|
|
817
|
+
? template.metadata.authoring
|
|
818
|
+
: {};
|
|
819
|
+
const componentAttachment = pilot.componentAttachment
|
|
820
|
+
|| authoring.componentAttachment
|
|
821
|
+
|| {
|
|
822
|
+
adapter: authoring.adapter || 'xtend.template',
|
|
823
|
+
componentAdapter: 'xtend.component',
|
|
824
|
+
componentRefs: Array.isArray(authoring.componentRefs) ? authoring.componentRefs : []
|
|
825
|
+
};
|
|
826
|
+
|
|
827
|
+
return {
|
|
828
|
+
contractVersion: pilot.contractVersion || 'xtend.rmt.template-pilot-flow.v1',
|
|
829
|
+
status: pilot.status || 'reference-only',
|
|
830
|
+
templateRef,
|
|
831
|
+
routeRef: pilot.routeRef || 'templating',
|
|
832
|
+
templateMode: template.mode || template.templateMode || 'dom_descriptor',
|
|
833
|
+
componentAttachment,
|
|
834
|
+
slots: template.slots ? Object.keys(template.slots) : [],
|
|
835
|
+
events: template.events ? Object.keys(template.events) : [],
|
|
836
|
+
hydration: template.hydration || {},
|
|
837
|
+
adapterSequence: Array.isArray(pilot.adapterSequence) ? pilot.adapterSequence : [],
|
|
838
|
+
minimumGate: pilot.minimumGate || 'node scripts/run_xtend_tests.js rmt-compatibility --json',
|
|
839
|
+
kernelBoundary: 'RMT keeps XTend component attachment as adapter data.',
|
|
840
|
+
bridgeRuntime: pilot.bridgeRuntime || authoring.bridgeRuntime || 'reserved-for-Epic-05',
|
|
841
|
+
kernelVisible: pilot.kernelVisible === true ? true : false
|
|
842
|
+
};
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
function createJobRecord(schedule, label) {
|
|
846
|
+
const now = performance.now();
|
|
847
|
+
return {
|
|
848
|
+
id: `${schedule.id}:${Math.round(now)}:${state.jobs.length + 1}`,
|
|
849
|
+
label,
|
|
850
|
+
scheduleId: schedule.id,
|
|
851
|
+
endpointName: schedule.endpointName,
|
|
852
|
+
lane: schedule.lane || 'visible',
|
|
853
|
+
priority: Number(schedule.priority || 0),
|
|
854
|
+
status: 'queued',
|
|
855
|
+
queuedAt: now,
|
|
856
|
+
startedAt: 0,
|
|
857
|
+
finishedAt: 0,
|
|
858
|
+
durationMs: 0,
|
|
859
|
+
source: 'rmt'
|
|
860
|
+
};
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
function readSchedulerSnapshot() {
|
|
864
|
+
const runtime = state.runtime;
|
|
865
|
+
const renderMan = runtime && typeof runtime.getRenderMan === 'function'
|
|
866
|
+
? runtime.getRenderMan()
|
|
867
|
+
: null;
|
|
868
|
+
const diagnostics = renderMan && typeof renderMan.getSchedulerDiagnostics === 'function'
|
|
869
|
+
? renderMan.getSchedulerDiagnostics()
|
|
870
|
+
: null;
|
|
871
|
+
const stats = renderMan && typeof renderMan.getSchedulerStats === 'function'
|
|
872
|
+
? renderMan.getSchedulerStats()
|
|
873
|
+
: null;
|
|
874
|
+
const scheduledJobs = renderMan && typeof renderMan.listScheduledJobs === 'function'
|
|
875
|
+
? renderMan.listScheduledJobs()
|
|
876
|
+
: [];
|
|
877
|
+
|
|
878
|
+
const pressure = diagnostics && diagnostics.pressureLevel
|
|
879
|
+
? diagnostics.pressureLevel
|
|
880
|
+
: (runtime && typeof runtime.getBackpressureProfile === 'function'
|
|
881
|
+
? (runtime.getBackpressureProfile('demo') || {}).pressureLevel
|
|
882
|
+
: 'normal');
|
|
883
|
+
|
|
884
|
+
state.schedulerPressure = pressure || 'normal';
|
|
885
|
+
return {
|
|
886
|
+
pressureLevel: state.schedulerPressure,
|
|
887
|
+
stats: stats || {},
|
|
888
|
+
diagnostics: diagnostics || {},
|
|
889
|
+
queuedJobs: Array.isArray(scheduledJobs) ? scheduledJobs.length : 0,
|
|
890
|
+
completedJobs: state.completedJobs,
|
|
891
|
+
failedJobs: state.failedJobs,
|
|
892
|
+
lastDurationMs: Number(state.lastDurationMs.toFixed(2))
|
|
893
|
+
};
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
function syncState() {
|
|
897
|
+
const snapshot = readSchedulerSnapshot();
|
|
898
|
+
const pilotSnapshot = readPilotFlowSnapshot();
|
|
899
|
+
const routeSnapshot = {
|
|
900
|
+
path: state.activeRoute,
|
|
901
|
+
component: state.activeComponent,
|
|
902
|
+
schedule: state.activeSchedule
|
|
903
|
+
};
|
|
904
|
+
|
|
905
|
+
xstate.set('xtend.rmt.demo.document', {
|
|
906
|
+
documentId: state.document && state.document.manifest
|
|
907
|
+
? state.document.manifest.documentId
|
|
908
|
+
: 'unknown',
|
|
909
|
+
routeCount: state.metadata.routes.length,
|
|
910
|
+
templateCount: state.document && Array.isArray(state.document.templates)
|
|
911
|
+
? state.document.templates.length
|
|
912
|
+
: 0
|
|
913
|
+
});
|
|
914
|
+
xstate.set('xtend.rmt.router.current', routeSnapshot);
|
|
915
|
+
xstate.set('xtend.rmt.templating.pilot', pilotSnapshot);
|
|
916
|
+
xstate.set('xtend.rmt.scheduler.snapshot', snapshot);
|
|
917
|
+
xstate.set('xtend.rmt.scheduler.jobs', state.jobs.slice(-12));
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
function renderTimeline() {
|
|
921
|
+
const timeline = byId('demo-timeline');
|
|
922
|
+
if (!timeline) return;
|
|
923
|
+
|
|
924
|
+
const recentJobs = state.jobs.slice(-5).reverse();
|
|
925
|
+
timeline.innerHTML = recentJobs.length
|
|
926
|
+
? recentJobs.map((job) => `
|
|
927
|
+
<x-card>
|
|
928
|
+
<div class="timeline-row">
|
|
929
|
+
<div>
|
|
930
|
+
<strong>${job.label}</strong><br>
|
|
931
|
+
<small>${job.endpointName} · ${job.scheduleId}</small>
|
|
932
|
+
</div>
|
|
933
|
+
<span class="pill">${job.status} · ${job.durationMs.toFixed(1)}ms</span>
|
|
934
|
+
</div>
|
|
935
|
+
</x-card>
|
|
936
|
+
`).join('')
|
|
937
|
+
: `
|
|
938
|
+
<x-card>
|
|
939
|
+
<h3>No scheduler jobs yet</h3>
|
|
940
|
+
<p>Run a route, hydration or diagnostics cycle to see RMT work items here.</p>
|
|
941
|
+
</x-card>
|
|
942
|
+
`;
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
function refreshDemoUi() {
|
|
946
|
+
const snapshot = readSchedulerSnapshot();
|
|
947
|
+
const pilotSnapshot = readPilotFlowSnapshot();
|
|
948
|
+
const pilotTemplate = findTemplate(pilotSnapshot.templateRef) || {};
|
|
949
|
+
const templateCount = state.document && Array.isArray(state.document.templates)
|
|
950
|
+
? state.document.templates.length
|
|
951
|
+
: 0;
|
|
952
|
+
|
|
953
|
+
setText('metric-routes', state.metadata.routes.length);
|
|
954
|
+
setText('metric-components', state.metadata.components.length);
|
|
955
|
+
setText('metric-templates', templateCount);
|
|
956
|
+
setText('metric-schedules', state.metadata.schedules.length);
|
|
957
|
+
setText('metric-jobs', state.completedJobs);
|
|
958
|
+
setText('metric-pressure', snapshot.pressureLevel);
|
|
959
|
+
setText('metric-active-route', state.activeRoute);
|
|
960
|
+
setText('metric-active-schedule', state.activeSchedule);
|
|
961
|
+
|
|
962
|
+
renderTimeline();
|
|
963
|
+
setXCode('demo-runtime-snapshot', snapshot);
|
|
964
|
+
setXCode('demo-route-dsl', {
|
|
965
|
+
sourceSyntax: state.sourceSyntax,
|
|
966
|
+
vNextSurfaces: state.vnextCore
|
|
967
|
+
? state.vnextCore.surfaces.map((surface) => ({
|
|
968
|
+
id: surface.id,
|
|
969
|
+
name: surface.name,
|
|
970
|
+
laneRefs: surface.laneRefs
|
|
971
|
+
}))
|
|
972
|
+
: [],
|
|
973
|
+
routes: state.metadata.routes.map((route) => ({
|
|
974
|
+
id: route.id,
|
|
975
|
+
path: route.path,
|
|
976
|
+
router: route.router,
|
|
977
|
+
component: route.component,
|
|
978
|
+
template: route.template,
|
|
979
|
+
schedule: route.schedule
|
|
980
|
+
}))
|
|
981
|
+
});
|
|
982
|
+
setXCode('demo-adapter-contract', {
|
|
983
|
+
adapters: state.metadata.adapters.map((adapter) => ({
|
|
984
|
+
id: adapter.id,
|
|
985
|
+
kind: adapter.kind,
|
|
986
|
+
providedCapabilities: adapter.providedCapabilities || [],
|
|
987
|
+
factory: adapter.metadata && adapter.metadata.factory
|
|
988
|
+
})),
|
|
989
|
+
productiveAdapterFactories: [
|
|
990
|
+
'createRmtXRouterAdapter',
|
|
991
|
+
'createRmtXtendComponentAdapter',
|
|
992
|
+
'createRmtStateSchedulerDiagnosticsBridge'
|
|
993
|
+
],
|
|
994
|
+
routeMapping: state.mappings.routes
|
|
995
|
+
? {
|
|
996
|
+
schema: state.mappings.routes.schema,
|
|
997
|
+
routeCount: state.mappings.routes.routeCount,
|
|
998
|
+
scheduleRefs: state.mappings.routes.scheduleRefs
|
|
999
|
+
}
|
|
1000
|
+
: null,
|
|
1001
|
+
componentMapping: state.mappings.components
|
|
1002
|
+
? {
|
|
1003
|
+
schema: state.mappings.components.schema,
|
|
1004
|
+
componentCount: state.mappings.components.componentCount,
|
|
1005
|
+
scheduleRefs: state.mappings.components.scheduleRefs
|
|
1006
|
+
}
|
|
1007
|
+
: null,
|
|
1008
|
+
lastAdapterResults: state.adapterResults.slice(-5).map((result) => ({
|
|
1009
|
+
adapterId: result.adapterId,
|
|
1010
|
+
operation: result.operation,
|
|
1011
|
+
status: result.status,
|
|
1012
|
+
phase: result.phase
|
|
1013
|
+
})),
|
|
1014
|
+
kernelBoundary: 'RMT does not import XTend; XTend registers as host adapter.',
|
|
1015
|
+
canonicalNamespace: 'window.XTend.rmt'
|
|
1016
|
+
});
|
|
1017
|
+
setXCode('demo-document-preview', {
|
|
1018
|
+
kind: state.document ? state.document.kind : 'rmt_document',
|
|
1019
|
+
version: state.document ? state.document.version : '2.0-vnext',
|
|
1020
|
+
documentId: state.document && state.document.manifest ? state.document.manifest.documentId : '',
|
|
1021
|
+
sourceSyntax: state.sourceSyntax,
|
|
1022
|
+
vNextCore: state.vnextCore
|
|
1023
|
+
? {
|
|
1024
|
+
schema: state.vnextCore.schema,
|
|
1025
|
+
templates: state.vnextCore.templates.length,
|
|
1026
|
+
surfaces: state.vnextCore.surfaces.length,
|
|
1027
|
+
lanes: state.vnextCore.lanes.length,
|
|
1028
|
+
operations: state.vnextCore.operations.length,
|
|
1029
|
+
slots: state.vnextCore.slots.length,
|
|
1030
|
+
events: state.vnextCore.events.length,
|
|
1031
|
+
dataSources: state.vnextCore.dataSources.length
|
|
1032
|
+
}
|
|
1033
|
+
: null,
|
|
1034
|
+
runtimeProjectionDomains: ['adapters', 'components', 'routes', 'schedules'],
|
|
1035
|
+
normalization: state.document ? state.document.normalization : null,
|
|
1036
|
+
registries: state.registries
|
|
1037
|
+
? {
|
|
1038
|
+
routes: state.registries.routes ? state.registries.routes.length : 0,
|
|
1039
|
+
components: state.registries.components ? state.registries.components.length : 0,
|
|
1040
|
+
diagnostics: state.registries.diagnostics ? state.registries.diagnostics.length : 0
|
|
1041
|
+
}
|
|
1042
|
+
: null,
|
|
1043
|
+
templates: state.document && Array.isArray(state.document.templates)
|
|
1044
|
+
? state.document.templates.map((template) => template.id || template.templateId)
|
|
1045
|
+
: []
|
|
1046
|
+
});
|
|
1047
|
+
setXCode('demo-template-pilot', pilotSnapshot);
|
|
1048
|
+
setXCode('demo-component-attachment', pilotSnapshot.componentAttachment || {});
|
|
1049
|
+
setXCode('demo-template-record', {
|
|
1050
|
+
id: pilotTemplate.id || pilotSnapshot.templateRef,
|
|
1051
|
+
mode: pilotTemplate.mode || pilotSnapshot.templateMode,
|
|
1052
|
+
slots: pilotSnapshot.slots,
|
|
1053
|
+
events: pilotSnapshot.events,
|
|
1054
|
+
hydration: pilotSnapshot.hydration,
|
|
1055
|
+
authoring: pilotTemplate.metadata && pilotTemplate.metadata.authoring
|
|
1056
|
+
? pilotTemplate.metadata.authoring
|
|
1057
|
+
: {}
|
|
1058
|
+
});
|
|
1059
|
+
|
|
1060
|
+
syncState();
|
|
1061
|
+
}
|
|
1062
|
+
|
|
1063
|
+
function runScheduled(scheduleId, label, work) {
|
|
1064
|
+
const schedule = findSchedule(scheduleId);
|
|
1065
|
+
const job = createJobRecord(schedule, label);
|
|
1066
|
+
state.jobs.push(job);
|
|
1067
|
+
refreshDemoUi();
|
|
1068
|
+
|
|
1069
|
+
return new Promise((resolve) => {
|
|
1070
|
+
let started = false;
|
|
1071
|
+
|
|
1072
|
+
const finish = (status, result = null) => {
|
|
1073
|
+
job.status = status;
|
|
1074
|
+
job.finishedAt = performance.now();
|
|
1075
|
+
job.durationMs = job.finishedAt - (job.startedAt || job.queuedAt);
|
|
1076
|
+
state.lastDurationMs = job.durationMs;
|
|
1077
|
+
if (status === 'completed') {
|
|
1078
|
+
state.completedJobs += 1;
|
|
1079
|
+
} else if (status === 'failed') {
|
|
1080
|
+
state.failedJobs += 1;
|
|
1081
|
+
}
|
|
1082
|
+
refreshDemoUi();
|
|
1083
|
+
resolve(result);
|
|
1084
|
+
};
|
|
1085
|
+
|
|
1086
|
+
const execute = async (jobContext = {}) => {
|
|
1087
|
+
if (started) return;
|
|
1088
|
+
started = true;
|
|
1089
|
+
job.status = 'running';
|
|
1090
|
+
job.startedAt = performance.now();
|
|
1091
|
+
refreshDemoUi();
|
|
1092
|
+
try {
|
|
1093
|
+
const result = await work({
|
|
1094
|
+
...jobContext,
|
|
1095
|
+
schedule,
|
|
1096
|
+
job
|
|
1097
|
+
});
|
|
1098
|
+
finish('completed', result);
|
|
1099
|
+
} catch (error) {
|
|
1100
|
+
job.error = error && error.message ? error.message : String(error);
|
|
1101
|
+
finish('failed', null);
|
|
1102
|
+
}
|
|
1103
|
+
};
|
|
1104
|
+
|
|
1105
|
+
try {
|
|
1106
|
+
const scheduleOptions = {
|
|
1107
|
+
schedule,
|
|
1108
|
+
lane: schedule.lane,
|
|
1109
|
+
priority: schedule.priority,
|
|
1110
|
+
preferIdle: schedule.preferIdle,
|
|
1111
|
+
deadlineMs: schedule.deadlineMs,
|
|
1112
|
+
budgetClass: schedule.budgetClass,
|
|
1113
|
+
coalesceKey: schedule.coalesceKey,
|
|
1114
|
+
metadata: {
|
|
1115
|
+
scheduleId: schedule.id,
|
|
1116
|
+
demo: true
|
|
1117
|
+
}
|
|
1118
|
+
};
|
|
1119
|
+
if (state.adapters.bridge && typeof state.adapters.bridge.scheduleEndpoint === 'function') {
|
|
1120
|
+
state.adapters.bridge.scheduleEndpoint(schedule.endpointName, schedule.scope, execute, scheduleOptions);
|
|
1121
|
+
} else if (state.runtime && typeof state.runtime.scheduleEndpoint === 'function') {
|
|
1122
|
+
state.runtime.scheduleEndpoint(schedule.endpointName, schedule.scope, execute, scheduleOptions);
|
|
1123
|
+
} else {
|
|
1124
|
+
window.setTimeout(() => execute({ source: 'host-fallback' }), schedule.preferIdle ? 120 : 16);
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1127
|
+
window.setTimeout(() => {
|
|
1128
|
+
if (!started) {
|
|
1129
|
+
job.source = 'host-fallback';
|
|
1130
|
+
execute({ source: 'host-fallback-timeout' });
|
|
1131
|
+
}
|
|
1132
|
+
}, 1200);
|
|
1133
|
+
} catch (error) {
|
|
1134
|
+
job.source = 'host-fallback';
|
|
1135
|
+
window.setTimeout(() => execute({ source: 'host-fallback-error', error }), 16);
|
|
1136
|
+
}
|
|
1137
|
+
});
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
function navigateWithRmt(path) {
|
|
1141
|
+
const route = state.metadata.routes.find((candidate) => candidate.path === path)
|
|
1142
|
+
|| state.metadata.routes[0];
|
|
1143
|
+
if (!route) return Promise.resolve();
|
|
1144
|
+
|
|
1145
|
+
return runScheduled(route.schedule || 'route.visible.render', `Navigate ${route.path}`, async () => {
|
|
1146
|
+
if (state.adapters.router && typeof state.adapters.router.navigate === 'function') {
|
|
1147
|
+
const result = state.adapters.router.navigate({
|
|
1148
|
+
routeId: route.id,
|
|
1149
|
+
path: route.path,
|
|
1150
|
+
params: route.params || {},
|
|
1151
|
+
query: route.query || {},
|
|
1152
|
+
metadata: route.metadata || {}
|
|
1153
|
+
}, {
|
|
1154
|
+
mapping: state.mappings.routes,
|
|
1155
|
+
source: 'xtendrmt.bestcase.demo'
|
|
1156
|
+
});
|
|
1157
|
+
recordAdapterResult(result, { scheduleRef: route.schedule || 'route.visible.render' });
|
|
1158
|
+
} else {
|
|
1159
|
+
xstate.set('router-navigate', route.path);
|
|
1160
|
+
if (window.location.hash.replace(/^#/, '') !== route.path) {
|
|
1161
|
+
window.location.hash = route.path;
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
state.activeRoute = route.path;
|
|
1165
|
+
state.activeComponent = route.component;
|
|
1166
|
+
state.activeSchedule = route.schedule || 'route.visible.render';
|
|
1167
|
+
setStatus(`RMT scheduled route ${route.path} through XRouter using ${state.activeSchedule}.`, 'success');
|
|
1168
|
+
return route;
|
|
1169
|
+
});
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
function runHydrationCycle() {
|
|
1173
|
+
return runScheduled('component.idle.hydrate', 'Hydrate XTend component subtree', async () => {
|
|
1174
|
+
await new Promise((resolve) => window.setTimeout(resolve, 90));
|
|
1175
|
+
setStatus('RMT completed an idle hydration cycle for XTend component state.', 'success');
|
|
1176
|
+
return readSchedulerSnapshot();
|
|
1177
|
+
});
|
|
1178
|
+
}
|
|
1179
|
+
|
|
1180
|
+
function runDiagnosticsCycle() {
|
|
1181
|
+
return runScheduled('diagnostics.snapshot', 'Export scheduler diagnostics', async () => {
|
|
1182
|
+
await new Promise((resolve) => window.setTimeout(resolve, 60));
|
|
1183
|
+
const snapshot = readSchedulerSnapshot();
|
|
1184
|
+
setStatus(`Diagnostics snapshot exported with pressure level ${snapshot.pressureLevel}.`, 'info');
|
|
1185
|
+
return snapshot;
|
|
1186
|
+
});
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
function runTemplatePilotCycle() {
|
|
1190
|
+
return runScheduled('template.visible.inspect', 'Inspect RMT template pilot', async () => {
|
|
1191
|
+
await new Promise((resolve) => window.setTimeout(resolve, 45));
|
|
1192
|
+
const snapshot = readPilotFlowSnapshot();
|
|
1193
|
+
xstate.set('xtend.rmt.templating.pilot', snapshot);
|
|
1194
|
+
setStatus(`RMT inspected template ${snapshot.templateRef}; XTend attachment remains adapter data.`, 'success');
|
|
1195
|
+
return snapshot;
|
|
1196
|
+
});
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
async function runFullCycle() {
|
|
1200
|
+
const button = byId('demo-run-all');
|
|
1201
|
+
if (button) button.setAttribute('loading', '');
|
|
1202
|
+
await navigateWithRmt(state.activeRoute || '/');
|
|
1203
|
+
await runTemplatePilotCycle();
|
|
1204
|
+
await runHydrationCycle();
|
|
1205
|
+
await runDiagnosticsCycle();
|
|
1206
|
+
if (button) button.removeAttribute('loading');
|
|
1207
|
+
|
|
1208
|
+
const modalCopy = byId('demo-modal-copy');
|
|
1209
|
+
const modal = byId('rmt-demo-modal');
|
|
1210
|
+
if (modalCopy) {
|
|
1211
|
+
modalCopy.textContent = `RMT cycle complete: ${state.completedJobs} completed jobs, last duration ${state.lastDurationMs.toFixed(1)}ms.`;
|
|
1212
|
+
}
|
|
1213
|
+
if (modal && typeof modal.open === 'function') {
|
|
1214
|
+
modal.open();
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
function bindRouteControls(root = document) {
|
|
1219
|
+
root.querySelectorAll('[data-demo-run]').forEach((button) => {
|
|
1220
|
+
button.addEventListener('click', () => {
|
|
1221
|
+
const action = button.getAttribute('data-demo-run');
|
|
1222
|
+
if (action === 'full') runFullCycle();
|
|
1223
|
+
if (action === 'hydrate') runHydrationCycle();
|
|
1224
|
+
if (action === 'diagnostics') runDiagnosticsCycle();
|
|
1225
|
+
if (action === 'template-pilot') runTemplatePilotCycle();
|
|
1226
|
+
if (action === 'route') navigateWithRmt(state.activeRoute || '/');
|
|
1227
|
+
});
|
|
1228
|
+
});
|
|
1229
|
+
|
|
1230
|
+
root.querySelectorAll('[data-demo-route]').forEach((button) => {
|
|
1231
|
+
button.addEventListener('click', () => {
|
|
1232
|
+
navigateWithRmt(button.getAttribute('data-demo-route') || '/');
|
|
1233
|
+
});
|
|
1234
|
+
});
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1237
|
+
function defineDemoRouteComponents() {
|
|
1238
|
+
if (!customElements.get(ROUTE_COMPONENTS.overview)) {
|
|
1239
|
+
customElements.define(ROUTE_COMPONENTS.overview, class XRmtRouteOverview extends HTMLElement {
|
|
1240
|
+
connectedCallback() {
|
|
1241
|
+
this.innerHTML = `
|
|
1242
|
+
<x-section layout="column" label="RMT Kernel Overview">
|
|
1243
|
+
<div slot="header">
|
|
1244
|
+
<h2>RMT orchestrates; XTend renders.</h2>
|
|
1245
|
+
<p class="muted">The active <code>.rmt</code> document is RMT vNext syntax. XRouter receives route records projected from vNext Core through the productive adapter. Every visible panel below is composed with XTend components.</p>
|
|
1246
|
+
<div class="demo-actions">
|
|
1247
|
+
<x-button data-demo-run="full" variant="primary">Run full RMT cycle</x-button>
|
|
1248
|
+
<x-button data-demo-route="/scheduler" variant="secondary">Open scheduler route</x-button>
|
|
1249
|
+
</div>
|
|
1250
|
+
</div>
|
|
1251
|
+
<x-cards columns="3" gap="1rem">
|
|
1252
|
+
<x-card>
|
|
1253
|
+
<h3>Routes</h3>
|
|
1254
|
+
<span id="metric-routes" class="metric">0</span>
|
|
1255
|
+
<span class="metric-label">XRouter entries projected from vNext Surfaces</span>
|
|
1256
|
+
</x-card>
|
|
1257
|
+
<x-card>
|
|
1258
|
+
<h3>XTend Components</h3>
|
|
1259
|
+
<span id="metric-components" class="metric">0</span>
|
|
1260
|
+
<span class="metric-label">First-class component records in the RMT document</span>
|
|
1261
|
+
</x-card>
|
|
1262
|
+
<x-card>
|
|
1263
|
+
<h3>Templates</h3>
|
|
1264
|
+
<span id="metric-templates" class="metric">0</span>
|
|
1265
|
+
<span class="metric-label">Registered through the RMT Template API</span>
|
|
1266
|
+
</x-card>
|
|
1267
|
+
</x-cards>
|
|
1268
|
+
<x-tabs>
|
|
1269
|
+
<x-tab name="Kernel">
|
|
1270
|
+
<x-card>
|
|
1271
|
+
<h3>RMT Boundary</h3>
|
|
1272
|
+
<p>RMT owns scheduling, execution planning, diagnostics and template registration. XTend is mounted as a host adapter, not baked into the kernel.</p>
|
|
1273
|
+
</x-card>
|
|
1274
|
+
</x-tab>
|
|
1275
|
+
<x-tab name="XTend">
|
|
1276
|
+
<x-card>
|
|
1277
|
+
<h3>First-Class UI Adapter</h3>
|
|
1278
|
+
<p>XTend components are represented by RMT component records and rendered through native Custom Elements.</p>
|
|
1279
|
+
</x-card>
|
|
1280
|
+
</x-tab>
|
|
1281
|
+
<x-tab name="XRouter">
|
|
1282
|
+
<x-card>
|
|
1283
|
+
<h3>Routes from RMT</h3>
|
|
1284
|
+
<p>The router on this page is an actual <code>x-router</code>. Its <code>x-route</code> children are generated from the RMT document.</p>
|
|
1285
|
+
</x-card>
|
|
1286
|
+
</x-tab>
|
|
1287
|
+
</x-tabs>
|
|
1288
|
+
<x-code id="demo-document-preview" lang="json"><template>{}</template></x-code>
|
|
1289
|
+
</x-section>
|
|
1290
|
+
`;
|
|
1291
|
+
bindRouteControls(this);
|
|
1292
|
+
refreshDemoUi();
|
|
1293
|
+
}
|
|
1294
|
+
});
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
if (!customElements.get(ROUTE_COMPONENTS.scheduler)) {
|
|
1298
|
+
customElements.define(ROUTE_COMPONENTS.scheduler, class XRmtRouteScheduler extends HTMLElement {
|
|
1299
|
+
connectedCallback() {
|
|
1300
|
+
this.innerHTML = `
|
|
1301
|
+
<x-section layout="column" label="RMT Scheduler Runtime">
|
|
1302
|
+
<div slot="header">
|
|
1303
|
+
<h2>Scheduler lanes and diagnostics</h2>
|
|
1304
|
+
<p class="muted">This view schedules interactive route work, idle hydration and diagnostics through the current RMT runtime.</p>
|
|
1305
|
+
<div class="demo-actions">
|
|
1306
|
+
<x-button data-demo-run="route" variant="primary">Schedule current route</x-button>
|
|
1307
|
+
<x-button data-demo-run="hydrate" variant="secondary">Idle hydration</x-button>
|
|
1308
|
+
<x-button data-demo-run="diagnostics" variant="secondary">Diagnostics snapshot</x-button>
|
|
1309
|
+
</div>
|
|
1310
|
+
</div>
|
|
1311
|
+
<x-cards columns="4" gap="1rem">
|
|
1312
|
+
<x-card>
|
|
1313
|
+
<h3>Schedules</h3>
|
|
1314
|
+
<span id="metric-schedules" class="metric">0</span>
|
|
1315
|
+
<span class="metric-label">Policies from native RMT schedules</span>
|
|
1316
|
+
</x-card>
|
|
1317
|
+
<x-card>
|
|
1318
|
+
<h3>Completed</h3>
|
|
1319
|
+
<span id="metric-jobs" class="metric">0</span>
|
|
1320
|
+
<span class="metric-label">RMT scheduled jobs</span>
|
|
1321
|
+
</x-card>
|
|
1322
|
+
<x-card>
|
|
1323
|
+
<h3>Pressure</h3>
|
|
1324
|
+
<span id="metric-pressure" class="metric">normal</span>
|
|
1325
|
+
<span class="metric-label">Current scheduler pressure</span>
|
|
1326
|
+
</x-card>
|
|
1327
|
+
<x-card>
|
|
1328
|
+
<h3>Active Route</h3>
|
|
1329
|
+
<span id="metric-active-route" class="metric">/</span>
|
|
1330
|
+
<span class="metric-label">XRouter state mirrored from RMT</span>
|
|
1331
|
+
</x-card>
|
|
1332
|
+
</x-cards>
|
|
1333
|
+
<x-cards id="demo-timeline" columns="1" gap="0.8rem"></x-cards>
|
|
1334
|
+
<x-code id="demo-runtime-snapshot" lang="json"><template>{}</template></x-code>
|
|
1335
|
+
</x-section>
|
|
1336
|
+
`;
|
|
1337
|
+
bindRouteControls(this);
|
|
1338
|
+
refreshDemoUi();
|
|
1339
|
+
}
|
|
1340
|
+
});
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
if (!customElements.get(ROUTE_COMPONENTS.routing)) {
|
|
1344
|
+
customElements.define(ROUTE_COMPONENTS.routing, class XRmtRouteRouting extends HTMLElement {
|
|
1345
|
+
connectedCallback() {
|
|
1346
|
+
this.innerHTML = `
|
|
1347
|
+
<x-section layout="column" label="RMT Routing DSL">
|
|
1348
|
+
<div slot="header">
|
|
1349
|
+
<h2>XRouter routes generated from <code>.rmt</code></h2>
|
|
1350
|
+
<p class="muted">The RMT document now stores route intent as vNext <code>surface</code>, <code>lane</code> and lifecycle records. The productive XRouter adapter receives the runtime projection and schedules navigation work through RMT.</p>
|
|
1351
|
+
<div class="demo-route-nav">
|
|
1352
|
+
<x-button data-demo-route="/" variant="secondary">Kernel</x-button>
|
|
1353
|
+
<x-button data-demo-route="/scheduler" variant="secondary">Scheduler</x-button>
|
|
1354
|
+
<x-button data-demo-route="/routing" variant="primary">Routing DSL</x-button>
|
|
1355
|
+
<x-button data-demo-route="/templating" variant="secondary">Templating Pilot</x-button>
|
|
1356
|
+
<x-button data-demo-route="/adapter" variant="secondary">Adapter</x-button>
|
|
1357
|
+
</div>
|
|
1358
|
+
</div>
|
|
1359
|
+
<x-cards columns="2" gap="1rem">
|
|
1360
|
+
<x-card>
|
|
1361
|
+
<h3>Route Schedule</h3>
|
|
1362
|
+
<span id="metric-active-schedule" class="metric">route.visible.render</span>
|
|
1363
|
+
<span class="metric-label">Schedule policy attached to current route</span>
|
|
1364
|
+
</x-card>
|
|
1365
|
+
<x-card>
|
|
1366
|
+
<h3>Router Adapter</h3>
|
|
1367
|
+
<span class="metric">XRouter</span>
|
|
1368
|
+
<span class="metric-label">First official RMT route adapter for XTend</span>
|
|
1369
|
+
</x-card>
|
|
1370
|
+
</x-cards>
|
|
1371
|
+
<x-code id="demo-route-dsl" lang="json"><template>{}</template></x-code>
|
|
1372
|
+
<p class="code-note">This is intentionally adapter-shaped: the RMT Kernel stays on vNext Core while host adapters map it to XRouter, React Router, Vue Router or custom routing.</p>
|
|
1373
|
+
</x-section>
|
|
1374
|
+
`;
|
|
1375
|
+
bindRouteControls(this);
|
|
1376
|
+
refreshDemoUi();
|
|
1377
|
+
}
|
|
1378
|
+
});
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
if (!customElements.get(ROUTE_COMPONENTS.templating)) {
|
|
1382
|
+
customElements.define(ROUTE_COMPONENTS.templating, class XRmtRouteTemplatePilot extends HTMLElement {
|
|
1383
|
+
connectedCallback() {
|
|
1384
|
+
this.innerHTML = `
|
|
1385
|
+
<x-section layout="column" label="RMT Template Pilot">
|
|
1386
|
+
<div slot="header">
|
|
1387
|
+
<h2>RMT authors the template record; XTend materializes the component tree.</h2>
|
|
1388
|
+
<p class="muted">This pilot uses a real vNext <code>.rmt</code> template flow with XTend component attachment data. The demo runs through the productive Bridge, Component Adapter and XRouter Adapter.</p>
|
|
1389
|
+
<div class="demo-actions">
|
|
1390
|
+
<x-button data-demo-run="template-pilot" variant="primary">Inspect template pilot</x-button>
|
|
1391
|
+
<x-button data-demo-run="full" variant="secondary">Run full cycle</x-button>
|
|
1392
|
+
<x-button data-demo-route="/adapter" variant="secondary">Adapter boundary</x-button>
|
|
1393
|
+
</div>
|
|
1394
|
+
</div>
|
|
1395
|
+
<x-cards columns="3" gap="1rem">
|
|
1396
|
+
<x-card>
|
|
1397
|
+
<h3>Template</h3>
|
|
1398
|
+
<span class="metric">RMT</span>
|
|
1399
|
+
<span class="metric-label">Owns serializable records, slots, events and hydration hints</span>
|
|
1400
|
+
</x-card>
|
|
1401
|
+
<x-card>
|
|
1402
|
+
<h3>Attachment</h3>
|
|
1403
|
+
<span class="metric">XTend</span>
|
|
1404
|
+
<span class="metric-label">Resolves Custom Elements through host adapter data</span>
|
|
1405
|
+
</x-card>
|
|
1406
|
+
<x-card>
|
|
1407
|
+
<h3>Bridge</h3>
|
|
1408
|
+
<span class="metric">E05</span>
|
|
1409
|
+
<span class="metric-label">Runtime adapter paths are active in the demo shell</span>
|
|
1410
|
+
</x-card>
|
|
1411
|
+
</x-cards>
|
|
1412
|
+
<x-code id="demo-template-pilot" lang="json"><template>{}</template></x-code>
|
|
1413
|
+
<x-code id="demo-component-attachment" lang="json"><template>{}</template></x-code>
|
|
1414
|
+
<x-code id="demo-template-record" lang="json"><template>{}</template></x-code>
|
|
1415
|
+
</x-section>
|
|
1416
|
+
`;
|
|
1417
|
+
bindRouteControls(this);
|
|
1418
|
+
refreshDemoUi();
|
|
1419
|
+
}
|
|
1420
|
+
});
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
if (!customElements.get(ROUTE_COMPONENTS.adapter)) {
|
|
1424
|
+
customElements.define(ROUTE_COMPONENTS.adapter, class XRmtRouteAdapter extends HTMLElement {
|
|
1425
|
+
connectedCallback() {
|
|
1426
|
+
this.innerHTML = `
|
|
1427
|
+
<x-section layout="column" label="XTend Product Adapter">
|
|
1428
|
+
<div slot="header">
|
|
1429
|
+
<h2>XTend is first-class; RMT stays agnostic.</h2>
|
|
1430
|
+
<p class="muted">The adapter boundary lets RMT serve large web apps where XTend runs beside React, Vue, Vanilla JS or custom host runtimes.</p>
|
|
1431
|
+
<div class="demo-actions">
|
|
1432
|
+
<x-button data-demo-run="full" variant="primary">Run adapter cycle</x-button>
|
|
1433
|
+
<x-button data-demo-route="/routing" variant="secondary">Inspect route DSL</x-button>
|
|
1434
|
+
</div>
|
|
1435
|
+
</div>
|
|
1436
|
+
<x-cards columns="3" gap="1rem">
|
|
1437
|
+
<x-card>
|
|
1438
|
+
<h3>Kernel</h3>
|
|
1439
|
+
<p>Owns scheduling, diagnostics and execution plans.</p>
|
|
1440
|
+
</x-card>
|
|
1441
|
+
<x-card>
|
|
1442
|
+
<h3>Host Adapter</h3>
|
|
1443
|
+
<p>Maps generic RMT contracts to XTend components and XRouter.</p>
|
|
1444
|
+
</x-card>
|
|
1445
|
+
<x-card>
|
|
1446
|
+
<h3>Future Hosts</h3>
|
|
1447
|
+
<p>React, Vue and Custom adapters can reuse the same scheduler core.</p>
|
|
1448
|
+
</x-card>
|
|
1449
|
+
</x-cards>
|
|
1450
|
+
<x-code id="demo-adapter-contract" lang="json"><template>{}</template></x-code>
|
|
1451
|
+
</x-section>
|
|
1452
|
+
`;
|
|
1453
|
+
bindRouteControls(this);
|
|
1454
|
+
refreshDemoUi();
|
|
1455
|
+
}
|
|
1456
|
+
});
|
|
1457
|
+
}
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1460
|
+
async function waitForXtendElements() {
|
|
1461
|
+
await Promise.all([
|
|
1462
|
+
'x-header',
|
|
1463
|
+
'x-section',
|
|
1464
|
+
'x-cards',
|
|
1465
|
+
'x-card',
|
|
1466
|
+
'x-tabs',
|
|
1467
|
+
'x-tab',
|
|
1468
|
+
'x-button',
|
|
1469
|
+
'x-alert',
|
|
1470
|
+
'x-code',
|
|
1471
|
+
'x-modal',
|
|
1472
|
+
'x-router',
|
|
1473
|
+
'x-route',
|
|
1474
|
+
'x-footer'
|
|
1475
|
+
].map((tag) => customElements.whenDefined(tag)));
|
|
1476
|
+
}
|
|
1477
|
+
|
|
1478
|
+
function registerDocumentWithRuntime(documentInput) {
|
|
1479
|
+
if (!state.runtime) return;
|
|
1480
|
+
try {
|
|
1481
|
+
if (typeof state.runtime.registerDocument === 'function') {
|
|
1482
|
+
state.runtime.registerDocument(documentInput);
|
|
1483
|
+
return;
|
|
1484
|
+
}
|
|
1485
|
+
const templateApi = typeof state.runtime.getTemplateApi === 'function'
|
|
1486
|
+
? state.runtime.getTemplateApi()
|
|
1487
|
+
: null;
|
|
1488
|
+
if (templateApi && typeof templateApi.registerDocument === 'function') {
|
|
1489
|
+
templateApi.registerDocument(documentInput);
|
|
1490
|
+
}
|
|
1491
|
+
} catch (error) {
|
|
1492
|
+
console.warn('XTendRMT Demo: RMT document registration failed.', error);
|
|
1493
|
+
}
|
|
1494
|
+
}
|
|
1495
|
+
|
|
1496
|
+
function initializeProductiveAdapters() {
|
|
1497
|
+
const router = document.getElementById('rmt-demo-router');
|
|
1498
|
+
if (!router || !state.document || !state.registries) return false;
|
|
1499
|
+
|
|
1500
|
+
state.adapters.router = createRmtXRouterAdapter({
|
|
1501
|
+
rmtFormat: getRmtFormat(),
|
|
1502
|
+
routerElement: router,
|
|
1503
|
+
xstate
|
|
1504
|
+
});
|
|
1505
|
+
state.adapters.component = createRmtXtendComponentAdapter({
|
|
1506
|
+
rmtFormat: getRmtFormat(),
|
|
1507
|
+
document,
|
|
1508
|
+
customElements,
|
|
1509
|
+
xstate,
|
|
1510
|
+
manifest: XTEND_COMPONENT_MANIFEST,
|
|
1511
|
+
dispatchCommand(commandName, payload) {
|
|
1512
|
+
xstate.set(commandName, payload);
|
|
1513
|
+
}
|
|
1514
|
+
});
|
|
1515
|
+
state.adapters.bridge = createRmtStateSchedulerDiagnosticsBridge({
|
|
1516
|
+
xstate,
|
|
1517
|
+
scheduler: state.runtime,
|
|
1518
|
+
schedules: state.metadata.schedules,
|
|
1519
|
+
document: state.document
|
|
1520
|
+
});
|
|
1521
|
+
|
|
1522
|
+
const stateBridgeResult = state.adapters.bridge.createStateBridge();
|
|
1523
|
+
state.stateBridge = stateBridgeResult.handle || null;
|
|
1524
|
+
recordAdapterResult(stateBridgeResult);
|
|
1525
|
+
|
|
1526
|
+
state.mappings.routes = state.adapters.router.mapRoutes(state.registries);
|
|
1527
|
+
state.mappings.components = state.adapters.component.mapComponents(state.registries, {
|
|
1528
|
+
manifest: XTEND_COMPONENT_MANIFEST
|
|
1529
|
+
});
|
|
1530
|
+
|
|
1531
|
+
return true;
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1534
|
+
function buildRoutesFromDocument() {
|
|
1535
|
+
const router = document.getElementById('rmt-demo-router');
|
|
1536
|
+
if (!router || !initializeProductiveAdapters()) return;
|
|
1537
|
+
|
|
1538
|
+
const routeResult = state.adapters.router.registerRoutes(state.registries, {
|
|
1539
|
+
mapping: state.mappings.routes,
|
|
1540
|
+
replace: true,
|
|
1541
|
+
render: false
|
|
1542
|
+
});
|
|
1543
|
+
recordAdapterResult(routeResult, { scheduleRef: 'route.visible.render' });
|
|
1544
|
+
|
|
1545
|
+
const componentResult = state.adapters.component.registerComponent(state.registries, {
|
|
1546
|
+
mapping: state.mappings.components,
|
|
1547
|
+
manifest: XTEND_COMPONENT_MANIFEST
|
|
1548
|
+
});
|
|
1549
|
+
recordAdapterResult(componentResult, { scheduleRef: 'component.visible.mount' });
|
|
1550
|
+
|
|
1551
|
+
if (!router.__xtendrmtDemoRouteHandlerBound) {
|
|
1552
|
+
router.__xtendrmtDemoRouteHandlerBound = true;
|
|
1553
|
+
router.addEventListener('route-changed', (event) => {
|
|
1554
|
+
const detail = event.detail || {};
|
|
1555
|
+
const route = findRouteFromDetail(detail);
|
|
1556
|
+
if (route) {
|
|
1557
|
+
state.activeRoute = route.path;
|
|
1558
|
+
state.activeComponent = route.component;
|
|
1559
|
+
state.activeSchedule = route.schedule || 'route.visible.render';
|
|
1560
|
+
const hydrationResult = state.adapters.component.hydrateComponent(router, route.component, {
|
|
1561
|
+
routeId: route.id,
|
|
1562
|
+
path: route.path,
|
|
1563
|
+
template: route.template,
|
|
1564
|
+
schedule: state.activeSchedule
|
|
1565
|
+
}, {
|
|
1566
|
+
mapping: state.mappings.components,
|
|
1567
|
+
manifest: XTEND_COMPONENT_MANIFEST
|
|
1568
|
+
});
|
|
1569
|
+
recordAdapterResult(hydrationResult, {
|
|
1570
|
+
scheduleRef: hydrationResult.metadata && hydrationResult.metadata.scheduleRef
|
|
1571
|
+
? hydrationResult.metadata.scheduleRef
|
|
1572
|
+
: 'component.visible.mount'
|
|
1573
|
+
});
|
|
1574
|
+
runScheduled(state.activeSchedule, `Render route ${route.path}`, async () => {
|
|
1575
|
+
setStatus(`XRouter rendered ${route.path}; RMT tracked native route ${route.id} with ${route.schedule}.`, 'success');
|
|
1576
|
+
return route;
|
|
1577
|
+
});
|
|
1578
|
+
}
|
|
1579
|
+
refreshDemoUi();
|
|
1580
|
+
});
|
|
1581
|
+
}
|
|
1582
|
+
|
|
1583
|
+
if (typeof router._handleNavigation === 'function') {
|
|
1584
|
+
router._handleNavigation();
|
|
1585
|
+
}
|
|
1586
|
+
}
|
|
1587
|
+
|
|
1588
|
+
function bindGlobalControls() {
|
|
1589
|
+
const runAll = byId('demo-run-all');
|
|
1590
|
+
if (runAll) {
|
|
1591
|
+
runAll.addEventListener('click', () => runFullCycle());
|
|
1592
|
+
}
|
|
1593
|
+
|
|
1594
|
+
const modalClose = byId('demo-modal-close');
|
|
1595
|
+
const modal = byId('rmt-demo-modal');
|
|
1596
|
+
if (modalClose && modal && typeof modal.close === 'function') {
|
|
1597
|
+
modalClose.addEventListener('click', () => modal.close());
|
|
1598
|
+
}
|
|
1599
|
+
}
|
|
1600
|
+
|
|
1601
|
+
async function loadDemoDocument() {
|
|
1602
|
+
const response = await fetch(DEMO_DOCUMENT_URL, { cache: 'no-store' });
|
|
1603
|
+
if (!response.ok) {
|
|
1604
|
+
throw new Error(`RMT document failed to load: ${response.status}`);
|
|
1605
|
+
}
|
|
1606
|
+
const rmtFormat = getRmtFormat();
|
|
1607
|
+
const documentText = await response.text();
|
|
1608
|
+
const isLegacyJson = documentText.trimStart().startsWith('{');
|
|
1609
|
+
let documentInput;
|
|
1610
|
+
let normalizedDocument;
|
|
1611
|
+
let vnextCore = null;
|
|
1612
|
+
|
|
1613
|
+
if (isLegacyJson) {
|
|
1614
|
+
documentInput = rmtFormat.parseDocument(documentText, { sourceUrl: DEMO_DOCUMENT_URL });
|
|
1615
|
+
normalizedDocument = rmtFormat.normalizeDocument(documentInput);
|
|
1616
|
+
} else {
|
|
1617
|
+
const coreResponse = await fetch(DEMO_CORE_DOCUMENT_URL, { cache: 'no-store' });
|
|
1618
|
+
if (!coreResponse.ok) {
|
|
1619
|
+
throw new Error(`RMT vNext core document failed to load: ${coreResponse.status}`);
|
|
1620
|
+
}
|
|
1621
|
+
vnextCore = await coreResponse.json();
|
|
1622
|
+
documentInput = createRuntimeDocumentFromVNextCore(vnextCore, {
|
|
1623
|
+
sourceUrl: DEMO_DOCUMENT_URL
|
|
1624
|
+
});
|
|
1625
|
+
normalizedDocument = rmtFormat.normalizeDocument(documentInput);
|
|
1626
|
+
}
|
|
1627
|
+
|
|
1628
|
+
const registries = rmtFormat.createRuntimeRegistries(normalizedDocument);
|
|
1629
|
+
const metadata = normalizedDocument && normalizedDocument.manifest && normalizedDocument.manifest.metadata
|
|
1630
|
+
? normalizedDocument.manifest.metadata
|
|
1631
|
+
: {};
|
|
1632
|
+
|
|
1633
|
+
state.vnextSource = isLegacyJson ? '' : documentText;
|
|
1634
|
+
state.vnextCore = vnextCore;
|
|
1635
|
+
state.sourceSyntax = isLegacyJson ? 'legacy-json' : 'rmt-vnext';
|
|
1636
|
+
state.rawDocument = documentInput;
|
|
1637
|
+
state.document = normalizedDocument;
|
|
1638
|
+
state.normalizedDocument = normalizedDocument;
|
|
1639
|
+
state.registries = registries;
|
|
1640
|
+
state.metadata = {
|
|
1641
|
+
adapters: Array.isArray(normalizedDocument.adapters) ? normalizedDocument.adapters : [],
|
|
1642
|
+
components: Array.isArray(normalizedDocument.components) ? normalizedDocument.components : [],
|
|
1643
|
+
routes: Array.isArray(normalizedDocument.routes) ? normalizedDocument.routes : [],
|
|
1644
|
+
schedules: Array.isArray(normalizedDocument.schedules) ? normalizedDocument.schedules : [],
|
|
1645
|
+
pilotFlow: metadata.pilotFlow || null,
|
|
1646
|
+
nativeDemoMigration: metadata.nativeDemoMigration || null
|
|
1647
|
+
};
|
|
1648
|
+
return normalizedDocument;
|
|
1649
|
+
}
|
|
1650
|
+
|
|
1651
|
+
async function initDemo() {
|
|
1652
|
+
try {
|
|
1653
|
+
ensureXTendNamespace();
|
|
1654
|
+
defineDemoRouteComponents();
|
|
1655
|
+
await waitForXtendElements();
|
|
1656
|
+
|
|
1657
|
+
state.runtime = createRmtRuntime({
|
|
1658
|
+
windowTarget: window,
|
|
1659
|
+
documentTarget: document,
|
|
1660
|
+
globalName: 'xtend.rmt',
|
|
1661
|
+
enablePrewarmWorker: false,
|
|
1662
|
+
defaults: {
|
|
1663
|
+
namespace: 'xtendrmt.demo',
|
|
1664
|
+
metadata: {
|
|
1665
|
+
host: 'xtend',
|
|
1666
|
+
demo: true
|
|
1667
|
+
}
|
|
1668
|
+
}
|
|
1669
|
+
});
|
|
1670
|
+
|
|
1671
|
+
const xtend = ensureXTendNamespace();
|
|
1672
|
+
xtend.rmt = {
|
|
1673
|
+
...(typeof xtend.rmt === 'object' ? xtend.rmt : {}),
|
|
1674
|
+
runtime: state.runtime,
|
|
1675
|
+
scheduler: {
|
|
1676
|
+
run: runScheduled,
|
|
1677
|
+
snapshot: readSchedulerSnapshot
|
|
1678
|
+
},
|
|
1679
|
+
templating: {
|
|
1680
|
+
inspect: runTemplatePilotCycle,
|
|
1681
|
+
snapshot: readPilotFlowSnapshot
|
|
1682
|
+
},
|
|
1683
|
+
router: {
|
|
1684
|
+
navigate: navigateWithRmt
|
|
1685
|
+
},
|
|
1686
|
+
demo: state
|
|
1687
|
+
};
|
|
1688
|
+
|
|
1689
|
+
await loadDemoDocument();
|
|
1690
|
+
registerDocumentWithRuntime(state.document);
|
|
1691
|
+
buildRoutesFromDocument();
|
|
1692
|
+
bindGlobalControls();
|
|
1693
|
+
|
|
1694
|
+
state.initialized = true;
|
|
1695
|
+
setStatus('XTendRMT Demo bereit: RMT vNext Core geladen, Runtime-Projektion erstellt, produktive Adapter aktiv.', 'success');
|
|
1696
|
+
refreshDemoUi();
|
|
1697
|
+
} catch (error) {
|
|
1698
|
+
console.error('XTendRMT BestCase Demo failed.', error);
|
|
1699
|
+
setStatus(`Demo konnte nicht initialisiert werden: ${error.message || error}`, 'error');
|
|
1700
|
+
}
|
|
1701
|
+
}
|
|
1702
|
+
|
|
1703
|
+
const demoApi = {
|
|
1704
|
+
state,
|
|
1705
|
+
bindRouteControls,
|
|
1706
|
+
refresh: refreshDemoUi,
|
|
1707
|
+
navigate: navigateWithRmt,
|
|
1708
|
+
runFullCycle,
|
|
1709
|
+
runHydrationCycle,
|
|
1710
|
+
runDiagnosticsCycle,
|
|
1711
|
+
runTemplatePilotCycle,
|
|
1712
|
+
readPilotFlowSnapshot,
|
|
1713
|
+
snapshot: readSchedulerSnapshot
|
|
1714
|
+
};
|
|
1715
|
+
|
|
1716
|
+
if (typeof window !== 'undefined') {
|
|
1717
|
+
window.XTendRmtDemo = demoApi;
|
|
1718
|
+
}
|
|
1719
|
+
|
|
1720
|
+
if (typeof document !== 'undefined') {
|
|
1721
|
+
if (document.readyState === 'loading') {
|
|
1722
|
+
document.addEventListener('DOMContentLoaded', initDemo, { once: true });
|
|
1723
|
+
} else {
|
|
1724
|
+
initDemo();
|
|
1725
|
+
}
|
|
1726
|
+
}
|
|
1727
|
+
|
|
1728
|
+
export { demoApi as XTendRmtDemo };
|