@madojs/mado 0.11.1 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. package/AGENTS.md +102 -25
  2. package/CHANGELOG.md +158 -1
  3. package/README.md +135 -172
  4. package/dist/src/component.d.ts +3 -2
  5. package/dist/src/component.js +98 -6
  6. package/dist/src/component.js.map +1 -1
  7. package/dist/src/css.js +34 -5
  8. package/dist/src/css.js.map +1 -1
  9. package/dist/src/head.d.ts +6 -6
  10. package/dist/src/head.js +6 -6
  11. package/dist/src/html/parser.d.ts +1 -1
  12. package/dist/src/html/parser.js +1 -1
  13. package/dist/src/html/template.js +24 -10
  14. package/dist/src/html/template.js.map +1 -1
  15. package/dist/src/index.d.ts +8 -4
  16. package/dist/src/index.js +13 -3
  17. package/dist/src/index.js.map +1 -1
  18. package/dist/src/page.d.ts +62 -28
  19. package/dist/src/page.js +5 -0
  20. package/dist/src/page.js.map +1 -1
  21. package/dist/src/resource.js +2 -1
  22. package/dist/src/resource.js.map +1 -1
  23. package/dist/src/router/base.d.ts +65 -0
  24. package/dist/src/router/base.js +168 -0
  25. package/dist/src/router/base.js.map +1 -0
  26. package/dist/src/router/manifest.js +75 -31
  27. package/dist/src/router/manifest.js.map +1 -1
  28. package/dist/src/router/match.d.ts +16 -2
  29. package/dist/src/router/match.js +41 -1
  30. package/dist/src/router/match.js.map +1 -1
  31. package/dist/src/router/navigation.js +58 -9
  32. package/dist/src/router/navigation.js.map +1 -1
  33. package/dist/src/static-runtime.d.ts +81 -0
  34. package/dist/src/static-runtime.js +209 -0
  35. package/dist/src/static-runtime.js.map +1 -0
  36. package/dist/src/vite/index.d.ts +31 -3
  37. package/dist/src/vite/index.js +49 -18
  38. package/dist/src/vite/index.js.map +1 -1
  39. package/docs/README.md +5 -8
  40. package/docs/architecture/adr/0001-browser-static-snapshots.md +132 -0
  41. package/docs/en/00-the-mado-way.md +1 -1
  42. package/docs/en/01-quickstart.md +183 -0
  43. package/docs/en/10-pages-and-components.md +271 -0
  44. package/docs/en/11-templates-and-signals.md +211 -0
  45. package/docs/en/12-routing.md +229 -0
  46. package/docs/en/13-data.md +225 -0
  47. package/docs/en/14-forms.md +244 -0
  48. package/docs/en/15-static-snapshots.md +181 -0
  49. package/docs/en/{10-app-architecture.md → 16-app-architecture.md} +53 -2
  50. package/docs/en/{13-deployment.md → 20-deployment.md} +59 -10
  51. package/docs/en/{14-testing.md → 22-testing.md} +6 -5
  52. package/docs/en/23-cookbook.md +292 -0
  53. package/docs/en/{18-api-freeze-map.md → 30-api-freeze-map.md} +12 -3
  54. package/docs/en/{20-v1-stability.md → 32-v1-stability.md} +3 -3
  55. package/docs/en/40-llm-guide.md +776 -0
  56. package/docs/en/{06-for-backenders.md → 41-for-backenders.md} +15 -16
  57. package/docs/en/{05-why-mado.md → 42-why-mado.md} +1 -1
  58. package/docs/en/README.md +97 -27
  59. package/docs/recipes/nginx/Containerfile +26 -0
  60. package/docs/recipes/nginx/nginx.conf +42 -0
  61. package/llms.txt +246 -211
  62. package/package.json +17 -10
  63. package/scripts/bake.mjs +4 -569
  64. package/scripts/cli/generate.mjs +55 -5
  65. package/scripts/cli/help.mjs +11 -5
  66. package/scripts/cli/index.mjs +20 -4
  67. package/scripts/cli/init.mjs +7 -2
  68. package/scripts/cli/release.mjs +20 -68
  69. package/scripts/docs-lint.mjs +170 -0
  70. package/scripts/package-smoke.mjs +67 -9
  71. package/scripts/preview.mjs +95 -6
  72. package/scripts/size-budget.mjs +5 -1
  73. package/scripts/static/browser.mjs +654 -0
  74. package/scripts/static/discover.mjs +281 -0
  75. package/scripts/static/output.mjs +141 -0
  76. package/scripts/static/serialize.mjs +212 -0
  77. package/scripts/static/server.mjs +167 -0
  78. package/scripts/static.mjs +191 -0
  79. package/starters/default/README.md +57 -55
  80. package/starters/default/package.json +3 -9
  81. package/starters/default/src/app.routes.ts +20 -33
  82. package/starters/default/src/components/feature-card.component.ts +40 -0
  83. package/starters/default/src/components/live-counter.component.ts +57 -0
  84. package/starters/default/src/content/guides.ts +55 -0
  85. package/starters/default/src/main.ts +9 -13
  86. package/starters/default/src/pages/app.page.ts +41 -0
  87. package/starters/default/src/pages/guide.page.ts +40 -0
  88. package/starters/default/src/pages/home.page.ts +49 -0
  89. package/starters/default/src/pages/not-found.page.ts +18 -0
  90. package/starters/default/src/styles/document.css +39 -0
  91. package/starters/default/src/styles/reset.css +37 -0
  92. package/starters/default/src/styles/tokens.css +30 -0
  93. package/starters/default/src/styles.d.ts +3 -1
  94. package/starters/default/src/vite-env.d.ts +1 -1
  95. package/starters/default/vite.config.ts +14 -1
  96. package/starters/modular/README.md +142 -0
  97. package/starters/modular/index.html +13 -0
  98. package/starters/modular/package.json +30 -0
  99. package/starters/modular/src/app.routes.ts +39 -0
  100. package/starters/{default → modular}/src/layouts/app-shell.layout.ts +8 -5
  101. package/starters/{default → modular}/src/layouts/auth-shell.layout.ts +3 -3
  102. package/starters/modular/src/main.ts +16 -0
  103. package/starters/{default → modular}/src/modules/billing/pages/invoices-list.page.ts +3 -3
  104. package/starters/{default → modular}/src/modules/home/home.page.ts +5 -7
  105. package/starters/modular/src/modules/home/not-found.page.ts +14 -0
  106. package/starters/modular/src/styles.d.ts +1 -0
  107. package/starters/modular/src/vite-env.d.ts +1 -0
  108. package/starters/modular/tsconfig.json +24 -0
  109. package/starters/modular/vite.config.ts +131 -0
  110. package/TODO.md +0 -79
  111. package/docs/en/01-routing.md +0 -152
  112. package/docs/en/02-project-layout.md +0 -124
  113. package/docs/en/03-static-bake.md +0 -249
  114. package/docs/en/04-ide-setup.md +0 -162
  115. package/docs/en/07-llm-pitfalls.md +0 -724
  116. package/docs/en/08-llm-zero-history-test.md +0 -56
  117. package/docs/en/09-shadow-vs-light-dom.md +0 -174
  118. package/docs/en/11-layouts.md +0 -113
  119. package/docs/en/12-auth-and-api.md +0 -124
  120. package/docs/en/16-bake-cookbook.md +0 -100
  121. package/docs/en/17-shadow-dom-forms.md +0 -192
  122. package/docs/fr/00-the-mado-way.md +0 -85
  123. package/docs/fr/01-routing.md +0 -120
  124. package/docs/fr/02-project-layout.md +0 -84
  125. package/docs/fr/03-static-bake.md +0 -289
  126. package/docs/fr/04-ide-setup.md +0 -162
  127. package/docs/fr/05-why-mado.md +0 -193
  128. package/docs/fr/06-for-backenders.md +0 -438
  129. package/docs/fr/07-llm-pitfalls.md +0 -625
  130. package/docs/fr/08-llm-zero-history-test.md +0 -38
  131. package/docs/fr/09-shadow-vs-light-dom.md +0 -65
  132. package/docs/fr/10-app-architecture.md +0 -138
  133. package/docs/fr/11-layouts.md +0 -47
  134. package/docs/fr/12-auth-and-api.md +0 -76
  135. package/docs/fr/13-deployment.md +0 -57
  136. package/docs/fr/14-testing.md +0 -41
  137. package/docs/fr/15-error-handling.md +0 -50
  138. package/docs/fr/16-bake-cookbook.md +0 -88
  139. package/docs/fr/17-shadow-dom-forms.md +0 -196
  140. package/docs/fr/18-api-freeze-map.md +0 -63
  141. package/docs/fr/19-reactivity-ordering.md +0 -97
  142. package/docs/fr/20-v1-stability.md +0 -88
  143. package/docs/fr/README.md +0 -27
  144. package/docs/ru/00-the-mado-way.md +0 -84
  145. package/docs/ru/01-routing.md +0 -119
  146. package/docs/ru/02-project-layout.md +0 -84
  147. package/docs/ru/03-static-bake.md +0 -250
  148. package/docs/ru/04-ide-setup.md +0 -144
  149. package/docs/ru/05-why-mado.md +0 -193
  150. package/docs/ru/06-for-backenders.md +0 -428
  151. package/docs/ru/07-llm-pitfalls.md +0 -624
  152. package/docs/ru/08-llm-zero-history-test.md +0 -57
  153. package/docs/ru/09-shadow-vs-light-dom.md +0 -63
  154. package/docs/ru/10-app-architecture.md +0 -152
  155. package/docs/ru/11-layouts.md +0 -47
  156. package/docs/ru/12-auth-and-api.md +0 -75
  157. package/docs/ru/13-deployment.md +0 -66
  158. package/docs/ru/14-testing.md +0 -50
  159. package/docs/ru/15-error-handling.md +0 -56
  160. package/docs/ru/16-bake-cookbook.md +0 -95
  161. package/docs/ru/17-shadow-dom-forms.md +0 -193
  162. package/docs/ru/18-api-freeze-map.md +0 -64
  163. package/docs/ru/19-reactivity-ordering.md +0 -95
  164. package/docs/ru/20-v1-stability.md +0 -82
  165. package/docs/ru/README.md +0 -25
  166. package/docs/uk/00-the-mado-way.md +0 -82
  167. package/docs/uk/01-routing.md +0 -76
  168. package/docs/uk/02-project-layout.md +0 -73
  169. package/docs/uk/03-static-bake.md +0 -48
  170. package/docs/uk/04-ide-setup.md +0 -26
  171. package/docs/uk/05-why-mado.md +0 -34
  172. package/docs/uk/06-for-backenders.md +0 -55
  173. package/docs/uk/07-llm-pitfalls.md +0 -145
  174. package/docs/uk/08-llm-zero-history-test.md +0 -34
  175. package/docs/uk/09-shadow-vs-light-dom.md +0 -58
  176. package/docs/uk/10-app-architecture.md +0 -97
  177. package/docs/uk/11-layouts.md +0 -47
  178. package/docs/uk/12-auth-and-api.md +0 -70
  179. package/docs/uk/13-deployment.md +0 -40
  180. package/docs/uk/14-testing.md +0 -34
  181. package/docs/uk/15-error-handling.md +0 -32
  182. package/docs/uk/16-bake-cookbook.md +0 -36
  183. package/docs/uk/17-shadow-dom-forms.md +0 -193
  184. package/docs/uk/18-api-freeze-map.md +0 -61
  185. package/docs/uk/19-reactivity-ordering.md +0 -95
  186. package/docs/uk/20-v1-stability.md +0 -83
  187. package/docs/uk/README.md +0 -27
  188. package/starters/default/src/modules/home/not-found.page.ts +0 -11
  189. /package/docs/en/{15-error-handling.md → 21-error-handling.md} +0 -0
  190. /package/docs/en/{19-reactivity-ordering.md → 31-reactivity-ordering.md} +0 -0
  191. /package/starters/{default → modular}/.editorconfig +0 -0
  192. /package/starters/{default → modular}/eslint.config.mjs +0 -0
  193. /package/starters/{default → modular}/public/favicon.svg +0 -0
  194. /package/starters/{default → modular}/src/modules/auth/_contracts/auth-api.types.ts +0 -0
  195. /package/starters/{default → modular}/src/modules/auth/auth.connector.ts +0 -0
  196. /package/starters/{default → modular}/src/modules/auth/auth.guard.ts +0 -0
  197. /package/starters/{default → modular}/src/modules/auth/auth.public.ts +0 -0
  198. /package/starters/{default → modular}/src/modules/auth/auth.routes.ts +0 -0
  199. /package/starters/{default → modular}/src/modules/auth/auth.service.ts +0 -0
  200. /package/starters/{default → modular}/src/modules/auth/auth.types.ts +0 -0
  201. /package/starters/{default → modular}/src/modules/auth/login.page.ts +0 -0
  202. /package/starters/{default → modular}/src/modules/billing/_contracts/stripe.types.ts +0 -0
  203. /package/starters/{default → modular}/src/modules/billing/api/stripe.connector.ts +0 -0
  204. /package/starters/{default → modular}/src/modules/billing/billing.public.ts +0 -0
  205. /package/starters/{default → modular}/src/modules/billing/billing.routes.ts +0 -0
  206. /package/starters/{default → modular}/src/modules/billing/billing.types.ts +0 -0
  207. /package/starters/{default → modular}/src/modules/billing/components/invoice-status-badge.component.ts +0 -0
  208. /package/starters/{default → modular}/src/modules/billing/data/invoices.resource.ts +0 -0
  209. /package/starters/{default → modular}/src/modules/billing/pages/invoice-detail.page.ts +0 -0
  210. /package/starters/{default → modular}/src/shared/http/http-client.ts +0 -0
  211. /package/starters/{default → modular}/src/shared/http/http-error.ts +0 -0
  212. /package/starters/{default → modular}/src/shared/http/interceptors.ts +0 -0
  213. /package/starters/{default → modular}/src/shared/lib/format-date.ts +0 -0
  214. /package/starters/{default → modular}/src/shared/styles/content.css +0 -0
  215. /package/starters/{default → modular}/src/shared/styles/reset.css +0 -0
  216. /package/starters/{default → modular}/src/shared/styles/shell.css +0 -0
  217. /package/starters/{default → modular}/src/shared/styles/tokens.css +0 -0
  218. /package/starters/{default → modular}/src/shared/ui/x-button.component.ts +0 -0
  219. /package/starters/{default → modular}/src/shared/ui/x-spinner.component.ts +0 -0
package/README.md CHANGED
@@ -6,126 +6,85 @@
6
6
  />
7
7
 
8
8
  <p>
9
- <strong>Build business apps. Keep maintenance boring.</strong>
9
+ <strong>A calm native-first web framework for sites and apps.</strong>
10
10
  </p>
11
11
 
12
12
  <p>
13
- Browser-native · TypeScript-first · Zero runtime dependencies
13
+ Web Components · Signals · Browser-rendered static snapshots · Zero runtime dependencies
14
14
  </p>
15
15
  </div>
16
16
 
17
17
 
18
18
  # Mado
19
19
 
20
- > A calm frontend stack for internal tools, admin panels and business SPA.
20
+ > A calm native-first web framework for sites and apps.
21
21
 
22
22
  [![npm](https://img.shields.io/npm/v/@madojs/mado.svg)](https://www.npmjs.com/package/@madojs/mado)
23
23
  [![CI](https://github.com/madojs/mado/actions/workflows/ci.yml/badge.svg)](https://github.com/madojs/mado/actions/workflows/ci.yml)
24
- [![Browser Regression](https://github.com/madojs/mado/actions/workflows/browser.yml/badge.svg)](https://github.com/madojs/mado/actions/workflows/browser.yml)
25
24
  [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE)
26
25
  [![Donate: PayPal](https://img.shields.io/badge/Donate-PayPal-ff3f59.svg)](https://www.paypal.com/paypalme/tsekhmister)
27
26
 
28
- Mado is a browser-native SPA framework for teams that want routing, forms,
29
- data fetching and state management without turning their frontend into an
30
- infrastructure project.
27
+ Build with real Web Components, signals, routing, data and forms.
28
+ Ship live SPAs and browser-rendered static documents from one
29
+ component model.
31
30
 
32
- You write TypeScript, run `tsc`, and open the browser. No JSX transform, no
33
- Vite required, no hidden build pipeline. The entire runtime is readable in an
34
- evening. When something breaks, you can read the source and fix it.
31
+ **One component model. One page model. One release command.**
35
32
 
36
- Mado (`窓`) means "window" in Japanese: a calm window into your app, without
37
- dragging a whole frontend factory into the room.
38
-
39
- ## When to use Mado
40
-
41
- - **Admin panels and dashboards** — forms, tables, filters, auth, role guards.
42
- - **Internal tools and backoffice** — CRUD workflows, settings, billing UI.
43
- - **Small SaaS frontends** — where long-term maintainability matters more than
44
- ecosystem size.
45
- - **Embedded widgets** — where small footprint and independence from host
46
- frameworks matter.
47
-
48
- The common thread: apps where **the frontend should not become its own
49
- infrastructure problem**.
50
-
51
- ## When not to use Mado
52
-
53
- - **SEO-heavy public sites** that need SSR with hydration.
54
- - **Large teams optimizing for hiring compatibility** — React/Vue have bigger
55
- talent pools.
56
- - **Projects that need a mature UI-kit ecosystem** comparable to React today.
57
- - **Beginners learning frontend** — React, Vue and Svelte have far larger
58
- learning resources.
59
- - **Teams uncomfortable with a pre-v1 framework** — Mado is honest about its
60
- stage.
61
-
62
- ## What Mado will not build
63
-
64
- Mado stays useful by saying no. These are intentionally out of scope:
65
-
66
- - SSR with hydration. Use `bake` or edge prerender for SEO-oriented static
67
- output.
68
- - A template compiler, JSX transform, or VDOM compatibility layer.
69
- - A separate store library. Use `signal()`, `computed()` and `resource()`.
70
- - Suspense primitives or a router plugin system.
71
- - Built-in i18n, animation, or virtual-scroll primitives.
72
- - Non-evergreen browser support. The baseline is modern evergreen browsers with
73
- Baseline 2023 platform features.
74
-
75
- ## Why teams pick Mado
76
-
77
- | What matters to you | Best choice |
78
- |---|---|
79
- | Largest ecosystem, most hires available | React or Vue |
80
- | Reusable design-system components across host frameworks | Lit |
81
- | Maximum rendering performance, JSX workflow | Solid or Svelte 5 |
82
- | Progressive enhancement of server-rendered pages | htmx + your backend |
83
- | Full app stack with minimal infrastructure and calm maintenance | **Mado** |
84
-
85
- **Honest tradeoffs:**
86
-
87
- - **vs Lit** — Lit is better for design systems. Mado is for whole apps:
88
- router, data, forms and prerender in one package, no assembly required.
89
- - **vs Solid** — Solid is faster and more mature. Mado keeps a smaller runtime
90
- and uses Vite only as the development/build transport layer.
91
- - **vs htmx** — htmx is excellent when your backend owns HTML. Mado is for
92
- cases where you want a real SPA: local state, optimistic updates, cached
93
- resources, lazy modules and persisted UI state.
33
+ Mado (`窓`) means *window* in Japanese: a calm window into your app,
34
+ without dragging a whole frontend factory into the room.
94
35
 
95
36
  ## What you get
96
37
 
97
- Routing, forms, state, data fetching and prerendering — without ecosystem tax:
98
-
99
- - No runtime dependencies to audit, update or break
100
- - Vite-powered dev/build without a framework-specific bundler to maintain
101
- - Fewer Mado-specific moving parts to debug
102
- - Compact API surface you can learn in a day
103
- - Lower long-term cognitive load
104
-
105
38
  ```txt
106
- Runtime budget:
107
- enforced in CI with npm run size
108
- Runtime dependencies: 0
109
- Required dev dependencies: typescript, vite, linkedom
39
+ Mado component = Custom Element + open Shadow DOM
40
+ Mado page = route + load + head + view + optional static declaration
41
+ Mado release = Vite build
42
+ + browser-rendered static documents
43
+ + Declarative Shadow DOM
44
+ + SPA fallback
45
+ + deployment artifact
46
+
47
+ Client activation = atomic takeover
48
+ ≠ hydration
49
+ ≠ SSR reconciliation
110
50
  ```
111
51
 
112
- ## Quick Start
52
+ Browser-native source, with Vite as the development and delivery
53
+ transport. No framework-specific compiler and zero runtime
54
+ dependencies.
55
+
56
+ ## Use cases
113
57
 
114
- ### Start a new app
58
+ - Public landing pages
59
+ - Documentation sites
60
+ - Product / catalog pages
61
+ - SaaS applications
62
+ - Business applications
63
+ - Admin panels and internal tools
64
+ - Dashboards
65
+ - Embedded widgets
66
+
67
+ ## Quick start
115
68
 
116
69
  ```bash
117
- npm exec --package @madojs/mado@latest -- mado init my-app
70
+ npm exec --package @madojs/mado -- mado init my-app
118
71
  cd my-app
119
72
  npm install
120
73
  npm run dev
121
74
  ```
122
75
 
123
- The default starter is the blessed production shape: app-zone layouts, guards,
124
- module boundaries, API connectors, resources, forms and a small admin shell.
125
- Larger demos live outside this package in the separate `madojs-examples`
126
- workspace/repository.
76
+ The default starter is the universal starter: ~15 source files,
77
+ runnable without a backend, demonstrating one Shadow Component shared
78
+ between a static landing page and a live SPA route.
79
+
80
+ Need the modular reference architecture (auth shell, guarded zones,
81
+ billing module, HTTP client, module boundaries)?
127
82
 
128
- ## How it works
83
+ ```bash
84
+ mado init my-app --starter modular
85
+ ```
86
+
87
+ ## The Mado way
129
88
 
130
89
  ### Signals — reactive state
131
90
 
@@ -139,9 +98,6 @@ effect(() => console.log(count()));
139
98
  count.set(1);
140
99
  ```
141
100
 
142
- Signals are getter functions: read with `count()`, write with `count.set(v)`
143
- or `count.update(fn)`.
144
-
145
101
  ### Templates — tagged template html
146
102
 
147
103
  ```ts
@@ -155,7 +111,7 @@ html`<button @click=${fn} ?disabled=${loading} class=${cls}>${label}</button>`;
155
111
  - `?attr=${flag}` — boolean attribute
156
112
  - Functions and signals are tracked reactively
157
113
 
158
- ### Components — Web Components
114
+ ### Components — real Web Components
159
115
 
160
116
  ```ts
161
117
  import { component, css, html } from "@madojs/mado";
@@ -169,25 +125,47 @@ component(
169
125
  );
170
126
  ```
171
127
 
172
- ### Routing file-based-free
128
+ Open shadow root, scoped styles, slots, attribute reactivity, a real
129
+ custom element under the hood. The same component renders inside the
130
+ static snapshot via Declarative Shadow DOM and inside the live SPA via
131
+ direct DOM attachment.
132
+
133
+ ### Pages — `route + load + head + view`
173
134
 
174
135
  ```ts
175
- import { routes } from "@madojs/mado";
136
+ import { html, page } from "@madojs/mado";
137
+
138
+ export default page({
139
+ static: true, // capture as HTML at release
140
+ title: "Mado Keyboard",
141
+ head: () => ({ description: "A canonical product page." }),
142
+ view: () => html`<h1>Welcome</h1>`,
143
+ });
144
+ ```
145
+
146
+ ### Routing — explicit, code-split
147
+
148
+ ```ts
149
+ import { routes, routeUrl } from "@madojs/mado";
176
150
 
177
151
  export default routes({
178
- "/": () => import("./pages/home.js"),
179
- "/users/:id": () => import("./pages/user-detail.js"),
180
- "*": () => import("./pages/not-found.js"),
152
+ "/": () => import("./pages/home.page"),
153
+ "/users/:id": () => import("./pages/user.page"),
154
+ "*": () => import("./pages/not-found.page"),
181
155
  });
156
+
157
+ // Internal links must be base-aware.
158
+ html`<a data-link href=${routeUrl("/users/42")}>User</a>`;
182
159
  ```
183
160
 
184
- Lazy loading, layout groups, query params, guards, hover prefetch, scroll
185
- restoration, error boundary, View Transitions.
161
+ Lazy loading, layout groups, query params, guards, hover prefetch,
162
+ scroll restoration, error boundary, View Transitions, base-path
163
+ awareness (Vite `base` → runtime `import.meta.env.BASE_URL`).
186
164
 
187
165
  ### Data — resource + mutation
188
166
 
189
167
  ```ts
190
- import { resource, mutation, invalidate, jsonFetcher } from "@madojs/mado";
168
+ import { resource, mutation, jsonFetcher } from "@madojs/mado";
191
169
 
192
170
  const user = resource(
193
171
  () => `/api/users/${userId()}`,
@@ -203,10 +181,6 @@ const save = mutation(api.saveUser, {
203
181
  Cache, loading/error state, abort, refresh, optimistic `mutate()`,
204
182
  glob-based invalidation. Lifecycle-aware inside components.
205
183
 
206
- Resource keys are the cache identity. Use keys that include the endpoint, params
207
- and data shape; two resources with the same key share cached data and in-flight
208
- requests.
209
-
210
184
  ### Forms — schema-based validation
211
185
 
212
186
  ```ts
@@ -216,92 +190,80 @@ const form = useForm({
216
190
  email: { required: true, type: "email" },
217
191
  age: { type: "number", min: 18 },
218
192
  });
219
-
220
- html`
221
- <form @submit=${form.onSubmit(async (values) => api.save(values))}>
222
- <input name="email" @input=${form.onInput} @blur=${form.onBlur}>
223
- <button ?disabled=${() => !form.isValid() || form.submitting()}>Save</button>
224
- </form>
225
- `;
226
193
  ```
227
194
 
228
- HTML-like constraints (`required`, `min`, `max`, `pattern`, `type`), async
229
- validators, field arrays. Close to the platform, not fighting it.
195
+ ### Static snapshots SEO without SSR
230
196
 
231
- ### Lists — keyed reconciliation
197
+ ```bash
198
+ mado release
199
+ ```
232
200
 
233
- ```ts
234
- import { each } from "@madojs/mado";
201
+ `mado release` runs your app in a real Chromium and freezes the
202
+ rendered HTML including the Shadow DOM via Declarative Shadow DOM —
203
+ into one file per route. On first paint Mado atomically replaces the
204
+ static tree with the live tree: no hydration protocol, no node
205
+ reconciliation, no per-attribute diffing.
235
206
 
236
- html`<ul>${() => each(items(), (item) => item.id, (item) => html`<li>${item.name}</li>`)}</ul>`;
237
- ```
207
+ - Real search engines see a fully rendered document.
208
+ - Social preview bots see the canonical / og tags inside the raw HTML.
209
+ - JS-disabled browsers see meaningful content.
210
+ - The live app boots from the same snapshot without re-fetching seeded
211
+ data.
238
212
 
239
- ### Static prerender — SEO without SSR
213
+ ## CLI
240
214
 
241
215
  ```bash
242
- mado release
216
+ mado init my-app # scaffold universal starter
217
+ mado init my-app --starter modular # scaffold modular reference architecture
218
+ mado dev # Vite dev server
219
+ mado build # Vite production SPA build
220
+ mado typecheck # tsc --noEmit
221
+ mado static [--base-url …] # low-level snapshot only
222
+ mado release # vite build + snapshots + deployment files
223
+ mado preview # serve out/ like a real static host
224
+ mado new <kind> <path> # scaffold canonical files
243
225
  ```
244
226
 
245
- Build-time prerender of routes into static HTML with meta tags and JSON-LD.
246
- No hydration runtime. Keep personalized or real-time content in the client SPA.
227
+ ## Honest boundaries
247
228
 
248
- ## Production
229
+ - No server renderer.
230
+ - No hydration protocol.
231
+ - No framework compiler.
232
+ - No runtime dependencies.
233
+ - No built-in backend.
234
+ - No UI-kit marketplace.
235
+ - Modern evergreen browsers only.
236
+ - A compatible Chromium is required at release time for static routes.
237
+ - Static `paths()` and `initialData()` callbacks must be browser-safe
238
+ and secret-free (they run during discovery AND ship in the client
239
+ bundle).
249
240
 
250
- ```bash
251
- mado release # typecheck + vite build + bake + static deploy files -> out/
252
- mado preview # serve out/ like a static host
253
- ```
241
+ ## Why teams pick Mado
254
242
 
255
- One command, one artifact (`out/`). Upload anywhere: VPS, Cloudflare Pages,
256
- any static CDN.
243
+ | What matters to you | Best choice |
244
+ |---|---|
245
+ | Largest ecosystem, most hires available | React or Vue |
246
+ | Reusable design-system components across host frameworks | Lit |
247
+ | Maximum rendering performance, JSX workflow | Solid or Svelte 5 |
248
+ | Progressive enhancement of server-rendered pages | htmx + your backend |
249
+ | One component model for sites and apps with calm maintenance | **Mado** |
257
250
 
258
- ## CLI
251
+ ## Production
259
252
 
260
253
  ```bash
261
- mado init my-app # scaffold new app
262
- mado dev # Vite dev server
263
- mado build # tsc compile (framework/package work)
264
- mado typecheck # type check without emit
265
- mado test # run test suite
266
- mado new module billing # scaffold canonical app files
267
- mado release # full production build
268
- mado preview # serve production build locally
254
+ mado release # typecheck + vite build + static snapshots + deployment files
255
+ mado preview # serve out/ like a real static host
269
256
  ```
270
257
 
258
+ One command, one artifact (`out/`). Upload anywhere: VPS, Cloudflare
259
+ Pages, GitHub Pages (with base), any static CDN.
260
+
271
261
  ## Documentation
272
262
 
273
- - [The Mado way](./docs/en/00-the-mado-way.md) — conventions and principles
274
- - [Routing](./docs/en/01-routing.md)
275
- - [Project layout](./docs/en/02-project-layout.md)
276
- - [Static bake & SEO](./docs/en/03-static-bake.md)
277
- - [App architecture](./docs/en/10-app-architecture.md)
278
- - [Layouts](./docs/en/11-layouts.md)
279
- - [Auth and API](./docs/en/12-auth-and-api.md)
280
- - [Deployment](./docs/en/13-deployment.md)
281
- - [Testing](./docs/en/14-testing.md)
282
- - [Error handling](./docs/en/15-error-handling.md)
283
- - [For backend developers](./docs/en/06-for-backenders.md)
284
- - [Why Mado (detailed comparison)](./docs/en/05-why-mado.md)
285
-
286
- Localized docs: [French](./docs/fr/README.md) · [Ukrainian](./docs/uk/README.md) · [Russian](./docs/ru/README.md)
263
+ Canonical docs (English) live in [`docs/en/`](./docs/en/README.md).
287
264
 
288
265
  AI-agent entrypoints: [AGENTS.md](./AGENTS.md) · [llms.txt](./llms.txt)
289
266
 
290
- ## Examples
291
-
292
- The large examples are kept outside the framework package in `madojs-examples`
293
- so the core repo stays focused on runtime, tooling, starter and tests.
294
-
295
- ## Known Limits
296
-
297
- | Limit | What it means |
298
- |---|---|
299
- | No SSR hydration | Use `bake` or edge prerender for SEO. Server rendering is out of scope. |
300
- | Small ecosystem | No UI-kit or plugin marketplace. You own your components. |
301
- | Pre-v1 API | Public API is small and intentional, but may change before v1. |
302
- | Evergreen browsers only | Modern Chrome, Edge, Firefox, Safari. No IE/legacy. |
303
- | Template IDE support | `html`` highlighting needs lit-plugin or similar. |
304
-
305
267
  ## Tests
306
268
 
307
269
  ```bash
@@ -312,15 +274,16 @@ npm run size
312
274
  npm run package:smoke
313
275
  ```
314
276
 
315
- Covers signals, computed, effects, html parser, keyed reconciliation, resources,
316
- mutations, forms, router isolation, component lifecycle, release output and
317
- package smoke tests.
277
+ The full snapshot + takeover round-trip and the base-path contract
278
+ are required CI gates (`.github/workflows/ci.yml → static-snapshot`),
279
+ run under a pinned Playwright-managed Chromium with
280
+ `MADO_REQUIRE_BROWSER=1` so they never silently skip on PRs.
318
281
 
319
282
  ## Contributing
320
283
 
321
284
  Read [CONTRIBUTING.md](./CONTRIBUTING.md). Bug fixes with tests, docs
322
- improvements, examples and carefully discussed core changes are welcome.
323
- Runtime dependencies are not.
285
+ improvements, examples and carefully discussed core changes are
286
+ welcome. Runtime dependencies are not.
324
287
 
325
288
  ## License
326
289
 
@@ -12,8 +12,9 @@
12
12
  * The returned render function is called via an effect, so any signals
13
13
  * read inside it automatically re-render the template.
14
14
  *
15
- * Shadow DOM (open) is used by default. It can be disabled, and
16
- * styles will be scoped via @scope (or a tag-prefix fallback).
15
+ * Shadow DOM (open, serializable) is used by default. It can be disabled for
16
+ * advanced integration cases, and styles will be scoped via @scope
17
+ * (or a tag-prefix fallback).
17
18
  */
18
19
  import { type Signal, type Disposer } from "./signal.js";
19
20
  import { html } from "./html/template.js";
@@ -12,14 +12,87 @@
12
12
  * The returned render function is called via an effect, so any signals
13
13
  * read inside it automatically re-render the template.
14
14
  *
15
- * Shadow DOM (open) is used by default. It can be disabled, and
16
- * styles will be scoped via @scope (or a tag-prefix fallback).
15
+ * Shadow DOM (open, serializable) is used by default. It can be disabled for
16
+ * advanced integration cases, and styles will be scoped via @scope
17
+ * (or a tag-prefix fallback).
17
18
  */
18
19
  import { signal, effect } from "./signal.js";
19
20
  import { html, render } from "./html/template.js";
20
- import { adopt, scopeStyles } from "./css.js";
21
+ import { adopt, createStylesheet, scopeStyles, } from "./css.js";
21
22
  import { createLifecycle, runInLifecycle, } from "./lifecycle.js";
22
23
  import { warnOnce } from "./diagnostics.js";
24
+ /**
25
+ * Components upgraded inside a server-side or build-time snapshot live
26
+ * temporarily under `<#app data-mado-static>`. Their setup() is intentionally
27
+ * NOT run yet: Mado replaces the snapshot tree atomically when the SPA
28
+ * boots, and any work performed by setup() before takeover would leak.
29
+ *
30
+ * The set lets the runtime double-check, after takeover, that no deferred
31
+ * element survives — see _flushDeferredStaticElements().
32
+ */
33
+ const deferredStaticElements = new Set();
34
+ /**
35
+ * Walk composed ancestry (Light DOM parentNode plus ShadowRoot.host) and
36
+ * return true when the element lives inside a tree marked with
37
+ * `data-mado-static`. Used to defer component activation until the SPA
38
+ * takeover atomically removes that tree.
39
+ */
40
+ function isInsideStaticTree(node) {
41
+ let n = node;
42
+ while (n) {
43
+ if (n instanceof Element &&
44
+ n.hasAttribute &&
45
+ n.hasAttribute("data-mado-static")) {
46
+ return true;
47
+ }
48
+ const parent = typeof ShadowRoot !== "undefined" && n instanceof ShadowRoot
49
+ ? n.host
50
+ : n.parentNode;
51
+ n = parent;
52
+ }
53
+ return false;
54
+ }
55
+ /** @internal */
56
+ export function _markDeferredForStatic(host) {
57
+ deferredStaticElements.add(host);
58
+ }
59
+ /** @internal */
60
+ export function _isDeferredForStatic(host) {
61
+ return deferredStaticElements.has(host);
62
+ }
63
+ /**
64
+ * Called by render() after a root takeover has atomically replaced the
65
+ * `data-mado-static` tree. By that time every component that was
66
+ * mid-snapshot must either be:
67
+ * 1. removed with the static tree (the typical case), or
68
+ * 2. still connected but no longer under a static ancestor — in which
69
+ * case the SPA tree placed it live and we activate it now.
70
+ * Any element that fails both checks is a stuck snapshot leaf; emit a
71
+ * single diagnostic so the developer notices the orphan.
72
+ *
73
+ * @internal
74
+ */
75
+ export function _flushDeferredStaticElements() {
76
+ for (const el of [...deferredStaticElements]) {
77
+ if (!el.isConnected) {
78
+ deferredStaticElements.delete(el);
79
+ continue;
80
+ }
81
+ if (!isInsideStaticTree(el)) {
82
+ // Reset the guard so the live connectedCallback runs setup().
83
+ deferredStaticElements.delete(el);
84
+ // Force a clean re-enter of connectedCallback. Browsers fire that
85
+ // callback exactly once per insertion, so we toggle the element out
86
+ // and back in. Avoid this if the element is the document root.
87
+ const parent = el.parentNode;
88
+ const next = el.nextSibling;
89
+ if (parent) {
90
+ parent.removeChild(el);
91
+ parent.insertBefore(el, next);
92
+ }
93
+ }
94
+ }
95
+ }
23
96
  export function component(tagName, setup, options = {}) {
24
97
  if (!tagName.includes("-")) {
25
98
  warnOnce(`component-invalid-tag-${tagName}`, `component("${tagName}") skipped: Custom Element names must contain a hyphen.`);
@@ -52,7 +125,13 @@ export function component(tagName, setup, options = {}) {
52
125
  #attrDefaults = new Map();
53
126
  constructor() {
54
127
  super();
55
- this.#root = useShadow ? this.attachShadow({ mode: "open" }) : this;
128
+ this.#root = useShadow
129
+ ? this.shadowRoot ??
130
+ this.attachShadow({
131
+ mode: "open",
132
+ serializable: true,
133
+ })
134
+ : this;
56
135
  }
57
136
  connectedCallback() {
58
137
  // A keyed move (each() relocating via insertBefore) fires
@@ -62,6 +141,16 @@ export function component(tagName, setup, options = {}) {
62
141
  this.#teardownQueued = false;
63
142
  if (this.#connected)
64
143
  return;
144
+ // Deferred activation inside a static snapshot tree. The runtime keeps
145
+ // setup()/effect() asleep until the SPA performs root takeover; the
146
+ // existing DSD inside shadowRoot stays as inert first-paint markup.
147
+ // When the SPA replaces the static root, this element is either
148
+ // removed with that tree (the common case) or re-inserted live —
149
+ // in which case connectedCallback() runs again and reaches setup().
150
+ if (isInsideStaticTree(this)) {
151
+ _markDeferredForStatic(this);
152
+ return;
153
+ }
65
154
  this.#connected = true;
66
155
  if (stylesheets.length > 0) {
67
156
  if (useShadow) {
@@ -114,6 +203,10 @@ export function component(tagName, setup, options = {}) {
114
203
  });
115
204
  }
116
205
  disconnectedCallback() {
206
+ // A deferred snapshot leaf was removed by takeover before setup() ever
207
+ // ran. Clear the deferred marker so the registry does not accumulate
208
+ // dead references.
209
+ deferredStaticElements.delete(this);
117
210
  // Defer teardown to a microtask. A keyed move (each() relocating a node
118
211
  // via insertBefore) fires disconnectedCallback → connectedCallback in the
119
212
  // same tick; connectedCallback clears #teardownQueued so the teardown is
@@ -151,8 +244,7 @@ function normalizeStyles(input, tagName, useShadow) {
151
244
  return arr.map((s) => {
152
245
  let sheet;
153
246
  if (typeof s === "string") {
154
- sheet = new CSSStyleSheet();
155
- sheet.replaceSync(s);
247
+ sheet = createStylesheet(s);
156
248
  }
157
249
  else {
158
250
  sheet = s;
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sourceRoot":"","sources":["../../src/component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,EAA8B,MAAM,aAAa,CAAC;AACzE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,KAAK,EAAE,WAAW,EAAkB,MAAM,UAAU,CAAC;AAC9D,OAAO,EACL,eAAe,EACf,cAAc,GAEf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAmC5C,MAAM,UAAU,SAAS,CACvB,OAAe,EACf,KAAc,EACd,UAA4B,EAAE;IAE9B,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAC3B,QAAQ,CACN,yBAAyB,OAAO,EAAE,EAClC,cAAc,OAAO,yDAAyD,CAC/E,CAAC;QACF,OAAO;IACT,CAAC;IAED,MAAM,YAAY,GAAG,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC7C,IAAI,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;QAChC,IACE,CAAC,YAAY;YACb,YAAY,CAAC,KAAK,KAAK,KAAK;YAC5B,CAAC,oBAAoB,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,EACpD,CAAC;YACD,QAAQ,CACN,uBAAuB,OAAO,EAAE,EAChC,cAAc,OAAO,oFAAoF,CAC1G,CAAC;QACJ,CAAC;QACD,OAAO,CAAC,wBAAwB;IAClC,CAAC;IAED,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,KAAK,KAAK,CAAC;IAE3C,sDAAsD;IACtD,qE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