create-waku 0.9.2-alpha.1 → 0.9.2-beta.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.
- package/package.json +1 -1
- package/template/01_template/package.json +4 -4
- package/template/02_template_js/package.json +4 -4
- package/template/03_demo/package.json +4 -4
- package/template/03_demo/src/pages/index.tsx +1 -1
- package/template/04_cssmodules/package.json +4 -4
- package/template/05_nossr/package.json +4 -4
- package/template/07_router/package.json +4 -4
- package/template/08_cookies/package.json +4 -4
- package/template/08_cookies/src/components/App.tsx +3 -3
- package/template/08_cookies/src/entries.tsx +5 -2
- package/template/08_cookies/waku.config.ts +1 -0
- package/template/09_api/package.json +22 -0
- package/template/09_api/src/components/App.tsx +14 -0
- package/template/09_api/src/components/Counter.tsx +30 -0
- package/template/09_api/src/entries.tsx +27 -0
- package/template/09_api/src/main.tsx +17 -0
- package/template/09_api/src/middleware/api.ts +24 -0
- package/template/09_api/tsconfig.json +15 -0
- package/template/09_api/waku.config.ts +18 -0
- package/template/10_fs-router/package.json +4 -4
- package/template/11_form/package.json +4 -4
- package/template/12_css/package.json +4 -4
- package/template/13_path-alias/package.json +4 -4
- package/template/14_react-tweet/package.json +4 -4
- package/template/14_react-tweet/vite.config.ts +0 -3
- package/template/20_minimal/package.json +4 -4
- package/template/21_minimal_js/package.json +4 -4
- package/template/22_promise/package.json +4 -4
- package/template/23_actions/package.json +4 -4
- package/template/23_actions/src/components2/funcs.ts +5 -2
- package/template/23_actions/src/components2/funcs2.ts +2 -2
- package/template/24_nesting/package.json +4 -4
package/package.json
CHANGED
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
"start": "waku start"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"react": "19.0.0-rc
|
|
13
|
-
"react-dom": "19.0.0-rc
|
|
14
|
-
"react-server-dom-webpack": "19.0.0-rc
|
|
15
|
-
"waku": "0.21.0-
|
|
12
|
+
"react": "19.0.0-rc.0",
|
|
13
|
+
"react-dom": "19.0.0-rc.0",
|
|
14
|
+
"react-server-dom-webpack": "19.0.0-rc.0",
|
|
15
|
+
"waku": "0.21.0-beta.0"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@types/react": "18.3.3",
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
"start": "waku start"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"react": "19.0.0-rc
|
|
13
|
-
"react-dom": "19.0.0-rc
|
|
14
|
-
"react-server-dom-webpack": "19.0.0-rc
|
|
15
|
-
"waku": "0.21.0-
|
|
12
|
+
"react": "19.0.0-rc.0",
|
|
13
|
+
"react-dom": "19.0.0-rc.0",
|
|
14
|
+
"react-server-dom-webpack": "19.0.0-rc.0",
|
|
15
|
+
"waku": "0.21.0-beta.0"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"autoprefixer": "10.4.19",
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
"start": "waku start"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"react": "19.0.0-rc
|
|
13
|
-
"react-dom": "19.0.0-rc
|
|
14
|
-
"react-server-dom-webpack": "19.0.0-rc
|
|
15
|
-
"waku": "0.21.0-
|
|
12
|
+
"react": "19.0.0-rc.0",
|
|
13
|
+
"react-dom": "19.0.0-rc.0",
|
|
14
|
+
"react-server-dom-webpack": "19.0.0-rc.0",
|
|
15
|
+
"waku": "0.21.0-beta.0"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@types/react": "18.3.3",
|
|
@@ -12,7 +12,7 @@ export default async function HomePage() {
|
|
|
12
12
|
<div className="flex h-full w-full flex-col items-center justify-center p-6">
|
|
13
13
|
<div className="px-6">
|
|
14
14
|
<a
|
|
15
|
-
href="https://github.com/dai-shi/waku/tree/main/examples/
|
|
15
|
+
href="https://github.com/dai-shi/waku/tree/main/examples/03_demo/src"
|
|
16
16
|
target="_blank"
|
|
17
17
|
rel="noreferrer"
|
|
18
18
|
className="whitespace-nowrap text-xs font-bold hover:underline sm:text-base"
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
"start": "waku start"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"react": "19.0.0-rc
|
|
13
|
-
"react-dom": "19.0.0-rc
|
|
14
|
-
"react-server-dom-webpack": "19.0.0-rc
|
|
15
|
-
"waku": "0.21.0-
|
|
12
|
+
"react": "19.0.0-rc.0",
|
|
13
|
+
"react-dom": "19.0.0-rc.0",
|
|
14
|
+
"react-server-dom-webpack": "19.0.0-rc.0",
|
|
15
|
+
"waku": "0.21.0-beta.0"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@types/react": "18.3.3",
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
"start": "waku start"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"react": "19.0.0-rc
|
|
13
|
-
"react-dom": "19.0.0-rc
|
|
14
|
-
"react-server-dom-webpack": "19.0.0-rc
|
|
15
|
-
"waku": "0.21.0-
|
|
12
|
+
"react": "19.0.0-rc.0",
|
|
13
|
+
"react-dom": "19.0.0-rc.0",
|
|
14
|
+
"react-server-dom-webpack": "19.0.0-rc.0",
|
|
15
|
+
"waku": "0.21.0-beta.0"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@types/react": "18.3.3",
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
"start": "waku start"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"react": "19.0.0-rc
|
|
13
|
-
"react-dom": "19.0.0-rc
|
|
14
|
-
"react-server-dom-webpack": "19.0.0-rc
|
|
15
|
-
"waku": "0.21.0-
|
|
12
|
+
"react": "19.0.0-rc.0",
|
|
13
|
+
"react-dom": "19.0.0-rc.0",
|
|
14
|
+
"react-server-dom-webpack": "19.0.0-rc.0",
|
|
15
|
+
"waku": "0.21.0-beta.0"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@types/react": "18.3.3",
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"cookie": "0.6.0",
|
|
13
|
-
"react": "19.0.0-rc
|
|
14
|
-
"react-dom": "19.0.0-rc
|
|
15
|
-
"react-server-dom-webpack": "19.0.0-rc
|
|
16
|
-
"waku": "0.21.0-
|
|
13
|
+
"react": "19.0.0-rc.0",
|
|
14
|
+
"react-dom": "19.0.0-rc.0",
|
|
15
|
+
"react-server-dom-webpack": "19.0.0-rc.0",
|
|
16
|
+
"waku": "0.21.0-beta.0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@types/cookie": "0.6.0",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Suspense, cache } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { unstable_getCustomContext as getCustomContext } from 'waku/server';
|
|
3
3
|
|
|
4
4
|
import { Counter } from './Counter';
|
|
5
5
|
|
|
@@ -12,12 +12,12 @@ const InternalAsyncComponent = async () => {
|
|
|
12
12
|
if (val1 !== val2) {
|
|
13
13
|
throw new Error('Cache not working');
|
|
14
14
|
}
|
|
15
|
-
console.log(
|
|
15
|
+
console.log(getCustomContext());
|
|
16
16
|
return null;
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
const App = ({ name, items }: { name: string; items: unknown[] }) => {
|
|
20
|
-
const context =
|
|
20
|
+
const context = getCustomContext<{ count: number }>();
|
|
21
21
|
return (
|
|
22
22
|
<div style={{ border: '3px red dashed', margin: '1em', padding: '1em' }}>
|
|
23
23
|
<title>Waku</title>
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import { fileURLToPath } from 'node:url';
|
|
3
3
|
import fsPromises from 'node:fs/promises';
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
defineEntries,
|
|
6
|
+
unstable_getCustomContext as getCustomContext,
|
|
7
|
+
} from 'waku/server';
|
|
5
8
|
import { Slot } from 'waku/client';
|
|
6
9
|
|
|
7
10
|
import App from './components/App';
|
|
@@ -9,7 +12,7 @@ import App from './components/App';
|
|
|
9
12
|
export default defineEntries(
|
|
10
13
|
// renderEntries
|
|
11
14
|
async (input) => {
|
|
12
|
-
const context =
|
|
15
|
+
const context = getCustomContext<{ count: number }>();
|
|
13
16
|
++context.count;
|
|
14
17
|
const items = JSON.parse(
|
|
15
18
|
await fsPromises.readFile(
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "waku-example",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"private": true,
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "waku dev",
|
|
8
|
+
"build": "waku build",
|
|
9
|
+
"start": "waku start"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"react": "19.0.0-rc.0",
|
|
13
|
+
"react-dom": "19.0.0-rc.0",
|
|
14
|
+
"react-server-dom-webpack": "19.0.0-rc.0",
|
|
15
|
+
"waku": "0.21.0-beta.0"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@types/react": "18.3.3",
|
|
19
|
+
"@types/react-dom": "18.3.0",
|
|
20
|
+
"typescript": "5.4.5"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Counter } from './Counter';
|
|
2
|
+
|
|
3
|
+
const App = ({ name }: { name: string }) => {
|
|
4
|
+
return (
|
|
5
|
+
<div style={{ border: '3px red dashed', margin: '1em', padding: '1em' }}>
|
|
6
|
+
<title>Waku</title>
|
|
7
|
+
<h1>Hello {name}!!</h1>
|
|
8
|
+
<h3>This is a server component.</h3>
|
|
9
|
+
<Counter />
|
|
10
|
+
</div>
|
|
11
|
+
);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export default App;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { Suspense, use, useState, useEffect } from 'react';
|
|
4
|
+
|
|
5
|
+
export const Counter = () => {
|
|
6
|
+
const [count, setCount] = useState(0);
|
|
7
|
+
const [promise, setPromise] = useState<Promise<unknown>>();
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
setPromise(fetch('/api/hello').then((res) => res.text()));
|
|
10
|
+
}, []);
|
|
11
|
+
return (
|
|
12
|
+
<div style={{ border: '3px blue dashed', margin: '1em', padding: '1em' }}>
|
|
13
|
+
<p>Count: {count}</p>
|
|
14
|
+
<button onClick={() => setCount((c) => c + 1)}>Increment</button>
|
|
15
|
+
<h3>This is a client component.</h3>
|
|
16
|
+
<Suspense fallback={<p>Loading...</p>}>
|
|
17
|
+
{promise && <Hello promise={promise} />}
|
|
18
|
+
</Suspense>
|
|
19
|
+
</div>
|
|
20
|
+
);
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const Hello = ({ promise }: { promise: Promise<unknown> }) => {
|
|
24
|
+
const message = `${use(promise)}`;
|
|
25
|
+
return (
|
|
26
|
+
<div>
|
|
27
|
+
<p>Hello, {message}</p>
|
|
28
|
+
</div>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { defineEntries } from 'waku/server';
|
|
2
|
+
import { Slot } from 'waku/client';
|
|
3
|
+
|
|
4
|
+
import App from './components/App';
|
|
5
|
+
|
|
6
|
+
export default defineEntries(
|
|
7
|
+
// renderEntries
|
|
8
|
+
async (input) => {
|
|
9
|
+
return {
|
|
10
|
+
App: <App name={input || 'Waku'} />,
|
|
11
|
+
};
|
|
12
|
+
},
|
|
13
|
+
// getBuildConfig
|
|
14
|
+
async () => [{ pathname: '/', entries: [{ input: '' }] }],
|
|
15
|
+
// getSsrConfig
|
|
16
|
+
async (pathname) => {
|
|
17
|
+
switch (pathname) {
|
|
18
|
+
case '/':
|
|
19
|
+
return {
|
|
20
|
+
input: '',
|
|
21
|
+
body: <Slot id="App" />,
|
|
22
|
+
};
|
|
23
|
+
default:
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { StrictMode } from 'react';
|
|
2
|
+
import { createRoot, hydrateRoot } from 'react-dom/client';
|
|
3
|
+
import { Root, Slot } from 'waku/client';
|
|
4
|
+
|
|
5
|
+
const rootElement = (
|
|
6
|
+
<StrictMode>
|
|
7
|
+
<Root>
|
|
8
|
+
<Slot id="App" />
|
|
9
|
+
</Root>
|
|
10
|
+
</StrictMode>
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
if (document.body.dataset.hydrate) {
|
|
14
|
+
hydrateRoot(document.body, rootElement);
|
|
15
|
+
} else {
|
|
16
|
+
createRoot(document.body).render(rootElement);
|
|
17
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Middleware } from 'waku/config';
|
|
2
|
+
|
|
3
|
+
const stringToStream = (str: string): ReadableStream => {
|
|
4
|
+
const encoder = new TextEncoder();
|
|
5
|
+
return new ReadableStream({
|
|
6
|
+
start(controller) {
|
|
7
|
+
controller.enqueue(encoder.encode(str));
|
|
8
|
+
controller.close();
|
|
9
|
+
},
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const apiMiddleware: Middleware = () => {
|
|
14
|
+
return async (ctx, next) => {
|
|
15
|
+
const path = ctx.req.url.pathname;
|
|
16
|
+
if (path === '/api/hello') {
|
|
17
|
+
ctx.res.body = stringToStream('world');
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
await next();
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default apiMiddleware;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"strict": true,
|
|
4
|
+
"target": "esnext",
|
|
5
|
+
"downlevelIteration": true,
|
|
6
|
+
"esModuleInterop": true,
|
|
7
|
+
"module": "esnext",
|
|
8
|
+
"moduleResolution": "bundler",
|
|
9
|
+
"skipLibCheck": true,
|
|
10
|
+
"noUncheckedIndexedAccess": true,
|
|
11
|
+
"exactOptionalPropertyTypes": true,
|
|
12
|
+
"types": ["react/experimental"],
|
|
13
|
+
"jsx": "react-jsx"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const DO_NOT_BUNDLE = '';
|
|
2
|
+
|
|
3
|
+
/** @type {import('waku/config').Config} */
|
|
4
|
+
export default {
|
|
5
|
+
middleware: (cmd: 'dev' | 'start') => [
|
|
6
|
+
import('./src/middleware/api.js'),
|
|
7
|
+
...(cmd === 'dev'
|
|
8
|
+
? [
|
|
9
|
+
import(
|
|
10
|
+
/* @vite-ignore */ DO_NOT_BUNDLE + 'waku/middleware/dev-server'
|
|
11
|
+
),
|
|
12
|
+
]
|
|
13
|
+
: []),
|
|
14
|
+
import('waku/middleware/headers'),
|
|
15
|
+
import('waku/middleware/ssr'),
|
|
16
|
+
import('waku/middleware/rsc'),
|
|
17
|
+
],
|
|
18
|
+
};
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
"start": "waku start"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"react": "19.0.0-rc
|
|
13
|
-
"react-dom": "19.0.0-rc
|
|
14
|
-
"react-server-dom-webpack": "19.0.0-rc
|
|
15
|
-
"waku": "0.21.0-
|
|
12
|
+
"react": "19.0.0-rc.0",
|
|
13
|
+
"react-dom": "19.0.0-rc.0",
|
|
14
|
+
"react-server-dom-webpack": "19.0.0-rc.0",
|
|
15
|
+
"waku": "0.21.0-beta.0"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@types/react": "18.3.3",
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
"start": "waku start"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"react": "19.0.0-rc
|
|
13
|
-
"react-dom": "19.0.0-rc
|
|
14
|
-
"react-server-dom-webpack": "19.0.0-rc
|
|
15
|
-
"waku": "0.21.0-
|
|
12
|
+
"react": "19.0.0-rc.0",
|
|
13
|
+
"react-dom": "19.0.0-rc.0",
|
|
14
|
+
"react-server-dom-webpack": "19.0.0-rc.0",
|
|
15
|
+
"waku": "0.21.0-beta.0"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@types/react": "18.3.3",
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
"@stylexjs/stylex": "0.6.1",
|
|
13
13
|
"@vanilla-extract/css": "1.15.2",
|
|
14
14
|
"classnames": "2.5.1",
|
|
15
|
-
"react": "19.0.0-rc
|
|
16
|
-
"react-dom": "19.0.0-rc
|
|
17
|
-
"react-server-dom-webpack": "19.0.0-rc
|
|
18
|
-
"waku": "0.21.0-
|
|
15
|
+
"react": "19.0.0-rc.0",
|
|
16
|
+
"react-dom": "19.0.0-rc.0",
|
|
17
|
+
"react-server-dom-webpack": "19.0.0-rc.0",
|
|
18
|
+
"waku": "0.21.0-beta.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@types/react": "18.3.3",
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
"start": "waku start"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"react": "19.0.0-rc
|
|
13
|
-
"react-dom": "19.0.0-rc
|
|
14
|
-
"react-server-dom-webpack": "19.0.0-rc
|
|
15
|
-
"waku": "0.21.0-
|
|
12
|
+
"react": "19.0.0-rc.0",
|
|
13
|
+
"react-dom": "19.0.0-rc.0",
|
|
14
|
+
"react-server-dom-webpack": "19.0.0-rc.0",
|
|
15
|
+
"waku": "0.21.0-beta.0"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@types/react": "18.3.3",
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
"start": "waku start"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"react": "19.0.0-rc
|
|
13
|
-
"react-dom": "19.0.0-rc
|
|
14
|
-
"react-server-dom-webpack": "19.0.0-rc
|
|
12
|
+
"react": "19.0.0-rc.0",
|
|
13
|
+
"react-dom": "19.0.0-rc.0",
|
|
14
|
+
"react-server-dom-webpack": "19.0.0-rc.0",
|
|
15
15
|
"react-tweet": "^3.2.0",
|
|
16
|
-
"waku": "0.21.0-
|
|
16
|
+
"waku": "0.21.0-beta.0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@types/react": "18.3.3",
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
"start": "waku start"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"react": "19.0.0-rc
|
|
13
|
-
"react-dom": "19.0.0-rc
|
|
14
|
-
"react-server-dom-webpack": "19.0.0-rc
|
|
15
|
-
"waku": "0.21.0-
|
|
12
|
+
"react": "19.0.0-rc.0",
|
|
13
|
+
"react-dom": "19.0.0-rc.0",
|
|
14
|
+
"react-server-dom-webpack": "19.0.0-rc.0",
|
|
15
|
+
"waku": "0.21.0-beta.0"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@types/react": "18.3.3",
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
"start": "waku start"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"react": "19.0.0-rc
|
|
13
|
-
"react-dom": "19.0.0-rc
|
|
14
|
-
"react-server-dom-webpack": "19.0.0-rc
|
|
15
|
-
"waku": "0.21.0-
|
|
12
|
+
"react": "19.0.0-rc.0",
|
|
13
|
+
"react-dom": "19.0.0-rc.0",
|
|
14
|
+
"react-server-dom-webpack": "19.0.0-rc.0",
|
|
15
|
+
"waku": "0.21.0-beta.0"
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
"start": "waku start"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"react": "19.0.0-rc
|
|
13
|
-
"react-dom": "19.0.0-rc
|
|
14
|
-
"react-server-dom-webpack": "19.0.0-rc
|
|
15
|
-
"waku": "0.21.0-
|
|
12
|
+
"react": "19.0.0-rc.0",
|
|
13
|
+
"react-dom": "19.0.0-rc.0",
|
|
14
|
+
"react-server-dom-webpack": "19.0.0-rc.0",
|
|
15
|
+
"waku": "0.21.0-beta.0"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@types/react": "18.3.3",
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
"start": "waku start"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"react": "19.0.0-rc
|
|
13
|
-
"react-dom": "19.0.0-rc
|
|
14
|
-
"react-server-dom-webpack": "19.0.0-rc
|
|
12
|
+
"react": "19.0.0-rc.0",
|
|
13
|
+
"react-dom": "19.0.0-rc.0",
|
|
14
|
+
"react-server-dom-webpack": "19.0.0-rc.0",
|
|
15
15
|
"react-wrap-balancer": "1.1.0",
|
|
16
|
-
"waku": "0.21.0-
|
|
16
|
+
"waku": "0.21.0-beta.0"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@types/react": "18.3.3",
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
'use server';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
rerender,
|
|
5
|
+
unstable_getCustomContext as getCustomContext,
|
|
6
|
+
} from 'waku/server';
|
|
4
7
|
|
|
5
8
|
export const greet = async (name: string) => {
|
|
6
9
|
await Promise.resolve();
|
|
7
|
-
console.log('
|
|
10
|
+
console.log('Custom Context:', getCustomContext()); // ---> {}
|
|
8
11
|
return `Hello ${name} from server!`;
|
|
9
12
|
};
|
|
10
13
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use server';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { unstable_getCustomContext as getCustomContext } from 'waku/server';
|
|
4
4
|
|
|
5
5
|
export const greet = async (name: string) => {
|
|
6
6
|
await Promise.resolve();
|
|
7
|
-
console.log('
|
|
7
|
+
console.log('Custom Context:', getCustomContext()); // ---> {}
|
|
8
8
|
return `Hello ${name} from server!`;
|
|
9
9
|
};
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
"start": "waku start"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"react": "19.0.0-rc
|
|
13
|
-
"react-dom": "19.0.0-rc
|
|
14
|
-
"react-server-dom-webpack": "19.0.0-rc
|
|
15
|
-
"waku": "0.21.0-
|
|
12
|
+
"react": "19.0.0-rc.0",
|
|
13
|
+
"react-dom": "19.0.0-rc.0",
|
|
14
|
+
"react-server-dom-webpack": "19.0.0-rc.0",
|
|
15
|
+
"waku": "0.21.0-beta.0"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@types/react": "18.3.3",
|