Convert to fragtml for base layout#260
Open
bcomnes wants to merge 1 commit into
Open
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Coverage Report for CI Build 26799408132Coverage increased (+0.3%) to 92.589%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
Contributor
There was a problem hiding this comment.
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 className → class, 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 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 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 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' | ||
| */ |
| --help, -h show help | ||
| --version, -v show version information | ||
| domstack (v11.0.0) | ||
| domstack (v12.0.0) |
# Conflicts: # test-cases/watch/index.test.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.