create-waku 0.6.2 → 0.6.4
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 +5 -3
- package/template/01_counter/package.json +7 -6
- package/template/02_async/package.json +7 -6
- package/template/03_promise/package.json +7 -6
- package/template/04_callserver/package.json +7 -6
- package/template/05_mutation/package.json +7 -6
- package/template/06_nesting/package.json +7 -6
- package/template/07_router/package.json +7 -6
- package/template/08_cookies/db/items.json +12 -0
- package/template/08_cookies/package.json +4 -4
- package/template/08_cookies/src/components/App.tsx +2 -1
- package/template/08_cookies/src/entries.tsx +13 -1
- package/template/09_cssmodules/package.json +7 -6
- package/template/10_dynamicroute/package.json +7 -6
- package/template/11_form/package.json +7 -6
- package/template/01_counter/dist/components/App.js +0 -6
- package/template/01_counter/dist/components/Counter.js +0 -7
- package/template/01_counter/dist/entries.js +0 -32
- package/template/01_counter/dist/main.js +0 -11
- package/template/01_counter/node_modules/.bin/tsc +0 -17
- package/template/01_counter/node_modules/.bin/tsserver +0 -17
- package/template/01_counter/node_modules/.bin/vite +0 -17
- package/template/01_counter/node_modules/.bin/waku +0 -17
- package/template/02_async/dist/components/App.js +0 -13
- package/template/02_async/dist/components/Counter.js +0 -7
- package/template/02_async/dist/entries.js +0 -32
- package/template/02_async/dist/main.js +0 -11
- package/template/02_async/node_modules/.bin/tsc +0 -17
- package/template/02_async/node_modules/.bin/tsserver +0 -17
- package/template/02_async/node_modules/.bin/vite +0 -17
- package/template/02_async/node_modules/.bin/waku +0 -17
- package/template/03_promise/dist/components/App.js +0 -9
- package/template/03_promise/dist/components/Counter.js +0 -8
- package/template/03_promise/dist/entries.js +0 -32
- package/template/03_promise/dist/main.js +0 -11
- package/template/03_promise/node_modules/.bin/tsc +0 -17
- package/template/03_promise/node_modules/.bin/tsserver +0 -17
- package/template/03_promise/node_modules/.bin/vite +0 -17
- package/template/03_promise/node_modules/.bin/waku +0 -17
- package/template/04_callserver/dist/components/App.js +0 -7
- package/template/04_callserver/dist/components/Counter.js +0 -15
- package/template/04_callserver/dist/components/TextBox.js +0 -6
- package/template/04_callserver/dist/components/funcs.js +0 -2
- package/template/04_callserver/dist/entries.js +0 -32
- package/template/04_callserver/dist/main.js +0 -11
- package/template/04_callserver/node_modules/.bin/tsc +0 -17
- package/template/04_callserver/node_modules/.bin/tsserver +0 -17
- package/template/04_callserver/node_modules/.bin/vite +0 -17
- package/template/04_callserver/node_modules/.bin/waku +0 -17
- package/template/05_mutation/dist/components/App.js +0 -8
- package/template/05_mutation/dist/components/Counter.js +0 -13
- package/template/05_mutation/dist/components/funcs.js +0 -9
- package/template/05_mutation/dist/entries.js +0 -32
- package/template/05_mutation/dist/main.js +0 -11
- package/template/05_mutation/node_modules/.bin/tsc +0 -17
- package/template/05_mutation/node_modules/.bin/tsserver +0 -17
- package/template/05_mutation/node_modules/.bin/vite +0 -17
- package/template/05_mutation/node_modules/.bin/waku +0 -17
- package/template/06_nesting/dist/components/App.js +0 -6
- package/template/06_nesting/dist/components/Counter.js +0 -24
- package/template/06_nesting/dist/components/InnerApp.js +0 -6
- package/template/06_nesting/dist/entries.js +0 -46
- package/template/06_nesting/dist/main.js +0 -11
- package/template/06_nesting/node_modules/.bin/tsc +0 -17
- package/template/06_nesting/node_modules/.bin/tsserver +0 -17
- package/template/06_nesting/node_modules/.bin/vite +0 -17
- package/template/06_nesting/node_modules/.bin/waku +0 -17
- package/template/07_router/dist/node/tsconfig.node.tsbuildinfo +0 -1
- package/template/07_router/dist/node/vite.config.d.ts +0 -15
- package/template/07_router/dist/node/vite.config.js +0 -19
- package/template/07_router/dist/src/components/Counter.d.ts +0 -1
- package/template/07_router/dist/src/components/Counter.js +0 -8
- package/template/07_router/dist/src/components/ErrorBoundary.d.ts +0 -7
- package/template/07_router/dist/src/components/ErrorBoundary.js +0 -17
- package/template/07_router/dist/src/entries.d.ts +0 -6
- package/template/07_router/dist/src/entries.js +0 -29
- package/template/07_router/dist/src/main.d.ts +0 -1
- package/template/07_router/dist/src/main.js +0 -12
- package/template/07_router/dist/src/routes/bar/page.d.ts +0 -2
- package/template/07_router/dist/src/routes/bar/page.js +0 -4
- package/template/07_router/dist/src/routes/foo/page.d.ts +0 -2
- package/template/07_router/dist/src/routes/foo/page.js +0 -4
- package/template/07_router/dist/src/routes/layout.d.ts +0 -5
- package/template/07_router/dist/src/routes/layout.js +0 -9
- package/template/07_router/dist/src/routes/nested/baz/page.d.ts +0 -2
- package/template/07_router/dist/src/routes/nested/baz/page.js +0 -3
- package/template/07_router/dist/src/routes/nested/layout.d.ts +0 -5
- package/template/07_router/dist/src/routes/nested/layout.js +0 -4
- package/template/07_router/dist/src/routes/nested/qux/page.d.ts +0 -2
- package/template/07_router/dist/src/routes/nested/qux/page.js +0 -3
- package/template/07_router/dist/src/routes/page.d.ts +0 -2
- package/template/07_router/dist/src/routes/page.js +0 -3
- package/template/07_router/dist/tsconfig.tsbuildinfo +0 -1
- package/template/07_router/node_modules/.bin/glob +0 -17
- package/template/07_router/node_modules/.bin/tsc +0 -17
- package/template/07_router/node_modules/.bin/tsserver +0 -17
- package/template/07_router/node_modules/.bin/vite +0 -17
- package/template/07_router/node_modules/.bin/waku +0 -17
- package/template/08_cookies/dist/components/App.js +0 -8
- package/template/08_cookies/dist/components/Counter.js +0 -7
- package/template/08_cookies/dist/entries.js +0 -35
- package/template/08_cookies/dist/main.js +0 -11
- package/template/08_cookies/node_modules/.bin/tsc +0 -17
- package/template/08_cookies/node_modules/.bin/tsserver +0 -17
- package/template/08_cookies/node_modules/.bin/vite +0 -17
- package/template/08_cookies/node_modules/.bin/waku +0 -17
- package/template/09_cssmodules/dist/components/App.js +0 -8
- package/template/09_cssmodules/dist/components/Counter.js +0 -7
- package/template/09_cssmodules/dist/entries.js +0 -32
- package/template/09_cssmodules/dist/main.js +0 -11
- package/template/09_cssmodules/node_modules/.bin/tsc +0 -17
- package/template/09_cssmodules/node_modules/.bin/tsserver +0 -17
- package/template/09_cssmodules/node_modules/.bin/vite +0 -17
- package/template/09_cssmodules/node_modules/.bin/waku +0 -17
- package/template/10_dynamicroute/dist/node/tsconfig.node.tsbuildinfo +0 -1
- package/template/10_dynamicroute/dist/node/vite.config.d.ts +0 -15
- package/template/10_dynamicroute/dist/node/vite.config.js +0 -19
- package/template/10_dynamicroute/dist/src/entries.d.ts +0 -6
- package/template/10_dynamicroute/dist/src/entries.js +0 -61
- package/template/10_dynamicroute/dist/src/main.d.ts +0 -1
- package/template/10_dynamicroute/dist/src/main.js +0 -11
- package/template/10_dynamicroute/dist/src/routes/[name]/page.d.ts +0 -4
- package/template/10_dynamicroute/dist/src/routes/[name]/page.js +0 -3
- package/template/10_dynamicroute/dist/src/routes/layout.d.ts +0 -5
- package/template/10_dynamicroute/dist/src/routes/layout.js +0 -4
- package/template/10_dynamicroute/dist/src/routes/page.d.ts +0 -2
- package/template/10_dynamicroute/dist/src/routes/page.js +0 -3
- package/template/10_dynamicroute/dist/tsconfig.tsbuildinfo +0 -1
- package/template/10_dynamicroute/node_modules/.bin/glob +0 -17
- package/template/10_dynamicroute/node_modules/.bin/tsc +0 -17
- package/template/10_dynamicroute/node_modules/.bin/tsserver +0 -17
- package/template/10_dynamicroute/node_modules/.bin/vite +0 -17
- package/template/10_dynamicroute/node_modules/.bin/waku +0 -17
- package/template/11_form/dist/components/App.js +0 -8
- package/template/11_form/dist/components/Counter.js +0 -13
- package/template/11_form/dist/components/Form.js +0 -10
- package/template/11_form/dist/components/funcs.js +0 -10
- package/template/11_form/dist/entries.js +0 -32
- package/template/11_form/dist/main.js +0 -11
- package/template/11_form/node_modules/.bin/tsc +0 -17
- package/template/11_form/node_modules/.bin/tsserver +0 -17
- package/template/11_form/node_modules/.bin/vite +0 -17
- package/template/11_form/node_modules/.bin/waku +0 -17
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
6
|
-
esac
|
|
7
|
-
|
|
8
|
-
if [ -z "$NODE_PATH" ]; then
|
|
9
|
-
export NODE_PATH="/home/runner/work/waku/waku/packages/waku/dist/node_modules:/home/runner/work/waku/waku/packages/waku/node_modules:/home/runner/work/waku/waku/packages/node_modules:/home/runner/work/waku/waku/node_modules:/home/runner/work/waku/node_modules:/home/runner/work/node_modules:/home/runner/node_modules:/home/node_modules:/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/node_modules"
|
|
10
|
-
else
|
|
11
|
-
export NODE_PATH="/home/runner/work/waku/waku/packages/waku/dist/node_modules:/home/runner/work/waku/waku/packages/waku/node_modules:/home/runner/work/waku/waku/packages/node_modules:/home/runner/work/waku/waku/node_modules:/home/runner/work/waku/node_modules:/home/runner/work/node_modules:/home/runner/node_modules:/home/node_modules:/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
12
|
-
fi
|
|
13
|
-
if [ -x "$basedir/node" ]; then
|
|
14
|
-
exec "$basedir/node" "$basedir/../waku/dist/cli.js" "$@"
|
|
15
|
-
else
|
|
16
|
-
exec node "$basedir/../waku/dist/cli.js" "$@"
|
|
17
|
-
fi
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Counter } from './Counter.js';
|
|
3
|
-
const App = ({ name, children }) => {
|
|
4
|
-
const delayedMessage = new Promise((resolve) => {
|
|
5
|
-
setTimeout(() => resolve('Hello from server!'), 2000);
|
|
6
|
-
});
|
|
7
|
-
return (_jsxs("div", { style: { border: '3px red dashed', margin: '1em', padding: '1em' }, children: [_jsxs("h1", { children: ["Hello ", name, "!!"] }), _jsx("h3", { children: "This is a server component." }), _jsx(Counter, { delayedMessage: delayedMessage }), children] }));
|
|
8
|
-
};
|
|
9
|
-
export default App;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { Suspense, useState } from 'react';
|
|
4
|
-
export const Counter = ({ delayedMessage, }) => {
|
|
5
|
-
const [count, setCount] = useState(0);
|
|
6
|
-
return (_jsxs("div", { style: { border: '3px blue dashed', margin: '1em', padding: '1em' }, children: [_jsxs("p", { children: ["Count: ", count] }), _jsx("button", { onClick: () => setCount((c) => c + 1), children: "Increment" }), _jsx("h3", { children: "This is a client component." }), _jsx(Suspense, { fallback: "Pending...", children: _jsx(Message, { count: count, delayedMessage: delayedMessage }) })] }));
|
|
7
|
-
};
|
|
8
|
-
const Message = ({ count, delayedMessage, }) => (_jsxs("ul", { children: [_jsxs("li", { children: ["count: ", count] }), _jsxs("li", { children: ["delayedMessage: ", delayedMessage] })] }));
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { lazy } from 'react';
|
|
3
|
-
import { defineEntries } from 'waku/server';
|
|
4
|
-
import { Children, Slot } from 'waku/client';
|
|
5
|
-
const App = lazy(() => import('./components/App.js'));
|
|
6
|
-
export default defineEntries(
|
|
7
|
-
// renderEntries
|
|
8
|
-
async (input) => {
|
|
9
|
-
return {
|
|
10
|
-
App: (_jsx(App, { name: input || 'Waku', children: _jsx(Children, {}) })),
|
|
11
|
-
};
|
|
12
|
-
},
|
|
13
|
-
// getBuildConfig
|
|
14
|
-
async () => {
|
|
15
|
-
return {
|
|
16
|
-
'/': {
|
|
17
|
-
entries: [['']],
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
},
|
|
21
|
-
// getSsrConfig
|
|
22
|
-
async (pathStr) => {
|
|
23
|
-
switch (pathStr) {
|
|
24
|
-
case '/':
|
|
25
|
-
return {
|
|
26
|
-
input: '',
|
|
27
|
-
unstable_render: () => (_jsx(Slot, { id: "App", children: _jsx("h3", { children: "A client element" }) })),
|
|
28
|
-
};
|
|
29
|
-
default:
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { StrictMode } from 'react';
|
|
3
|
-
import { createRoot, hydrateRoot } from 'react-dom/client';
|
|
4
|
-
import { Root, Slot } from 'waku/client';
|
|
5
|
-
const rootElement = (_jsx(StrictMode, { children: _jsx(Root, { children: _jsx(Slot, { id: "App", children: _jsx("h3", { children: "A client element" }) }) }) }));
|
|
6
|
-
if (globalThis.__WAKU_SSR_ENABLED__) {
|
|
7
|
-
hydrateRoot(document.getElementById('root'), rootElement);
|
|
8
|
-
}
|
|
9
|
-
else {
|
|
10
|
-
createRoot(document.getElementById('root')).render(rootElement);
|
|
11
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
6
|
-
esac
|
|
7
|
-
|
|
8
|
-
if [ -z "$NODE_PATH" ]; then
|
|
9
|
-
export NODE_PATH="/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/bin/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/node_modules"
|
|
10
|
-
else
|
|
11
|
-
export NODE_PATH="/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/bin/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
12
|
-
fi
|
|
13
|
-
if [ -x "$basedir/node" ]; then
|
|
14
|
-
exec "$basedir/node" "$basedir/../typescript/bin/tsc" "$@"
|
|
15
|
-
else
|
|
16
|
-
exec node "$basedir/../typescript/bin/tsc" "$@"
|
|
17
|
-
fi
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
6
|
-
esac
|
|
7
|
-
|
|
8
|
-
if [ -z "$NODE_PATH" ]; then
|
|
9
|
-
export NODE_PATH="/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/bin/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/node_modules"
|
|
10
|
-
else
|
|
11
|
-
export NODE_PATH="/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/bin/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
12
|
-
fi
|
|
13
|
-
if [ -x "$basedir/node" ]; then
|
|
14
|
-
exec "$basedir/node" "$basedir/../typescript/bin/tsserver" "$@"
|
|
15
|
-
else
|
|
16
|
-
exec node "$basedir/../typescript/bin/tsserver" "$@"
|
|
17
|
-
fi
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
6
|
-
esac
|
|
7
|
-
|
|
8
|
-
if [ -z "$NODE_PATH" ]; then
|
|
9
|
-
export NODE_PATH="/home/runner/work/waku/waku/node_modules/.pnpm/vite@4.5.0_@types+node@20.9.0/node_modules/vite/bin/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/vite@4.5.0_@types+node@20.9.0/node_modules/vite/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/vite@4.5.0_@types+node@20.9.0/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/node_modules"
|
|
10
|
-
else
|
|
11
|
-
export NODE_PATH="/home/runner/work/waku/waku/node_modules/.pnpm/vite@4.5.0_@types+node@20.9.0/node_modules/vite/bin/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/vite@4.5.0_@types+node@20.9.0/node_modules/vite/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/vite@4.5.0_@types+node@20.9.0/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
12
|
-
fi
|
|
13
|
-
if [ -x "$basedir/node" ]; then
|
|
14
|
-
exec "$basedir/node" "$basedir/../vite/bin/vite.js" "$@"
|
|
15
|
-
else
|
|
16
|
-
exec node "$basedir/../vite/bin/vite.js" "$@"
|
|
17
|
-
fi
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
6
|
-
esac
|
|
7
|
-
|
|
8
|
-
if [ -z "$NODE_PATH" ]; then
|
|
9
|
-
export NODE_PATH="/home/runner/work/waku/waku/packages/waku/dist/node_modules:/home/runner/work/waku/waku/packages/waku/node_modules:/home/runner/work/waku/waku/packages/node_modules:/home/runner/work/waku/waku/node_modules:/home/runner/work/waku/node_modules:/home/runner/work/node_modules:/home/runner/node_modules:/home/node_modules:/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/node_modules"
|
|
10
|
-
else
|
|
11
|
-
export NODE_PATH="/home/runner/work/waku/waku/packages/waku/dist/node_modules:/home/runner/work/waku/waku/packages/waku/node_modules:/home/runner/work/waku/waku/packages/node_modules:/home/runner/work/waku/waku/node_modules:/home/runner/work/waku/node_modules:/home/runner/work/node_modules:/home/runner/node_modules:/home/node_modules:/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
12
|
-
fi
|
|
13
|
-
if [ -x "$basedir/node" ]; then
|
|
14
|
-
exec "$basedir/node" "$basedir/../waku/dist/cli.js" "$@"
|
|
15
|
-
else
|
|
16
|
-
exec node "$basedir/../waku/dist/cli.js" "$@"
|
|
17
|
-
fi
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Counter } from './Counter.js';
|
|
3
|
-
import { greet } from './funcs.js';
|
|
4
|
-
const App = ({ name }) => {
|
|
5
|
-
return (_jsxs("div", { style: { border: '3px red dashed', margin: '1em', padding: '1em' }, children: [_jsxs("h1", { children: ["Hello ", name, "!!"] }), _jsx("h3", { children: "This is a server component." }), _jsx(Counter, { greet: greet })] }));
|
|
6
|
-
};
|
|
7
|
-
export default App;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { useState, useTransition } from 'react';
|
|
4
|
-
import { TextBox } from './TextBox.js';
|
|
5
|
-
export const Counter = ({ greet, }) => {
|
|
6
|
-
const [count, setCount] = useState(0);
|
|
7
|
-
const [text, setText] = useState('');
|
|
8
|
-
const [isPending, startTransition] = useTransition();
|
|
9
|
-
const handleClick = () => {
|
|
10
|
-
startTransition(() => {
|
|
11
|
-
setText(greet('c=' + count));
|
|
12
|
-
});
|
|
13
|
-
};
|
|
14
|
-
return (_jsxs("div", { style: { border: '3px blue dashed', margin: '1em', padding: '1em' }, children: [_jsxs("p", { children: ["Count: ", count] }), _jsx("button", { onClick: () => setCount((c) => c + 1), children: "Increment" }), _jsxs("p", { children: [_jsxs("button", { onClick: handleClick, children: ["greet(\"c=\" + count) = ", text] }), ' ', isPending ? 'Pending...' : ''] }), _jsx("h3", { children: "This is a client component." }), _jsx(TextBox, {})] }));
|
|
15
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from 'react';
|
|
3
|
-
export const TextBox = () => {
|
|
4
|
-
const [text, setText] = useState('hello');
|
|
5
|
-
return (_jsxs("div", { children: [_jsx("input", { value: text, onChange: (e) => setText(e.target.value) }), _jsx("span", { children: text.toUpperCase() })] }));
|
|
6
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { lazy } from 'react';
|
|
3
|
-
import { defineEntries } from 'waku/server';
|
|
4
|
-
import { Slot } from 'waku/client';
|
|
5
|
-
const App = lazy(() => import('./components/App.js'));
|
|
6
|
-
export default defineEntries(
|
|
7
|
-
// renderEntries
|
|
8
|
-
async (input) => {
|
|
9
|
-
return {
|
|
10
|
-
App: _jsx(App, { name: input || 'Waku' }),
|
|
11
|
-
};
|
|
12
|
-
},
|
|
13
|
-
// getBuildConfig
|
|
14
|
-
async () => {
|
|
15
|
-
return {
|
|
16
|
-
'/': {
|
|
17
|
-
entries: [['']],
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
},
|
|
21
|
-
// getSsrConfig
|
|
22
|
-
async (pathStr) => {
|
|
23
|
-
switch (pathStr) {
|
|
24
|
-
case '/':
|
|
25
|
-
return {
|
|
26
|
-
input: '',
|
|
27
|
-
unstable_render: () => _jsx(Slot, { id: "App" }),
|
|
28
|
-
};
|
|
29
|
-
default:
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { StrictMode } from 'react';
|
|
3
|
-
import { createRoot, hydrateRoot } from 'react-dom/client';
|
|
4
|
-
import { Root, Slot } from 'waku/client';
|
|
5
|
-
const rootElement = (_jsx(StrictMode, { children: _jsx(Root, { children: _jsx(Slot, { id: "App" }) }) }));
|
|
6
|
-
if (globalThis.__WAKU_SSR_ENABLED__) {
|
|
7
|
-
hydrateRoot(document.getElementById('root'), rootElement);
|
|
8
|
-
}
|
|
9
|
-
else {
|
|
10
|
-
createRoot(document.getElementById('root')).render(rootElement);
|
|
11
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
6
|
-
esac
|
|
7
|
-
|
|
8
|
-
if [ -z "$NODE_PATH" ]; then
|
|
9
|
-
export NODE_PATH="/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/bin/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/node_modules"
|
|
10
|
-
else
|
|
11
|
-
export NODE_PATH="/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/bin/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
12
|
-
fi
|
|
13
|
-
if [ -x "$basedir/node" ]; then
|
|
14
|
-
exec "$basedir/node" "$basedir/../typescript/bin/tsc" "$@"
|
|
15
|
-
else
|
|
16
|
-
exec node "$basedir/../typescript/bin/tsc" "$@"
|
|
17
|
-
fi
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
6
|
-
esac
|
|
7
|
-
|
|
8
|
-
if [ -z "$NODE_PATH" ]; then
|
|
9
|
-
export NODE_PATH="/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/bin/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/node_modules"
|
|
10
|
-
else
|
|
11
|
-
export NODE_PATH="/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/bin/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
12
|
-
fi
|
|
13
|
-
if [ -x "$basedir/node" ]; then
|
|
14
|
-
exec "$basedir/node" "$basedir/../typescript/bin/tsserver" "$@"
|
|
15
|
-
else
|
|
16
|
-
exec node "$basedir/../typescript/bin/tsserver" "$@"
|
|
17
|
-
fi
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
6
|
-
esac
|
|
7
|
-
|
|
8
|
-
if [ -z "$NODE_PATH" ]; then
|
|
9
|
-
export NODE_PATH="/home/runner/work/waku/waku/node_modules/.pnpm/vite@4.5.0_@types+node@20.9.0/node_modules/vite/bin/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/vite@4.5.0_@types+node@20.9.0/node_modules/vite/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/vite@4.5.0_@types+node@20.9.0/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/node_modules"
|
|
10
|
-
else
|
|
11
|
-
export NODE_PATH="/home/runner/work/waku/waku/node_modules/.pnpm/vite@4.5.0_@types+node@20.9.0/node_modules/vite/bin/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/vite@4.5.0_@types+node@20.9.0/node_modules/vite/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/vite@4.5.0_@types+node@20.9.0/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
12
|
-
fi
|
|
13
|
-
if [ -x "$basedir/node" ]; then
|
|
14
|
-
exec "$basedir/node" "$basedir/../vite/bin/vite.js" "$@"
|
|
15
|
-
else
|
|
16
|
-
exec node "$basedir/../vite/bin/vite.js" "$@"
|
|
17
|
-
fi
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
6
|
-
esac
|
|
7
|
-
|
|
8
|
-
if [ -z "$NODE_PATH" ]; then
|
|
9
|
-
export NODE_PATH="/home/runner/work/waku/waku/packages/waku/dist/node_modules:/home/runner/work/waku/waku/packages/waku/node_modules:/home/runner/work/waku/waku/packages/node_modules:/home/runner/work/waku/waku/node_modules:/home/runner/work/waku/node_modules:/home/runner/work/node_modules:/home/runner/node_modules:/home/node_modules:/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/node_modules"
|
|
10
|
-
else
|
|
11
|
-
export NODE_PATH="/home/runner/work/waku/waku/packages/waku/dist/node_modules:/home/runner/work/waku/waku/packages/waku/node_modules:/home/runner/work/waku/waku/packages/node_modules:/home/runner/work/waku/waku/node_modules:/home/runner/work/waku/node_modules:/home/runner/work/node_modules:/home/runner/node_modules:/home/node_modules:/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
12
|
-
fi
|
|
13
|
-
if [ -x "$basedir/node" ]; then
|
|
14
|
-
exec "$basedir/node" "$basedir/../waku/dist/cli.js" "$@"
|
|
15
|
-
else
|
|
16
|
-
exec node "$basedir/../waku/dist/cli.js" "$@"
|
|
17
|
-
fi
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Balancer } from 'react-wrap-balancer';
|
|
3
|
-
import { Counter } from './Counter.js';
|
|
4
|
-
import { getCounter, increment } from './funcs.js';
|
|
5
|
-
const App = ({ name }) => {
|
|
6
|
-
return (_jsxs("div", { style: { border: '3px red dashed', margin: '1em', padding: '1em' }, children: [_jsxs("h1", { children: ["Hello ", name, "!!"] }), _jsx("h3", { children: "This is a server component." }), _jsxs("p", { children: ["Server counter: ", getCounter()] }), _jsx(Counter, { increment: increment }), _jsx(Balancer, { children: "My Awesome Title" })] }));
|
|
7
|
-
};
|
|
8
|
-
export default App;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { useState, useTransition } from 'react';
|
|
4
|
-
export const Counter = ({ increment }) => {
|
|
5
|
-
const [count, setCount] = useState(0);
|
|
6
|
-
const [isPending, startTransition] = useTransition();
|
|
7
|
-
const handleClick = () => {
|
|
8
|
-
startTransition(() => {
|
|
9
|
-
increment();
|
|
10
|
-
});
|
|
11
|
-
};
|
|
12
|
-
return (_jsxs("div", { style: { border: '3px blue dashed', margin: '1em', padding: '1em' }, children: [_jsxs("p", { children: ["Count: ", count] }), _jsx("button", { onClick: () => setCount((c) => c + 1), children: "Increment" }), _jsxs("p", { children: [_jsx("button", { onClick: handleClick, children: "Increment server counter" }), ' ', isPending ? 'Pending...' : ''] }), _jsx("h3", { children: "This is a client component." })] }));
|
|
13
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { lazy } from 'react';
|
|
3
|
-
import { defineEntries } from 'waku/server';
|
|
4
|
-
import { Slot } from 'waku/client';
|
|
5
|
-
const App = lazy(() => import('./components/App.js'));
|
|
6
|
-
export default defineEntries(
|
|
7
|
-
// renderEntries
|
|
8
|
-
async (input) => {
|
|
9
|
-
return {
|
|
10
|
-
App: _jsx(App, { name: input || 'Waku' }),
|
|
11
|
-
};
|
|
12
|
-
},
|
|
13
|
-
// getBuildConfig
|
|
14
|
-
async () => {
|
|
15
|
-
return {
|
|
16
|
-
'/': {
|
|
17
|
-
entries: [['']],
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
},
|
|
21
|
-
// getSsrConfig
|
|
22
|
-
async (pathStr) => {
|
|
23
|
-
switch (pathStr) {
|
|
24
|
-
case '/':
|
|
25
|
-
return {
|
|
26
|
-
input: '',
|
|
27
|
-
unstable_render: () => _jsx(Slot, { id: "App" }),
|
|
28
|
-
};
|
|
29
|
-
default:
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { StrictMode } from 'react';
|
|
3
|
-
import { createRoot, hydrateRoot } from 'react-dom/client';
|
|
4
|
-
import { Root, Slot } from 'waku/client';
|
|
5
|
-
const rootElement = (_jsx(StrictMode, { children: _jsx(Root, { children: _jsx(Slot, { id: "App" }) }) }));
|
|
6
|
-
if (globalThis.__WAKU_SSR_ENABLED__) {
|
|
7
|
-
hydrateRoot(document.getElementById('root'), rootElement);
|
|
8
|
-
}
|
|
9
|
-
else {
|
|
10
|
-
createRoot(document.getElementById('root')).render(rootElement);
|
|
11
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
6
|
-
esac
|
|
7
|
-
|
|
8
|
-
if [ -z "$NODE_PATH" ]; then
|
|
9
|
-
export NODE_PATH="/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/bin/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/node_modules"
|
|
10
|
-
else
|
|
11
|
-
export NODE_PATH="/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/bin/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
12
|
-
fi
|
|
13
|
-
if [ -x "$basedir/node" ]; then
|
|
14
|
-
exec "$basedir/node" "$basedir/../typescript/bin/tsc" "$@"
|
|
15
|
-
else
|
|
16
|
-
exec node "$basedir/../typescript/bin/tsc" "$@"
|
|
17
|
-
fi
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
6
|
-
esac
|
|
7
|
-
|
|
8
|
-
if [ -z "$NODE_PATH" ]; then
|
|
9
|
-
export NODE_PATH="/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/bin/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/node_modules"
|
|
10
|
-
else
|
|
11
|
-
export NODE_PATH="/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/bin/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
12
|
-
fi
|
|
13
|
-
if [ -x "$basedir/node" ]; then
|
|
14
|
-
exec "$basedir/node" "$basedir/../typescript/bin/tsserver" "$@"
|
|
15
|
-
else
|
|
16
|
-
exec node "$basedir/../typescript/bin/tsserver" "$@"
|
|
17
|
-
fi
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
6
|
-
esac
|
|
7
|
-
|
|
8
|
-
if [ -z "$NODE_PATH" ]; then
|
|
9
|
-
export NODE_PATH="/home/runner/work/waku/waku/node_modules/.pnpm/vite@4.5.0_@types+node@20.9.0/node_modules/vite/bin/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/vite@4.5.0_@types+node@20.9.0/node_modules/vite/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/vite@4.5.0_@types+node@20.9.0/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/node_modules"
|
|
10
|
-
else
|
|
11
|
-
export NODE_PATH="/home/runner/work/waku/waku/node_modules/.pnpm/vite@4.5.0_@types+node@20.9.0/node_modules/vite/bin/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/vite@4.5.0_@types+node@20.9.0/node_modules/vite/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/vite@4.5.0_@types+node@20.9.0/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
12
|
-
fi
|
|
13
|
-
if [ -x "$basedir/node" ]; then
|
|
14
|
-
exec "$basedir/node" "$basedir/../vite/bin/vite.js" "$@"
|
|
15
|
-
else
|
|
16
|
-
exec node "$basedir/../vite/bin/vite.js" "$@"
|
|
17
|
-
fi
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
6
|
-
esac
|
|
7
|
-
|
|
8
|
-
if [ -z "$NODE_PATH" ]; then
|
|
9
|
-
export NODE_PATH="/home/runner/work/waku/waku/packages/waku/dist/node_modules:/home/runner/work/waku/waku/packages/waku/node_modules:/home/runner/work/waku/waku/packages/node_modules:/home/runner/work/waku/waku/node_modules:/home/runner/work/waku/node_modules:/home/runner/work/node_modules:/home/runner/node_modules:/home/node_modules:/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/node_modules"
|
|
10
|
-
else
|
|
11
|
-
export NODE_PATH="/home/runner/work/waku/waku/packages/waku/dist/node_modules:/home/runner/work/waku/waku/packages/waku/node_modules:/home/runner/work/waku/waku/packages/node_modules:/home/runner/work/waku/waku/node_modules:/home/runner/work/waku/node_modules:/home/runner/work/node_modules:/home/runner/node_modules:/home/node_modules:/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
12
|
-
fi
|
|
13
|
-
if [ -x "$basedir/node" ]; then
|
|
14
|
-
exec "$basedir/node" "$basedir/../waku/dist/cli.js" "$@"
|
|
15
|
-
else
|
|
16
|
-
exec node "$basedir/../waku/dist/cli.js" "$@"
|
|
17
|
-
fi
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Counter } from './Counter.js';
|
|
3
|
-
const App = ({ name }) => {
|
|
4
|
-
return (_jsxs("div", { style: { border: '3px red dashed', margin: '1em', padding: '1em' }, children: [_jsxs("h1", { children: ["Hello ", name, "!!"] }), _jsx("h3", { children: "This is a server component." }), _jsx(Counter, { enableInnerApp: true })] }));
|
|
5
|
-
};
|
|
6
|
-
export default App;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { useState, useTransition } from 'react';
|
|
4
|
-
import { Slot, useRefetch } from 'waku/client';
|
|
5
|
-
export const Counter = ({ enableInnerApp }) => {
|
|
6
|
-
const [count, setCount] = useState(0);
|
|
7
|
-
const [isPending, startTransition] = useTransition();
|
|
8
|
-
const refetch = useRefetch();
|
|
9
|
-
const handleClick = () => {
|
|
10
|
-
if (enableInnerApp) {
|
|
11
|
-
startTransition(() => {
|
|
12
|
-
const nextCount = count + 1;
|
|
13
|
-
setCount(nextCount);
|
|
14
|
-
if (enableInnerApp) {
|
|
15
|
-
refetch('InnerApp=' + nextCount);
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
setCount((c) => c + 1);
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
return (_jsxs("div", { style: { border: '3px blue dashed', margin: '1em', padding: '1em' }, children: [_jsxs("p", { children: ["Count: ", count] }), _jsx("button", { onClick: handleClick, children: "Increment" }), ' ', isPending && 'Pending...', _jsx("h3", { children: "This is a client component." }), enableInnerApp && _jsx(Slot, { id: "InnerApp" })] }));
|
|
24
|
-
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Counter } from './Counter.js';
|
|
3
|
-
const InnerApp = ({ count }) => {
|
|
4
|
-
return (_jsxs("div", { style: { border: '3px red dashed', margin: '1em', padding: '1em' }, children: [_jsx("h3", { children: "This is another server component." }), _jsxs("p", { children: ["The outer count is ", count, "."] }), _jsx(Counter, {})] }));
|
|
5
|
-
};
|
|
6
|
-
export default InnerApp;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { lazy } from 'react';
|
|
3
|
-
import { defineEntries } from 'waku/server';
|
|
4
|
-
import { Slot } from 'waku/client';
|
|
5
|
-
const App = lazy(() => import('./components/App.js'));
|
|
6
|
-
const InnerApp = lazy(() => import('./components/InnerApp.js'));
|
|
7
|
-
export default defineEntries(
|
|
8
|
-
// renderEntries
|
|
9
|
-
async (input) => {
|
|
10
|
-
const params = new URLSearchParams(input || 'App=Waku&InnerApp=0');
|
|
11
|
-
const result = {};
|
|
12
|
-
if (params.has('App')) {
|
|
13
|
-
result.App = _jsx(App, { name: params.get('App') });
|
|
14
|
-
}
|
|
15
|
-
if (params.has('InnerApp')) {
|
|
16
|
-
result.InnerApp = _jsx(InnerApp, { count: Number(params.get('InnerApp')) });
|
|
17
|
-
}
|
|
18
|
-
return result;
|
|
19
|
-
},
|
|
20
|
-
// getBuildConfig
|
|
21
|
-
async () => {
|
|
22
|
-
return {
|
|
23
|
-
'/': {
|
|
24
|
-
entries: [
|
|
25
|
-
[''],
|
|
26
|
-
['InnerApp=1', true],
|
|
27
|
-
['InnerApp=2', true],
|
|
28
|
-
['InnerApp=3', true],
|
|
29
|
-
['InnerApp=4', true],
|
|
30
|
-
['InnerApp=5', true],
|
|
31
|
-
],
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
},
|
|
35
|
-
// getSsrConfig
|
|
36
|
-
async (pathStr) => {
|
|
37
|
-
switch (pathStr) {
|
|
38
|
-
case '/':
|
|
39
|
-
return {
|
|
40
|
-
input: '',
|
|
41
|
-
unstable_render: () => _jsx(Slot, { id: "App" }),
|
|
42
|
-
};
|
|
43
|
-
default:
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { StrictMode } from 'react';
|
|
3
|
-
import { createRoot, hydrateRoot } from 'react-dom/client';
|
|
4
|
-
import { Root, Slot } from 'waku/client';
|
|
5
|
-
const rootElement = (_jsx(StrictMode, { children: _jsx(Root, { children: _jsx(Slot, { id: "App" }) }) }));
|
|
6
|
-
if (globalThis.__WAKU_SSR_ENABLED__) {
|
|
7
|
-
hydrateRoot(document.getElementById('root'), rootElement);
|
|
8
|
-
}
|
|
9
|
-
else {
|
|
10
|
-
createRoot(document.getElementById('root')).render(rootElement);
|
|
11
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
-
|
|
4
|
-
case `uname` in
|
|
5
|
-
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
|
|
6
|
-
esac
|
|
7
|
-
|
|
8
|
-
if [ -z "$NODE_PATH" ]; then
|
|
9
|
-
export NODE_PATH="/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/bin/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/node_modules"
|
|
10
|
-
else
|
|
11
|
-
export NODE_PATH="/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/bin/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules/typescript/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/typescript@5.2.2/node_modules:/home/runner/work/waku/waku/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
12
|
-
fi
|
|
13
|
-
if [ -x "$basedir/node" ]; then
|
|
14
|
-
exec "$basedir/node" "$basedir/../typescript/bin/tsc" "$@"
|
|
15
|
-
else
|
|
16
|
-
exec node "$basedir/../typescript/bin/tsc" "$@"
|
|
17
|
-
fi
|