JavaScript execution on top of Blitz
This crate implements a [ScriptDocument]: a wrapper around a BaseDocument
which can execute the JavaScript contained in (or referenced by) the document's <script> tags
using the Boa JavaScript engine, and which exposes JavaScript DOM APIs
(document, elements, events, timers, etc) backed by blitz-dom to the scripts it runs.
It is capable of running real-world JavaScript frameworks such as Preact.
Modules
<script type="module"> is parsed in module goal and its imports are
resolved and fetched through the same [ScriptFetcher] as classic
<script src>, so a module graph blocks the document thread the same way a
classic script already does. <script type="importmap">, import.meta.url,
dynamic import() and JSON modules (with { type: "json" }) are supported;
import-map integrity and module workers are not.
Example
use ScriptDocument;
use DocumentConfig;
let mut doc = from_html;
doc.execute_scripts;