@ccslabs/xtend 0.1.0-rc.1 → 0.1.2
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 +2 -0
- package/README.md +4 -0
- package/catalog/component-catalog-coverage.js +2 -0
- package/catalog/epic13-package-export-lock.js +11 -1
- package/catalog/epic13-rmt-production-readiness.js +0 -1
- package/catalog/epic18-rmt-action-effect-runtime.d.ts +36 -0
- package/catalog/epic18-rmt-action-effect-runtime.js +249 -0
- package/catalog/epic18-rmt-app-platform-authoring.d.ts +39 -0
- package/catalog/epic18-rmt-app-platform-authoring.js +319 -0
- package/catalog/epic18-rmt-app-platform-fixture.d.ts +33 -0
- package/catalog/epic18-rmt-app-platform-fixture.js +221 -0
- package/catalog/epic18-rmt-app-platform-release-handoff.d.ts +30 -0
- package/catalog/epic18-rmt-app-platform-release-handoff.js +231 -0
- package/catalog/epic18-rmt-app-platform-tooling.d.ts +38 -0
- package/catalog/epic18-rmt-app-platform-tooling.js +242 -0
- package/catalog/epic18-rmt-component-template-primitives.d.ts +33 -0
- package/catalog/epic18-rmt-component-template-primitives.js +240 -0
- package/catalog/epic18-rmt-dom-descriptor-renderer.d.ts +35 -0
- package/catalog/epic18-rmt-dom-descriptor-renderer.js +232 -0
- package/catalog/epic18-rmt-event-routing-runtime.d.ts +35 -0
- package/catalog/epic18-rmt-event-routing-runtime.js +234 -0
- package/catalog/epic18-rmt-state-selector-runtime.d.ts +34 -0
- package/catalog/epic18-rmt-state-selector-runtime.js +216 -0
- package/catalog/epic18-rmt-surface-resource-graph-runtime.d.ts +36 -0
- package/catalog/epic18-rmt-surface-resource-graph-runtime.js +256 -0
- package/catalog/surface-manager-controller.js +5 -1
- package/catalog/surface-manager-materialization.js +7 -1
- package/catalog/surface-manager-overlay-bridge.js +41 -6
- package/catalog/surface-manager-workbench-fixture.js +1 -1
- package/catalog/surface-type-capability-matrix.d.ts +61 -0
- package/catalog/surface-type-capability-matrix.js +183 -0
- package/catalog/type-exports-rmt.js +37 -1
- package/catalog/type-exports.js +3 -3
- package/components/icon-packs/lucide.js +4 -0
- package/components/manifest.json +2 -0
- package/components/prism-rmt.d.ts +34 -0
- package/components/prism-rmt.js +130 -0
- package/components/xcards.js +15 -0
- package/components/xcode.d.ts +36 -1
- package/components/xcode.js +215 -20
- package/components/xfooter.js +17 -0
- package/components/xheader.js +14 -0
- package/components/xhero.js +16 -1
- package/components/xlink.js +97 -14
- package/components/xmasonry.js +15 -0
- package/components/xplayer.d.ts +44 -2
- package/components/xplayer.js +242 -15
- package/components/xrouter.js +27 -2
- package/components/xsection.js +15 -0
- package/components/xsidepanel.js +10 -2
- package/components/xsurfacemanager-controller.d.ts +2 -1
- package/components/xsurfacemanager-controller.js +27 -3
- package/components/xsurfacemanager.d.ts +2 -0
- package/components/xsurfacemanager.js +20 -8
- package/components/xsurfaceoverlay-bridge.d.ts +20 -5
- package/components/xsurfaceoverlay-bridge.js +114 -18
- package/components/xsurfaceportal.d.ts +29 -0
- package/components/xsurfaceportal.js +122 -0
- package/components/xsurfaceregion.d.ts +50 -0
- package/components/xsurfaceregion.js +285 -0
- package/components/xsurfacewindow.js +2 -1
- package/components/xtooltip.js +89 -23
- package/docs/README.md +222 -298
- package/docs/changelog.md +107 -0
- package/docs/component-catalog-coverage.md +9 -9
- package/docs/component-platform.md +19 -1
- package/docs/component-ux-app-authoring.md +56 -63
- package/docs/components/xcode.md +83 -53
- package/docs/components/xsurfaceportal.md +32 -0
- package/docs/components/xsurfaceregion.md +37 -0
- package/docs/components.md +105 -69
- package/docs/de/README.md +264 -0
- package/docs/de/XTend-ADR.md +221 -0
- package/docs/de/a11y-keyboard-smokes.md +62 -0
- package/docs/de/about.md +18 -0
- package/docs/de/api.md +157 -0
- package/docs/de/best-practices.md +76 -0
- package/docs/de/changelog.md +107 -0
- package/docs/de/component-catalog-coverage.md +58 -0
- package/docs/de/component-lab.md +103 -0
- package/docs/de/component-long-tail-migration.md +41 -0
- package/docs/de/component-platform.md +177 -0
- package/docs/de/component-ux-app-authoring.md +123 -0
- package/docs/de/component-ux-authoring.md +96 -0
- package/docs/de/component-ux-gates.md +45 -0
- package/docs/de/components/x-rmt-lifecycle-demo-build.md +60 -0
- package/docs/de/components/xalert.md +81 -0
- package/docs/de/components/xbutton.md +103 -0
- package/docs/de/components/xcalendar.md +82 -0
- package/docs/de/components/xcards.md +128 -0
- package/docs/de/components/xcheckbox.md +102 -0
- package/docs/de/components/xcode.md +156 -0
- package/docs/de/components/xdialog.md +92 -0
- package/docs/de/components/xdrawer.md +84 -0
- package/docs/de/components/xfooter.md +126 -0
- package/docs/de/components/xform.md +128 -0
- package/docs/de/components/xheader.md +308 -0
- package/docs/de/components/xhero.md +142 -0
- package/docs/de/components/xicon.md +125 -0
- package/docs/de/components/xinput.md +129 -0
- package/docs/de/components/xlightbox.md +98 -0
- package/docs/de/components/xlink.md +109 -0
- package/docs/de/components/xmasonry.md +124 -0
- package/docs/de/components/xmenu.md +158 -0
- package/docs/de/components/xmodal.md +82 -0
- package/docs/de/components/xplayer.md +104 -0
- package/docs/de/components/xpopover.md +67 -0
- package/docs/de/components/xprogress.md +56 -0
- package/docs/de/components/xradio.md +103 -0
- package/docs/de/components/xrouter.md +260 -0
- package/docs/de/components/xsection.md +125 -0
- package/docs/de/components/xselect.md +105 -0
- package/docs/de/components/xsidepanel.md +30 -0
- package/docs/de/components/xspinner.md +102 -0
- package/docs/de/components/xstate.md +148 -0
- package/docs/de/components/xstatus.md +55 -0
- package/docs/de/components/xsummary.md +78 -0
- package/docs/de/components/xsurfacemanager.md +27 -0
- package/docs/de/components/xsurfacewindow.md +21 -0
- package/docs/de/components/xtabs.md +160 -0
- package/docs/de/components/xtextarea.md +98 -0
- package/docs/de/components/xtheme.md +167 -0
- package/docs/de/components/xtoast.md +62 -0
- package/docs/de/components/xtooltip.md +66 -0
- package/docs/de/components/xtype.md +82 -0
- package/docs/de/components/xutils.md +144 -0
- package/docs/de/components/xwriter.md +94 -0
- package/docs/de/components.md +153 -0
- package/docs/de/conditional-network-evidence-ci.md +38 -0
- package/docs/de/conditional-network-evidence.md +50 -0
- package/docs/de/core-migration-guide.md +110 -0
- package/docs/de/design-tokens.md +116 -0
- package/docs/de/docs-rmt-production-hardening.md +31 -0
- package/docs/de/enterprise-adoption.md +413 -0
- package/docs/de/enterprise-component-flex-release-handoff.md +129 -0
- package/docs/de/epic10-platform-gates.md +62 -0
- package/docs/de/epic10-release-handoff.md +81 -0
- package/docs/de/epic11-enterprise-ux-handoff.md +70 -0
- package/docs/de/epic12-rc0-handoff.md +61 -0
- package/docs/de/epic18-media-manager-vendor-upstream.md +318 -0
- package/docs/de/epic18-rmt-app-platform-release-handoff.md +67 -0
- package/docs/de/epic18-vendor-bugfixes.md +34 -0
- package/docs/de/existing-component-metadata.md +67 -0
- package/docs/de/hydration-performance-closure.md +34 -0
- package/docs/de/hydration-policies.md +71 -0
- package/docs/de/known-residual-triage.md +22 -0
- package/docs/de/manifest-import-policy.md +79 -0
- package/docs/de/manifest.md +112 -0
- package/docs/de/motion-contrast.md +67 -0
- package/docs/de/package-export-lock.md +44 -0
- package/docs/de/performance-measurements.md +106 -0
- package/docs/de/performance-regression.md +89 -0
- package/docs/de/performance.md +94 -0
- package/docs/de/previews/README.md +17 -0
- package/docs/de/prod-browser-csp-smokes.md +40 -0
- package/docs/de/public-component-types.md +79 -0
- package/docs/de/quick-start-guide.md +220 -0
- package/docs/de/rc0-adoption-guide.md +102 -0
- package/docs/de/rc0-gate-matrix.md +58 -0
- package/docs/de/rc1-gate-matrix-ci-handoff.md +56 -0
- package/docs/de/rc1-migration-notes.md +69 -0
- package/docs/de/rc1-readiness.md +46 -0
- package/docs/de/release-owner-acceptance.md +56 -0
- package/docs/de/release-report-pack-dry-run-evidence.md +39 -0
- package/docs/de/rmt-action-effect-runtime.md +81 -0
- package/docs/de/rmt-app-platform-authoring.md +54 -0
- package/docs/de/rmt-app-platform-fixture.md +46 -0
- package/docs/de/rmt-app-platform-migration-guide.md +88 -0
- package/docs/de/rmt-app-platform-tooling.md +79 -0
- package/docs/de/rmt-component-template-primitives.md +57 -0
- package/docs/de/rmt-dom-descriptor-renderer.md +64 -0
- package/docs/de/rmt-dsl-authoring-polish.md +145 -0
- package/docs/de/rmt-event-routing-runtime.md +81 -0
- package/docs/de/rmt-first-demo-app.md +77 -0
- package/docs/de/rmt-first-xtend-apps.md +129 -0
- package/docs/de/rmt-kernel-panic-recovery-incident-handoff.md +61 -0
- package/docs/de/rmt-kernel-security-hardening-migration.md +50 -0
- package/docs/de/rmt-kernel-trusted-output-authoring.md +69 -0
- package/docs/de/rmt-language-server.md +234 -0
- package/docs/de/rmt-lifecycle-demo.md +24 -0
- package/docs/de/rmt-linter.md +140 -0
- package/docs/de/rmt-node-ssr-adapter.md +100 -0
- package/docs/de/rmt-php-ssr-adapter.md +120 -0
- package/docs/de/rmt-production-readiness.md +63 -0
- package/docs/de/rmt-state-selector-runtime.md +47 -0
- package/docs/de/rmt-surface-resource-graph-runtime.md +92 -0
- package/docs/de/rmt-tooling-release-gates.md +77 -0
- package/docs/de/rmt-vnext-authoring.md +170 -0
- package/docs/de/rmt-vnext-component-primitives.md +188 -0
- package/docs/de/rmt-vnext-cross-surface-events.md +68 -0
- package/docs/de/rmt-vnext-enterprise-mfe-handoff.md +70 -0
- package/docs/de/rmt-vnext-fabric-bridge-evidence.md +81 -0
- package/docs/de/rmt-vnext-migration-notes.md +62 -0
- package/docs/de/rmt-vnext-primitive-authoring-tooling.md +247 -0
- package/docs/de/rmt-vnext-primitive-grammar-design.md +289 -0
- package/docs/de/rmt-vnext-primitive-lowering.md +108 -0
- package/docs/de/rmt-vnext-primitive-migration.md +119 -0
- package/docs/de/rmt-vnext-primitive-parser-ast.md +76 -0
- package/docs/de/rmt-vnext-primitive-semantic-graph.md +118 -0
- package/docs/de/rmt-vnext-primitives-compiler-backlog.md +739 -0
- package/docs/de/rmt-vnext-release-handoff.md +83 -0
- package/docs/de/rmt-vnext-remote-surfaces.md +90 -0
- package/docs/de/rmt-vnext-source-to-sea-gate.md +612 -0
- package/docs/de/rmt-vnext-surface-registry-enterprise.md +76 -0
- package/docs/de/screenreader-signals.md +56 -0
- package/docs/de/supply-chain-gates.md +100 -0
- package/docs/de/surface-manager-authoring-guide.md +94 -0
- package/docs/de/surface-manager-browser-lab.md +45 -0
- package/docs/de/surface-manager-component-lab.md +43 -0
- package/docs/de/surface-manager-controller.md +66 -0
- package/docs/de/surface-manager-layout-engines.md +32 -0
- package/docs/de/surface-manager-lazy-hydration.md +63 -0
- package/docs/de/surface-manager-migration-guide.md +122 -0
- package/docs/de/surface-manager-native-rmt-surfaces.md +38 -0
- package/docs/de/surface-manager-overlay-bridge.md +53 -0
- package/docs/de/surface-manager-persistence.md +30 -0
- package/docs/de/surface-manager-quality-gates.md +51 -0
- package/docs/de/surface-manager-release-handoff.md +68 -0
- package/docs/de/surface-manager-remote-policy.md +54 -0
- package/docs/de/surface-manager-rmt-authoring.md +102 -0
- package/docs/de/surface-manager-route-lifecycle.md +59 -0
- package/docs/de/surface-manager-runtime-release-handoff.md +69 -0
- package/docs/de/surface-manager-side-panel-runtime.md +36 -0
- package/docs/de/surface-manager-stack-policy.md +39 -0
- package/docs/de/surface-manager-window-runtime.md +47 -0
- package/docs/de/surface-manager-workbench-fixture.md +43 -0
- package/docs/de/third-party-design-authoring.md +406 -0
- package/docs/de/trusted-dom-boundary-browser-proof.md +32 -0
- package/docs/de/trusted-dom-sanitizing.md +110 -0
- package/docs/de/type-exports.md +61 -0
- package/docs/de/typescript-components.md +63 -0
- package/docs/de/visual-browser-regression.md +83 -0
- package/docs/de/visual-owner-artifacts.md +46 -0
- package/docs/de/visual-snapshot-automation.md +87 -0
- package/docs/de/xtend-api-types.md +55 -0
- package/docs/de/xtend-builder-types.md +55 -0
- package/docs/de/xtend-catalog-types.md +44 -0
- package/docs/de/xtend-fabric-rmt-lane-mapping.md +143 -0
- package/docs/de/xtend-fabric.md +474 -0
- package/docs/de/xtend-loader-types.md +58 -0
- package/docs/de/xtend-loader.md +265 -0
- package/docs/de/xtend-policy-types.md +38 -0
- package/docs/de/xtend-rmt-types.md +40 -0
- package/docs/de/xtend-vendor-types.md +36 -0
- package/docs/de/xtendrmt-app-dsl.md +334 -0
- package/docs/de/xtendrmt-migration-guide.md +266 -0
- package/docs/de/xtendrmt-native-authoring.md +333 -0
- package/docs/de/xtendrmt-overview.md +109 -0
- package/docs/de/xtendrmt-parsedown-scheduling.md +301 -0
- package/docs/de/xtendrmt-runtime-bridge.md +155 -0
- package/docs/en/README.md +163 -0
- package/docs/en/XTend-ADR.md +221 -0
- package/docs/en/a11y-keyboard-smokes.md +68 -0
- package/docs/en/about.md +25 -0
- package/docs/en/api.md +171 -0
- package/docs/en/best-practices.md +125 -0
- package/docs/en/changelog.md +104 -0
- package/docs/en/component-catalog-coverage.md +104 -0
- package/docs/en/component-lab.md +103 -0
- package/docs/en/component-long-tail-migration.md +41 -0
- package/docs/en/component-platform.md +243 -0
- package/docs/en/component-ux-app-authoring.md +118 -0
- package/docs/en/component-ux-authoring.md +96 -0
- package/docs/en/component-ux-gates.md +45 -0
- package/docs/en/components/x-rmt-lifecycle-demo-build.md +75 -0
- package/docs/en/components/xalert.md +94 -0
- package/docs/en/components/xbutton.md +118 -0
- package/docs/en/components/xcalendar.md +95 -0
- package/docs/en/components/xcards.md +139 -0
- package/docs/en/components/xcheckbox.md +118 -0
- package/docs/en/components/xcode.md +153 -0
- package/docs/en/components/xdialog.md +108 -0
- package/docs/en/components/xdrawer.md +110 -0
- package/docs/en/components/xfooter.md +138 -0
- package/docs/en/components/xform.md +147 -0
- package/docs/en/components/xheader.md +308 -0
- package/docs/en/components/xhero.md +157 -0
- package/docs/en/components/xicon.md +149 -0
- package/docs/en/components/xinput.md +147 -0
- package/docs/en/components/xlightbox.md +113 -0
- package/docs/en/components/xlink.md +130 -0
- package/docs/en/components/xmasonry.md +136 -0
- package/docs/en/components/xmenu.md +185 -0
- package/docs/en/components/xmodal.md +102 -0
- package/docs/en/components/xplayer.md +114 -0
- package/docs/en/components/xpopover.md +87 -0
- package/docs/en/components/xprogress.md +73 -0
- package/docs/en/components/xradio.md +119 -0
- package/docs/en/components/xrouter.md +260 -0
- package/docs/en/components/xsection.md +136 -0
- package/docs/en/components/xselect.md +122 -0
- package/docs/en/components/xsidepanel.md +48 -0
- package/docs/en/components/xspinner.md +118 -0
- package/docs/en/components/xstate.md +163 -0
- package/docs/en/components/xstatus.md +71 -0
- package/docs/en/components/xsummary.md +90 -0
- package/docs/en/components/xsurfacemanager.md +42 -0
- package/docs/en/components/xsurfacewindow.md +31 -0
- package/docs/en/components/xtabs.md +187 -0
- package/docs/en/components/xtextarea.md +115 -0
- package/docs/en/components/xtheme.md +203 -0
- package/docs/en/components/xtoast.md +78 -0
- package/docs/en/components/xtooltip.md +85 -0
- package/docs/en/components/xtype.md +91 -0
- package/docs/en/components/xutils.md +161 -0
- package/docs/en/components/xwriter.md +106 -0
- package/docs/en/components.md +151 -0
- package/docs/en/conditional-network-evidence-ci.md +38 -0
- package/docs/en/conditional-network-evidence.md +50 -0
- package/docs/en/core-migration-guide.md +110 -0
- package/docs/en/design-tokens.md +137 -0
- package/docs/en/docs-rmt-production-hardening.md +31 -0
- package/docs/en/enterprise-adoption.md +413 -0
- package/docs/en/enterprise-component-flex-release-handoff.md +129 -0
- package/docs/en/epic10-platform-gates.md +62 -0
- package/docs/en/epic10-release-handoff.md +81 -0
- package/docs/en/epic11-enterprise-ux-handoff.md +70 -0
- package/docs/en/epic12-rc0-handoff.md +61 -0
- package/docs/en/epic18-media-manager-vendor-upstream.md +232 -0
- package/docs/en/epic18-rmt-app-platform-release-handoff.md +60 -0
- package/docs/en/epic18-vendor-bugfixes.md +29 -0
- package/docs/en/existing-component-metadata.md +67 -0
- package/docs/en/hydration-performance-closure.md +34 -0
- package/docs/en/hydration-policies.md +75 -0
- package/docs/en/known-residual-triage.md +22 -0
- package/docs/en/manifest-import-policy.md +81 -0
- package/docs/en/manifest.md +135 -0
- package/docs/en/motion-contrast.md +67 -0
- package/docs/en/package-export-lock.md +44 -0
- package/docs/en/performance-measurements.md +106 -0
- package/docs/en/performance-regression.md +89 -0
- package/docs/en/performance.md +132 -0
- package/docs/en/previews/README.md +17 -0
- package/docs/en/prod-browser-csp-smokes.md +40 -0
- package/docs/en/public-component-types.md +79 -0
- package/docs/en/quick-start-guide.md +189 -0
- package/docs/en/rc0-adoption-guide.md +102 -0
- package/docs/en/rc0-gate-matrix.md +58 -0
- package/docs/en/rc1-gate-matrix-ci-handoff.md +56 -0
- package/docs/en/rc1-migration-notes.md +69 -0
- package/docs/en/rc1-readiness.md +46 -0
- package/docs/en/release-owner-acceptance.md +56 -0
- package/docs/en/release-report-pack-dry-run-evidence.md +39 -0
- package/docs/en/rmt-action-effect-runtime.md +101 -0
- package/docs/en/rmt-app-platform-authoring.md +47 -0
- package/docs/en/rmt-app-platform-fixture.md +35 -0
- package/docs/en/rmt-app-platform-migration-guide.md +75 -0
- package/docs/en/rmt-app-platform-tooling.md +58 -0
- package/docs/en/rmt-component-template-primitives.md +49 -0
- package/docs/en/rmt-dom-descriptor-renderer.md +54 -0
- package/docs/en/rmt-dsl-authoring-polish.md +143 -0
- package/docs/en/rmt-event-routing-runtime.md +98 -0
- package/docs/en/rmt-first-demo-app.md +87 -0
- package/docs/en/rmt-first-xtend-apps.md +127 -0
- package/docs/en/rmt-kernel-panic-recovery-incident-handoff.md +60 -0
- package/docs/en/rmt-kernel-security-hardening-migration.md +49 -0
- package/docs/en/rmt-kernel-trusted-output-authoring.md +68 -0
- package/docs/en/rmt-language-server.md +243 -0
- package/docs/en/rmt-lifecycle-demo.md +23 -0
- package/docs/en/rmt-linter.md +146 -0
- package/docs/en/rmt-node-ssr-adapter.md +99 -0
- package/docs/en/rmt-php-ssr-adapter.md +118 -0
- package/docs/en/rmt-production-readiness.md +63 -0
- package/docs/en/rmt-state-selector-runtime.md +34 -0
- package/docs/en/rmt-surface-resource-graph-runtime.md +68 -0
- package/docs/en/rmt-tooling-release-gates.md +77 -0
- package/docs/en/rmt-vnext-authoring.md +102 -0
- package/docs/en/rmt-vnext-component-primitives.md +185 -0
- package/docs/en/rmt-vnext-cross-surface-events.md +59 -0
- package/docs/en/rmt-vnext-enterprise-mfe-handoff.md +62 -0
- package/docs/en/rmt-vnext-fabric-bridge-evidence.md +64 -0
- package/docs/en/rmt-vnext-migration-notes.md +62 -0
- package/docs/en/rmt-vnext-primitive-authoring-tooling.md +174 -0
- package/docs/en/rmt-vnext-primitive-grammar-design.md +268 -0
- package/docs/en/rmt-vnext-primitive-lowering.md +91 -0
- package/docs/en/rmt-vnext-primitive-migration.md +93 -0
- package/docs/en/rmt-vnext-primitive-parser-ast.md +59 -0
- package/docs/en/rmt-vnext-primitive-semantic-graph.md +103 -0
- package/docs/en/rmt-vnext-primitives-compiler-backlog.md +327 -0
- package/docs/en/rmt-vnext-release-handoff.md +83 -0
- package/docs/en/rmt-vnext-remote-surfaces.md +81 -0
- package/docs/en/rmt-vnext-source-to-sea-gate.md +482 -0
- package/docs/en/rmt-vnext-surface-registry-enterprise.md +68 -0
- package/docs/en/screenreader-signals.md +56 -0
- package/docs/en/supply-chain-gates.md +106 -0
- package/docs/en/surface-manager-authoring-guide.md +94 -0
- package/docs/en/surface-manager-browser-lab.md +45 -0
- package/docs/en/surface-manager-component-lab.md +43 -0
- package/docs/en/surface-manager-controller.md +66 -0
- package/docs/en/surface-manager-layout-engines.md +32 -0
- package/docs/en/surface-manager-lazy-hydration.md +63 -0
- package/docs/en/surface-manager-migration-guide.md +113 -0
- package/docs/en/surface-manager-native-rmt-surfaces.md +38 -0
- package/docs/en/surface-manager-overlay-bridge.md +53 -0
- package/docs/en/surface-manager-persistence.md +30 -0
- package/docs/en/surface-manager-quality-gates.md +51 -0
- package/docs/en/surface-manager-release-handoff.md +68 -0
- package/docs/en/surface-manager-remote-policy.md +54 -0
- package/docs/en/surface-manager-rmt-authoring.md +89 -0
- package/docs/en/surface-manager-route-lifecycle.md +59 -0
- package/docs/en/surface-manager-runtime-release-handoff.md +69 -0
- package/docs/en/surface-manager-side-panel-runtime.md +36 -0
- package/docs/en/surface-manager-stack-policy.md +39 -0
- package/docs/en/surface-manager-window-runtime.md +47 -0
- package/docs/en/surface-manager-workbench-fixture.md +43 -0
- package/docs/en/third-party-design-authoring.md +406 -0
- package/docs/en/trusted-dom-boundary-browser-proof.md +32 -0
- package/docs/en/trusted-dom-sanitizing.md +124 -0
- package/docs/en/type-exports.md +61 -0
- package/docs/en/typescript-components.md +63 -0
- package/docs/en/visual-browser-regression.md +83 -0
- package/docs/en/visual-owner-artifacts.md +46 -0
- package/docs/en/visual-snapshot-automation.md +87 -0
- package/docs/en/xtend-api-types.md +55 -0
- package/docs/en/xtend-builder-types.md +55 -0
- package/docs/en/xtend-catalog-types.md +44 -0
- package/docs/en/xtend-fabric-rmt-lane-mapping.md +143 -0
- package/docs/en/xtend-fabric.md +474 -0
- package/docs/en/xtend-loader-types.md +58 -0
- package/docs/en/xtend-loader.md +265 -0
- package/docs/en/xtend-policy-types.md +38 -0
- package/docs/en/xtend-rmt-types.md +40 -0
- package/docs/en/xtend-vendor-types.md +36 -0
- package/docs/en/xtendrmt-app-dsl.md +331 -0
- package/docs/en/xtendrmt-migration-guide.md +256 -0
- package/docs/en/xtendrmt-native-authoring.md +336 -0
- package/docs/en/xtendrmt-overview.md +63 -0
- package/docs/en/xtendrmt-parsedown-scheduling.md +301 -0
- package/docs/en/xtendrmt-runtime-bridge.md +155 -0
- package/docs/enterprise-adoption.md +4 -2
- package/docs/epic18-media-manager-vendor-upstream.md +318 -0
- package/docs/epic18-rmt-app-platform-release-handoff.md +67 -0
- package/docs/epic18-vendor-bugfixes.md +34 -0
- package/docs/index.php +1056 -109
- package/docs/manifest.md +8 -2
- package/docs/menu.json +986 -133
- package/docs/package-export-lock.md +2 -2
- package/docs/public-component-types.md +2 -2
- package/docs/quick-start-guide.md +126 -58
- package/docs/rmt-action-effect-runtime.md +101 -0
- package/docs/rmt-app-platform-authoring.md +54 -0
- package/docs/rmt-app-platform-fixture.md +46 -0
- package/docs/rmt-app-platform-migration-guide.md +88 -0
- package/docs/rmt-app-platform-tooling.md +79 -0
- package/docs/rmt-component-template-primitives.md +57 -0
- package/docs/rmt-dom-descriptor-renderer.md +64 -0
- package/docs/rmt-dsl-authoring-polish.md +67 -44
- package/docs/rmt-event-routing-runtime.md +98 -0
- package/docs/rmt-first-demo-app.md +2 -2
- package/docs/rmt-first-xtend-apps.md +70 -46
- package/docs/rmt-language-server.md +61 -4
- package/docs/rmt-lifecycle-demo.md +1 -2
- package/docs/rmt-node-ssr-adapter.md +144 -0
- package/docs/rmt-php-ssr-adapter.md +158 -0
- package/docs/rmt-state-selector-runtime.md +47 -0
- package/docs/rmt-surface-resource-graph-runtime.md +92 -0
- package/docs/rmt-vnext-authoring.md +128 -18
- package/docs/rmt-vnext-component-primitives.md +188 -0
- package/docs/rmt-vnext-fabric-bridge-evidence.md +81 -0
- package/docs/rmt-vnext-primitive-authoring-tooling.md +247 -0
- package/docs/rmt-vnext-primitive-grammar-design.md +289 -0
- package/docs/rmt-vnext-primitive-lowering.md +108 -0
- package/docs/rmt-vnext-primitive-migration.md +119 -0
- package/docs/rmt-vnext-primitive-parser-ast.md +76 -0
- package/docs/rmt-vnext-primitive-semantic-graph.md +118 -0
- package/docs/rmt-vnext-primitives-compiler-backlog.md +742 -0
- package/docs/rmt-vnext-release-handoff.md +14 -0
- package/docs/rmt-vnext-source-to-sea-gate.md +629 -0
- package/docs/surface-manager-migration-guide.md +34 -6
- package/docs/surface-manager-overlay-bridge.md +9 -4
- package/docs/surface-manager-rmt-authoring.md +50 -34
- package/docs/surface-manager-workbench-fixture.md +1 -2
- package/docs/third-party-design-authoring.md +1 -1
- package/docs/type-exports.md +3 -3
- package/docs/utils/pageloader.js +811 -62
- package/docs/visual-browser-regression.md +1 -1
- package/docs/xtend-rmt-types.md +3 -2
- package/docs/xtendrmt-app-dsl.md +187 -122
- package/docs/xtendrmt-docs-shell-vnext.rmt +165 -0
- package/docs/xtendrmt-migration-guide.md +48 -17
- package/docs/xtendrmt-native-authoring.md +213 -217
- package/docs/xtendrmt-overview.md +81 -61
- package/docs/xtendrmt-parsedown-scheduling.md +23 -8
- package/fabric/package.json +1 -1
- package/package.json +684 -21
- package/tools/package.json +5 -1
- package/tools/rmt-editor/vscode/README.md +72 -5
- package/tools/rmt-editor/vscode/XTend-Logo.png +0 -0
- package/tools/rmt-editor/vscode/extension.d.ts +33 -0
- package/tools/rmt-editor/vscode/extension.js +1816 -7
- package/tools/rmt-editor/vscode/language-configuration.json +2 -1
- package/tools/rmt-editor/vscode/package.json +193 -2
- package/tools/rmt-editor/vscode/snippets/rmt.code-snippets +41 -0
- package/tools/rmt-editor/vscode/syntaxes/rmt.tmLanguage.json +103 -1
- package/tools/rmt-editor/vscode/templates/launch.json +70 -0
- package/tools/rmt-editor/vscode/templates/tasks.json +172 -0
- package/tools/rmt-editor/vscode/xtend-rmt-language-0.0.0-enterprise-readiness.vsix +0 -0
- package/tools/rmt-language/app-platform-tooling.d.ts +128 -0
- package/tools/rmt-language/app-platform-tooling.js +677 -0
- package/tools/rmt-language/completions.d.ts +5 -0
- package/tools/rmt-language/completions.js +185 -3
- package/tools/rmt-language/diagnostics.js +54 -0
- package/tools/rmt-language/hover.js +36 -0
- package/tools/rmt-language/rmt-tooling-public-types.d.ts +7 -0
- package/tools/rmt-language/rules/app-platform-policy.js +39 -0
- package/tools/rmt-language/rules/index.js +5 -1
- package/tools/rmt-language/semantic-graph.d.ts +6 -0
- package/tools/rmt-language/semantic-graph.js +928 -0
- package/tools/rmt-language/snippets/index.js +44 -0
- package/tools/rmt-language/snippets/rmt.code-snippets +41 -0
- package/tools/rmt-language/vnext-compatibility.d.ts +10 -0
- package/tools/rmt-language/vnext-compatibility.js +642 -0
- package/tools/rmt-language/vnext-compiler.d.ts +5 -0
- package/tools/rmt-language/vnext-compiler.js +863 -17
- package/tools/rmt-language/vnext-parser.js +725 -9
- package/tools/rmt-language/vnext-release.d.ts +1 -0
- package/tools/rmt-language/vnext-release.js +20 -0
- package/tools/rmt-language/vnext-source-to-sea.d.ts +33 -0
- package/tools/rmt-language/vnext-source-to-sea.js +2227 -0
- package/tools/rmt-language/vnext-surfaces.js +111 -52
- package/tools/rmt-language/vnext-tooling.d.ts +19 -1
- package/tools/rmt-language/vnext-tooling.js +1247 -5
- package/tools/rmt-language-server/protocol.js +3 -0
- package/tools/rmt-language-server/server.d.ts +2 -0
- package/tools/rmt-language-server/server.js +176 -22
- package/tools/rmt-linter/cli.d.ts +2 -0
- package/tools/rmt-linter/cli.js +62 -0
- package/xtend-builder/generators/registry.js +11 -0
- package/xtend-builder/generators/rmt-app-platform.js +239 -0
- package/xtend-builder/generators/rmt-lifecycle-demo.js +3 -11
- package/xtend-builder/lib/cli.js +38 -0
- package/xtend-builder/package.json +3 -3
- package/xtend-builder/scaffold.config.js +29 -2
- package/xtend.css +49 -2
- package/xtendrmt/package.json +49 -1
- package/xtendrmt/rmt-action-effect-runtime.d.ts +126 -0
- package/xtendrmt/rmt-action-effect-runtime.js +494 -0
- package/xtendrmt/rmt-component-capability-registry.d.ts +180 -0
- package/xtendrmt/rmt-component-capability-registry.js +636 -0
- package/xtendrmt/rmt-core.d.ts +6 -0
- package/xtendrmt/rmt-core.esm.js +32 -6
- package/xtendrmt/rmt-dom-descriptor-renderer.d.ts +107 -0
- package/xtendrmt/rmt-dom-descriptor-renderer.js +1066 -0
- package/xtendrmt/rmt-event-routing-runtime.d.ts +144 -0
- package/xtendrmt/rmt-event-routing-runtime.js +666 -0
- package/xtendrmt/rmt-lifecycle-demo.app.js +2 -2
- package/xtendrmt/rmt-lifecycle-demo.core.json +4 -0
- package/xtendrmt/rmt-lifecycle-demo.rmt-build.app.js +1 -1
- package/xtendrmt/rmt-lifecycle-demo.rmt-build.scaffold.json +2 -2
- package/xtendrmt/rmt-lifecycle-demo.scaffold.json +4 -4
- package/xtendrmt/rmt-native-shell-runtime.d.ts +77 -0
- package/xtendrmt/rmt-native-shell-runtime.js +309 -0
- package/xtendrmt/rmt-node-ssr-adapter.d.ts +197 -0
- package/xtendrmt/rmt-node-ssr-adapter.js +1006 -0
- package/xtendrmt/rmt-php-ssr-adapter.php +976 -0
- package/xtendrmt/rmt-runtime.browser.js +32 -6
- package/xtendrmt/rmt-runtime.esm.js +32 -6
- package/xtendrmt/rmt-state-selector-runtime.d.ts +166 -0
- package/xtendrmt/rmt-state-selector-runtime.js +866 -0
- package/xtendrmt/rmt-surface-resource-graph-runtime.d.ts +224 -0
- package/xtendrmt/rmt-surface-resource-graph-runtime.js +932 -0
- package/xtendrmt/rmt-vnext-enterprise-mfe-demo.core.json +3 -0
- package/xtendrmt/rmt-vnext-reference-demo.core.json +3 -0
- package/xtendrmt/xtendrmt-bestcase-demo.core.json +3420 -372
- package/xtendrmt/xtendrmt-bestcase-demo.js +424 -8
- package/xtendrmt/xtendrmt-bestcase-demo.rmt +214 -6
|
@@ -4,15 +4,60 @@ const {
|
|
|
4
4
|
RMT_VNEXT_PARSER_WORKPACKAGE,
|
|
5
5
|
parseRmtVNextSource
|
|
6
6
|
} = require('./vnext-parser');
|
|
7
|
+
const {
|
|
8
|
+
buildRmtVNextPrimitiveSemanticGraph
|
|
9
|
+
} = require('./semantic-graph');
|
|
7
10
|
|
|
8
11
|
const RMT_VNEXT_CORE_SCHEMA = 'xtend.rmt.core-format.vnext.v1';
|
|
9
12
|
const RMT_VNEXT_COMPILER_SCHEMA = 'xtend.rmt.vnext-compiler.v1';
|
|
10
13
|
const RMT_VNEXT_COMPILER_REPORT_SCHEMA = 'xtend.rmt.vnext-compiler-report.v1';
|
|
11
14
|
const RMT_VNEXT_COMPILER_WORKPACKAGE = 'WP-E15-05';
|
|
15
|
+
const RMT_VNEXT_PRIMITIVE_LOWERING_SCHEMA = 'xtend.rmt.vnext.primitive-lowering.v1';
|
|
16
|
+
const RMT_VNEXT_PRIMITIVE_LOWERING_WORKPACKAGE = 'RMT-VNEXT-PRIM-04';
|
|
12
17
|
const RMT_VNEXT_COMPILER_MODULE_PATH = 'tools/rmt-language/vnext-compiler.js';
|
|
13
18
|
const RMT_VNEXT_COMPILER_SUITE_PATH = 'tests/rmt-language/rmt_vnext_compiler_suite.js';
|
|
14
19
|
const RMT_VNEXT_COMPILER_PACKAGE_SCRIPT = 'npm run test:rmt-vnext-compiler';
|
|
15
20
|
const RMT_VNEXT_COMPILER_DIAGNOSTIC_CODE = 'rmt.vnext.compiler.diagnostic';
|
|
21
|
+
const RMT_KERNEL_RECORDS_SCHEMA = 'xtend.rmt.vnext.kernel-records.v1';
|
|
22
|
+
const RMT_APP_PLATFORM_RECORDS_SCHEMA = 'xtend.rmt.vnext.app-platform-records.v1';
|
|
23
|
+
const RMT_KERNEL_BOUNDARY = 'no-rmt-kernel-import-of-host-runtime-types';
|
|
24
|
+
const PRIMITIVE_DECLARATION_TYPES = new Set([
|
|
25
|
+
'RmtStateDeclaration',
|
|
26
|
+
'RmtSelectorDeclaration',
|
|
27
|
+
'RmtDataSourceDeclaration',
|
|
28
|
+
'RmtActionDeclaration',
|
|
29
|
+
'RmtPortalDeclaration',
|
|
30
|
+
'RmtOverlayDeclaration',
|
|
31
|
+
'RmtResourceDeclaration'
|
|
32
|
+
]);
|
|
33
|
+
const PRIMITIVE_SURFACE_CLAUSE_TYPES = new Set([
|
|
34
|
+
'RmtSurfaceSourceClause',
|
|
35
|
+
'RmtSurfaceRepeatClause',
|
|
36
|
+
'RmtSurfaceKeyClause',
|
|
37
|
+
'RmtSurfacePortalClause',
|
|
38
|
+
'RmtSurfaceBoundsClause',
|
|
39
|
+
'RmtSurfacePreserveClause',
|
|
40
|
+
'RmtSurfaceDestroyClause'
|
|
41
|
+
]);
|
|
42
|
+
const PRIMITIVE_SOURCE_KINDS = new Set([
|
|
43
|
+
'action',
|
|
44
|
+
'datasource',
|
|
45
|
+
'dataSource',
|
|
46
|
+
'overlay',
|
|
47
|
+
'portal',
|
|
48
|
+
'resource',
|
|
49
|
+
'selector',
|
|
50
|
+
'state',
|
|
51
|
+
'surface'
|
|
52
|
+
]);
|
|
53
|
+
|
|
54
|
+
function lowerSurfaceKindToRuntimeType(kind, fallback = 'window') {
|
|
55
|
+
const candidate = String(kind || '').trim().toLowerCase();
|
|
56
|
+
if (['root', 'workspace', 'page', 'card', 'list', 'region', 'overlay-host'].includes(candidate)) return 'region';
|
|
57
|
+
if (['panel', 'side-panel', 'sidepanel'].includes(candidate)) return 'side-panel';
|
|
58
|
+
if (['window', 'modal', 'dialog', 'drawer', 'popover', 'tooltip', 'toast', 'lightbox', 'menu'].includes(candidate)) return candidate;
|
|
59
|
+
return fallback;
|
|
60
|
+
}
|
|
16
61
|
|
|
17
62
|
function normalizeIdSegment(value, fallback = 'unnamed') {
|
|
18
63
|
const normalized = String(value || fallback)
|
|
@@ -66,8 +111,17 @@ function createCoreDocument(manifest = {}) {
|
|
|
66
111
|
slots: [],
|
|
67
112
|
events: [],
|
|
68
113
|
dataSources: [],
|
|
114
|
+
states: [],
|
|
115
|
+
selectors: [],
|
|
116
|
+
actions: [],
|
|
117
|
+
effects: [],
|
|
118
|
+
portals: [],
|
|
119
|
+
overlays: [],
|
|
120
|
+
resources: [],
|
|
69
121
|
securityPolicies: [],
|
|
70
|
-
sourceMap: []
|
|
122
|
+
sourceMap: [],
|
|
123
|
+
appPlatform: null,
|
|
124
|
+
kernelRecords: null
|
|
71
125
|
};
|
|
72
126
|
}
|
|
73
127
|
|
|
@@ -214,6 +268,380 @@ function eventVersionFromName(eventName) {
|
|
|
214
268
|
return match ? `v${match[1]}` : '';
|
|
215
269
|
}
|
|
216
270
|
|
|
271
|
+
function toArray(value) {
|
|
272
|
+
return Array.isArray(value) ? value : [];
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
function primitiveValueToCore(value) {
|
|
276
|
+
if (!value || typeof value !== 'object') return null;
|
|
277
|
+
|
|
278
|
+
if (value.kind === 'literal') {
|
|
279
|
+
return value.value;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
if (value.kind === 'array') {
|
|
283
|
+
return toArray(value.items).map((entry) => primitiveValueToCore(entry));
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
if (value.kind === 'object') {
|
|
287
|
+
return toArray(value.fields).reduce((objectValue, field) => {
|
|
288
|
+
if (field && field.key) {
|
|
289
|
+
objectValue[field.key] = primitiveValueToCore(field.value);
|
|
290
|
+
}
|
|
291
|
+
return objectValue;
|
|
292
|
+
}, {});
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
if (value.kind === 'path') {
|
|
296
|
+
return value.value || toArray(value.path).join('.');
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
if (Object.prototype.hasOwnProperty.call(value, 'value')) {
|
|
300
|
+
return value.value;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
return null;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
function primitiveValueToString(value) {
|
|
307
|
+
const coreValue = primitiveValueToCore(value);
|
|
308
|
+
if (coreValue === null || coreValue === undefined) return '';
|
|
309
|
+
return String(coreValue).trim();
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
function primitiveRecordId(kind, name) {
|
|
313
|
+
return `${kind}:${normalizeIdSegment(name)}`;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
function getPrimitiveAttribute(node, keyword) {
|
|
317
|
+
return toArray(node && node.attributes).find((attribute) => attribute && attribute.keyword === keyword) || null;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
function getPrimitiveAttributeValue(node, keyword) {
|
|
321
|
+
const attribute = getPrimitiveAttribute(node, keyword);
|
|
322
|
+
return attribute ? primitiveValueToCore(attribute.value) : null;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
function getPrimitiveHeaderValue(node, keyword) {
|
|
326
|
+
const header = toArray(node && node.metadata).find((entry) => entry && entry.keyword === keyword) || null;
|
|
327
|
+
return header ? primitiveValueToCore(header.value) : null;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
function getPrimitiveBodyNode(node, type) {
|
|
331
|
+
return toArray(node && node.body).find((entry) => entry && entry.type === type) || null;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
function getPrimitiveBodyNodes(node, type) {
|
|
335
|
+
return toArray(node && node.body).filter((entry) => entry && entry.type === type);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
function compilePrimitiveSourceReference(source) {
|
|
339
|
+
if (!source || typeof source !== 'object') return null;
|
|
340
|
+
const kind = source.kind || null;
|
|
341
|
+
const target = source.target || source.value || source.ref || null;
|
|
342
|
+
if (!kind && !target) return null;
|
|
343
|
+
|
|
344
|
+
const normalizedKind = kind === 'datasource' ? 'dataSource' : kind;
|
|
345
|
+
const result = {
|
|
346
|
+
kind: normalizedKind,
|
|
347
|
+
target
|
|
348
|
+
};
|
|
349
|
+
|
|
350
|
+
if (target && PRIMITIVE_SOURCE_KINDS.has(kind)) {
|
|
351
|
+
const refKind = kind === 'datasource' ? 'dataSource' : kind;
|
|
352
|
+
result.ref = primitiveRecordId(refKind, target);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
return result;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
function compileInlinePrimitiveFields(fields) {
|
|
359
|
+
return toArray(fields).reduce((result, field) => {
|
|
360
|
+
if (field && field.key) {
|
|
361
|
+
result[field.key] = primitiveValueToCore(field.value);
|
|
362
|
+
}
|
|
363
|
+
return result;
|
|
364
|
+
}, {});
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
function compileInitialBlock(node) {
|
|
368
|
+
const block = getPrimitiveBodyNode(node, 'RmtInitialBlock');
|
|
369
|
+
if (!block) return null;
|
|
370
|
+
return toArray(block.body).reduce((initial, entry) => {
|
|
371
|
+
if (entry && entry.key) {
|
|
372
|
+
initial[entry.key] = primitiveValueToCore(entry.value);
|
|
373
|
+
}
|
|
374
|
+
return initial;
|
|
375
|
+
}, {});
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
function compileSelectorClause(node) {
|
|
379
|
+
if (node.type === 'RmtSelectorWhereClause') {
|
|
380
|
+
return {
|
|
381
|
+
kind: 'where',
|
|
382
|
+
text: node.text || ''
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
if (node.type === 'RmtSelectorFindClause') {
|
|
387
|
+
return {
|
|
388
|
+
kind: 'find',
|
|
389
|
+
text: node.text || ''
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
if (node.type === 'RmtSelectorSortClause') {
|
|
394
|
+
return {
|
|
395
|
+
kind: 'sort',
|
|
396
|
+
by: node.by || null,
|
|
397
|
+
direction: node.direction || 'asc'
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
if (node.type === 'RmtSelectorOutputClause') {
|
|
402
|
+
return {
|
|
403
|
+
kind: 'output',
|
|
404
|
+
type: node.dataType && node.dataType.value || null
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
return null;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
function compileEventPayloadContract(eventNode) {
|
|
412
|
+
const mappings = toArray(eventNode && eventNode.policy && eventNode.policy.body)
|
|
413
|
+
.filter((entry) => entry && entry.type === 'RmtEventPayloadMapping')
|
|
414
|
+
.map((entry) => ({
|
|
415
|
+
name: entry.name,
|
|
416
|
+
source: entry.source
|
|
417
|
+
}));
|
|
418
|
+
|
|
419
|
+
if (mappings.length === 0) return null;
|
|
420
|
+
|
|
421
|
+
return {
|
|
422
|
+
type: 'object',
|
|
423
|
+
required: mappings.map((entry) => entry.name).filter(Boolean),
|
|
424
|
+
mappings
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
function compileEventOptions(eventNode) {
|
|
429
|
+
return toArray(eventNode && eventNode.policy && eventNode.policy.body)
|
|
430
|
+
.filter((entry) => entry && entry.type === 'RmtEventOptionClause')
|
|
431
|
+
.reduce((options, entry) => {
|
|
432
|
+
if (entry.keyword) {
|
|
433
|
+
options[entry.keyword] = primitiveValueToCore(entry.value);
|
|
434
|
+
}
|
|
435
|
+
return options;
|
|
436
|
+
}, {});
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
function parseOwnerReference(owner) {
|
|
440
|
+
const match = String(owner || '').trim().match(/^([A-Za-z][A-Za-z0-9_-]*)\.(.+)$/);
|
|
441
|
+
if (!match) {
|
|
442
|
+
return null;
|
|
443
|
+
}
|
|
444
|
+
return {
|
|
445
|
+
kind: match[1],
|
|
446
|
+
id: match[2],
|
|
447
|
+
ref: primitiveRecordId(match[1], match[2])
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
function hasPrimitiveDeclarations(ast) {
|
|
452
|
+
let found = false;
|
|
453
|
+
|
|
454
|
+
function walk(node) {
|
|
455
|
+
if (found || !node || typeof node !== 'object') return;
|
|
456
|
+
if (PRIMITIVE_DECLARATION_TYPES.has(node.type)) {
|
|
457
|
+
found = true;
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
if (node.type === 'RmtSurfaceDeclaration') {
|
|
461
|
+
if (toArray(node.metadata).length > 0 || toArray(node.body).some((entry) => entry && (PRIMITIVE_SURFACE_CLAUSE_TYPES.has(entry.type) || entry.type === 'RmtEventBinding'))) {
|
|
462
|
+
found = true;
|
|
463
|
+
return;
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
['body', 'attributes', 'metadata', 'payload', 'source', 'condition', 'policy', 'expression', 'left', 'right', 'argument', 'value', 'dataType', 'initial'].forEach((key) => {
|
|
467
|
+
const value = node[key];
|
|
468
|
+
if (Array.isArray(value)) value.forEach(walk);
|
|
469
|
+
else if (value && typeof value === 'object') walk(value);
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
walk(ast);
|
|
474
|
+
return found;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
function hasPrimitiveCoreRecords(core) {
|
|
478
|
+
return ['states', 'selectors', 'actions', 'effects', 'portals', 'overlays', 'resources'].some((domain) => core[domain].length > 0)
|
|
479
|
+
|| core.surfaces.some((surface) => surface.primitive === true);
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
function createAppPlatformRecords(core) {
|
|
483
|
+
return {
|
|
484
|
+
schema: RMT_APP_PLATFORM_RECORDS_SCHEMA,
|
|
485
|
+
workpackage: RMT_VNEXT_PRIMITIVE_LOWERING_WORKPACKAGE,
|
|
486
|
+
sourceSyntax: 'rmt-vnext',
|
|
487
|
+
state: core.states.map((record) => ({
|
|
488
|
+
id: record.name,
|
|
489
|
+
type: record.type,
|
|
490
|
+
preserve: record.preserve,
|
|
491
|
+
initial: record.initial
|
|
492
|
+
})),
|
|
493
|
+
selectors: core.selectors.map((record) => ({
|
|
494
|
+
id: record.name,
|
|
495
|
+
from: record.source && record.source.target,
|
|
496
|
+
clauses: record.clauses,
|
|
497
|
+
output: record.output
|
|
498
|
+
})),
|
|
499
|
+
dataSources: core.dataSources
|
|
500
|
+
.filter((record) => record.primitive === true)
|
|
501
|
+
.map((record) => ({
|
|
502
|
+
id: record.name,
|
|
503
|
+
kind: record.kind,
|
|
504
|
+
target: record.target,
|
|
505
|
+
method: record.method,
|
|
506
|
+
contract: record.contract,
|
|
507
|
+
result: record.result,
|
|
508
|
+
fallback: record.fallback
|
|
509
|
+
})),
|
|
510
|
+
actions: core.actions.map((record) => ({
|
|
511
|
+
id: record.name,
|
|
512
|
+
inputs: record.inputs,
|
|
513
|
+
status: record.status,
|
|
514
|
+
reducers: record.reducers,
|
|
515
|
+
emits: record.emits,
|
|
516
|
+
effects: record.effectRefs
|
|
517
|
+
})),
|
|
518
|
+
portals: core.portals.map((record) => ({
|
|
519
|
+
id: record.name,
|
|
520
|
+
root: record.root,
|
|
521
|
+
layer: record.layer,
|
|
522
|
+
z: record.z,
|
|
523
|
+
policies: record.policies
|
|
524
|
+
})),
|
|
525
|
+
overlays: core.overlays.map((record) => ({
|
|
526
|
+
id: record.name,
|
|
527
|
+
kind: record.kind,
|
|
528
|
+
portal: record.portal && record.portal.target,
|
|
529
|
+
policies: record.policies
|
|
530
|
+
})),
|
|
531
|
+
surfaces: core.surfaces
|
|
532
|
+
.filter((record) => record.primitive === true)
|
|
533
|
+
.map((record) => ({
|
|
534
|
+
id: record.name,
|
|
535
|
+
kind: record.kind,
|
|
536
|
+
component: record.component,
|
|
537
|
+
source: record.source && record.source.target,
|
|
538
|
+
repeat: record.repeat || null,
|
|
539
|
+
key: record.key || null,
|
|
540
|
+
portal: record.portal && record.portal.target,
|
|
541
|
+
bounds: record.bounds || null,
|
|
542
|
+
resources: toArray(record.resourceRefs).map((ref) => ref.target),
|
|
543
|
+
events: record.eventRefs
|
|
544
|
+
})),
|
|
545
|
+
overlaysByPortal: core.overlays.reduce((byPortal, overlay) => {
|
|
546
|
+
const portal = overlay.portal && overlay.portal.target;
|
|
547
|
+
if (portal) {
|
|
548
|
+
byPortal[portal] = byPortal[portal] || [];
|
|
549
|
+
byPortal[portal].push(overlay.name);
|
|
550
|
+
}
|
|
551
|
+
return byPortal;
|
|
552
|
+
}, {}),
|
|
553
|
+
resources: core.resources.map((record) => ({
|
|
554
|
+
id: record.name,
|
|
555
|
+
kind: record.kind,
|
|
556
|
+
owner: record.owner,
|
|
557
|
+
source: record.source,
|
|
558
|
+
dispose: record.dispose,
|
|
559
|
+
adapter: record.adapter
|
|
560
|
+
})),
|
|
561
|
+
events: core.events
|
|
562
|
+
.filter((record) => record.primitive === true)
|
|
563
|
+
.map((record) => ({
|
|
564
|
+
id: record.id,
|
|
565
|
+
event: record.event,
|
|
566
|
+
selector: record.selector || null,
|
|
567
|
+
target: record.target || null,
|
|
568
|
+
owner: record.scope && record.scope.surface || record.ownerOperation || null,
|
|
569
|
+
action: record.action,
|
|
570
|
+
payloadContract: record.payloadContract,
|
|
571
|
+
options: record.options || {}
|
|
572
|
+
}))
|
|
573
|
+
};
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
function createKernelRecords(core) {
|
|
577
|
+
return {
|
|
578
|
+
schema: RMT_KERNEL_RECORDS_SCHEMA,
|
|
579
|
+
workpackage: RMT_VNEXT_PRIMITIVE_LOWERING_WORKPACKAGE,
|
|
580
|
+
boundary: RMT_KERNEL_BOUNDARY,
|
|
581
|
+
schedules: core.lanes.map((lane) => ({
|
|
582
|
+
id: `schedule:${lane.id.slice('lane:'.length)}`,
|
|
583
|
+
lane: lane.name,
|
|
584
|
+
scope: lane.scope,
|
|
585
|
+
operationRefs: lane.operationRefs.slice()
|
|
586
|
+
})),
|
|
587
|
+
fibers: core.operations.map((operation) => ({
|
|
588
|
+
id: `fiber:${operation.id.slice('operation:'.length)}`,
|
|
589
|
+
lane: operation.scope && operation.scope.lane || null,
|
|
590
|
+
operation: operation.id,
|
|
591
|
+
kind: operation.kind,
|
|
592
|
+
op: operation.op,
|
|
593
|
+
target: operation.target,
|
|
594
|
+
source: operation.source || null
|
|
595
|
+
})),
|
|
596
|
+
lifecycleRecords: core.operations.map((operation) => ({
|
|
597
|
+
id: operation.id,
|
|
598
|
+
kind: operation.kind,
|
|
599
|
+
op: operation.op,
|
|
600
|
+
scope: operation.scope,
|
|
601
|
+
sourceRef: operation.sourceRef
|
|
602
|
+
})),
|
|
603
|
+
stateRecords: core.states.map((state) => ({
|
|
604
|
+
id: state.id,
|
|
605
|
+
name: state.name,
|
|
606
|
+
type: state.type,
|
|
607
|
+
preserve: state.preserve,
|
|
608
|
+
sourceRef: state.sourceRef
|
|
609
|
+
})),
|
|
610
|
+
selectorRecords: core.selectors.map((selector) => ({
|
|
611
|
+
id: selector.id,
|
|
612
|
+
name: selector.name,
|
|
613
|
+
source: selector.source,
|
|
614
|
+
output: selector.output,
|
|
615
|
+
sourceRef: selector.sourceRef
|
|
616
|
+
})),
|
|
617
|
+
actionRecords: core.actions.map((action) => ({
|
|
618
|
+
id: action.id,
|
|
619
|
+
name: action.name,
|
|
620
|
+
inputCount: action.inputs.length,
|
|
621
|
+
effectRefs: action.effectRefs.slice(),
|
|
622
|
+
sourceRef: action.sourceRef
|
|
623
|
+
})),
|
|
624
|
+
dataSourceRecords: core.dataSources.map((dataSource) => ({
|
|
625
|
+
id: dataSource.id,
|
|
626
|
+
name: dataSource.name || dataSource.target,
|
|
627
|
+
kind: dataSource.kind,
|
|
628
|
+
target: dataSource.target,
|
|
629
|
+
contract: dataSource.contract || null,
|
|
630
|
+
sourceRef: dataSource.sourceRef
|
|
631
|
+
})),
|
|
632
|
+
resourceRecords: core.resources.map((resource) => ({
|
|
633
|
+
id: resource.id,
|
|
634
|
+
name: resource.name,
|
|
635
|
+
kind: resource.kind,
|
|
636
|
+
owner: resource.owner,
|
|
637
|
+
source: resource.source,
|
|
638
|
+
dispose: resource.dispose,
|
|
639
|
+
kernelVisible: resource.kernelVisible !== false,
|
|
640
|
+
sourceRef: resource.sourceRef
|
|
641
|
+
}))
|
|
642
|
+
};
|
|
643
|
+
}
|
|
644
|
+
|
|
217
645
|
class VNextCompiler {
|
|
218
646
|
constructor(ast, options = {}) {
|
|
219
647
|
this.ast = ast;
|
|
@@ -223,6 +651,7 @@ class VNextCompiler {
|
|
|
223
651
|
namespace: options.namespace || namespaceFromDocumentId(documentId)
|
|
224
652
|
});
|
|
225
653
|
this.diagnostics = [];
|
|
654
|
+
this.semanticGraph = options.semanticGraph || null;
|
|
226
655
|
}
|
|
227
656
|
|
|
228
657
|
compile() {
|
|
@@ -237,9 +666,12 @@ class VNextCompiler {
|
|
|
237
666
|
this.compileRemoteSurface(node);
|
|
238
667
|
} else if (isSurfaceNode(node)) {
|
|
239
668
|
this.compileSurface(node, null);
|
|
669
|
+
} else if (PRIMITIVE_DECLARATION_TYPES.has(node.type)) {
|
|
670
|
+
this.compilePrimitiveDeclaration(node, null);
|
|
240
671
|
}
|
|
241
672
|
});
|
|
242
673
|
|
|
674
|
+
this.finalizePrimitiveLowering();
|
|
243
675
|
return this.core;
|
|
244
676
|
}
|
|
245
677
|
|
|
@@ -274,6 +706,12 @@ class VNextCompiler {
|
|
|
274
706
|
templatePath: normalizedName
|
|
275
707
|
});
|
|
276
708
|
if (surface) surfaceRefs.push(surface.id);
|
|
709
|
+
} else if (PRIMITIVE_DECLARATION_TYPES.has(child.type)) {
|
|
710
|
+
this.compilePrimitiveDeclaration(child, {
|
|
711
|
+
templateName: name,
|
|
712
|
+
templateId,
|
|
713
|
+
templatePath: normalizedName
|
|
714
|
+
});
|
|
277
715
|
}
|
|
278
716
|
});
|
|
279
717
|
|
|
@@ -287,10 +725,21 @@ class VNextCompiler {
|
|
|
287
725
|
const scopePath = templateContext ? `${templateContext.templatePath}/${surfaceSegment}` : surfaceSegment;
|
|
288
726
|
const surfaceId = templateContext ? `surface:${scopePath}` : `surface:${surfaceSegment}`;
|
|
289
727
|
const laneRefs = [];
|
|
728
|
+
const eventRefs = [];
|
|
729
|
+
const primitive = this.isPrimitiveSurface(node);
|
|
730
|
+
const sourceNode = getPrimitiveBodyNode(node, 'RmtSurfaceSourceClause');
|
|
731
|
+
const repeatNode = getPrimitiveBodyNode(node, 'RmtSurfaceRepeatClause');
|
|
732
|
+
const keyNode = getPrimitiveBodyNode(node, 'RmtSurfaceKeyClause');
|
|
733
|
+
const portalNode = getPrimitiveBodyNode(node, 'RmtSurfacePortalClause');
|
|
734
|
+
const boundsNode = getPrimitiveBodyNode(node, 'RmtSurfaceBoundsClause');
|
|
735
|
+
const preserveNode = getPrimitiveBodyNode(node, 'RmtSurfacePreserveClause');
|
|
736
|
+
const destroyNode = getPrimitiveBodyNode(node, 'RmtSurfaceDestroyClause');
|
|
737
|
+
const declaredKind = primitive ? getPrimitiveHeaderValue(node, 'kind') || 'named_surface' : name === 'root' ? 'root' : 'named_surface';
|
|
290
738
|
const record = {
|
|
291
739
|
id: surfaceId,
|
|
292
740
|
name,
|
|
293
|
-
kind:
|
|
741
|
+
kind: declaredKind,
|
|
742
|
+
type: lowerSurfaceKindToRuntimeType(declaredKind, name === 'root' ? 'region' : 'window'),
|
|
294
743
|
laneRefs
|
|
295
744
|
};
|
|
296
745
|
|
|
@@ -300,23 +749,340 @@ class VNextCompiler {
|
|
|
300
749
|
};
|
|
301
750
|
}
|
|
302
751
|
|
|
752
|
+
if (primitive) {
|
|
753
|
+
record.primitive = true;
|
|
754
|
+
record.eventRefs = eventRefs;
|
|
755
|
+
record.component = getPrimitiveHeaderValue(node, 'component') || null;
|
|
756
|
+
record.source = sourceNode ? compilePrimitiveSourceReference({
|
|
757
|
+
kind: sourceNode.kind,
|
|
758
|
+
value: sourceNode.ref
|
|
759
|
+
}) : null;
|
|
760
|
+
record.repeat = repeatNode ? {
|
|
761
|
+
source: compilePrimitiveSourceReference(repeatNode.source)
|
|
762
|
+
} : null;
|
|
763
|
+
record.key = keyNode ? keyNode.path || null : null;
|
|
764
|
+
record.portal = portalNode ? {
|
|
765
|
+
target: portalNode.path,
|
|
766
|
+
ref: primitiveRecordId('portal', portalNode.path)
|
|
767
|
+
} : null;
|
|
768
|
+
record.bounds = boundsNode ? compileInlinePrimitiveFields(boundsNode.fields) : null;
|
|
769
|
+
record.preserve = preserveNode ? {
|
|
770
|
+
text: preserveNode.text || '',
|
|
771
|
+
tokens: toArray(preserveNode.tokens)
|
|
772
|
+
} : null;
|
|
773
|
+
record.resourceRefs = destroyNode ? this.compileDestroyResourceRefs(destroyNode) : [];
|
|
774
|
+
}
|
|
775
|
+
|
|
303
776
|
const surfaceRecord = addRecord(this.core, 'surfaces', record, node, 'RmtSurfaceDeclaration');
|
|
304
777
|
|
|
305
778
|
(Array.isArray(node.body) ? node.body : []).forEach((child) => {
|
|
306
|
-
if (
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
779
|
+
if (isLaneNode(child)) {
|
|
780
|
+
const lane = this.compileLane(child, {
|
|
781
|
+
...templateContext,
|
|
782
|
+
surfaceName: name,
|
|
783
|
+
surfaceId,
|
|
784
|
+
surfacePath: scopePath
|
|
785
|
+
});
|
|
786
|
+
if (lane) laneRefs.push(lane.id);
|
|
787
|
+
return;
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
if (primitive && child && child.type === 'RmtEventBinding') {
|
|
791
|
+
const event = this.compileSurfaceEvent(child, {
|
|
792
|
+
...templateContext,
|
|
793
|
+
surfaceName: name,
|
|
794
|
+
surfaceId,
|
|
795
|
+
surfacePath: scopePath
|
|
796
|
+
});
|
|
797
|
+
if (event) eventRefs.push(event.id);
|
|
798
|
+
}
|
|
314
799
|
});
|
|
315
800
|
|
|
316
801
|
surfaceRecord.laneRefs = laneRefs;
|
|
802
|
+
if (primitive) {
|
|
803
|
+
surfaceRecord.eventRefs = eventRefs;
|
|
804
|
+
}
|
|
317
805
|
return surfaceRecord;
|
|
318
806
|
}
|
|
319
807
|
|
|
808
|
+
isPrimitiveSurface(node) {
|
|
809
|
+
return toArray(node && node.metadata).length > 0
|
|
810
|
+
|| toArray(node && node.body).some((entry) => entry && (PRIMITIVE_SURFACE_CLAUSE_TYPES.has(entry.type) || entry.type === 'RmtEventBinding'));
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
compileSurfaceEvent(node, context) {
|
|
814
|
+
const eventSegment = normalizeIdSegment(node.event || `event.${this.core.events.length}`);
|
|
815
|
+
const eventId = `event:${context.surfacePath}/${eventSegment}/${this.core.events.length}`;
|
|
816
|
+
const actionRef = node.action ? primitiveRecordId('action', node.action) : null;
|
|
817
|
+
const record = {
|
|
818
|
+
id: eventId,
|
|
819
|
+
primitive: true,
|
|
820
|
+
event: node.event,
|
|
821
|
+
selector: node.selector && node.selector.value || null,
|
|
822
|
+
target: node.target || null,
|
|
823
|
+
action: node.action,
|
|
824
|
+
actionRef,
|
|
825
|
+
ownerOperation: null,
|
|
826
|
+
scope: {
|
|
827
|
+
surface: context.surfaceId
|
|
828
|
+
},
|
|
829
|
+
condition: null,
|
|
830
|
+
payloadContract: compileEventPayloadContract(node),
|
|
831
|
+
options: compileEventOptions(node)
|
|
832
|
+
};
|
|
833
|
+
|
|
834
|
+
if (context.templateId) {
|
|
835
|
+
record.scope.template = context.templateId;
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
if (node.condition) {
|
|
839
|
+
record.condition = {
|
|
840
|
+
kind: 'condition',
|
|
841
|
+
expression: compileExpression(node.condition.expression),
|
|
842
|
+
sourceRef: makeSourceRef(`condition:${context.surfacePath}/event/${eventSegment}`)
|
|
843
|
+
};
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
return addRecord(this.core, 'events', record, node, 'RmtEventBinding');
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
compileDestroyResourceRefs(node) {
|
|
850
|
+
const tokens = toArray(node && node.tokens);
|
|
851
|
+
const resourceIndex = tokens.indexOf('resource');
|
|
852
|
+
|
|
853
|
+
if (resourceIndex === -1 || resourceIndex === tokens.length - 1) {
|
|
854
|
+
return [];
|
|
855
|
+
}
|
|
856
|
+
|
|
857
|
+
const target = tokens.slice(resourceIndex + 1).join('').replace(/\s+/g, '');
|
|
858
|
+
return target ? [{
|
|
859
|
+
target,
|
|
860
|
+
ref: primitiveRecordId('resource', target)
|
|
861
|
+
}] : [];
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
compilePrimitiveDeclaration(node, templateContext) {
|
|
865
|
+
if (node.type === 'RmtStateDeclaration') return this.compilePrimitiveState(node, templateContext);
|
|
866
|
+
if (node.type === 'RmtSelectorDeclaration') return this.compilePrimitiveSelector(node, templateContext);
|
|
867
|
+
if (node.type === 'RmtDataSourceDeclaration') return this.compilePrimitiveDataSource(node, templateContext);
|
|
868
|
+
if (node.type === 'RmtActionDeclaration') return this.compilePrimitiveAction(node, templateContext);
|
|
869
|
+
if (node.type === 'RmtPortalDeclaration') return this.compilePrimitivePortal(node, templateContext);
|
|
870
|
+
if (node.type === 'RmtOverlayDeclaration') return this.compilePrimitiveOverlay(node, templateContext);
|
|
871
|
+
if (node.type === 'RmtResourceDeclaration') return this.compilePrimitiveResource(node, templateContext);
|
|
872
|
+
return null;
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
primitiveScope(templateContext) {
|
|
876
|
+
return templateContext ? {
|
|
877
|
+
template: templateContext.templateId
|
|
878
|
+
} : null;
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
compilePrimitiveState(node, templateContext) {
|
|
882
|
+
const initial = node.initial ? primitiveValueToCore(node.initial) : compileInitialBlock(node);
|
|
883
|
+
const record = {
|
|
884
|
+
id: primitiveRecordId('state', node.name),
|
|
885
|
+
name: node.name,
|
|
886
|
+
primitive: true,
|
|
887
|
+
type: node.dataType && node.dataType.value || null,
|
|
888
|
+
preserve: node.preserve === true,
|
|
889
|
+
initial
|
|
890
|
+
};
|
|
891
|
+
|
|
892
|
+
if (templateContext) record.scope = this.primitiveScope(templateContext);
|
|
893
|
+
return addRecord(this.core, 'states', record, node, 'RmtStateDeclaration');
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
compilePrimitiveSelector(node, templateContext) {
|
|
897
|
+
const clauses = toArray(node.body).map(compileSelectorClause).filter(Boolean);
|
|
898
|
+
const outputClause = clauses.find((clause) => clause.kind === 'output') || null;
|
|
899
|
+
const record = {
|
|
900
|
+
id: primitiveRecordId('selector', node.name),
|
|
901
|
+
name: node.name,
|
|
902
|
+
primitive: true,
|
|
903
|
+
source: compilePrimitiveSourceReference(node.source),
|
|
904
|
+
clauses,
|
|
905
|
+
output: outputClause && outputClause.type || null
|
|
906
|
+
};
|
|
907
|
+
|
|
908
|
+
if (templateContext) record.scope = this.primitiveScope(templateContext);
|
|
909
|
+
return addRecord(this.core, 'selectors', record, node, 'RmtSelectorDeclaration');
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
compilePrimitiveDataSource(node, templateContext) {
|
|
913
|
+
const methodNode = getPrimitiveBodyNode(node, 'RmtDataSourceMethodClause');
|
|
914
|
+
const contractNode = getPrimitiveBodyNode(node, 'RmtDataSourceContractClause');
|
|
915
|
+
const resultNode = getPrimitiveBodyNode(node, 'RmtDataSourceResultClause');
|
|
916
|
+
const fallbackNode = getPrimitiveBodyNode(node, 'RmtDataSourceFallbackClause');
|
|
917
|
+
const source = compilePrimitiveSourceReference(node.source);
|
|
918
|
+
const record = {
|
|
919
|
+
id: primitiveRecordId('dataSource', node.name),
|
|
920
|
+
name: node.name,
|
|
921
|
+
primitive: true,
|
|
922
|
+
kind: source && source.kind || null,
|
|
923
|
+
target: source && source.target || null,
|
|
924
|
+
method: methodNode ? primitiveValueToString(methodNode.value) : null,
|
|
925
|
+
contract: contractNode ? primitiveValueToString(contractNode.value) : null,
|
|
926
|
+
result: resultNode ? primitiveValueToString(resultNode.value) : null,
|
|
927
|
+
fallback: fallbackNode ? {
|
|
928
|
+
kind: fallbackNode.kind || null,
|
|
929
|
+
target: fallbackNode.value || null
|
|
930
|
+
} : null,
|
|
931
|
+
ownerOperation: null
|
|
932
|
+
};
|
|
933
|
+
|
|
934
|
+
if (templateContext) record.scope = this.primitiveScope(templateContext);
|
|
935
|
+
return addRecord(this.core, 'dataSources', record, node, 'RmtDataSourceDeclaration');
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
compilePrimitiveAction(node, templateContext) {
|
|
939
|
+
const effectRefs = [];
|
|
940
|
+
const record = {
|
|
941
|
+
id: primitiveRecordId('action', node.name),
|
|
942
|
+
name: node.name,
|
|
943
|
+
primitive: true,
|
|
944
|
+
inputs: getPrimitiveBodyNodes(node, 'RmtActionInputClause').map((input) => ({
|
|
945
|
+
name: input.name,
|
|
946
|
+
type: input.dataType && input.dataType.value || null
|
|
947
|
+
})),
|
|
948
|
+
status: null,
|
|
949
|
+
reducers: [],
|
|
950
|
+
emits: [],
|
|
951
|
+
handlers: [],
|
|
952
|
+
effectRefs
|
|
953
|
+
};
|
|
954
|
+
|
|
955
|
+
if (templateContext) record.scope = this.primitiveScope(templateContext);
|
|
956
|
+
|
|
957
|
+
toArray(node.body).forEach((child, index) => {
|
|
958
|
+
if (child.type === 'RmtActionStatusClause') {
|
|
959
|
+
record.status = {
|
|
960
|
+
path: child.path || null
|
|
961
|
+
};
|
|
962
|
+
} else if (child.type === 'RmtReducerStatement') {
|
|
963
|
+
record.reducers.push({
|
|
964
|
+
target: child.target,
|
|
965
|
+
value: child.value ? primitiveValueToCore(child.value) : child.text || null
|
|
966
|
+
});
|
|
967
|
+
} else if (child.type === 'RmtEmitStatement') {
|
|
968
|
+
record.emits.push({
|
|
969
|
+
event: child.event,
|
|
970
|
+
payload: toArray(child.payload).map((entry) => ({
|
|
971
|
+
name: entry.name,
|
|
972
|
+
value: primitiveValueToCore(entry.value)
|
|
973
|
+
}))
|
|
974
|
+
});
|
|
975
|
+
} else if (child.type === 'RmtEffectStatement') {
|
|
976
|
+
const effect = this.compilePrimitiveEffect(child, record, index);
|
|
977
|
+
if (effect) effectRefs.push(effect.id);
|
|
978
|
+
} else if (child.type === 'RmtActionResultHandler') {
|
|
979
|
+
record.handlers.push({
|
|
980
|
+
phase: child.phase,
|
|
981
|
+
effect: child.effect || null
|
|
982
|
+
});
|
|
983
|
+
}
|
|
984
|
+
});
|
|
985
|
+
|
|
986
|
+
return addRecord(this.core, 'actions', record, node, 'RmtActionDeclaration');
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
compilePrimitiveEffect(node, actionRecord, index) {
|
|
990
|
+
const source = compilePrimitiveSourceReference(node.source);
|
|
991
|
+
return addRecord(this.core, 'effects', {
|
|
992
|
+
id: `effect:${normalizeIdSegment(actionRecord.name)}/${index}`,
|
|
993
|
+
primitive: true,
|
|
994
|
+
kind: node.kind || 'fetch',
|
|
995
|
+
action: actionRecord.name,
|
|
996
|
+
actionRef: actionRecord.id,
|
|
997
|
+
source
|
|
998
|
+
}, node, 'RmtEffectStatement');
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
compilePrimitivePortal(node, templateContext) {
|
|
1002
|
+
const record = {
|
|
1003
|
+
id: primitiveRecordId('portal', node.name),
|
|
1004
|
+
name: node.name,
|
|
1005
|
+
primitive: true,
|
|
1006
|
+
root: getPrimitiveAttributeValue(node, 'root'),
|
|
1007
|
+
layer: getPrimitiveAttributeValue(node, 'layer'),
|
|
1008
|
+
z: getPrimitiveAttributeValue(node, 'z'),
|
|
1009
|
+
policies: toArray(node.body).map((entry) => entry.text || '').filter(Boolean)
|
|
1010
|
+
};
|
|
1011
|
+
|
|
1012
|
+
if (templateContext) record.scope = this.primitiveScope(templateContext);
|
|
1013
|
+
return addRecord(this.core, 'portals', record, node, 'RmtPortalDeclaration');
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
compilePrimitiveOverlay(node, templateContext) {
|
|
1017
|
+
const portal = getPrimitiveAttributeValue(node, 'portal');
|
|
1018
|
+
const record = {
|
|
1019
|
+
id: primitiveRecordId('overlay', node.name),
|
|
1020
|
+
name: node.name,
|
|
1021
|
+
primitive: true,
|
|
1022
|
+
kind: getPrimitiveAttributeValue(node, 'kind') || 'overlay',
|
|
1023
|
+
portal: portal ? {
|
|
1024
|
+
target: portal,
|
|
1025
|
+
ref: primitiveRecordId('portal', portal)
|
|
1026
|
+
} : null,
|
|
1027
|
+
policies: toArray(node.body).map((entry) => entry.text || '').filter(Boolean)
|
|
1028
|
+
};
|
|
1029
|
+
|
|
1030
|
+
if (templateContext) record.scope = this.primitiveScope(templateContext);
|
|
1031
|
+
return addRecord(this.core, 'overlays', record, node, 'RmtOverlayDeclaration');
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
compilePrimitiveResource(node, templateContext) {
|
|
1035
|
+
const owner = parseOwnerReference(getPrimitiveAttributeValue(node, 'owner'));
|
|
1036
|
+
const importNode = getPrimitiveBodyNode(node, 'RmtResourceImportClause');
|
|
1037
|
+
const sourceNode = getPrimitiveBodyNode(node, 'RmtResourceSourceClause');
|
|
1038
|
+
const disposeNode = getPrimitiveBodyNode(node, 'RmtResourceDisposeClause');
|
|
1039
|
+
const record = {
|
|
1040
|
+
id: primitiveRecordId('resource', node.name),
|
|
1041
|
+
name: node.name,
|
|
1042
|
+
primitive: true,
|
|
1043
|
+
kind: getPrimitiveAttributeValue(node, 'kind') || 'resource',
|
|
1044
|
+
owner: owner ? {
|
|
1045
|
+
kind: owner.kind,
|
|
1046
|
+
id: owner.id,
|
|
1047
|
+
ref: this.resolvePrimitiveOwnerRef(owner, templateContext)
|
|
1048
|
+
} : null,
|
|
1049
|
+
source: sourceNode ? compilePrimitiveSourceReference({
|
|
1050
|
+
kind: sourceNode.kind,
|
|
1051
|
+
value: sourceNode.ref
|
|
1052
|
+
}) : null,
|
|
1053
|
+
dispose: disposeNode ? {
|
|
1054
|
+
text: disposeNode.text || '',
|
|
1055
|
+
tokens: toArray(disposeNode.tokens)
|
|
1056
|
+
} : null,
|
|
1057
|
+
kernelVisible: importNode ? false : true,
|
|
1058
|
+
adapter: importNode ? {
|
|
1059
|
+
kind: 'host-import',
|
|
1060
|
+
import: primitiveValueToString(importNode.value),
|
|
1061
|
+
kernelVisible: false
|
|
1062
|
+
} : null
|
|
1063
|
+
};
|
|
1064
|
+
|
|
1065
|
+
if (templateContext) record.scope = this.primitiveScope(templateContext);
|
|
1066
|
+
return addRecord(this.core, 'resources', record, node, 'RmtResourceDeclaration');
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1069
|
+
resolvePrimitiveOwnerRef(owner, templateContext) {
|
|
1070
|
+
if (!owner) return null;
|
|
1071
|
+
if (owner.kind === 'surface' && templateContext) {
|
|
1072
|
+
return `surface:${templateContext.templatePath}/${normalizeIdSegment(owner.id)}`;
|
|
1073
|
+
}
|
|
1074
|
+
return owner.ref;
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1077
|
+
finalizePrimitiveLowering() {
|
|
1078
|
+
if (!hasPrimitiveCoreRecords(this.core)) {
|
|
1079
|
+
return;
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
this.core.appPlatform = createAppPlatformRecords(this.core);
|
|
1083
|
+
this.core.kernelRecords = createKernelRecords(this.core);
|
|
1084
|
+
}
|
|
1085
|
+
|
|
320
1086
|
compileRemoteSurface(node) {
|
|
321
1087
|
const name = node.name || `remote.surface.${this.core.remoteSurfaces.length}`;
|
|
322
1088
|
const surfaceSegment = normalizeIdSegment(name);
|
|
@@ -494,12 +1260,21 @@ class VNextCompiler {
|
|
|
494
1260
|
}
|
|
495
1261
|
|
|
496
1262
|
if (node.source) {
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
1263
|
+
if (PRIMITIVE_SOURCE_KINDS.has(node.source.kind)) {
|
|
1264
|
+
const primitiveSource = compilePrimitiveSourceReference(node.source);
|
|
1265
|
+
record.source = {
|
|
1266
|
+
ref: primitiveSource.ref,
|
|
1267
|
+
kind: primitiveSource.kind,
|
|
1268
|
+
id: primitiveSource.target
|
|
1269
|
+
};
|
|
1270
|
+
} else {
|
|
1271
|
+
const dataSource = this.compileDataSource(node.source, operationId, context.operationPath);
|
|
1272
|
+
record.source = {
|
|
1273
|
+
ref: dataSource.id,
|
|
1274
|
+
kind: dataSource.kind,
|
|
1275
|
+
id: dataSource.target
|
|
1276
|
+
};
|
|
1277
|
+
}
|
|
503
1278
|
}
|
|
504
1279
|
|
|
505
1280
|
if (node.condition) {
|
|
@@ -636,6 +1411,20 @@ function coreDocumentForSerialization(coreDocument) {
|
|
|
636
1411
|
delete serializable.remoteSurfaces;
|
|
637
1412
|
}
|
|
638
1413
|
|
|
1414
|
+
['states', 'selectors', 'actions', 'effects', 'portals', 'overlays', 'resources'].forEach((domain) => {
|
|
1415
|
+
if (Array.isArray(serializable[domain]) && serializable[domain].length === 0) {
|
|
1416
|
+
delete serializable[domain];
|
|
1417
|
+
}
|
|
1418
|
+
});
|
|
1419
|
+
|
|
1420
|
+
if (serializable.appPlatform === null) {
|
|
1421
|
+
delete serializable.appPlatform;
|
|
1422
|
+
}
|
|
1423
|
+
|
|
1424
|
+
if (serializable.kernelRecords === null) {
|
|
1425
|
+
delete serializable.kernelRecords;
|
|
1426
|
+
}
|
|
1427
|
+
|
|
639
1428
|
return serializable;
|
|
640
1429
|
}
|
|
641
1430
|
|
|
@@ -661,17 +1450,68 @@ function compileRmtVNextSource(input = {}, options = {}) {
|
|
|
661
1450
|
};
|
|
662
1451
|
}
|
|
663
1452
|
|
|
664
|
-
const
|
|
1453
|
+
const primitiveSemanticGraph = buildRmtVNextPrimitiveSemanticGraph(input, {
|
|
1454
|
+
...options,
|
|
1455
|
+
parserResult
|
|
1456
|
+
});
|
|
1457
|
+
const primitiveInput = hasPrimitiveDeclarations(parserResult.ast);
|
|
1458
|
+
const primitiveErrors = primitiveInput
|
|
1459
|
+
? primitiveSemanticGraph.listDiagnostics({ severity: 'error' })
|
|
1460
|
+
: [];
|
|
1461
|
+
|
|
1462
|
+
if (primitiveErrors.length > 0) {
|
|
1463
|
+
return {
|
|
1464
|
+
schema: RMT_VNEXT_COMPILER_SCHEMA,
|
|
1465
|
+
workpackage: RMT_VNEXT_COMPILER_WORKPACKAGE,
|
|
1466
|
+
primitiveLoweringSchema: RMT_VNEXT_PRIMITIVE_LOWERING_SCHEMA,
|
|
1467
|
+
primitiveLoweringWorkpackage: RMT_VNEXT_PRIMITIVE_LOWERING_WORKPACKAGE,
|
|
1468
|
+
ok: false,
|
|
1469
|
+
phase: 'semantic',
|
|
1470
|
+
status: 'semantic_error',
|
|
1471
|
+
parserResult,
|
|
1472
|
+
primitiveSemanticGraph,
|
|
1473
|
+
coreDocument: null,
|
|
1474
|
+
coreJson: null,
|
|
1475
|
+
diagnostics: primitiveSemanticGraph.diagnostics,
|
|
1476
|
+
compilerDiagnostics: primitiveErrors
|
|
1477
|
+
};
|
|
1478
|
+
}
|
|
1479
|
+
|
|
1480
|
+
const coreDocument = compileRmtVNextAst(parserResult.ast, {
|
|
1481
|
+
...options,
|
|
1482
|
+
semanticGraph: primitiveSemanticGraph
|
|
1483
|
+
});
|
|
665
1484
|
const coreJson = serializeRmtVNextCore(coreDocument);
|
|
666
1485
|
const diagnostics = parserResult.diagnostics.slice();
|
|
1486
|
+
const primitiveArtifacts = coreDocument.appPlatform ? {
|
|
1487
|
+
schema: RMT_VNEXT_PRIMITIVE_LOWERING_SCHEMA,
|
|
1488
|
+
workpackage: RMT_VNEXT_PRIMITIVE_LOWERING_WORKPACKAGE,
|
|
1489
|
+
appPlatform: coreDocument.appPlatform,
|
|
1490
|
+
kernelRecords: coreDocument.kernelRecords,
|
|
1491
|
+
sourceMap: coreDocument.sourceMap.filter((entry) => [
|
|
1492
|
+
'RmtStateDeclaration',
|
|
1493
|
+
'RmtSelectorDeclaration',
|
|
1494
|
+
'RmtDataSourceDeclaration',
|
|
1495
|
+
'RmtActionDeclaration',
|
|
1496
|
+
'RmtEffectStatement',
|
|
1497
|
+
'RmtPortalDeclaration',
|
|
1498
|
+
'RmtOverlayDeclaration',
|
|
1499
|
+
'RmtResourceDeclaration',
|
|
1500
|
+
'RmtEventBinding'
|
|
1501
|
+
].includes(entry.nodeType))
|
|
1502
|
+
} : null;
|
|
667
1503
|
|
|
668
1504
|
return {
|
|
669
1505
|
schema: RMT_VNEXT_COMPILER_SCHEMA,
|
|
670
1506
|
workpackage: RMT_VNEXT_COMPILER_WORKPACKAGE,
|
|
1507
|
+
primitiveLoweringSchema: RMT_VNEXT_PRIMITIVE_LOWERING_SCHEMA,
|
|
1508
|
+
primitiveLoweringWorkpackage: RMT_VNEXT_PRIMITIVE_LOWERING_WORKPACKAGE,
|
|
671
1509
|
ok: diagnostics.filter((diagnostic) => diagnostic.severity === 'error').length === 0,
|
|
672
1510
|
phase: 'compile',
|
|
673
1511
|
status: 'compiled',
|
|
674
1512
|
parserResult,
|
|
1513
|
+
primitiveSemanticGraph,
|
|
1514
|
+
primitiveArtifacts,
|
|
675
1515
|
coreDocument,
|
|
676
1516
|
coreJson,
|
|
677
1517
|
diagnostics,
|
|
@@ -690,6 +1530,7 @@ function createRmtVNextCompiler(defaultOptions = {}) {
|
|
|
690
1530
|
return Object.freeze({
|
|
691
1531
|
schema: RMT_VNEXT_COMPILER_SCHEMA,
|
|
692
1532
|
coreSchema: RMT_VNEXT_CORE_SCHEMA,
|
|
1533
|
+
primitiveLoweringSchema: RMT_VNEXT_PRIMITIVE_LOWERING_SCHEMA,
|
|
693
1534
|
parserSchema: RMT_VNEXT_PARSER_SCHEMA,
|
|
694
1535
|
workpackage: RMT_VNEXT_COMPILER_WORKPACKAGE,
|
|
695
1536
|
compileSource,
|
|
@@ -708,6 +1549,11 @@ module.exports = {
|
|
|
708
1549
|
RMT_VNEXT_COMPILER_SUITE_PATH,
|
|
709
1550
|
RMT_VNEXT_COMPILER_WORKPACKAGE,
|
|
710
1551
|
RMT_VNEXT_CORE_SCHEMA,
|
|
1552
|
+
RMT_VNEXT_PRIMITIVE_LOWERING_SCHEMA,
|
|
1553
|
+
RMT_VNEXT_PRIMITIVE_LOWERING_WORKPACKAGE,
|
|
1554
|
+
RMT_APP_PLATFORM_RECORDS_SCHEMA,
|
|
1555
|
+
RMT_KERNEL_BOUNDARY,
|
|
1556
|
+
RMT_KERNEL_RECORDS_SCHEMA,
|
|
711
1557
|
RMT_VNEXT_PARSER_WORKPACKAGE,
|
|
712
1558
|
compileRmtVNextAst,
|
|
713
1559
|
compileRmtVNextSource,
|