From 91b53c6afd31e70cf5e9fc06f6d9d22a28ef790b Mon Sep 17 00:00:00 2001 From: Anvay Date: Thu, 23 Oct 2025 00:28:16 +0530 Subject: [PATCH 1/2] docs: clarify protocolVersion field to distinguish from API versioning Add explicit clarification that `protocolVersion` refers to the version of the underlying communication protocol (e.g., AMQP 0.9.1, MQTT 3.1.1), not the AsyncAPI specification version or application API version. Updates documentation in: - markdown/docs/reference/specification/v3.0.0.md - markdown/docs/concepts/asyncapi-document/structure.md Closes ambiguity between protocol versioning and API versioning. --- markdown/docs/concepts/asyncapi-document/structure.md | 2 +- markdown/docs/reference/specification/v3.0.0.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/markdown/docs/concepts/asyncapi-document/structure.md b/markdown/docs/concepts/asyncapi-document/structure.md index cd6256c97645..be25a87a847e 100644 --- a/markdown/docs/concepts/asyncapi-document/structure.md +++ b/markdown/docs/concepts/asyncapi-document/structure.md @@ -69,7 +69,7 @@ The individual `servers` field contains the following properties: - `host`: The server hostname. It may include the port. - `protocol`: The protocol or messaging protocol that is used by the server (for example, AMQP, MQTT, WebSocket). -- `protocolVersion`: The protocol version used for the connection. +- `protocolVersion`: The version of the **underlying communication protocol** used for connection (for example, AMQP `0.9.1`, MQTT `3.1.1`, HTTP `2.0`). This is distinct from the AsyncAPI specification version or your application's API version. - `pathname`: The path to a resource in the host. - `description`: A string describing the server. - `title`: A human-friendly title for the server. diff --git a/markdown/docs/reference/specification/v3.0.0.md b/markdown/docs/reference/specification/v3.0.0.md index 369ab2ad9544..ad2198d3d1ce 100644 --- a/markdown/docs/reference/specification/v3.0.0.md +++ b/markdown/docs/reference/specification/v3.0.0.md @@ -410,7 +410,7 @@ Field Name | Type | Description ---|:---:|--- host | `string` | **REQUIRED**. The server host name. It MAY include the port. This field supports [Server Variables](#serverObjectVariables). Variable substitutions will be made when a variable is named in `{`braces`}`. protocol | `string` | **REQUIRED**. The protocol this server supports for connection. -protocolVersion | `string` | The version of the protocol used for connection. For instance: AMQP `0.9.1`, HTTP `2.0`, Kafka `1.0.0`, etc. +protocolVersion | `string` | The version of the **underlying communication protocol** used for connection. This refers to the protocol version itself (e.g., AMQP `0.9.1`, MQTT `3.1.1`, HTTP `2.0`, Kafka `1.0.0`), **not** the AsyncAPI document version or application API version. Omit this field if the protocol has no versioning concept. pathname | `string` | The path to a resource in the host. This field supports [Server Variables](#serverObjectVariables). Variable substitutions will be made when a variable is named in `{`braces`}`. description | `string` | An optional string describing the server. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation. title | `string` | A human-friendly title for the server. From ed50843ae99e6ff18107caf17a779cb38bc8605f Mon Sep 17 00:00:00 2001 From: Anvay Date: Sat, 25 Oct 2025 15:37:43 +0530 Subject: [PATCH 2/2] feat: Add pagination to blog page - Implement client-side pagination with 15 posts per page - Add Previous/Next navigation controls with proper disabled states - Reset pagination when filtering or clearing filters - Maintain responsive design consistent with existing blog layout - Display current page info and total post count - Improve performance by only rendering visible posts --- next-env.d.ts | 6 + package-lock.json | 307 ------------------------------------------- pages/blog/index.tsx | 80 ++++++++++- 3 files changed, 80 insertions(+), 313 deletions(-) create mode 100644 next-env.d.ts diff --git a/next-env.d.ts b/next-env.d.ts new file mode 100644 index 000000000000..254b73c165d9 --- /dev/null +++ b/next-env.d.ts @@ -0,0 +1,6 @@ +/// +/// +/// + +// NOTE: This file should not be edited +// see https://nextjs.org/docs/pages/api-reference/config/typescript for more information. diff --git a/package-lock.json b/package-lock.json index 29ab1ce76688..7ff7b38d5401 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7333,35 +7333,6 @@ } } }, - "node_modules/@storybook/preset-react-webpack/node_modules/@adobe/css-tools": { - "version": "4.4.3", - "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.4.3.tgz", - "integrity": "sha512-VQKMkwriZbaOgVCby1UDY/LDk5fIjhQicCvVPFqfe+69fWaPWydbWJ3wRt59/YzIwda1I81loas3oCoHxnqvdA==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true - }, - "node_modules/@storybook/preset-react-webpack/node_modules/@storybook/instrumenter": { - "version": "8.6.14", - "resolved": "https://registry.npmjs.org/@storybook/instrumenter/-/instrumenter-8.6.14.tgz", - "integrity": "sha512-iG4MlWCcz1L7Yu8AwgsnfVAmMbvyRSk700Mfy2g4c8y5O+Cv1ejshE1LBBsCwHgkuqU0H4R0qu4g23+6UnUemQ==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "@storybook/global": "^5.0.0", - "@vitest/utils": "^2.1.1" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/storybook" - }, - "peerDependencies": { - "storybook": "^8.6.14" - } - }, "node_modules/@storybook/preset-react-webpack/node_modules/@storybook/react": { "version": "8.6.14", "resolved": "https://registry.npmjs.org/@storybook/react/-/react-8.6.14.tgz", @@ -7415,272 +7386,6 @@ "storybook": "^8.6.14" } }, - "node_modules/@storybook/preset-react-webpack/node_modules/@storybook/test": { - "version": "8.6.14", - "resolved": "https://registry.npmjs.org/@storybook/test/-/test-8.6.14.tgz", - "integrity": "sha512-GkPNBbbZmz+XRdrhMtkxPotCLOQ1BaGNp/gFZYdGDk2KmUWBKmvc5JxxOhtoXM2703IzNFlQHSSNnhrDZYuLlw==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "@storybook/global": "^5.0.0", - "@storybook/instrumenter": "8.6.14", - "@testing-library/dom": "10.4.0", - "@testing-library/jest-dom": "6.5.0", - "@testing-library/user-event": "14.5.2", - "@vitest/expect": "2.0.5", - "@vitest/spy": "2.0.5" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/storybook" - }, - "peerDependencies": { - "storybook": "^8.6.14" - } - }, - "node_modules/@storybook/preset-react-webpack/node_modules/@testing-library/dom": { - "version": "10.4.0", - "resolved": "https://registry.npmjs.org/@testing-library/dom/-/dom-10.4.0.tgz", - "integrity": "sha512-pemlzrSESWbdAloYml3bAJMEfNh1Z7EduzqPKprCH5S341frlpYnUEW0H72dLxa6IsYr+mPno20GiSm+h9dEdQ==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "@babel/code-frame": "^7.10.4", - "@babel/runtime": "^7.12.5", - "@types/aria-query": "^5.0.1", - "aria-query": "5.3.0", - "chalk": "^4.1.0", - "dom-accessibility-api": "^0.5.9", - "lz-string": "^1.5.0", - "pretty-format": "^27.0.2" - }, - "engines": { - "node": ">=18" - } - }, - "node_modules/@storybook/preset-react-webpack/node_modules/@testing-library/jest-dom": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-6.5.0.tgz", - "integrity": "sha512-xGGHpBXYSHUUr6XsKBfs85TWlYKpTc37cSBBVrXcib2MkHLboWlkClhWF37JKlDb9KEq3dHs+f2xR7XJEWGBxA==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "@adobe/css-tools": "^4.4.0", - "aria-query": "^5.0.0", - "chalk": "^3.0.0", - "css.escape": "^1.5.1", - "dom-accessibility-api": "^0.6.3", - "lodash": "^4.17.21", - "redent": "^3.0.0" - }, - "engines": { - "node": ">=14", - "npm": ">=6", - "yarn": ">=1" - } - }, - "node_modules/@storybook/preset-react-webpack/node_modules/@testing-library/jest-dom/node_modules/chalk": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", - "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@storybook/preset-react-webpack/node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.6.3.tgz", - "integrity": "sha512-7ZgogeTnjuHbo+ct10G9Ffp0mif17idi0IyWNVA/wcwcm7NPOD/WEHVP3n7n3MhXqxoIYm8d6MuZohYWIZ4T3w==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true - }, - "node_modules/@storybook/preset-react-webpack/node_modules/@vitest/expect": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.0.5.tgz", - "integrity": "sha512-yHZtwuP7JZivj65Gxoi8upUN2OzHTi3zVfjwdpu2WrvCZPLwsJ2Ey5ILIPccoW23dd/zQBlJ4/dhi7DWNyXCpA==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "@vitest/spy": "2.0.5", - "@vitest/utils": "2.0.5", - "chai": "^5.1.1", - "tinyrainbow": "^1.2.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@storybook/preset-react-webpack/node_modules/@vitest/expect/node_modules/@vitest/pretty-format": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-2.0.5.tgz", - "integrity": "sha512-h8k+1oWHfwTkyTkb9egzwNMfJAEx4veaPSnMeKbVSjp4euqGSbQlm5+6VHwTr7u4FJslVVsUG5nopCaAYdOmSQ==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "tinyrainbow": "^1.2.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@storybook/preset-react-webpack/node_modules/@vitest/expect/node_modules/@vitest/utils": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.0.5.tgz", - "integrity": "sha512-d8HKbqIcya+GR67mkZbrzhS5kKhtp8dQLcmRZLGTscGVg7yImT82cIrhtn2L8+VujWcy6KZweApgNmPsTAO/UQ==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "@vitest/pretty-format": "2.0.5", - "estree-walker": "^3.0.3", - "loupe": "^3.1.1", - "tinyrainbow": "^1.2.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@storybook/preset-react-webpack/node_modules/@vitest/spy": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-2.0.5.tgz", - "integrity": "sha512-c/jdthAhvJdpfVuaexSrnawxZz6pywlTPe84LUB2m/4t3rl2fTo9NFGBG4oWgaD+FTgDDV8hJ/nibT7IfH3JfA==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "tinyspy": "^3.0.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@storybook/preset-react-webpack/node_modules/@vitest/utils": { - "version": "2.1.9", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-2.1.9.tgz", - "integrity": "sha512-v0psaMSkNJ3A2NMrUEHFRzJtDPFn+/VWZ5WxImB21T9fjucJRmS7xCS3ppEnARb9y11OAzaD+P2Ps+b+BGX5iQ==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "@vitest/pretty-format": "2.1.9", - "loupe": "^3.1.2", - "tinyrainbow": "^1.2.0" - }, - "funding": { - "url": "https://opencollective.com/vitest" - } - }, - "node_modules/@storybook/preset-react-webpack/node_modules/assertion-error": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", - "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/@storybook/preset-react-webpack/node_modules/chai": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/chai/-/chai-5.2.0.tgz", - "integrity": "sha512-mCuXncKXk5iCLhfhwTc0izo0gtEmpz5CtG2y8GiOINBlMVS6v8TMRc5TaLWKS6692m9+dVVfzgeVxR5UxWHTYw==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "dependencies": { - "assertion-error": "^2.0.1", - "check-error": "^2.1.1", - "deep-eql": "^5.0.1", - "loupe": "^3.1.0", - "pathval": "^2.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@storybook/preset-react-webpack/node_modules/check-error": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.1.tgz", - "integrity": "sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "engines": { - "node": ">= 16" - } - }, - "node_modules/@storybook/preset-react-webpack/node_modules/deep-eql": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", - "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/@storybook/preset-react-webpack/node_modules/loupe": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.3.tgz", - "integrity": "sha512-kkIp7XSkP78ZxJEsSxW3712C6teJVoeHHwgo9zJ380de7IYyJ2ISlxojcH2pC5OFLewESmnRi/+XCDIEEVyoug==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true - }, - "node_modules/@storybook/preset-react-webpack/node_modules/pathval": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.0.tgz", - "integrity": "sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "engines": { - "node": ">= 14.16" - } - }, - "node_modules/@storybook/preset-react-webpack/node_modules/tinyspy": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-3.0.2.tgz", - "integrity": "sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==", - "dev": true, - "license": "MIT", - "optional": true, - "peer": true, - "engines": { - "node": ">=14.0.0" - } - }, "node_modules/@storybook/preview-api": { "version": "8.6.14", "resolved": "https://registry.npmjs.org/@storybook/preview-api/-/preview-api-8.6.14.tgz", @@ -8310,18 +8015,6 @@ "integrity": "sha512-AjwI4MvWx3HAOaZqYsjKWyEObT9lcVV0Y0V8nXo6cXzN8ZiMxVhf6F3d/UNvXVGKrEzL/Dluc5p+y9GkzlTWig==", "dev": true }, - "node_modules/@types/eslint": { - "version": "8.56.10", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.10.tgz", - "integrity": "sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==", - "dev": true, - "optional": true, - "peer": true, - "dependencies": { - "@types/estree": "*", - "@types/json-schema": "*" - } - }, "node_modules/@types/estree": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", diff --git a/pages/blog/index.tsx b/pages/blog/index.tsx index b6a13e507157..226803e8bef0 100644 --- a/pages/blog/index.tsx +++ b/pages/blog/index.tsx @@ -14,6 +14,9 @@ import type { IBlogPost } from '@/types/post'; import { HeadingLevel, HeadingTypeStyle } from '@/types/typography/Heading'; import { ParagraphTypeStyle } from '@/types/typography/Paragraph'; +// Configuration for pagination +const POSTS_PER_PAGE = 15; + /** * @description The BlogIndexPage is the blog index page of the website. */ @@ -35,8 +38,12 @@ export default function BlogIndexPage() { : [] ); const [isClient, setIsClient] = useState(false); + const [currentPage, setCurrentPage] = useState(1); - const onFilter = (data: IBlogPost[]) => setPosts(data); + const onFilter = (data: IBlogPost[]) => { + setPosts(data); + setCurrentPage(1); // Reset to first page when filtering + }; const toFilter = [ { name: 'type' @@ -53,9 +60,30 @@ export default function BlogIndexPage() { router.push(`${router.pathname}`, undefined, { shallow: true }); + setCurrentPage(1); // Reset to first page when clearing filters }; const showClearFilters = Object.keys(router.query).length > 0; + // Pagination calculations + const totalPosts = posts.length; + const totalPages = Math.ceil(totalPosts / POSTS_PER_PAGE); + const startIndex = (currentPage - 1) * POSTS_PER_PAGE; + const endIndex = startIndex + POSTS_PER_PAGE; + const currentPosts = posts.slice(startIndex, endIndex); + + // Pagination handlers + const goToNextPage = () => { + if (currentPage < totalPages) { + setCurrentPage(currentPage + 1); + } + }; + + const goToPreviousPage = () => { + if (currentPage > 1) { + setCurrentPage(currentPage - 1); + } + }; + const description = 'Find the latest and greatest stories from our community'; const image = '/img/social/blog.webp'; @@ -121,11 +149,51 @@ export default function BlogIndexPage() { )} {Object.keys(posts).length > 0 && isClient && ( -
    - {posts.map((post, index) => ( - - ))} -
+ <> +
    + {currentPosts.map((post, index) => ( + + ))} +
+ + {/* Pagination Controls */} + {totalPages > 1 && ( +
+ + +
+ + Page {currentPage} of {totalPages} + + + ({totalPosts} total posts) + +
+ + +
+ )} + )} {Object.keys(posts).length > 0 && !isClient && (