Repository navigation
Vault Publisher 0.1.0
A vault can hold a built web application and publish it as a working site.
That is what the HTML-as-is path was always for, and until this release it
could not actually do it: a stock Vite or Angular build published its page
and left enough behind to break it. The version moves to 0.1.0 because this
is the first arrangement worth handing to somebody else.
A built application now works
Checked against a real vite build and a real ng build, served and driven
in a browser rather than reasoned about.
Its stylesheet's own files travel. A page's references were read out of
its markup, which is every file the page asks for and no further. A
stylesheet asks for files of its own -- a @font-face src, a
background-image, an @import -- and all of that is inside the CSS, where
nothing scanning HTML would ever see it. The failure was quiet: the layout,
the colours and the spacing were all correct, the webfont fell back to the
system font, and the background images were simply gone. Nothing was
reported either, because a reference nothing reads cannot be found
unresolved. A carried stylesheet is now read and put through the same rules
its page went through, resolved against the sheet rather than the page --
../fonts/a.woff2 names a different file depending on which one said it.
A folder can be published whole. A bundler splits code, and a split
chunk is named nowhere a build can read it: not in the HTML, not in the CSS,
but inside a string in the minified JavaScript, fetched when a route is
visited. Leaving it behind is not a missing route -- in React the dynamic
import rejects with no error boundary above it and the application unmounts,
so one click turns the whole page blank. Name the folder your build produces
under Publish folders whole and every file in it is published, whether
or not anything references it.
And it can be published somewhere other than its vault path. Each folder
has a second field saying where it lands: blank keeps the vault path, app
publishes it at /app/, and / publishes it at the front page of the site,
which is the arrangement that was impossible before -- the application at
the front with the notes behind it. A homepage note moves to
/index-note.html and both the settings panel and the build report say so.
Only discovery changes. Excluded folders still win, hidden files are still
skipped, installed dependencies are still skipped, the size ceiling still
applies per file, reserved paths and URL collisions are still refused, and
Markdown is still never published as source. Every file left out is reported
with its reason.
Installed dependencies are not content
A vault with a prototype in it has a node_modules, and nothing here used
to look at the name -- so every package README was rendered as a note and
every bundled .html published as a page. The cost is not linear: each page
carries the whole vault listing, so N files published means N rows inlined
into each of N pages. Measured on a vault of 2,000 packages that is 1.9 MB a
page and a 3.68 GB site; at 8,000 it is 7.7 MB a page and 58.79 GB, which is
the build that never finishes rather than the build that is slow.
node_modules, bower_components and jspm_packages are now skipped by
name, in both selectors. On a real vault holding a stock Vite project: 196
Markdown files, 193 of them package READMEs, and 3 notes published. A scope
aimed inside one of these folders is still an exemption, and a file one of
your own pages references is still carried.
Comments stay on the thing they were left on
A pin left on a pop-up or a side panel stayed on screen after that panel
closed, drawn over whatever was underneath. A comment now records the
nearest nameable ancestor it was dropped inside, and the point within it,
and is drawn only while that ancestor is in the document and showing. The
card follows the panel: a comment opened while its context was open closes
with it. Two further defects this turned up only in a real browser are fixed
with it -- a second panel with the same tag emptying the view key, and a pin
on a position: fixed dialog drifting away from it on scroll.
Storage schema 10 adds context and the point within it.
Also
- The
assets/reservation refused a whole folder to protect the seven
paths the build writes there, which meant a Vite or Angulardistscoped
directly had its entire bundle refused. It now names those paths, and a
test holds the list against what the build actually writes. - An unbuilt framework
index.htmlis reported. It publishes perfectly and
cannot run, so what is wrong with it is what it does not contain: a
framework root element and no<script>anywhere. - The README says what a vault can publish besides notes, including the
shape people actually have -- the vault is the project, with adocs
folder of notes besidesrc,node_modulesanddist.
Known limitations
An application that computes a request path at runtime is asking for a
server, and a static host has none. A locked site still cannot serve a
code-split application, for a different reason: a module running from a blob
URL has no URL to resolve its own imports against.