Reference › Project
clarusjs 0.6.0
All releases · [email protected] on npm
Minor Changes
- Fragment navigation: with
fragments: true, every static and server page loads a navigation script (under 1 KB gzip) that intercepts same-site navigations with the Navigation API, fetches the page'sindex.frag.html, swaps its region (data-cl-swap, or the body), updates the title, and attaches the islands that arrive. Elements markeddata-cl-persist="key"are kept across swaps with their state. Back and forward work; only the latest navigation may change the page; a failure falls back to a normal load. Browsers without the Navigation API load pages normally. #106 - Fragment responses: with
fragments: true, every static and server page also answers at<path>/index.frag.htmlwith its<title>and its swap region (the element markeddata-cl-swap, or the<body>).vite buildwrites the files next to each static page; server routes serve them from the handler and, withadapter: 'netlify', from the function. The URL selects the fragment (not a header), so it works on static hosts. #105