Repository navigation
feat(angular-lang): run on lang-core's renderer runtime - #1803
Open
Aditya-thesys wants to merge 31 commits into
Open
Aditya-thesys wants to merge 31 commits into
Aditya-thesys wants to merge 31 commits into
Conversation
5 of 6 tasks
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Closed
6 tasks
Aditya-thesys
force-pushed
the
surfaces/web-angular
branch
from
December 4, 2026 12:41
917a3c5 to
d213d43
Compare
An Angular view layer over @openuidev/lang-core/runtime: one message runtime per Renderer, elements as views of their RenderNode's ViewContainerRef with the first instance created in place (so server rendered HTML can hydrate), an element boundary that keeps the last valid render, projected openui-renderer-* slots. injectSetDefaultValue replaces setDefaultValue; OpenUiToolProvider is now ToolProviderInput (the old name stays for one minor). Adds a server-render spec (server-render.ssr.ts, run by vitest.ssr.config.ts). As in 0.4: rendered elements are keyed by statement id and occurrence (else index path), [library]="null" renders nothing, and a form name passed as the signal injectFormName() returns is read. defineComponent takes the schema as its only type argument. package.json: lang-core is a workspace dependency (workspace:~), catalog versions where openui uses them, exports under publishConfig, and @angular/platform-server pinned to 22.1.7, the Angular version the lockfile resolves (a range resolves it to 22.3.0 against core 22.1.7). The README has a migration section from 0.4.
As in angular-lang 0.4, an element is reused only when its typeName is unchanged: two library components rendered by one Angular class no longer share an instance (and its typed text) when one replaces the other.
Each element is placed right after the views placed before it, counted as the reconciliation goes, instead of scanning the entries for every item; a kept view is compared with the container's view at its index. Prepending to 4,000 items takes about 5 ms instead of growing with the square of the list, as in angular-lang 0.4.
A component declaring `@Input() props?: {...}` compiles again: the props
type is read from an optional input too (it resolved to never), as
angular-lang 0.4 accepted it.
Content projected into <openui-renderer-query-loading> or <openui-renderer-query-error> inside an <ng-template> is created only while the slot shows, as react-lang renders a slot's children; plain projected content keeps working.
They describe the current renderer inputs (library may be null, toolProvider is ToolProviderInput) with each output as a callback. A type check in renderer.spec.ts keeps them in step with the component's inputs.
0.4 emitted both from ngOnChanges, which also runs on the server. The runtime glue only mounted and committed in afterNextRender, a no-op on the server, so neither output fired there. On the server the glue now calls the runtime's reportOnServer once, as vue-lang does.
…iles The copied reactive() and the hand-built render-error (with its message helper) go. The unreferenced tsconfig.spec.json and the ActionConfig re-export in context.ts nothing imported are deleted. README and the renderNode JSDoc say injectRenderNode() returns its argument unchanged; children nest with <openui-render-node [value]>.
triggerAction, setFieldValue, evaluationContext and queryManager were only ever read through untracked(...), so their computeds added nothing: untracked(view) reads the same value.
…down - Entry is TextEntry | ElementEntry instead of one type with nine optional fields, which drops the non-null assertions on type and node - ngOnChanges passes the container index it is placing at down to render, create and place, instead of a placing field that slotIndex special-cased (still linear time) - render decides once whether the instance is healthy
…ist test The test timed a prepend at two sizes and compared the ratio, which is flaky on a busy machine (and a failure there skipped the server render suite). It now counts view lookups, container scans and moves for a prepend to 100 and to 1,000 items: lookups grow with the list, scans do not, and nothing moves. The 0.4 placement fails it (about n squared / 2 lookups).
…faults State is initialized after mount, as in react-lang, and the server render test asserts the defaults are not in the server HTML.
The runtime lives in a computed over the library input, created once there is a library: a new library starts a new message and a null library renders nothing (no NO_LIBRARY runtime, no early onError([])). An effect per runtime subscribes, mounts after the next render and unmounts on cleanup; the render output is a computed over the epoch, committed after each render. The context reads the current runtime and view; boundaries call setRenderError through it; retry and getParseResult call the runtime. ResponseMetadata is no longer re-exported.
…svelte-lang and vue-lang; a server-render comment names render
…oes not export parse, resolveStateField, stripReactiveAssign, OpenUIErrorCode, ValidationErrorCode, InferStateFieldValue and isElementNode are no longer re-exported (import them from @openuidev/lang-core); AcceptsSchema and PropsOf stay internal. README migration section and changeset say so.
…Schema, TriggerAction, DefaultValueRequest and FieldErrors, as react-lang
A new library starts a new message, and react-lang remounts the tree. The render node reused an instance when the component class, type name and context matched, so a library reset kept the old instances and the props they last rendered (including `partial` flags from streaming). An instance is now reused only for the library it was rendered from.
…y call them more than once per update
…or, with 0.4's arguments and rule
…fecycle methods, the removed exports and upgrading lang-core alongside
- Migration notes: the host is display: contents (was block) and the 0.4 renderer classes are gone; a custom queryLoader renders in flow; library is a required input; OpenUiContextValue drops the report*/clearError members and requires storeSnapshot, revision, applyDefault, getParseResult and queryManager (for code that builds its own [context]); a form-name signal is always truthy - The deprecated setDefaultValue takes the injectFormName() signal as formName, with a test - README: zod/v4 in samples; the lang-core link points at the migration section - @angular/platform-server comes from the catalog like the other @angular packages
…ads, trim the new exports - RenderNode keeps the context and library its entries rendered with on the component, not per entry - inline report() and componentOf(); setRenderError goes through the rendered context everywhere - the context reads getFieldValue/applyDefault off the view directly instead of through computeds - OPENUI_RENDERER, RendererSlotContext and OPENUI_FORM are no longer exported (new since 0.4.2; injectRendererQuery and injectOpenUiForm/provideOpenUiForm cover them) - rxjs is no longer a peer dependency: nothing imports it
…he other ports and aligned to 1.2.1 so this release lands at 1.3.0
…hout a linked group
…rror only if it still fails once the query is registered
Aditya-thesys
force-pushed
the
surfaces/web-angular
branch
from
December 4, 2026 17:26
cdbe6bd to
e830828
Compare
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #1800: this PR targets
surfaces/web-core, so it shows only the angular-lang changes. After #1800 merges, GitHub retargets it tomain.What
Rebuilds angular-lang as a thin view layer over
@openuidev/lang-core/runtime. It reaches react-lang's feature set:$state, queries and mutations, action plans, custom actions, library functions, form validation, structured errors through(error), projected renderer slots and an element error boundary that keeps the last valid render. It renders on the server without calling tools.Changes
renderer-runtime.ts). Elements are views of their render node'sViewContainerRef; the first instance is created in place, so server HTML can hydrate.openui-renderer-*slots and an element boundary.libraryrenders new element instances and starts a new message: its state resets and its queries run again.injectSetDefaultValuereplacessetDefaultValue;OpenUiToolProvideris nowToolProviderInput(the old name stays for one minor);injectFormName()returns a signal.parse,resolveStateField,stripReactiveAssign,OpenUIErrorCode,ValidationErrorCodeand the lang-core types react-lang does not export are no longer re-exported; import them from@openuidev/lang-core.server-render.ssr.ts, run byvitest.ssr.config.ts;testruns both suites). Adds@angular/platform-serveras a dev dependency.~1.3.0) instead of 0.4.Test Plan
verify-peer-windows; lang-core (371) and react-lang (92) tests pass on this branch.Checklist
Notes
pnpm-lock.yamland.changeset/config.jsonconflict with the Svelte and Vue PRs once one of them is merged. Regenerate the lockfile withpnpm install --lockfile-onlyand keep every port in the fixed group.Follow-ups
readSourceTarget),useDataSources,WithPreviewRenderer/useRendererPreview.button[openuiRendererRetry]retries even when the app's own(click)callspreventDefault().ErrorHandler, not(error).