0.29.0
elements man changelog/v0-29-0Content passed to a template is created each time the template's <slot/>
renders it. This release and @elements/app 0.29.0 go together: upgrade the
package in every project after upgrading Elements.
Changes
- Content passed to a template is created each time the template's
<slot/>renders it. Requires@elements/app0.29.0. - Command line messages name the server that runs while you work the build server.
- The manual's long pages open with a list of their sections, and 56 headings were renamed to say what their section covers.
- Fixed: an
e:ifin content passed to a template stayed empty after the template removed its<slot/>and rendered it again, for example a dialog closed and reopened. - Fixed: the progress spinner moved the cursor along the line while it drew.
Upgrade
Upgrade @elements/app
The compiler and @elements/app changed together. A project still on an older
@elements/app builds, but content passed to its templates does not render
correctly. In each project:
Terminalelements install @elements/app -u -json elements build -json
A project that pins @elements/app to an exact version changes the pin to
0.29.0 or later in config.jsoc first. Restart elements start after the
install.
Slot content is new each time
app/pages/home/template.ehtml<Panel open={open}> <Editor draft={draft}/> </Panel>
When Panel removes its <slot/> and renders it again, for example behind an
e:if, the content is created again. Editor is a new instance: its own state
starts over and its oninsert runs again. State the calling template owns
(draft here) is kept, since the caller was never removed.
Keep any state that has to outlive a close and reopen in the calling template,
and pass it down as an attribute. This already applied to content passed with
slot="name"; it now applies to all content passed to a template.