Skip to content

Convert to fragtml for base layout#260

Open
bcomnes wants to merge 1 commit into
domstack-syncfrom
fragtml
Open

Convert to fragtml for base layout#260
bcomnes wants to merge 1 commit into
domstack-syncfrom
fragtml

Conversation

@bcomnes
Copy link
Copy Markdown
Owner

@bcomnes bcomnes commented Jun 2, 2026

Convert the base layout to fragtml instead of preact render to string. Its simpler, faster and more appropriate tool for the job. Of course you can still customize your layout an use preact if you want.

Copilot AI review requested due to automatic review settings June 2, 2026 04:51
@socket-security
Copy link
Copy Markdown

socket-security Bot commented Jun 2, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedmarkdown-it-admonition@​1.0.4761008475100
Addedmarkdown-it-container@​4.0.01001009979100

View full report

@coveralls
Copy link
Copy Markdown

coveralls commented Jun 2, 2026

Coverage Report for CI Build 26799408132

Coverage increased (+0.3%) to 92.589%

Details

  • Coverage increased (+0.3%) from the base build.
  • Patch coverage: 2 uncovered changes across 2 files (67 of 69 lines covered, 97.1%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
test-cases/general-features/src/layouts/blog.layout.js 13 12 92.31%
test-cases/general-features/src/layouts/ts.layout.ts 13 12 92.31%
Total (8 files) 69 67 97.1%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 4143
Covered Lines: 3935
Line Coverage: 94.98%
Relevant Branches: 755
Covered Branches: 600
Branch Coverage: 79.47%
Branches in Coverage %: Yes
Coverage Strength: 73.87 hits per line

💛 - Coveralls

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates DOMStack’s server-side HTML rendering path by switching the bundled/default layout (and most example/fixture layouts) from Preact render-to-string to fragtml, and makes client-side JSX runtime configuration explicitly opt-in via esbuild.settings.

Changes:

  • Replace Preact/HTM-based server layouts with fragtml (html, raw, render) across defaults, fixtures, and examples.
  • Remove default esbuild JSX runtime settings so projects choose their own JSX runtime via esbuild.settings.
  • Update tests and docs (including adding a v12 migration guide) to reflect the new defaults.

Reviewed changes

Copilot reviewed 48 out of 49 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tsconfig.json Adjusts TypeScript JSX emit configuration for repo-wide typechecking.
package.json Adds fragtml dependency; removes SSR Preact deps; keeps Preact as dev-only.
lib/defaults/default.root.layout.js Converts bundled default root layout to fragtml rendering + raw() insertion.
lib/build-esbuild/index.js Removes default jsx/jsxImportSource esbuild settings to make JSX runtime opt-in.
bin.js Updates --eject dependency injection from uhtml-isomorphic to fragtml.
test-cases/watch/index.test.js Updates watch tests to capture structured logger output and new log messages.
test-cases/default-layout/index.test.js Strengthens default-layout test assertions by inspecting output HTML.
test-cases/general-features/src/esbuild.settings.js Adds fixture-local esbuild JSX config for Preact TSX client code.
test-cases/general-features/src/global.data.js Converts global data HTML generation to fragtml.
test-cases/general-features/src/blog/page.js Switches page template helper import to fragtml.
test-cases/general-features/src/blog/2025/a-blog-post-from-2025/client.tsx Adds @jsxImportSource preact directive for TSX client compilation.
test-cases/general-features/src/layouts/root.layout.js Converts general-features root layout to fragtml and raw() for children.
test-cases/general-features/src/layouts/blog.layout.js Converts blog layout to fragtml and replaces dangerouslySetInnerHTML.
test-cases/general-features/src/layouts/ts.layout.ts Converts TS layout to fragtml, swaps classNameclass, uses raw().
README.md Updates docs to describe fragtml default layout + v12 migration positioning.
docs/v12-migration.md Adds v12 migration guide covering fragtml, opt-in JSX runtime, and dev server changes.
docs/v11-migration.md Updates v11 migration text (but now overlaps with v12 default-layout changes).
examples/basic/tsconfig.json Removes example-local JSX defaults and sets DOM lib; keeps TS extension importing options.
examples/basic/package.json Swaps server-side deps to fragtml.
examples/basic/README.md Updates example cross-links to reflect new fragtml default approach.
examples/basic/src/layouts/root.layout.ts Converts example root layout to fragtml.
examples/basic/src/layouts/child.layout.ts Converts child layout to fragtml, updates imports for TS source layout.
examples/basic/src/js-page/page.js Switches page templating to fragtml and updates JSDoc typing.
examples/basic/src/js-page/loose-assets/page.ts Switches page templating to fragtml, updates typing/imports.
examples/blog/tsconfig.json Removes JSX defaults from blog example config.
examples/blog/package.json Switches blog example server deps to fragtml.
examples/blog/src/global.data.ts Converts global data rendering to fragtml.
examples/blog/src/blog/page.ts Converts blog index rendering to fragtml.
examples/blog/src/layouts/root.layout.ts Converts blog root layout to fragtml and raw() children insertion.
examples/blog/src/layouts/post.layout.ts Converts post layout to fragtml and raw() children insertion.
examples/blog/src/layouts/year-index.layout.ts Converts year index layout to fragtml and tightens publishDate typing.
examples/blog/src/blog/2024/hello-world/README.md Updates narrative docs to reference fragtml layouts.
examples/blog/src/about/README.md Updates “Built with” section to reference fragtml.
examples/css-modules/package.json Switches server-side deps to fragtml.
examples/css-modules/src/modules/page.js Switches module page templating helper to fragtml.
examples/css-modules/src/layouts/root.layout.js Converts root layout to fragtml.
examples/preact-isomorphic/src/esbuild.settings.js Adds example-local esbuild JSX config for Preact.
examples/react/src/README.md Updates React example docs to reflect opt-in JSX runtime.
examples/react/src/globals/esbuild.settings.ts Clarifies React esbuild JSX runtime override.
examples/string-layouts/README.md Updates string-layout docs to remove Preact-specific framing.
examples/tailwind/package.json Switches server-side deps to fragtml; keeps Preact for client UI.
examples/tailwind/src/layouts/root.layout.js Converts tailwind root layout to fragtml.
examples/type-stripping/package.json Switches server-side deps to fragtml; removes preact-render-to-string.
examples/type-stripping/src/esbuild.settings.js Adds example-local esbuild JSX config for Preact.
examples/type-stripping/src/layouts/root.layout.ts Converts type-stripping root layout to fragtml.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/v11-migration.md
Comment on lines 16 to 19
10. [Web Worker Files Bundled Automatically](#10-web-worker-files-bundled-automatically)
11. [browserVars + esbuild define Conflict Now Throws](#11-browservars--esbuild-define-conflict-now-throws)
12. [Default Layout: uhtml-isomorphic → preact](#12-default-layout-uhtml-isomorphic--preact)
12. [Default Layout: uhtml-isomorphic → fragtml](#12-default-layout-uhtml-isomorphic--fragtml)
13. [Default siteName Changed](#13-default-sitename-changed)
Comment thread docs/v11-migration.md
Comment on lines +259 to 262
## 12. Default Layout: uhtml-isomorphic → fragtml

The bundled default `root.layout.js` (used when `--eject` has not been run, or when using the default layout) was rewritten from `uhtml-isomorphic` to use `preact` + `preact-render-to-string`.
The bundled default `root.layout.js` (used when `--eject` has not been run, or when using the default layout) was rewritten from `uhtml-isomorphic` to use `fragtml`.

Comment thread docs/v11-migration.md
Comment on lines 263 to +264
- `uhtml-isomorphic` is **no longer a production dependency** of `@domstack/static`
- `preact` and `preact-render-to-string` are now production dependencies
- `fragtml` is now a production dependency
Comment on lines 1 to 5
/**
* @import { PageFunction } from '@domstack/static'
* @import { PageVars } from '../layouts/root.layout.js
* @import { HtmlResult } from 'fragtml/types.js'
*/
Comment thread README.md
--help, -h show help
--version, -v show version information
domstack (v11.0.0)
domstack (v12.0.0)
# Conflicts:
#	test-cases/watch/index.test.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants