Rendering and hydration
Ember has no renderer of its own. DocumentView projects the document onto the scalajs-ui component tree, on the server into HTML and in the browser onto the delivered page.
A keyed projection
Every container gets keyed children by NodeId. An unchanged node is not touched, and typing writes exactly one characterData mutation.
The same call, another cursor
Inside a server-rendered page, mount the view under the page's cursor as usual. For output without a page, renderToHtml takes a Document, not a session: no selection, history or focus.
The live editors on these pages are built exactly this way: rendered with the page, then attached after hydration has claimed the markup.
Editable only when it is safe
Before the first claim, hydration captures what the user may already have typed. Editing begins only when the page is hydrated and no input session could be running.
- Active
- Editable.
- Deferred(PageHydrating)
- The page around the editor is still hydrating.
- Deferred(InputSession)
- An input session is open, or might be.
- Deferred(UnimportedSource)
- The source text changed since it was rendered.
- Failed
- The local claim failed; nothing is coming.