From 45cb32eca76f71b9bea4edd438dce2f8b6492664 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Jan 2025 01:49:10 +0000 Subject: [PATCH 1/2] chore(deps): bump the next group with 3 updates (#3649) Bumps the next group with 3 updates: [next](https://github.com/vercel/next.js), [@next/mdx](https://github.com/vercel/next.js/tree/HEAD/packages/next-mdx) and [eslint-config-next](https://github.com/vercel/next.js/tree/HEAD/packages/eslint-config-next). Updates `next` from 15.1.3 to 15.1.4 - [Release notes](https://github.com/vercel/next.js/releases) - [Changelog](https://github.com/vercel/next.js/blob/canary/release.js) - [Commits](https://github.com/vercel/next.js/compare/v15.1.3...v15.1.4) Updates `@next/mdx` from 15.1.3 to 15.1.4 - [Release notes](https://github.com/vercel/next.js/releases) - [Changelog](https://github.com/vercel/next.js/blob/canary/release.js) - [Commits](https://github.com/vercel/next.js/commits/v15.1.4/packages/next-mdx) Updates `eslint-config-next` from 15.1.3 to 15.1.4 - [Release notes](https://github.com/vercel/next.js/releases) - [Changelog](https://github.com/vercel/next.js/blob/canary/release.js) - [Commits](https://github.com/vercel/next.js/commits/v15.1.4/packages/eslint-config-next) --- updated-dependencies: - dependency-name: next dependency-type: direct:production update-type: version-update:semver-patch dependency-group: next - dependency-name: "@next/mdx" dependency-type: direct:development update-type: version-update:semver-patch dependency-group: next - dependency-name: eslint-config-next dependency-type: direct:development update-type: version-update:semver-patch dependency-group: next ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- package-lock.json | 106 +++++++++++++++--------------- showcases/patternhub/package.json | 6 +- 2 files changed, 56 insertions(+), 56 deletions(-) diff --git a/package-lock.json b/package-lock.json index d03e437a0eb..16c0f4daf45 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6986,14 +6986,14 @@ } }, "node_modules/@next/env": { - "version": "15.1.3", - "resolved": "https://registry.npmjs.org/@next/env/-/env-15.1.3.tgz", - "integrity": "sha512-Q1tXwQCGWyA3ehMph3VO+E6xFPHDKdHFYosadt0F78EObYxPio0S09H9UGYznDe6Wc8eLKLG89GqcFJJDiK5xw==" + "version": "15.1.4", + "resolved": "https://registry.npmjs.org/@next/env/-/env-15.1.4.tgz", + "integrity": "sha512-2fZ5YZjedi5AGaeoaC0B20zGntEHRhi2SdWcu61i48BllODcAmmtj8n7YarSPt4DaTsJaBFdxQAVEVzgmx2Zpw==" }, "node_modules/@next/eslint-plugin-next": { - "version": "15.1.3", - "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-15.1.3.tgz", - "integrity": "sha512-oeP1vnc5Cq9UoOb8SYHAEPbCXMzOgG70l+Zfd+Ie00R25FOm+CCVNrcIubJvB1tvBgakXE37MmqSycksXVPRqg==", + "version": "15.1.4", + "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-15.1.4.tgz", + "integrity": "sha512-HwlEXwCK3sr6zmVGEvWBjW9tBFs1Oe6hTmTLoFQtpm4As5HCdu8jfSE0XJOp7uhfEGLniIx8yrGxEWwNnY0fmQ==", "dev": true, "dependencies": { "fast-glob": "3.3.1" @@ -7028,9 +7028,9 @@ } }, "node_modules/@next/mdx": { - "version": "15.1.3", - "resolved": "https://registry.npmjs.org/@next/mdx/-/mdx-15.1.3.tgz", - "integrity": "sha512-dvOQWYbvdztu9ubhSwQPTnIY5zUA8lorEtO1+f8kaba2nVjQSh3G16tfqY/8Ovw9T3kAJhxOZIbuWMpaeDIBAw==", + "version": "15.1.4", + "resolved": "https://registry.npmjs.org/@next/mdx/-/mdx-15.1.4.tgz", + "integrity": "sha512-GsmKCWPDW6Qas4/yL+zj7RLGrDsVu89F42/S9pVcPTvYmXNK1PqRT6H7outQy6Ox/AGB8As1lxPvk4dJmDIm7w==", "dev": true, "dependencies": { "source-map": "^0.7.0" @@ -7049,9 +7049,9 @@ } }, "node_modules/@next/swc-darwin-arm64": { - "version": "15.1.3", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-15.1.3.tgz", - "integrity": "sha512-aZtmIh8jU89DZahXQt1La0f2EMPt/i7W+rG1sLtYJERsP7GRnNFghsciFpQcKHcGh4dUiyTB5C1X3Dde/Gw8gg==", + "version": "15.1.4", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-15.1.4.tgz", + "integrity": "sha512-wBEMBs+np+R5ozN1F8Y8d/Dycns2COhRnkxRc+rvnbXke5uZBHkUGFgWxfTXn5rx7OLijuUhyfB+gC/ap58dDw==", "cpu": [ "arm64" ], @@ -7064,9 +7064,9 @@ } }, "node_modules/@next/swc-darwin-x64": { - "version": "15.1.3", - "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-15.1.3.tgz", - "integrity": "sha512-aw8901rjkVBK5mbq5oV32IqkJg+CQa6aULNlN8zyCWSsePzEG3kpDkAFkkTOh3eJ0p95KbkLyWBzslQKamXsLA==", + "version": "15.1.4", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-15.1.4.tgz", + "integrity": "sha512-7sgf5rM7Z81V9w48F02Zz6DgEJulavC0jadab4ZsJ+K2sxMNK0/BtF8J8J3CxnsJN3DGcIdC260wEKssKTukUw==", "cpu": [ "x64" ], @@ -7079,9 +7079,9 @@ } }, "node_modules/@next/swc-linux-arm64-gnu": { - "version": "15.1.3", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-15.1.3.tgz", - "integrity": "sha512-YbdaYjyHa4fPK4GR4k2XgXV0p8vbU1SZh7vv6El4bl9N+ZSiMfbmqCuCuNU1Z4ebJMumafaz6UCC2zaJCsdzjw==", + "version": "15.1.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-15.1.4.tgz", + "integrity": "sha512-JaZlIMNaJenfd55kjaLWMfok+vWBlcRxqnRoZrhFQrhM1uAehP3R0+Aoe+bZOogqlZvAz53nY/k3ZyuKDtT2zQ==", "cpu": [ "arm64" ], @@ -7094,9 +7094,9 @@ } }, "node_modules/@next/swc-linux-arm64-musl": { - "version": "15.1.3", - "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-15.1.3.tgz", - "integrity": "sha512-qgH/aRj2xcr4BouwKG3XdqNu33SDadqbkqB6KaZZkozar857upxKakbRllpqZgWl/NDeSCBYPmUAZPBHZpbA0w==", + "version": "15.1.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-15.1.4.tgz", + "integrity": "sha512-7EBBjNoyTO2ipMDgCiORpwwOf5tIueFntKjcN3NK+GAQD7OzFJe84p7a2eQUeWdpzZvhVXuAtIen8QcH71ZCOQ==", "cpu": [ "arm64" ], @@ -7109,9 +7109,9 @@ } }, "node_modules/@next/swc-linux-x64-gnu": { - "version": "15.1.3", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-15.1.3.tgz", - "integrity": "sha512-uzafnTFwZCPN499fNVnS2xFME8WLC9y7PLRs/yqz5lz1X/ySoxfaK2Hbz74zYUdEg+iDZPd8KlsWaw9HKkLEVw==", + "version": "15.1.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-15.1.4.tgz", + "integrity": "sha512-9TGEgOycqZFuADyFqwmK/9g6S0FYZ3tphR4ebcmCwhL8Y12FW8pIBKJvSwV+UBjMkokstGNH+9F8F031JZKpHw==", "cpu": [ "x64" ], @@ -7124,9 +7124,9 @@ } }, "node_modules/@next/swc-linux-x64-musl": { - "version": "15.1.3", - "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-15.1.3.tgz", - "integrity": "sha512-el6GUFi4SiDYnMTTlJJFMU+GHvw0UIFnffP1qhurrN1qJV3BqaSRUjkDUgVV44T6zpw1Lc6u+yn0puDKHs+Sbw==", + "version": "15.1.4", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-15.1.4.tgz", + "integrity": "sha512-0578bLRVDJOh+LdIoKvgNDz77+Bd85c5JrFgnlbI1SM3WmEQvsjxTA8ATu9Z9FCiIS/AliVAW2DV/BDwpXbtiQ==", "cpu": [ "x64" ], @@ -7139,9 +7139,9 @@ } }, "node_modules/@next/swc-win32-arm64-msvc": { - "version": "15.1.3", - "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-15.1.3.tgz", - "integrity": "sha512-6RxKjvnvVMM89giYGI1qye9ODsBQpHSHVo8vqA8xGhmRPZHDQUE4jcDbhBwK0GnFMqBnu+XMg3nYukNkmLOLWw==", + "version": "15.1.4", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-15.1.4.tgz", + "integrity": "sha512-JgFCiV4libQavwII+kncMCl30st0JVxpPOtzWcAI2jtum4HjYaclobKhj+JsRu5tFqMtA5CJIa0MvYyuu9xjjQ==", "cpu": [ "arm64" ], @@ -7154,9 +7154,9 @@ } }, "node_modules/@next/swc-win32-x64-msvc": { - "version": "15.1.3", - "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-15.1.3.tgz", - "integrity": "sha512-VId/f5blObG7IodwC5Grf+aYP0O8Saz1/aeU3YcWqNdIUAmFQY3VEPKPaIzfv32F/clvanOb2K2BR5DtDs6XyQ==", + "version": "15.1.4", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-15.1.4.tgz", + "integrity": "sha512-xxsJy9wzq7FR5SqPCUqdgSXiNXrMuidgckBa8nH9HtjjxsilgcN6VgXF6tZ3uEWuVEadotQJI8/9EQ6guTC4Yw==", "cpu": [ "x64" ], @@ -17323,12 +17323,12 @@ } }, "node_modules/eslint-config-next": { - "version": "15.1.3", - "resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-15.1.3.tgz", - "integrity": "sha512-wGYlNuWnh4ujuKtZvH+7B2Z2vy9nONZE6ztd+DKF7hAsIabkrxmD4TzYHzASHENo42lmz2tnT2B+zN2sOHvpJg==", + "version": "15.1.4", + "resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-15.1.4.tgz", + "integrity": "sha512-u9+7lFmfhKNgGjhQ9tBeyCFsPJyq0SvGioMJBngPC7HXUpR0U+ckEwQR48s7TrRNHra1REm6evGL2ie38agALg==", "dev": true, "dependencies": { - "@next/eslint-plugin-next": "15.1.3", + "@next/eslint-plugin-next": "15.1.4", "@rushstack/eslint-patch": "^1.10.3", "@typescript-eslint/eslint-plugin": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0", "@typescript-eslint/parser": "^5.4.2 || ^6.0.0 || ^7.0.0 || ^8.0.0", @@ -25991,11 +25991,11 @@ } }, "node_modules/next": { - "version": "15.1.3", - "resolved": "https://registry.npmjs.org/next/-/next-15.1.3.tgz", - "integrity": "sha512-5igmb8N8AEhWDYzogcJvtcRDU6n4cMGtBklxKD4biYv4LXN8+awc/bbQ2IM2NQHdVPgJ6XumYXfo3hBtErg1DA==", + "version": "15.1.4", + "resolved": "https://registry.npmjs.org/next/-/next-15.1.4.tgz", + "integrity": "sha512-mTaq9dwaSuwwOrcu3ebjDYObekkxRnXpuVL21zotM8qE2W0HBOdVIdg2Li9QjMEZrj73LN96LcWcz62V19FjAg==", "dependencies": { - "@next/env": "15.1.3", + "@next/env": "15.1.4", "@swc/counter": "0.1.3", "@swc/helpers": "0.5.15", "busboy": "1.6.0", @@ -26010,14 +26010,14 @@ "node": "^18.18.0 || ^19.8.0 || >= 20.0.0" }, "optionalDependencies": { - "@next/swc-darwin-arm64": "15.1.3", - "@next/swc-darwin-x64": "15.1.3", - "@next/swc-linux-arm64-gnu": "15.1.3", - "@next/swc-linux-arm64-musl": "15.1.3", - "@next/swc-linux-x64-gnu": "15.1.3", - "@next/swc-linux-x64-musl": "15.1.3", - "@next/swc-win32-arm64-msvc": "15.1.3", - "@next/swc-win32-x64-msvc": "15.1.3", + "@next/swc-darwin-arm64": "15.1.4", + "@next/swc-darwin-x64": "15.1.4", + "@next/swc-linux-arm64-gnu": "15.1.4", + "@next/swc-linux-arm64-musl": "15.1.4", + "@next/swc-linux-x64-gnu": "15.1.4", + "@next/swc-linux-x64-musl": "15.1.4", + "@next/swc-win32-arm64-msvc": "15.1.4", + "@next/swc-win32-x64-msvc": "15.1.4", "sharp": "^0.33.5" }, "peerDependencies": { @@ -39923,7 +39923,7 @@ }, "showcases/next-showcase": { "dependencies": { - "next": "latest", + "next": "*", "react": "18.3.1", "react-dom": "18.3.1" }, @@ -39953,7 +39953,7 @@ "@db-ux/core-icons": "0.0.7", "dompurify": "3.2.3", "highlight.js": "^11.11.1", - "next": "15.1.3", + "next": "15.1.4", "react": "18.3.1", "react-archer": "^4.4.0", "react-dom": "18.3.1", @@ -39963,14 +39963,14 @@ "devDependencies": { "@mdx-js/loader": "^3.1.0", "@mdx-js/react": "^3.1.0", - "@next/mdx": "^15.1.3", + "@next/mdx": "^15.1.4", "@types/dompurify": "3.2.0", "@types/node": "22.10.5", "@types/react": "18.3.13", "@types/react-dom": "18.3.1", "esbuild": "0.24.2", "eslint": "8.57.0", - "eslint-config-next": "15.1.3", + "eslint-config-next": "15.1.4", "iframe-resizer": "^5.3.2", "open-cli": "^8.0.0", "sass": "1.77.4", diff --git a/showcases/patternhub/package.json b/showcases/patternhub/package.json index c4b35613e08..a8ce63be377 100644 --- a/showcases/patternhub/package.json +++ b/showcases/patternhub/package.json @@ -26,7 +26,7 @@ "@db-ux/core-icons": "0.0.7", "dompurify": "3.2.3", "highlight.js": "^11.11.1", - "next": "15.1.3", + "next": "15.1.4", "react": "18.3.1", "react-archer": "^4.4.0", "react-dom": "18.3.1", @@ -36,14 +36,14 @@ "devDependencies": { "@mdx-js/loader": "^3.1.0", "@mdx-js/react": "^3.1.0", - "@next/mdx": "^15.1.3", + "@next/mdx": "^15.1.4", "@types/dompurify": "3.2.0", "@types/node": "22.10.5", "@types/react": "18.3.13", "@types/react-dom": "18.3.1", "esbuild": "0.24.2", "eslint": "8.57.0", - "eslint-config-next": "15.1.3", + "eslint-config-next": "15.1.4", "iframe-resizer": "^5.3.2", "open-cli": "^8.0.0", "sass": "1.77.4", From de56755d604d8d1956c8e978df8d31965c910f42 Mon Sep 17 00:00:00 2001 From: Nicolas Merget <104347736+nmerget@users.noreply.github.com> Date: Wed, 8 Jan 2025 08:27:55 +0100 Subject: [PATCH 2/2] docs: add performance documentation with purgecss and csso (#3648) --- packages/foundations/docs/Performance.md | 67 +++++++++++++++++++ showcases/patternhub/data/routes.tsx | 3 +- .../pages/foundations/performance/index.mdx | 7 ++ showcases/patternhub/styles/highlight.scss | 2 +- 4 files changed, 77 insertions(+), 2 deletions(-) create mode 100644 packages/foundations/docs/Performance.md create mode 100644 showcases/patternhub/pages/foundations/performance/index.mdx diff --git a/packages/foundations/docs/Performance.md b/packages/foundations/docs/Performance.md new file mode 100644 index 00000000000..97807d52eba --- /dev/null +++ b/packages/foundations/docs/Performance.md @@ -0,0 +1,67 @@ +# Performance + +If you need to improve the performance of your application, you can use the following tips: + +## Minify with PurgeCSS and CSSO + +When you use the full bundled `.css` file we provide, you could easily reduce the file size by removing unused CSS classes. This can be done with [PurgeCSS](https://purgecss.com/) and [CSSO](https://github.com/css/csso). + +Install both with: + +```shell +npm i purgecss csso --save-dev +``` + +Next you should create a file, e.g. `purgecss.js` in your project root with the following content: + +```javascript +import { writeFileSync } from "node:fs"; + +import { PurgeCSS } from "purgecss"; +import { minify } from "csso"; + +const distFolder = "dist"; // TODO: Change me if you need another folder + +new PurgeCSS() + .purge({ + content: [`${distFolder}/**/*.html`, `${distFolder}/**/*.js`], + css: [`${distFolder}/**/*.css`], + defaultExtractor: (content) => content.match(/[\w-/:]+(? { + for (const result of purgeCSSResult) { + writeFileSync(result.file, minify(result.css).css); + + /* Optional: for debugging */ + // writeFileSync(`rejected.css`, result.rejectedCss || ""); + } + }); +``` + +You can run this script with `node purgecss.js` and it will minify your CSS files. You can also add this script to your `package.json` to run after your regular build process: + +```json +{ + "scripts": { + "postbuild": "node purgecss.js" + } +} +``` diff --git a/showcases/patternhub/data/routes.tsx b/showcases/patternhub/data/routes.tsx index 99bb4a25951..c44c55594a1 100644 --- a/showcases/patternhub/data/routes.tsx +++ b/showcases/patternhub/data/routes.tsx @@ -233,7 +233,8 @@ export const ROUTES: NavigationItem[] = [ label: 'Testing Overview Table', path: '/foundations/test-table' }, - { label: 'IDE Support', path: '/foundations/ide' } + { label: 'IDE Support', path: '/foundations/ide' }, + { label: 'Performance', path: '/foundations/performance' } ] }, { diff --git a/showcases/patternhub/pages/foundations/performance/index.mdx b/showcases/patternhub/pages/foundations/performance/index.mdx new file mode 100644 index 00000000000..baa52a6b46e --- /dev/null +++ b/showcases/patternhub/pages/foundations/performance/index.mdx @@ -0,0 +1,7 @@ +import DefaultPage from "../../../components/default-page"; + +import Readme from "../../../../../packages/foundations/docs/Performance.md"; + + + +export default ({ children }) => {children}; diff --git a/showcases/patternhub/styles/highlight.scss b/showcases/patternhub/styles/highlight.scss index 70c131cd20c..be1ef281b71 100644 --- a/showcases/patternhub/styles/highlight.scss +++ b/showcases/patternhub/styles/highlight.scss @@ -73,7 +73,7 @@ pre:has(.hljs):not(:has(.language-shell)) { } .hljs-subst { /* prettylights-syntax-storage-modifier-import */ - color: colors.$db-neutral-bg-basic-level-1-default; + color: colors.$db-warning-on-bg-basic-emphasis-90-default; } .hljs-section { /* prettylights-syntax-markup-heading */