@finesoft/front 0.1.11 → 0.1.12
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.
- package/README.md +39 -39
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,13 +4,13 @@ Full-stack framework for building content-driven web applications with SSR suppo
|
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
7
|
+
- **Router** — file-system-style route definitions with intent-driven navigation
|
|
8
|
+
- **DI Container** — lightweight dependency injection for controllers and services
|
|
9
|
+
- **Actions & Intents** — declarative navigation model (FlowAction, ExternalUrlAction)
|
|
10
|
+
- **SSR** — server-side rendering pipeline with data serialization
|
|
11
|
+
- **Server** — one-shot factory for Hono + Vite + SSR (Node / Deno / Bun)
|
|
12
|
+
- **Browser Runtime** — app bootstrap, action handlers, history management
|
|
13
|
+
- **Browser Export Condition** — browser builds exclude server-only code automatically
|
|
14
14
|
|
|
15
15
|
## Install
|
|
16
16
|
|
|
@@ -30,17 +30,17 @@ npm install @finesoft/front hono vite @hono/node-server dotenv
|
|
|
30
30
|
|
|
31
31
|
### Peer dependencies
|
|
32
32
|
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
33
|
+
- `hono` — required for server usage
|
|
34
|
+
- `vite` — required for development SSR server usage
|
|
35
|
+
- `@hono/node-server` — required for Node.js server startup
|
|
36
|
+
- `dotenv` — optional, only needed if you want `.env` auto-loading in `createServer()`
|
|
37
37
|
|
|
38
38
|
## Package entry behavior
|
|
39
39
|
|
|
40
40
|
`@finesoft/front` ships a browser-aware export map.
|
|
41
41
|
|
|
42
|
-
-
|
|
43
|
-
-
|
|
42
|
+
- In browser bundles, the `browser` condition resolves to the browser-only entry and excludes server code.
|
|
43
|
+
- In SSR / Node environments, the default import resolves to the full entry with browser + SSR + server exports.
|
|
44
44
|
|
|
45
45
|
That means you can keep importing from:
|
|
46
46
|
|
|
@@ -70,9 +70,9 @@ const { app } = await createServer({
|
|
|
70
70
|
|
|
71
71
|
Notes:
|
|
72
72
|
|
|
73
|
-
-
|
|
74
|
-
-
|
|
75
|
-
-
|
|
73
|
+
- `root` defaults to `process.cwd()`
|
|
74
|
+
- `port` defaults to `process.env.PORT ?? 3000`
|
|
75
|
+
- if a `.env` file exists at the project root, `createServer()` will try to load it automatically
|
|
76
76
|
|
|
77
77
|
### Browser
|
|
78
78
|
|
|
@@ -108,9 +108,9 @@ startBrowserApp({
|
|
|
108
108
|
|
|
109
109
|
Notes:
|
|
110
110
|
|
|
111
|
-
-
|
|
112
|
-
-
|
|
113
|
-
-
|
|
111
|
+
- `mountId` defaults to `"app"`
|
|
112
|
+
- `locale` is resolved from `document.documentElement.lang` first, then falls back to `defaultLocale`
|
|
113
|
+
- `startBrowserApp()` automatically reads prefetched server data from the DOM and performs the initial route action
|
|
114
114
|
|
|
115
115
|
### SSR Entry
|
|
116
116
|
|
|
@@ -135,7 +135,7 @@ export { serializeServerData };
|
|
|
135
135
|
Your `index.html` must include SSR placeholders:
|
|
136
136
|
|
|
137
137
|
```html
|
|
138
|
-
<!
|
|
138
|
+
<!DOCTYPE html>
|
|
139
139
|
<html lang="<!--ssr-lang-->">
|
|
140
140
|
<head>
|
|
141
141
|
<!--ssr-head-->
|
|
@@ -177,31 +177,31 @@ Use the three pieces together:
|
|
|
177
177
|
|
|
178
178
|
### Browser
|
|
179
179
|
|
|
180
|
-
-
|
|
181
|
-
-
|
|
182
|
-
-
|
|
183
|
-
-
|
|
184
|
-
-
|
|
185
|
-
-
|
|
186
|
-
-
|
|
187
|
-
-
|
|
180
|
+
- `startBrowserApp`
|
|
181
|
+
- `History`
|
|
182
|
+
- `registerActionHandlers`
|
|
183
|
+
- `registerExternalUrlHandler`
|
|
184
|
+
- `registerFlowActionHandler`
|
|
185
|
+
- `deserializeServerData`
|
|
186
|
+
- `createPrefetchedIntentsFromDom`
|
|
187
|
+
- `tryScroll`
|
|
188
188
|
|
|
189
189
|
### SSR
|
|
190
190
|
|
|
191
|
-
-
|
|
192
|
-
-
|
|
193
|
-
-
|
|
194
|
-
-
|
|
195
|
-
-
|
|
191
|
+
- `createSSRRender`
|
|
192
|
+
- `ssrRender`
|
|
193
|
+
- `injectSSRContent`
|
|
194
|
+
- `serializeServerData`
|
|
195
|
+
- `SSR_PLACEHOLDERS`
|
|
196
196
|
|
|
197
197
|
### Server
|
|
198
198
|
|
|
199
|
-
-
|
|
200
|
-
-
|
|
201
|
-
-
|
|
202
|
-
-
|
|
203
|
-
-
|
|
204
|
-
-
|
|
199
|
+
- `createServer`
|
|
200
|
+
- `createSSRApp`
|
|
201
|
+
- `startServer`
|
|
202
|
+
- `parseAcceptLanguage`
|
|
203
|
+
- `detectRuntime`
|
|
204
|
+
- `resolveRoot`
|
|
205
205
|
|
|
206
206
|
## API Overview
|
|
207
207
|
|