From f0bbbbc296bc9f302d4ae1244ff26b6294c7660a Mon Sep 17 00:00:00 2001 From: Muhammad Date: Sat, 28 Dec 2024 23:27:15 +0700 Subject: [PATCH] Revert "test" This reverts commit 5063795c3f7bc5a9b6879704a122f6d7be39023d. --- examples/full/package.json | 3 --- examples/full/pages/+config.ts | 3 +-- examples/full/pages/index/+Page.tsx | 5 ----- packages/vike-react-antd/Wrapper.server.tsx | 5 +++-- pnpm-lock.yaml | 9 --------- 5 files changed, 4 insertions(+), 21 deletions(-) diff --git a/examples/full/package.json b/examples/full/package.json index e15b3de7..fef6872a 100644 --- a/examples/full/package.json +++ b/examples/full/package.json @@ -5,11 +5,9 @@ "preview": "vite build && vite preview" }, "dependencies": { - "@ant-design/cssinjs": "^1.22.1", "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", "@vitejs/plugin-react": "^4.3.1", - "antd": "^5.22.5", "node-fetch": "^3.3.2", "react": "^18.3.1", "react-dom": "^18.3.1", @@ -17,7 +15,6 @@ "typescript": "^5.5.4", "vike": "^0.4.211", "vike-react": "^0.5.11", - "vike-react-antd": "^0.0.0", "vite": "^5.4.0" }, "type": "module" diff --git a/examples/full/pages/+config.ts b/examples/full/pages/+config.ts index 6f411159..05d71c61 100644 --- a/examples/full/pages/+config.ts +++ b/examples/full/pages/+config.ts @@ -2,7 +2,6 @@ export { config } import type { Config } from 'vike/types' import vikeReact from 'vike-react/config' -import vikeReactAntd from 'vike-react-antd/config' // Default configs (can be overridden by pages) const config = { @@ -15,5 +14,5 @@ const config = { bodyAttributes: { class: 'dark' }, viewport: 999, // https://vike.dev/extends - extends: [vikeReact, vikeReactAntd], + extends: vikeReact, } satisfies Config diff --git a/examples/full/pages/index/+Page.tsx b/examples/full/pages/index/+Page.tsx index 36eb50dc..e909569b 100644 --- a/examples/full/pages/index/+Page.tsx +++ b/examples/full/pages/index/+Page.tsx @@ -4,7 +4,6 @@ import React from 'react' import { Counter } from '../../components/Counter' import image from '../../assets/logo-new.svg' import { Config } from 'vike-react/Config' -import { Button, Flex } from 'antd' function Page() { // Will be printed on the server and in the browser: @@ -21,10 +20,6 @@ function Page() { Interactive. - - - - ) } diff --git a/packages/vike-react-antd/Wrapper.server.tsx b/packages/vike-react-antd/Wrapper.server.tsx index d6a5718e..12c26bbb 100644 --- a/packages/vike-react-antd/Wrapper.server.tsx +++ b/packages/vike-react-antd/Wrapper.server.tsx @@ -7,13 +7,14 @@ import { usePageContext } from 'vike-react/usePageContext' function Wrapper({ children }: { children: ReactNode }) { const pageContext = usePageContext() const { antd } = pageContext.config + const cache = 'antd' in pageContext ? pageContext.antd?.cache : undefined - if (antd === null) { + if (antd === null || !cache) { return <>{children} } return ( - + {children} ) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f18cfca2..db2121dd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -77,9 +77,6 @@ importers: examples/full: dependencies: - '@ant-design/cssinjs': - specifier: ^1.22.1 - version: 1.22.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@types/react': specifier: ^18.3.3 version: 18.3.3 @@ -89,9 +86,6 @@ importers: '@vitejs/plugin-react': specifier: ^4.3.1 version: 4.3.1(vite@5.4.0(@types/node@20.11.17)) - antd: - specifier: ^5.22.5 - version: 5.22.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) node-fetch: specifier: ^3.3.2 version: 3.3.2 @@ -113,9 +107,6 @@ importers: vike-react: specifier: link:../../packages/vike-react version: link:../../packages/vike-react - vike-react-antd: - specifier: link:../../packages/vike-react-antd - version: link:../../packages/vike-react-antd vite: specifier: ^5.4.0 version: 5.4.0(@types/node@20.11.17)