@nexus_js/server 0.6.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 (51) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +17 -0
  3. package/dist/actions.d.ts +158 -0
  4. package/dist/actions.d.ts.map +1 -0
  5. package/dist/actions.js +396 -0
  6. package/dist/actions.js.map +1 -0
  7. package/dist/context.d.ts +41 -0
  8. package/dist/context.d.ts.map +1 -0
  9. package/dist/context.js +68 -0
  10. package/dist/context.js.map +1 -0
  11. package/dist/csrf.d.ts +56 -0
  12. package/dist/csrf.d.ts.map +1 -0
  13. package/dist/csrf.js +153 -0
  14. package/dist/csrf.js.map +1 -0
  15. package/dist/dev-assets.d.ts +31 -0
  16. package/dist/dev-assets.d.ts.map +1 -0
  17. package/dist/dev-assets.js +198 -0
  18. package/dist/dev-assets.js.map +1 -0
  19. package/dist/error-boundary.d.ts +87 -0
  20. package/dist/error-boundary.d.ts.map +1 -0
  21. package/dist/error-boundary.js +181 -0
  22. package/dist/error-boundary.js.map +1 -0
  23. package/dist/index.d.ts +44 -0
  24. package/dist/index.d.ts.map +1 -0
  25. package/dist/index.js +277 -0
  26. package/dist/index.js.map +1 -0
  27. package/dist/load-module.d.ts +26 -0
  28. package/dist/load-module.d.ts.map +1 -0
  29. package/dist/load-module.js +288 -0
  30. package/dist/load-module.js.map +1 -0
  31. package/dist/logger.d.ts +63 -0
  32. package/dist/logger.d.ts.map +1 -0
  33. package/dist/logger.js +158 -0
  34. package/dist/logger.js.map +1 -0
  35. package/dist/navigate.d.ts +21 -0
  36. package/dist/navigate.d.ts.map +1 -0
  37. package/dist/navigate.js +45 -0
  38. package/dist/navigate.js.map +1 -0
  39. package/dist/rate-limit.d.ts +71 -0
  40. package/dist/rate-limit.d.ts.map +1 -0
  41. package/dist/rate-limit.js +136 -0
  42. package/dist/rate-limit.js.map +1 -0
  43. package/dist/renderer.d.ts +92 -0
  44. package/dist/renderer.d.ts.map +1 -0
  45. package/dist/renderer.js +386 -0
  46. package/dist/renderer.js.map +1 -0
  47. package/dist/streaming.d.ts +98 -0
  48. package/dist/streaming.d.ts.map +1 -0
  49. package/dist/streaming.js +216 -0
  50. package/dist/streaming.js.map +1 -0
  51. package/package.json +68 -0
@@ -0,0 +1,216 @@
1
+ /**
2
+ * Nexus Streaming SSR — Out-of-order HTML flushing with Suspense boundaries.
3
+ *
4
+ * How it works:
5
+ *
6
+ * 1. The route render function returns immediately with the static shell.
7
+ * Any Promise in the template becomes a placeholder:
8
+ * <template id="nx-hole-3a9f"></template>
9
+ *
10
+ * 2. The HTTP connection stays OPEN (Transfer-Encoding: chunked).
11
+ * The browser receives and paints the static shell instantly.
12
+ *
13
+ * 3. When each Promise resolves, the server writes two chunks:
14
+ * a) The resolved HTML wrapped in a <template id="nx-fill-3a9f">
15
+ * b) A tiny inline script that moves the template content
16
+ * to the hole's position and removes both elements.
17
+ *
18
+ * 4. Error boundary: if a Promise rejects, the server writes the
19
+ * error.nx fallback HTML instead.
20
+ *
21
+ * Result: Users see content as it becomes available, not all-at-once.
22
+ * The Time-to-First-Byte is the server's fastest possible response.
23
+ *
24
+ * Wire format (chunks sent over HTTP):
25
+ * Chunk 1: Full HTML with placeholders
26
+ * <div>Static content</div>
27
+ * <template id="nx-hole-3a9f" data-nx-fallback="<p>Loading...</p>"></template>
28
+ * <template id="nx-hole-7b2c"></template>
29
+ *
30
+ * Chunk 2: Resolved content (arrives async)
31
+ * <template id="nx-fill-3a9f"><article>...</article></template>
32
+ * <script>__nx_fill("3a9f")</script>
33
+ *
34
+ * Chunk 3: Another resolution or error boundary
35
+ * <template id="nx-fill-7b2c"><div class="error">...</div></template>
36
+ * <script>__nx_fill("7b2c")</script>
37
+ *
38
+ * Final chunk (closes stream):
39
+ * <script>__nx_stream_complete()</script>
40
+ */
41
+ /** Bootstrap script injected once per page */
42
+ const BOOTSTRAP_SCRIPT = `<script id="__nx_stream_boot__">
43
+ (function(){
44
+ function __nx_fill(id){
45
+ var fill=document.getElementById('nx-fill-'+id);
46
+ var hole=document.getElementById('nx-hole-'+id);
47
+ if(fill&&hole){
48
+ hole.replaceWith(fill.content.cloneNode(true));
49
+ fill.remove();
50
+ }
51
+ }
52
+ function __nx_fill_error(id,html){
53
+ var hole=document.getElementById('nx-hole-'+id);
54
+ if(hole){var d=document.createElement('div');d.innerHTML=html;hole.replaceWith(d);}
55
+ }
56
+ function __nx_stream_complete(){
57
+ document.dispatchEvent(new Event('nexus:stream-complete'));
58
+ }
59
+ window.__nx_fill=__nx_fill;
60
+ window.__nx_fill_error=__nx_fill_error;
61
+ window.__nx_stream_complete=__nx_stream_complete;
62
+ })();
63
+ </script>`;
64
+ /**
65
+ * Creates a streaming SSR response.
66
+ * Returns a Web-standard `ReadableStream` for use in any edge runtime.
67
+ */
68
+ export function createStreamingResponse(renderFn, opts = {}) {
69
+ const encoder = new TextEncoder();
70
+ const pending = [];
71
+ let controller;
72
+ const stream = new ReadableStream({
73
+ async start(ctrl) {
74
+ controller = ctrl;
75
+ },
76
+ });
77
+ const write = (html) => {
78
+ controller.enqueue(encoder.encode(html));
79
+ };
80
+ const streamCtrl = {
81
+ writeShell(html) {
82
+ // Inject bootstrap script before </head>
83
+ const injected = html.replace('</head>', `${BOOTSTRAP_SCRIPT}\n</head>`);
84
+ write(injected);
85
+ },
86
+ defer(boundary) {
87
+ pending.push(boundary);
88
+ },
89
+ close() {
90
+ write('<script>__nx_stream_complete()</script>');
91
+ controller.close();
92
+ },
93
+ };
94
+ // Start rendering
95
+ const work = async () => {
96
+ try {
97
+ await renderFn(streamCtrl);
98
+ // Resolve all pending boundaries in parallel
99
+ const tasks = pending.map(async (boundary) => {
100
+ try {
101
+ const html = await boundary.promise;
102
+ write(buildFillChunk(boundary.id, html));
103
+ }
104
+ catch (err) {
105
+ const errorHtml = boundary.errorFallback ??
106
+ opts.onError?.(err) ??
107
+ buildDefaultErrorHTML(err);
108
+ write(buildErrorChunk(boundary.id, errorHtml));
109
+ }
110
+ });
111
+ await Promise.all(tasks);
112
+ streamCtrl.close();
113
+ }
114
+ catch (err) {
115
+ write(buildFatalErrorChunk(err));
116
+ controller.close();
117
+ }
118
+ };
119
+ work();
120
+ const headers = new Headers(opts.headers);
121
+ headers.set('content-type', 'text/html; charset=utf-8');
122
+ headers.set('transfer-encoding', 'chunked');
123
+ headers.set('x-content-type-options', 'nosniff');
124
+ // Signal to CDN that this is a streaming response
125
+ headers.set('cache-control', 'no-store');
126
+ return new Response(stream, { status: 200, headers });
127
+ }
128
+ /**
129
+ * Template tag for deferred content in .nx templates.
130
+ *
131
+ * Usage in template:
132
+ * {#await fetchPosts()}
133
+ * <p>Loading posts...</p>
134
+ * {:then posts}
135
+ * {#each posts as p}<article>{p.title}</article>{/each}
136
+ * {:catch error}
137
+ * <p class="error">{error.message}</p>
138
+ * {/await}
139
+ *
140
+ * Compiled output:
141
+ * createSuspenseBoundary(fetchPosts(), {
142
+ * fallback: '<p>Loading posts...</p>',
143
+ * render: (posts) => posts.map(...).join(''),
144
+ * })
145
+ */
146
+ export function createSuspenseBoundary(promise, opts) {
147
+ const id = generateBoundaryId();
148
+ const placeholder = `<template id="nx-hole-${id}"${opts.fallback ? ` data-nx-fallback="${htmlEscape(opts.fallback)}"` : ''}></template>`;
149
+ const boundary = {
150
+ id,
151
+ promise: promise.then((value) => opts.render(value)),
152
+ };
153
+ if (opts.fallback !== undefined) {
154
+ boundary.fallback = opts.fallback;
155
+ }
156
+ const ef = typeof opts.errorFallback !== 'function' ? opts.errorFallback : undefined;
157
+ if (ef !== undefined) {
158
+ boundary.errorFallback = ef;
159
+ }
160
+ return { id, placeholder, boundary };
161
+ }
162
+ // ── Node.js adapter ───────────────────────────────────────────────────────────
163
+ /**
164
+ * Pipes a streaming response to a Node.js `ServerResponse`.
165
+ * Used by the Node.js server adapter.
166
+ */
167
+ export async function pipeToNodeResponse(webResponse, nodeRes) {
168
+ nodeRes.statusCode = webResponse.status;
169
+ webResponse.headers.forEach((value, key) => nodeRes.setHeader(key, value));
170
+ if (!webResponse.body) {
171
+ nodeRes.end();
172
+ return;
173
+ }
174
+ const reader = webResponse.body.getReader();
175
+ try {
176
+ while (true) {
177
+ const { done, value } = await reader.read();
178
+ if (done)
179
+ break;
180
+ nodeRes.write(value);
181
+ }
182
+ }
183
+ finally {
184
+ nodeRes.end();
185
+ }
186
+ }
187
+ // ─────────────────────────────────────────────────────────────────────────────
188
+ // Helpers
189
+ // ─────────────────────────────────────────────────────────────────────────────
190
+ function buildFillChunk(id, html) {
191
+ return (`<template id="nx-fill-${id}">${html}</template>` +
192
+ `<script>__nx_fill("${id}")</script>`);
193
+ }
194
+ function buildErrorChunk(id, html) {
195
+ return (`<template id="nx-fill-${id}">${html}</template>` +
196
+ `<script>__nx_fill("${id}")</script>`);
197
+ }
198
+ function buildFatalErrorChunk(err) {
199
+ const msg = err instanceof Error ? err.message : String(err);
200
+ return `<script>console.error('[Nexus Stream] Fatal error:', ${JSON.stringify(msg)})</script>`;
201
+ }
202
+ function buildDefaultErrorHTML(err) {
203
+ const msg = err instanceof Error ? err.message : String(err);
204
+ return `<div data-nx-error style="color:red;padding:1rem;border:1px solid red;border-radius:4px">
205
+ <strong>Error</strong>: ${htmlEscape(msg)}
206
+ </div>`;
207
+ }
208
+ let _counter = 0;
209
+ function generateBoundaryId() {
210
+ _counter = (_counter + 1) % 0xffff;
211
+ return (_counter + Date.now()).toString(16).slice(-6);
212
+ }
213
+ function htmlEscape(s) {
214
+ return s.replace(/&/g, '&amp;').replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
215
+ }
216
+ //# sourceMappingURL=streaming.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"streaming.js","sourceRoot":"","sources":["../src/streaming.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAuBH,8CAA8C;AAC9C,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;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AAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACxD,CAAC;AAED,SAAS,UAAU,CAAC,CAAS;IAC3B,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACtG,CAAC"}
package/package.json ADDED
@@ -0,0 +1,68 @@
1
+ {
2
+ "name": "@nexus_js/server",
3
+ "version": "0.6.0",
4
+ "description": "Nexus HTTP server — SSR, Server Actions, Edge-ready",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.js",
11
+ "types": "./dist/index.d.ts"
12
+ },
13
+ "./actions": {
14
+ "import": "./dist/actions.js",
15
+ "types": "./dist/actions.d.ts"
16
+ },
17
+ "./context": {
18
+ "import": "./dist/context.js",
19
+ "types": "./dist/context.d.ts"
20
+ }
21
+ },
22
+ "dependencies": {
23
+ "@nexus_js/serialize": "0.6.0",
24
+ "@nexus_js/assets": "0.6.0",
25
+ "@nexus_js/compiler": "0.6.0",
26
+ "@nexus_js/connect": "0.6.0",
27
+ "@nexus_js/router": "0.6.0"
28
+ },
29
+ "devDependencies": {
30
+ "@types/node": "^22.0.0",
31
+ "typescript": "^5.5.0",
32
+ "vitest": "^2.0.0"
33
+ },
34
+ "license": "MIT",
35
+ "homepage": "https://nexusjs.dev",
36
+ "repository": {
37
+ "type": "git",
38
+ "url": "https://github.com/bierfor/nexus.git",
39
+ "directory": "packages/server"
40
+ },
41
+ "bugs": {
42
+ "url": "https://github.com/bierfor/nexus/issues"
43
+ },
44
+ "keywords": [
45
+ "nexus",
46
+ "framework",
47
+ "full-stack",
48
+ "svelte",
49
+ "islands",
50
+ "ssr",
51
+ "vite",
52
+ "server-actions"
53
+ ],
54
+ "files": [
55
+ "dist",
56
+ "README.md"
57
+ ],
58
+ "publishConfig": {
59
+ "access": "public",
60
+ "registry": "https://registry.npmjs.org/"
61
+ },
62
+ "scripts": {
63
+ "build": "tsc -p tsconfig.json",
64
+ "dev": "tsc -p tsconfig.json --watch",
65
+ "test": "vitest run --passWithNoTests",
66
+ "clean": "rm -rf dist"
67
+ }
68
+ }