start

Starts REALM in the current document. realm.js calls it for you.

start(): void
<script type="module">
  import { start } from "https://cdn.jsdelivr.net/npm/@realmorg/realm@alpha/dist/index.js";

  start();
</script>

What it does

  1. Adopts a page stylesheet: custom-element, import-element { display: none !important } and is-visible, is-hidden, repeat-list { display: contents }.
  2. Registers <import-element>, unless something already defined that name.
  3. Defines every <custom-element> in the document and removes it from the page.
  4. Watches the document with a MutationObserver: <custom-element> elements added later are defined too, and custom tags are noticed for lazy imports.

Inline definitions are resolved against document.baseURI.

Notes

Edit this page on GitHub · View as Markdown