Releases: rossrobino/domco
Releases · rossrobino/domco
[email protected]
Minor Changes
-
5088e8d: HTML
Injector
Easily manipulate HTML on the server with the
Injector
helper. -
Stabilizes the HTML
Injector
helper -
Adds
Injector
testsimport { Injector } from "domco/injector"; const injector = new Injector( `<!doctype html><html><body><!-- comment --></body></html>`, ); injector // Set or change the title .title("My Title") // pass a TagDescriptor .head([{ name: "script", attrs: { type: "module", src: "./script.js" } }]) // pass a string of text .body("Prepended to the body! ", "prepend") // replace comments .comment("comment", "My comment") // stringify HTML .toString();
Produces the following HTML.
<!doctype html> <html> <head> <title>My Title</title> <script type="module" src="./script.js"></script> </head> <body> Prepended to the body! My comment </body> </html>
[email protected]
Patch Changes
- 9a0295c: bump domco version
[email protected]
Patch Changes
-
9605fe3:
prerender
export can now be a function that returns an array or set of paths to prerender like in react-router v7. This makes it easier to prerender programmatically without having to create another function.// src/server/+func.ts import type { Prerender } from "domco"; // prerender can still be a value, for example: export const prerender: Prerender = ["/prerender"]; export const prerender: Prerender = new Set(["/prerender"]); // now prerender can also be a function, for example: export const prerender: Prerender = () => ["/prerender"]; export const prerender: Prerender = async () => new Set(["/prerender"]);
[email protected]
[email protected]
Patch Changes
- 8c59699:
prerender
export can now be aSet
in addition to being anArray
[email protected]
[email protected]
Patch Changes
- 185c105: show warning if the target directory exists and is not empty
[email protected]
Patch Changes
- 98b5ecd: update template for deno 2.0
[email protected]
Patch Changes
-
f106fac: Use
name
in the output filename instead of as a directory for easier debugging in production dev tools. Now the name will show up in the network tab instead of just the hash.Example:
dist/client/_immutable/name/hash.js
is nowdist/client/_immutable/name.hash.js
[email protected]
Patch Changes
- 0b2ee01: fix package.json formatting