Repository navigation
v0.9.0
Elements no longer mount with half their props while a spec streams.
When <json-render> has a catalog and loading is true, an element whose props do not yet pass its component's schema is held back: it shows the new fallback from its registry entry, or nothing, and the component mounts once the props arrive. Until now a Card whose title had not streamed in yet mounted with title: undefined, and apps filtered out elements without props by hand to avoid that.
What changes for your app
- Behaviour change if you bind
[catalog]while streaming (the agent skill's streaming example does): elements whose required props have not arrived appear only once complete, or as their fallback, instead of half-filled. Without[catalog], nothing changes. - New:
fallbackon a registry entry, also throughdefineRegistry(catalog, { components: { Card: { component: CardComponent, fallback: CardSkeleton } } }). The fallback gets the same render context as the component, so it can read the props that have arrived and place<jr-children />for the children that have. - Props are checked as the spec writes them: an expression such as
{ "$state": "/title" }counts as arrived, whatever it resolves to. A type the catalog has no props schema for is never held. - A component that has mounted never goes back to its fallback, even if a later patch removes a prop. When
loadingturns false every element mounts, valid or not; reporting what is wrong with the finished spec staysvalidate's job.
Also in this release
- README: a "Switching language" section.
$tkeys re-translate in place whendirectivesis derived from a locale signal, with nothing remounted (now covered by a test); text the model wrote needs a new generation.
Upgrading
npm i ngx-json-render@0.9.0 ngx-json-render-material@0.3.12 — install the pair together. If you bind [catalog] while streaming, watch one generation: anything that relied on rendering incomplete props now waits for them, so add a fallback where you want a placeholder in the meantime.
Full Changelog: v0.8.2...v0.9.0