Expand description
Widgets: React components used as capitalized HTML tags in Markdown.
On the server a page’s widget tags become placeholder elements carrying the
widget’s name, its props’ source and its content ([tags]), which comrak
renders as Markdown. In the browser the page script loads React and the
widgets, compiled here from TSX by oxc ([compile]), and mounts each
placeholder. What was read and compiled is kept in a Modules cache.
This module is the widget set a document has: its names, the address
each is served at, what a page loads, and what a request for one of its
modules answers ([request]).
Structs§
- Compiled
- A widget module, compiled, as a request for it is answered.
- Modules
- What was read and compiled, shared by every handle to it.
- Snapshot
- The files a module is made from, each read once: the module and every module its relative imports reach inside the served folder. Its version and its compiled bytes both come from one snapshot, so a save landing between the two can’t serve new bytes under the old version.
- Widgets
- The widgets a document’s pages can use: name → the address its module is served at.
Constants§
- LIVE_
CANVAS - The live session’s canvas: a scratch pad over the page.
- LIVE_
ORB - The live session’s orb, which starts and stops it: devpage’s own chrome, placed by devpage where the session is on.
- LIVE_
TASKS - The live session’s side panel: its agents and their tasks.
- LIVE_
TASKS_ BUTTON - The navbar’s button that opens the live session’s side panel.
- NOTES
- The tag a slide’s speaker notes are written in.
- REQUIREMENTS
- The system widget that lists a part’s requirements: the server writes its content.
- SHARED
- The modules system widgets share, by file name: what a system widget
imports by a relative specifier (
./live) beside the other system widgets. None is a widget: a page can’t name one. - SIDEBAR
- The widget that is a site’s sidebar: devpage’s own chrome, mounted by the
page script on the sidebar the server rendered, never written in a page.
Its
Devpageprefix keeps it clear of a project’s names: a project may have its ownSidebar. - SYSTEM
- The widgets devpage ships, compiled into the binary.
Functions§
- expand
- Replaces the tags of the widgets named in
knownin Markdown with placeholder elements, leaving code alone, and takes<Notes>out. An unknown capitalized tag, and aTaboutside aTabs, are reported; an unknown tag is replaced by an error in its place rather than passed through as HTML. - expand_
with expand, withwrittengiving the content the server writes for a widget, by name: what it answers replaces what the tag holds.- extension_
imports - The relative specifiers (
./x,../x) a module imports or re-exports from, as the parser sees them — the same statements [compile] rewrites. - is_
widget_ file - Whether
pathis a widget or helper file: a.tsor.tsxdirectly in a widgets folder. - project_
module - The project widget or helper at
pathinfolder’s served folder, compiled, asked for atversion. An import without an extension finds the.tsxor.tsbeside it. It renders by name the widgets of the document whose widgets folder holds it — the entry document’s when no other names it.Errwith why when it, or any helper its imports reach, doesn’t compile — the browser would only say an import failed;Nonewhen no such file is in the served folder. - system_
address - The address the system module in
fileis served at for the document served undermount, carrying its version. - system_
hash - A system module’s version: its source, the sources of every system
module its relative imports reach, the names a system widget can render
and the build — everything its compiled bytes are made from.
Nonefor a file that isn’t a system module. - system_
module - The system module in
file— a system widget’s,Tabs.tsx, or one they share,live.ts— compiled, asked for atversion;Errwith why when it doesn’t compile, andNonefor a file that isn’t a system module.