Expand description
Files from the page, on the web: the text files the page a web build runs
in holds, read into a bundle layer (ADR-0004 §1) the game lays over its own
files, and the game’s problems with them sent back (report). It is how
a page that edits a game’s data beside it (the site’s playground) runs the
game on its edits with no install. On every other target the page holds
none.
The page writes each file to sessionStorage under
shuyi-page-file:<path>, <path> being the file’s path in the game’s
project (files/stage.map); page_layer takes those under one folder.
The shuyi_page_files miniquad plugin in crates/cli/web/page-files.js
(our own code, loaded by crates/cli/web/index.html) reads them.
Structs§
- Page
Limits - How big the page’s files may be (
page_layer). Build it withPageLimits::newor take the default: a struct literal doesn’t compile outside this crate, so a new field never breaks a game (ADR-0039).
Enums§
- Page
Error - Why the page’s files could not be read into a layer (
page_layer).
Functions§
- page_
layer - The page’s files under the folder
name(files), as one layer namedname, each at its path after the folder:files/stage.mapis the layer’sstage.map, and the bundle shows it asfiles/stage.map, ascargo shuyi checknames the game’s own. Withnameempty, every file of the page, at its path.Nonewhen the page holds none there, and on every target but the web. Read it once, at the start: the layer’s files are kept for the life of the program, and the page runs the game again to change them. - report
- Sends the page
text: the game’s problems with the page’s files, one a line, each with its file and line ascargo shuyi checkprints them; the empty text when they load. The page’s parent frame gets it as a{ kind: "shuyi-report", text }message when it has the page’s origin, and the console otherwise. On every target but the web it does nothing.