Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(hono): getContext for DEV&PRD #894

Merged
merged 2 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/08_cookies/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
},
"dependencies": {
"cookie": "0.6.0",
"hono": "4.6.1",
"react": "19.0.0-rc-d6cb4e77-20240911",
"react-dom": "19.0.0-rc-d6cb4e77-20240911",
"react-server-dom-webpack": "19.0.0-rc-d6cb4e77-20240911",
Expand Down
4 changes: 3 additions & 1 deletion examples/08_cookies/src/components/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Suspense, cache } from 'react';
import { unstable_getCustomContext as getCustomContext } from 'waku/server';
import { getContext } from 'hono/context-storage';

import { Counter } from './Counter';

Expand All @@ -13,7 +14,8 @@ const InternalAsyncComponent = async () => {
throw new Error('Cache not working');
}
// console.log(getCustomContext()); // fails when it's sent to the browser
console.log(Object.keys(getCustomContext()));
console.log('waku context', Object.keys(getCustomContext()));
console.log('hono context', Object.keys(getContext()));
return null;
};

Expand Down
1 change: 1 addition & 0 deletions packages/waku/src/lib/builder/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ const buildServerBundle = async (
conditions: ['react-server'],
externalConditions: ['react-server'],
},
external: ['hono/context-storage'],
noExternal: /^(?!node:)/,
},
esbuild: {
Expand Down
1 change: 1 addition & 0 deletions packages/waku/src/lib/middleware/dev-server-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ const createRscViteServer = (
conditions: ['react-server'],
externalConditions: ['react-server'],
},
external: ['hono/context-storage'],
noExternal: /^(?!node:)/,
optimizeDeps: {
include: [
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading