Skip to content

Releases: rossrobino/domco

[email protected]

18 Oct 15:04
f0cc3cf
Compare
Choose a tag to compare

Minor Changes

  • 5088e8d: HTML Injector

    Easily manipulate HTML on the server with the Injector helper.

  • Stabilizes the HTML Injector helper

  • Adds Injector tests

    import { 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]

18 Oct 15:07
b2f526e
Compare
Choose a tag to compare

Patch Changes

[email protected]

15 Oct 20:04
69f1349
Compare
Choose a tag to compare

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]

15 Oct 20:04
69f1349
Compare
Choose a tag to compare

Patch Changes

[email protected]

09 Oct 20:01
b0ef0f8
Compare
Choose a tag to compare

Patch Changes

  • 8c59699: prerender export can now be a Set in addition to being an Array

[email protected]

09 Oct 20:01
b0ef0f8
Compare
Choose a tag to compare

Patch Changes

[email protected]

09 Oct 19:32
b57d067
Compare
Choose a tag to compare

Patch Changes

  • 185c105: show warning if the target directory exists and is not empty

[email protected]

09 Oct 18:25
c71281d
Compare
Choose a tag to compare

Patch Changes

  • 98b5ecd: update template for deno 2.0

[email protected]

03 Oct 10:41
a7f4dc3
Compare
Choose a tag to compare

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 now dist/client/_immutable/name.hash.js

[email protected]

03 Oct 11:07
9e26b1b
Compare
Choose a tag to compare

Patch Changes

  • 0b2ee01: fix package.json formatting