application/nd-javascript
tutorial

This tutorial demonstrates how the
application/nd-javascript
MIME type could work. It simulates a stream of newline-delimited JavaScript statements and shows how they build & update a web application.
Jump right to the demo.
application/nd-javascript
itself is not interesting.
application/nd-javascript
is a means to discuss evolving beyond
text/html
for transmitting applications. Sadly, because this capability does not actually exist in browsers, the following demonstration is faked. Whether a real implementation uses
 application/binary
,
application/wasm
, or another similar MIME--any or all would be welcome.
application/nd-javascript
is used for simplicity and because of its proximity to existing browser APIs.
Why do this at all? For many applications, we build executables whose core function is an interplay of generating DOM, responding to the user, and updating the DOM. Consider web application runtimes, such as
react
,
svelte
,
solid
, etc. These toolkits are for building applications--and ultimately, DOM nodes. Indeed, they can generate HTML, but that is an important secondary feature. Their primary objective is to make application development easier by applying tools that result in a predictable and maintainable DOM. Thus, if we have established that our primary application toolkits excel at
DOM-ops
, why is it then that we commonly burden ourselves with also generating HTML? Most senior web-devs have all heard of
VirtualDOM
by this point. Why is there no
VirtualHTML
(/s)? For server side rendering, why do we use DOM-first libraries, convert to HTML, then post-hydration, go right back to DOM? The answer is that we have to, not that we want to. Can we cut out the HTML middleman and operate with DOM from start to finish? HTML is wonderful DSL for documents, but for applications it is pure overhead. For applications, our community would likely operate on DOM directly if the browser would allow us. Imagine if all of the power backing browser's HTML engines were actually APIs that we could tap into at boot time!
Let's explore a HTML-free web application load!
NDJavaScript Emulator - Follow steps below to begin
https://ndjavascript.cdaringe.com/

Step 1 - Start loading a page

GET https://ndjavascript.cdaringe.com/
user-action
Simulate starting a page load. On large viewports, you'll see the network request in the simulated devtools