Capability first · transport second

HTMLImportScript.js

Renders the complete classic-script host wrapper shared by HTMLImport and native-module packaging.

SDK 0.97.1Runtime 0.8.12Protocol arcane/1
On this page

Overview

Renders the complete classic-script host wrapper shared by HTMLImport and native-module packaging.

  • Artifact
    HTMLImportScript.js · esm
  • Classification
    public first party
  • Availability
    Cross-host
  • Normalization
    Complete source retained with a terminating newline before the wrapper closes.

Import and lifecycle

JavaScript
import * as module from '/node_modules/arcane-os/runtime/arcane/modules/HTMLImportScript.js';

Importing and calling the helper execute no script and mutate no global state. Executing the returned classic script reads the current script token, resolves the shared HTMLImport host registry, binds the supplied source to that host, and stores its async completion promise.

Application-facing behavior: createHTMLImportScript(source) returns the script text without executing it.

Protocol and host implementation

In-process only This detail does not widen the application-facing API or grant authority.

Exports, signatures, parameters, and results

BindingFormDeclaration or signatureParameter syntax
createHTMLImportScriptfunctionfunction createHTMLImportScript(source)source

Parameter meanings and results

createHTMLImportScript(source) preserves the complete source text, adds one terminating newline before the async wrapper closes, and returns the complete classic-script string without executing it.

Events, side effects, and errors

Source-literal CustomEvent dispatches

No source-literal CustomEvent dispatch is part of this artifact.

Lifecycle and event flow

This artifact has no additional documented lifecycle event flow.

Direct coded failures

This artifact directly assigns no stable coded failure.

Exported Error subclasses

This artifact exports no Error subclass.

Documented failure behavior

  • the generated wrapper throws Error when its current script has no registered HTMLImport host binding
  • a failure from the supplied source rejects the binding promise

Availability and capabilities

Cross-host. Complete source retained with a terminating newline before the wrapper closes.

Cross-host source generation with no Core dependency; execution requires the browser DOM and the HTMLImport-owned host registry.

Contract example

JavaScript
import {createHTMLImportScript} from '/node_modules/arcane-os/runtime/arcane/modules/HTMLImportScript.js';
const script=createHTMLImportScript("this.textContent='Moon cheese inventory ready.';");
console.log(script);

No direct Core call is claimed for this artifact. Any injected provider or consuming module retains its own documented authority.