From 157dff33a50780c5777247cc682f8e1957d72fd5 Mon Sep 17 00:00:00 2001 From: Muhammad Date: Sun, 22 Dec 2024 15:57:22 +0700 Subject: [PATCH 1/6] chore(deps): update dependencies - @ant-design/cssinjs: 1.22.0 > 1.22.1 - antd: 5.22.2 > 5.22.5 --- packages/vike-react-antd/package.json | 4 +- pnpm-lock.yaml | 263 ++++++++++++++------------ 2 files changed, 140 insertions(+), 127 deletions(-) diff --git a/packages/vike-react-antd/package.json b/packages/vike-react-antd/package.json index d89b1b57..e4ae8d58 100644 --- a/packages/vike-react-antd/package.json +++ b/packages/vike-react-antd/package.json @@ -23,10 +23,10 @@ "vike-react": ">=0.4.13" }, "devDependencies": { - "@ant-design/cssinjs": "^1.22.0", + "@ant-design/cssinjs": "^1.22.1", "@brillout/release-me": "^0.4.2", "@types/react": "^18.2.55", - "antd": "^5.22.2", + "antd": "^5.22.5", "react": "^18.3.1", "rimraf": "^5.0.5", "typescript": "^5.5.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a6d1e2ca..4286aca0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -211,8 +211,8 @@ importers: packages/vike-react-antd: devDependencies: '@ant-design/cssinjs': - specifier: ^1.22.0 - version: 1.22.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + specifier: ^1.22.1 + version: 1.22.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@brillout/release-me': specifier: ^0.4.2 version: 0.4.2 @@ -220,8 +220,8 @@ importers: specifier: ^18.2.55 version: 18.3.3 antd: - specifier: ^5.22.2 - version: 5.22.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + specifier: ^5.22.5 + version: 5.22.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: specifier: ^18.3.1 version: 18.3.1 @@ -447,14 +447,14 @@ packages: '@ant-design/colors@7.1.0': resolution: {integrity: sha512-MMoDGWn1y9LdQJQSHiCC20x3uZ3CwQnv9QMz6pCmJOrqdgM9YxsoVVY0wtrdXbmfSgnV0KNk6zi09NAhMR2jvg==} - '@ant-design/cssinjs-utils@1.1.1': - resolution: {integrity: sha512-2HAiyGGGnM0es40SxdszeQAU5iWp41wBIInq+ONTCKjlSKOrzQfnw4JDtB8IBmqE6tQaEKwmzTP2LGdt5DSwYQ==} + '@ant-design/cssinjs-utils@1.1.3': + resolution: {integrity: sha512-nOoQMLW1l+xR1Co8NFVYiP8pZp3VjIIzqV6D6ShYF2ljtdwWJn5WSsH+7kvCktXL/yhEtWURKOfH5Xz/gzlwsg==} peerDependencies: react: '>=16.9.0' react-dom: '>=16.9.0' - '@ant-design/cssinjs@1.22.0': - resolution: {integrity: sha512-W9XSFeRPR0mAN3OuxfuS/xhENCYKf+8s+QyNNER0FSWoK9OpISTag6CCweg6lq0hASQ/2Vcza0Z8/kGivCP0Ng==} + '@ant-design/cssinjs@1.22.1': + resolution: {integrity: sha512-SLuXM4wiEE1blOx94iXrkOgseMZHzdr4ngdFu3VVDq6AOWh7rlwqTkMAtJho3EsBF6x/eUGOtK53VZXGQG7+sQ==} peerDependencies: react: '>=16.0.0' react-dom: '>=16.0.0' @@ -1339,8 +1339,8 @@ packages: react: '>=16.9.0' react-dom: '>=16.9.0' - '@rc-component/trigger@2.2.5': - resolution: {integrity: sha512-F1EJ4KjFpGAHAjuKvOyZB/6IZDkVx0bHl0M4fQM5wXcmm7lgTgVSSnR3bXwdmS6jOJGHOqfDxIJW3WUvwMIXhQ==} + '@rc-component/trigger@2.2.6': + resolution: {integrity: sha512-/9zuTnWwhQ3S3WT1T8BubuFTT46kvnXgaERR9f4BTKyn61/wpf/BvbImzYBubzJibU707FxwbKszLlHjcLiv1Q==} engines: {node: '>=8.x'} peerDependencies: react: '>=16.9.0' @@ -1982,8 +1982,8 @@ packages: resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} engines: {node: '>=12'} - antd@5.22.2: - resolution: {integrity: sha512-vihhiJbm9VG3d6boUeD1q2MXMax+qBrXhgqCEC+45v8iGUF6m4Ct+lFiCW4oWaN3EABOsbVA6Svy3Rj/QkQFKw==} + antd@5.22.5: + resolution: {integrity: sha512-+0UP8w+ULVv2OIzCDVz7j6I0UfH6mMLHSWO6qzpBc+9psOoVQLRbyAE21XnZM/eGrt2MNsEDL5fmlhXL/V8JyQ==} peerDependencies: react: '>=16.9.0' react-dom: '>=16.9.0' @@ -3010,14 +3010,14 @@ packages: react: '>=16.9.0' react-dom: '>=16.9.0' - rc-dropdown@4.2.0: - resolution: {integrity: sha512-odM8Ove+gSh0zU27DUj5cG1gNKg7mLWBYzB5E4nNLrLwBmYEgYP43vHKDGOVZcJSVElQBI0+jTQgjnq0NfLjng==} + rc-dropdown@4.2.1: + resolution: {integrity: sha512-YDAlXsPv3I1n42dv1JpdM7wJ+gSUBfeyPK59ZpBD9jQhK9jVuxpjj3NmWQHOBceA1zEPVX84T2wbdb2SD0UjmA==} peerDependencies: react: '>=16.11.0' react-dom: '>=16.11.0' - rc-field-form@2.5.1: - resolution: {integrity: sha512-33hunXwynQJyeae7LS3hMGTXNeRBjiPyPYgB0824EbmLHiXC1EBGyUwRh6xjLRy9c+en5WARYN0gJz5+JAqwig==} + rc-field-form@2.7.0: + resolution: {integrity: sha512-hgKsCay2taxzVnBPZl+1n4ZondsV78G++XVsMIJCAoioMjlMQR9YwAp7JZDIECzIu2Z66R+f4SFIRrO2DjDNAA==} engines: {node: '>=8.x'} peerDependencies: react: '>=16.9.0' @@ -3053,8 +3053,8 @@ packages: react: '>=16.9.0' react-dom: '>=16.9.0' - rc-motion@2.9.3: - resolution: {integrity: sha512-rkW47ABVkic7WEB0EKJqzySpvDqwl60/tdkY7hWP7dYnh5pm0SzJpo54oW3TDUGXV5wfxXFmMkxrzRRbotQ0+w==} + rc-motion@2.9.5: + resolution: {integrity: sha512-w+XTUrfh7ArbYEd2582uDrEhmBHwK1ZENJiSJVb7uRxdE7qJSYjbO2eksRXmndqyKqKoYPc9ClpPh5242mV1vA==} peerDependencies: react: '>=16.9.0' react-dom: '>=16.9.0' @@ -3072,14 +3072,14 @@ packages: react: '>=16.9.0' react-dom: '>=16.9.0' - rc-pagination@4.3.0: - resolution: {integrity: sha512-UubEWA0ShnroQ1tDa291Fzw6kj0iOeF26IsUObxYTpimgj4/qPCWVFl18RLZE+0Up1IZg0IK4pMn6nB3mjvB7g==} + rc-pagination@5.0.0: + resolution: {integrity: sha512-QjrPvbAQwps93iluvFM62AEYglGYhWW2q/nliQqmvkTi4PXP4HHoh00iC1Sa5LLVmtWQHmG73fBi2x6H6vFHRg==} peerDependencies: react: '>=16.9.0' react-dom: '>=16.9.0' - rc-picker@4.8.2: - resolution: {integrity: sha512-I6Nn4ngkRskSD//rsXDvjlEQ8CzX9kPQrUIb7+qTY49erJaa3/oKJWmi6JIxo/A7gy59phNmPTdhKosAa/NrQQ==} + rc-picker@4.8.3: + resolution: {integrity: sha512-hJ45qoEs4mfxXPAJdp1n3sKwADul874Cd0/HwnsEOE60H+tgiJUGgbOD62As3EG/rFVNS5AWRfBCDJJfmRqOVQ==} engines: {node: '>=8.x'} peerDependencies: date-fns: '>= 2.x' @@ -3111,8 +3111,8 @@ packages: react: '>=16.9.0' react-dom: '>=16.9.0' - rc-resize-observer@1.4.0: - resolution: {integrity: sha512-PnMVyRid9JLxFavTjeDXEXo65HCRqbmLBw9xX9gfC4BZiSzbLXKzW3jPz+J0P71pLbD5tBMTT+mkstV5gD0c9Q==} + rc-resize-observer@1.4.3: + resolution: {integrity: sha512-YZLjUbyIWox8E9i9C3Tm7ia+W7euPItNWSPX5sCcQTYbnwDb5uNpnLHQCG1f22oZWUhLw4Mv2tFmeWe68CDQRQ==} peerDependencies: react: '>=16.9.0' react-dom: '>=16.9.0' @@ -3123,8 +3123,8 @@ packages: react: '>=16.0.0' react-dom: '>=16.0.0' - rc-select@14.16.3: - resolution: {integrity: sha512-51+j6s3fJJJXB7E+B6W1hM4Tjzv1B/Decooz9ilgegDBt3ZAth1b/xMwYCTrT5BbG2e53XACQsyDib2+3Ro1fg==} + rc-select@14.16.4: + resolution: {integrity: sha512-jP6qf7+vjnxGvPpfPWbGYfFlSl3h8L2XcD4O7g2GYXmEeBC0mw+nPD7i++OOE8v3YGqP8xtYjRKAWCMLfjgxlw==} engines: {node: '>=8.x'} peerDependencies: react: '*' @@ -3150,8 +3150,8 @@ packages: react: '>=16.9.0' react-dom: '>=16.9.0' - rc-table@7.48.1: - resolution: {integrity: sha512-Z4mDKjWg+xz/Ezdw6ivWcbqRpaJ0QfCORRoRrlrw65KSGZLK8OcTdacH22/fyGb8L4It/0/9qcMm8VrVAk/WBw==} + rc-table@7.49.0: + resolution: {integrity: sha512-/FoPLX94muAQOxVpi1jhnpKjOIqUbT81eELQPAzSXOke4ky4oCWYUXOcVpL31ZCO90xScwVSXRd7coqtgtB1Ng==} engines: {node: '>=8.x'} peerDependencies: react: '>=16.9.0' @@ -3201,6 +3201,12 @@ packages: react: '>=16.9.0' react-dom: '>=16.9.0' + rc-util@5.44.2: + resolution: {integrity: sha512-uGSk3hpPBLa3/0QAcKhCjgl4SFnhQCJDLvvpoLdbR6KgDuXrujG+dQaUeUvBJr2ZWak1O/9n+cYbJiWmmk95EQ==} + peerDependencies: + react: '>=16.9.0' + react-dom: '>=16.9.0' + rc-virtual-list@3.15.0: resolution: {integrity: sha512-dF2YQztqrU3ijAeWOqscTshCEr7vpimzSqAVjO1AyAmaqcHulaXpnGR0ptK5PXfxTUy48VkJOiglMIxlkYGs0w==} engines: {node: '>=8.x'} @@ -3777,17 +3783,17 @@ snapshots: dependencies: '@ctrl/tinycolor': 3.6.1 - '@ant-design/cssinjs-utils@1.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@ant-design/cssinjs-utils@1.1.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@ant-design/cssinjs': 1.22.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@ant-design/cssinjs': 1.22.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@babel/runtime': 7.26.0 - rc-util: 5.43.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-util: 5.44.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - '@ant-design/cssinjs@1.22.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@ant-design/cssinjs@1.22.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: - '@babel/runtime': 7.23.5 + '@babel/runtime': 7.26.0 '@emotion/hash': 0.8.0 '@emotion/unitless': 0.7.5 classnames: 2.5.1 @@ -3809,7 +3815,7 @@ snapshots: '@ant-design/icons-svg': 4.4.2 '@babel/runtime': 7.26.0 classnames: 2.5.1 - rc-util: 5.43.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-util: 5.44.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -4684,14 +4690,14 @@ snapshots: '@ant-design/fast-color': 2.0.6 '@babel/runtime': 7.26.0 classnames: 2.5.1 - rc-util: 5.43.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-util: 5.44.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) '@rc-component/context@1.4.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: '@babel/runtime': 7.26.0 - rc-util: 5.43.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-util: 5.44.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -4703,7 +4709,7 @@ snapshots: dependencies: '@babel/runtime': 7.26.0 classnames: 2.5.1 - rc-util: 5.43.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-util: 5.44.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -4711,7 +4717,7 @@ snapshots: dependencies: '@babel/runtime': 7.26.0 classnames: 2.5.1 - rc-util: 5.43.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-util: 5.44.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -4719,7 +4725,7 @@ snapshots: dependencies: '@babel/runtime': 7.26.0 classnames: 2.5.1 - rc-util: 5.43.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-util: 5.44.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -4727,20 +4733,20 @@ snapshots: dependencies: '@babel/runtime': 7.26.0 '@rc-component/portal': 1.1.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@rc-component/trigger': 2.2.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@rc-component/trigger': 2.2.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1) classnames: 2.5.1 - rc-util: 5.43.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-util: 5.44.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - '@rc-component/trigger@2.2.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + '@rc-component/trigger@2.2.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': dependencies: '@babel/runtime': 7.26.0 '@rc-component/portal': 1.1.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) classnames: 2.5.1 - rc-motion: 2.9.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - rc-resize-observer: 1.4.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - rc-util: 5.43.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-motion: 2.9.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-resize-observer: 1.4.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-util: 5.44.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -5940,11 +5946,11 @@ snapshots: ansi-styles@6.2.1: {} - antd@5.22.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + antd@5.22.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: '@ant-design/colors': 7.1.0 - '@ant-design/cssinjs': 1.22.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@ant-design/cssinjs-utils': 1.1.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@ant-design/cssinjs': 1.22.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@ant-design/cssinjs-utils': 1.1.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@ant-design/icons': 5.5.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@ant-design/react-slick': 1.1.2(react@18.3.1) '@babel/runtime': 7.26.0 @@ -5953,7 +5959,7 @@ snapshots: '@rc-component/mutate-observer': 1.1.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@rc-component/qrcode': 1.0.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@rc-component/tour': 1.15.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - '@rc-component/trigger': 2.2.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@rc-component/trigger': 2.2.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1) classnames: 2.5.1 copy-to-clipboard: 3.3.3 dayjs: 1.11.13 @@ -5962,33 +5968,33 @@ snapshots: rc-collapse: 3.9.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-dialog: 9.6.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-drawer: 7.2.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - rc-dropdown: 4.2.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - rc-field-form: 2.5.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-dropdown: 4.2.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-field-form: 2.7.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-image: 7.11.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-input: 1.6.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-input-number: 9.3.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-mentions: 2.17.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-menu: 9.16.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - rc-motion: 2.9.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-motion: 2.9.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-notification: 5.6.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - rc-pagination: 4.3.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - rc-picker: 4.8.2(dayjs@1.11.13)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-pagination: 5.0.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-picker: 4.8.3(dayjs@1.11.13)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-progress: 4.0.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-rate: 2.13.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - rc-resize-observer: 1.4.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-resize-observer: 1.4.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-segmented: 2.5.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - rc-select: 14.16.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-select: 14.16.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-slider: 11.1.7(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-steps: 6.0.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-switch: 4.1.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - rc-table: 7.48.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-table: 7.49.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-tabs: 15.4.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-textarea: 1.8.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-tooltip: 6.2.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-tree: 5.10.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-tree-select: 5.24.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-upload: 4.8.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - rc-util: 5.43.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-util: 5.44.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) scroll-into-view-if-needed: 3.1.0 @@ -6021,7 +6027,7 @@ snapshots: babel-plugin-macros@3.1.0: dependencies: - '@babel/runtime': 7.23.5 + '@babel/runtime': 7.26.0 cosmiconfig: 7.1.0 resolve: 1.22.8 @@ -7038,9 +7044,9 @@ snapshots: dependencies: '@babel/runtime': 7.26.0 classnames: 2.5.1 - rc-select: 14.16.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-select: 14.16.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-tree: 5.10.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - rc-util: 5.43.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-util: 5.44.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -7048,7 +7054,7 @@ snapshots: dependencies: '@babel/runtime': 7.26.0 classnames: 2.5.1 - rc-util: 5.43.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-util: 5.44.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -7056,8 +7062,8 @@ snapshots: dependencies: '@babel/runtime': 7.26.0 classnames: 2.5.1 - rc-motion: 2.9.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - rc-util: 5.43.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-motion: 2.9.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-util: 5.44.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -7066,8 +7072,8 @@ snapshots: '@babel/runtime': 7.26.0 '@rc-component/portal': 1.1.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) classnames: 2.5.1 - rc-motion: 2.9.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - rc-util: 5.43.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-motion: 2.9.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-util: 5.44.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -7076,25 +7082,25 @@ snapshots: '@babel/runtime': 7.26.0 '@rc-component/portal': 1.1.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) classnames: 2.5.1 - rc-motion: 2.9.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - rc-util: 5.43.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-motion: 2.9.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-util: 5.44.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - rc-dropdown@4.2.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + rc-dropdown@4.2.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: '@babel/runtime': 7.26.0 - '@rc-component/trigger': 2.2.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@rc-component/trigger': 2.2.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1) classnames: 2.5.1 - rc-util: 5.43.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-util: 5.44.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - rc-field-form@2.5.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + rc-field-form@2.7.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: '@babel/runtime': 7.26.0 '@rc-component/async-validator': 5.0.4 - rc-util: 5.43.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-util: 5.44.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -7104,8 +7110,8 @@ snapshots: '@rc-component/portal': 1.1.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) classnames: 2.5.1 rc-dialog: 9.6.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - rc-motion: 2.9.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - rc-util: 5.43.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-motion: 2.9.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-util: 5.44.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -7115,7 +7121,7 @@ snapshots: '@rc-component/mini-decimal': 1.1.0 classnames: 2.5.1 rc-input: 1.6.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - rc-util: 5.43.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-util: 5.44.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -7123,38 +7129,38 @@ snapshots: dependencies: '@babel/runtime': 7.26.0 classnames: 2.5.1 - rc-util: 5.43.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-util: 5.44.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) rc-mentions@2.17.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: '@babel/runtime': 7.26.0 - '@rc-component/trigger': 2.2.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@rc-component/trigger': 2.2.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1) classnames: 2.5.1 rc-input: 1.6.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-menu: 9.16.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-textarea: 1.8.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - rc-util: 5.43.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-util: 5.44.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) rc-menu@9.16.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: '@babel/runtime': 7.26.0 - '@rc-component/trigger': 2.2.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@rc-component/trigger': 2.2.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1) classnames: 2.5.1 - rc-motion: 2.9.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-motion: 2.9.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-overflow: 1.3.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - rc-util: 5.43.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-util: 5.44.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - rc-motion@2.9.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + rc-motion@2.9.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: '@babel/runtime': 7.26.0 classnames: 2.5.1 - rc-util: 5.43.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-util: 5.44.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -7162,8 +7168,8 @@ snapshots: dependencies: '@babel/runtime': 7.26.0 classnames: 2.5.1 - rc-motion: 2.9.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - rc-util: 5.43.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-motion: 2.9.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-util: 5.44.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -7171,27 +7177,27 @@ snapshots: dependencies: '@babel/runtime': 7.26.0 classnames: 2.5.1 - rc-resize-observer: 1.4.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - rc-util: 5.43.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-resize-observer: 1.4.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-util: 5.44.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - rc-pagination@4.3.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + rc-pagination@5.0.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: '@babel/runtime': 7.26.0 classnames: 2.5.1 - rc-util: 5.43.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-util: 5.44.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - rc-picker@4.8.2(dayjs@1.11.13)(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + rc-picker@4.8.3(dayjs@1.11.13)(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: '@babel/runtime': 7.26.0 - '@rc-component/trigger': 2.2.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@rc-component/trigger': 2.2.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1) classnames: 2.5.1 rc-overflow: 1.3.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - rc-resize-observer: 1.4.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - rc-util: 5.43.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-resize-observer: 1.4.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-util: 5.44.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) optionalDependencies: @@ -7201,7 +7207,7 @@ snapshots: dependencies: '@babel/runtime': 7.26.0 classnames: 2.5.1 - rc-util: 5.43.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-util: 5.44.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -7209,15 +7215,15 @@ snapshots: dependencies: '@babel/runtime': 7.26.0 classnames: 2.5.1 - rc-util: 5.43.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-util: 5.44.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - rc-resize-observer@1.4.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + rc-resize-observer@1.4.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: '@babel/runtime': 7.26.0 classnames: 2.5.1 - rc-util: 5.43.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-util: 5.44.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) resize-observer-polyfill: 1.5.1 @@ -7226,19 +7232,19 @@ snapshots: dependencies: '@babel/runtime': 7.26.0 classnames: 2.5.1 - rc-motion: 2.9.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - rc-util: 5.43.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-motion: 2.9.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-util: 5.44.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - rc-select@14.16.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + rc-select@14.16.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: '@babel/runtime': 7.26.0 - '@rc-component/trigger': 2.2.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@rc-component/trigger': 2.2.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1) classnames: 2.5.1 - rc-motion: 2.9.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-motion: 2.9.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-overflow: 1.3.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - rc-util: 5.43.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-util: 5.44.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-virtual-list: 3.15.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -7247,7 +7253,7 @@ snapshots: dependencies: '@babel/runtime': 7.26.0 classnames: 2.5.1 - rc-util: 5.43.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-util: 5.44.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -7255,7 +7261,7 @@ snapshots: dependencies: '@babel/runtime': 7.26.0 classnames: 2.5.1 - rc-util: 5.43.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-util: 5.44.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -7263,17 +7269,17 @@ snapshots: dependencies: '@babel/runtime': 7.26.0 classnames: 2.5.1 - rc-util: 5.43.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-util: 5.44.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - rc-table@7.48.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + rc-table@7.49.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: '@babel/runtime': 7.26.0 '@rc-component/context': 1.4.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) classnames: 2.5.1 - rc-resize-observer: 1.4.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - rc-util: 5.43.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-resize-observer: 1.4.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-util: 5.44.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-virtual-list: 3.15.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -7282,11 +7288,11 @@ snapshots: dependencies: '@babel/runtime': 7.26.0 classnames: 2.5.1 - rc-dropdown: 4.2.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-dropdown: 4.2.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-menu: 9.16.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - rc-motion: 2.9.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - rc-resize-observer: 1.4.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - rc-util: 5.43.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-motion: 2.9.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-resize-observer: 1.4.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-util: 5.44.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -7295,15 +7301,15 @@ snapshots: '@babel/runtime': 7.26.0 classnames: 2.5.1 rc-input: 1.6.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - rc-resize-observer: 1.4.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - rc-util: 5.43.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-resize-observer: 1.4.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-util: 5.44.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) rc-tooltip@6.2.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: '@babel/runtime': 7.26.0 - '@rc-component/trigger': 2.2.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + '@rc-component/trigger': 2.2.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1) classnames: 2.5.1 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -7312,9 +7318,9 @@ snapshots: dependencies: '@babel/runtime': 7.26.0 classnames: 2.5.1 - rc-select: 14.16.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-select: 14.16.4(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-tree: 5.10.1(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - rc-util: 5.43.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-util: 5.44.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -7322,8 +7328,8 @@ snapshots: dependencies: '@babel/runtime': 7.26.0 classnames: 2.5.1 - rc-motion: 2.9.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - rc-util: 5.43.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-motion: 2.9.5(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-util: 5.44.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) rc-virtual-list: 3.15.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) @@ -7332,13 +7338,20 @@ snapshots: dependencies: '@babel/runtime': 7.26.0 classnames: 2.5.1 - rc-util: 5.43.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-util: 5.44.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) rc-util@5.43.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: - '@babel/runtime': 7.23.5 + '@babel/runtime': 7.26.0 + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + react-is: 18.2.0 + + rc-util@5.44.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1): + dependencies: + '@babel/runtime': 7.26.0 react: 18.3.1 react-dom: 18.3.1(react@18.3.1) react-is: 18.2.0 @@ -7347,8 +7360,8 @@ snapshots: dependencies: '@babel/runtime': 7.26.0 classnames: 2.5.1 - rc-resize-observer: 1.4.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - rc-util: 5.43.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-resize-observer: 1.4.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + rc-util: 5.44.2(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 react-dom: 18.3.1(react@18.3.1) From a2a533dab959897c213770d019942b46438a517c Mon Sep 17 00:00:00 2001 From: Muhammad Date: Sun, 22 Dec 2024 16:01:51 +0700 Subject: [PATCH 2/6] fix: move `pageContext.config.antd.cache` to `pageContext.antd.cache` --- packages/vike-react-antd/Wrapper.tsx | 9 +++++++-- packages/vike-react-antd/config.ts | 12 ++++++++++-- packages/vike-react-antd/onAfterRenderHtml.ts | 5 +++-- packages/vike-react-antd/onBeforeRenderHtml.ts | 5 +++-- 4 files changed, 23 insertions(+), 8 deletions(-) diff --git a/packages/vike-react-antd/Wrapper.tsx b/packages/vike-react-antd/Wrapper.tsx index 89193554..12c26bbb 100644 --- a/packages/vike-react-antd/Wrapper.tsx +++ b/packages/vike-react-antd/Wrapper.tsx @@ -7,10 +7,15 @@ 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} + return ( + + {children} + + ) } diff --git a/packages/vike-react-antd/config.ts b/packages/vike-react-antd/config.ts index 645fa0ae..1118ace2 100644 --- a/packages/vike-react-antd/config.ts +++ b/packages/vike-react-antd/config.ts @@ -13,10 +13,13 @@ const config = { onBeforeRenderHtml: 'import:vike-react-antd/__internal/onBeforeRenderHtml:onBeforeRenderHtml', Wrapper: 'import:vike-react-antd/__internal/Wrapper:Wrapper', meta: { + Wrapper: { + env: { server: true }, + }, antd: { env: { server: true, - client: true, + client: false, }, }, }, @@ -24,8 +27,13 @@ const config = { declare global { namespace Vike { + interface PageContext { + antd?: { + cache?: StyleProviderProps['cache'] + } + } interface Config { - antd?: null | Omit + antd?: null | Omit } } } diff --git a/packages/vike-react-antd/onAfterRenderHtml.ts b/packages/vike-react-antd/onAfterRenderHtml.ts index a42e6b8a..ffe65c6e 100644 --- a/packages/vike-react-antd/onAfterRenderHtml.ts +++ b/packages/vike-react-antd/onAfterRenderHtml.ts @@ -7,12 +7,13 @@ import type { PageContext } from 'vike/types' function onAfterRenderHtml(pageContext: PageContext) { const config = useConfig() + const cache = pageContext.antd?.cache - if (pageContext.config.antd?.cache) { + if (cache) { const styleTag = React.createElement('style', { id: 'antd-cssinjs', dangerouslySetInnerHTML: { - __html: extractStyle(pageContext.config.antd.cache, true), + __html: extractStyle(cache, true), }, }) config({ diff --git a/packages/vike-react-antd/onBeforeRenderHtml.ts b/packages/vike-react-antd/onBeforeRenderHtml.ts index 6129f9e3..c81428b6 100644 --- a/packages/vike-react-antd/onBeforeRenderHtml.ts +++ b/packages/vike-react-antd/onBeforeRenderHtml.ts @@ -5,7 +5,8 @@ import type { PageContext } from 'vike/types' function onBeforeRenderHtml(pageContext: PageContext) { if (pageContext.config.antd !== null) { - pageContext.config.antd ??= {} - pageContext.config.antd.cache = createCache() + pageContext.antd = { + cache: createCache(), + } } } From 4e21b06465b383e6b7dddf39f4af80fe27819652 Mon Sep 17 00:00:00 2001 From: Muhammad Date: Sun, 22 Dec 2024 16:03:10 +0700 Subject: [PATCH 3/6] update docs --- packages/vike-react-antd/README.md | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/packages/vike-react-antd/README.md b/packages/vike-react-antd/README.md index 6f0f0601..77df1fcf 100644 --- a/packages/vike-react-antd/README.md +++ b/packages/vike-react-antd/README.md @@ -3,6 +3,7 @@ [Installation](#installation) [Settings](#settings) [Version history](https://github.com/vikejs/vike-react/blob/main/packages/vike-react-antd/CHANGELOG.md) +[What it does](#what-it-does) [See Also](#see-also)
@@ -57,14 +58,14 @@ const px2rem = px2remTransformer({ rootValue: 32, // 32px = 1rem; @default 16 }) -const antd: Omit = { +const antd: Omit = { hashPriority: "high", layer: true, transformers: [legacyLogicalPropertiesTransformer, px2rem], } ``` -You can remove Ant Design from [some of your pages](https://vike.dev/config#inheritance): +You can remove the `vike-react-antd` integration from [some of your pages](https://vike.dev/config#inheritance): ```js // pages/about/+antd.js @@ -79,6 +80,21 @@ For full customization consider [ejecting](https://vike.dev/eject).
+## What it does + +The `vike-react-antd` extension allows you to use Ant Design without [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content). + +It collects the page's styles during SSR and injects them in the HTML, ensuring that styles are applied early (before even JavaScript starts loading). + +You can learn more at: + - [Vike > CSS-in-JS > Collect styles](https://vike.dev/css-in-js#collect-styles) + - [Antd Design > Server Side Rendering](https://ant.design/docs/react/server-side-rendering) + +For more details, have a look at the source code of `vike-react-styled-jsx` (which is small). + +
+ ## See also - [Vike Docs > Ant Design](https://vike.dev/antd) +- [Antd Design](https://ant.design) From 6fed80dad3111f92d739a734c2a9e216747e1fa2 Mon Sep 17 00:00:00 2001 From: Muhammad Date: Sun, 22 Dec 2024 23:33:15 +0700 Subject: [PATCH 4/6] fix: move `pageContext.styledComponentsSheet` to `pageContext.styledComponents.sheet` --- packages/vike-react-styled-components/Wrapper.tsx | 14 ++++++-------- packages/vike-react-styled-components/config.ts | 7 ++++++- .../onAfterRenderHtml.ts | 8 ++++---- .../onBeforeRenderHtml.ts | 5 +++-- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/packages/vike-react-styled-components/Wrapper.tsx b/packages/vike-react-styled-components/Wrapper.tsx index ac2588b3..72d69bfc 100644 --- a/packages/vike-react-styled-components/Wrapper.tsx +++ b/packages/vike-react-styled-components/Wrapper.tsx @@ -7,17 +7,15 @@ import { usePageContext } from 'vike-react/usePageContext' function Wrapper({ children }: { children: ReactNode }) { const pageContext = usePageContext() const { styledComponents } = pageContext.config + const sheet = 'styledComponents' in pageContext ? pageContext.styledComponents?.sheet : undefined + + if (styledComponents === null || !sheet) { + return <>{children} + } - if (isBrowser() || styledComponents === null) return <>{children} return ( - + {children} ) } - -function isBrowser() { - // Using `typeof window !== 'undefined'` alone is not enough because some users use https://www.npmjs.com/package/ssr-window - return typeof window !== 'undefined' && typeof window.scrollY === 'number' - // Alternatively, test whether environment is a *real* browser: https://github.com/brillout/picocolors/blob/d59a33a0fd52a8a33e4158884069192a89ce0113/picocolors.js#L87-L89 -} diff --git a/packages/vike-react-styled-components/config.ts b/packages/vike-react-styled-components/config.ts index 0cebded3..17396bd5 100644 --- a/packages/vike-react-styled-components/config.ts +++ b/packages/vike-react-styled-components/config.ts @@ -13,6 +13,9 @@ const config = { onBeforeRenderHtml: 'import:vike-react-styled-components/__internal/onBeforeRenderHtml:onBeforeRenderHtml', Wrapper: 'import:vike-react-styled-components/__internal/Wrapper:Wrapper', meta: { + Wrapper: { + env: { server: true }, + }, styledComponents: { env: { server: true, @@ -25,7 +28,9 @@ const config = { declare global { namespace Vike { interface PageContext { - styledComponentsSheet?: ServerStyleSheet + styledComponents?: { + sheet?: ServerStyleSheet + } } interface Config { styledComponents?: null | { diff --git a/packages/vike-react-styled-components/onAfterRenderHtml.ts b/packages/vike-react-styled-components/onAfterRenderHtml.ts index b8238479..9ed92990 100644 --- a/packages/vike-react-styled-components/onAfterRenderHtml.ts +++ b/packages/vike-react-styled-components/onAfterRenderHtml.ts @@ -6,18 +6,18 @@ import type { PageContext } from 'vike/types' function onAfterRenderHtml(pageContext: PageContext) { const config = useConfig() + const sheet = pageContext.styledComponents?.sheet - if (pageContext.styledComponentsSheet) { - const { styledComponentsSheet } = pageContext + if (sheet) { try { - const styles = styledComponentsSheet.getStyleElement() + const styles = sheet.getStyleElement() config({ Head: styles, }) } catch (error) { throw error } finally { - styledComponentsSheet.seal() + sheet.seal() } } } diff --git a/packages/vike-react-styled-components/onBeforeRenderHtml.ts b/packages/vike-react-styled-components/onBeforeRenderHtml.ts index ce81090d..e451bb9f 100644 --- a/packages/vike-react-styled-components/onBeforeRenderHtml.ts +++ b/packages/vike-react-styled-components/onBeforeRenderHtml.ts @@ -5,7 +5,8 @@ import type { PageContext } from 'vike/types' function onBeforeRenderHtml(pageContext: PageContext) { if (pageContext.config.styledComponents !== null) { - pageContext.config.styledComponents ??= {} - pageContext.styledComponentsSheet = new ServerStyleSheet() + pageContext.styledComponents = { + sheet: new ServerStyleSheet(), + } } } From 89e85f352769bd9372826c85d048384bf7515597 Mon Sep 17 00:00:00 2001 From: Muhammad Date: Sun, 22 Dec 2024 23:33:23 +0700 Subject: [PATCH 5/6] update docs --- packages/vike-react-antd/README.md | 5 ++- .../vike-react-styled-components/README.md | 40 +++++++++++++------ 2 files changed, 31 insertions(+), 14 deletions(-) diff --git a/packages/vike-react-antd/README.md b/packages/vike-react-antd/README.md index 77df1fcf..81a99548 100644 --- a/packages/vike-react-antd/README.md +++ b/packages/vike-react-antd/README.md @@ -1,5 +1,7 @@ # `vike-react-antd` +Integrates [Ant Design](https://ant.design) to your [`vike-react`](https://vike.dev/vike-react) app. + [Installation](#installation) [Settings](#settings) [Version history](https://github.com/vikejs/vike-react/blob/main/packages/vike-react-antd/CHANGELOG.md) @@ -8,8 +10,6 @@
-Integrates [Ant Design](https://ant.design) to your [`vike-react`](https://vike.dev/vike-react) app. - ## Installation 1. `npm install vike-react-antd antd @ant-design/cssinjs` @@ -97,4 +97,5 @@ For more details, have a look at the source code of `vike-react-styled-jsx` (whi ## See also - [Vike Docs > Ant Design](https://vike.dev/antd) +- [Vike Docs > CSS-in-JS](https://vike.dev/css-in-js) - [Antd Design](https://ant.design) diff --git a/packages/vike-react-styled-components/README.md b/packages/vike-react-styled-components/README.md index 5e900b49..5ff23c6a 100644 --- a/packages/vike-react-styled-components/README.md +++ b/packages/vike-react-styled-components/README.md @@ -1,14 +1,15 @@ # `vike-react-styled-components` +Integrates [styled-components](https://styled-components.com) to your [`vike-react`](https://vike.dev/vike-react) app. + [Installation](#installation) [Settings](#settings) [Version history](https://github.com/vikejs/vike-react/blob/main/packages/vike-react-styled-components/CHANGELOG.md) +[What it does](#what-it-does) [See also](#see-also)
-Integrates [styled-components](https://styled-components.com) to your [`vike-react`](https://vike.dev/vike-react) app. - ## Installation 1. ``` @@ -29,26 +30,25 @@ Integrates [styled-components](https://styled-components.com) to your [`vike-rea } ``` -3. Install `babel-plugin-styled-components`: +3. Add the `babel-plugin-styled-components` plugin: ```js // vite.config.js - import { defineConfig } from "vite" import react from "@vitejs/plugin-react" import vike from "vike/plugin" - export default defineConfig({ + export default { plugins: [ vike(), react({ babel: { - plugins: [["babel-plugin-styled-components"]], - }, - }), - ], - }); + plugins: [["babel-plugin-styled-components"]] + } + }) + ] + } ``` -4. You can now use styled-components at any of your components. +4. You can now use `styled-components` at any of your components. ```jsx import { styled } from "styled-components"; @@ -94,7 +94,7 @@ const styledComponents = { } ``` -You can remove the styled-components SSR integration from [some of your pages](https://vike.dev/config#inheritance): +You can remove the `vike-react-styled-components` integration from [some of your pages](https://vike.dev/config#inheritance): ```js // pages/about/+styledComponents.js @@ -109,6 +109,22 @@ For full customization consider [ejecting](https://vike.dev/eject).
+## What it does + +The `vike-react-styled-components` extension allows you to use `styled-components` without [FOUC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content). + +It collects the page's styles during SSR and injects them in the HTML, ensuring that styles are applied early (before even JavaScript starts loading). + +You can learn more at: + - [Vike > CSS-in-JS > Collect styles](https://vike.dev/css-in-js#collect-styles) + - [styled-components > Server Side Rendering](https://styled-components.com/docs/advanced#server-side-rendering) + +For more details, have a look at the source code of `vike-react-styled-jsx` (which is small). + +
+ ## See also - [Vike Docs > styled-components](https://vike.dev/styled-components) +- [Vike Docs > CSS-in-JS](https://vike.dev/css-in-js) +- [styled-components Docs](https://styled-components.com/docs) From c4d5bb02cecf068bc8ebe7499f1c4ebe852a6a58 Mon Sep 17 00:00:00 2001 From: Muhammad Date: Mon, 23 Dec 2024 20:55:20 +0700 Subject: [PATCH 6/6] fix: refactor multiple conditions into a single evaluation --- packages/vike-react-styled-jsx/Wrapper.tsx | 11 ++++++----- packages/vike-react-styled-jsx/onBeforeRenderHtml.ts | 5 +++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/vike-react-styled-jsx/Wrapper.tsx b/packages/vike-react-styled-jsx/Wrapper.tsx index 0e0706b2..e54b7745 100644 --- a/packages/vike-react-styled-jsx/Wrapper.tsx +++ b/packages/vike-react-styled-jsx/Wrapper.tsx @@ -6,11 +6,12 @@ import { usePageContext } from 'vike-react/usePageContext' function Wrapper({ children }: { children: ReactNode }) { const pageContext = usePageContext() + const { styledJsx } = pageContext.config + const registry = 'styledJsx' in pageContext ? pageContext.styledJsx?.registry : undefined - if (pageContext.config.styledJsx === null) return <>{children} - - if ('styledJsx' in pageContext) { - return {children} + if (styledJsx === null || !registry) { + return <>{children} } - return <>{children} + + return {children} } diff --git a/packages/vike-react-styled-jsx/onBeforeRenderHtml.ts b/packages/vike-react-styled-jsx/onBeforeRenderHtml.ts index b7f05afd..c850c673 100644 --- a/packages/vike-react-styled-jsx/onBeforeRenderHtml.ts +++ b/packages/vike-react-styled-jsx/onBeforeRenderHtml.ts @@ -5,7 +5,8 @@ import type { PageContext } from 'vike/types' function onBeforeRenderHtml(pageContext: PageContext) { if (pageContext.config.styledJsx !== null) { - pageContext.styledJsx ??= {} - pageContext.styledJsx.registry = createStyleRegistry() + pageContext.styledJsx = { + registry: createStyleRegistry(), + } } }