Skip to content

Conversation

@SHUBHANSHU602
Copy link

@SHUBHANSHU602 SHUBHANSHU602 commented Dec 21, 2025

This PR removes usage of the deprecated/discouraged legacyBehavior and
passHref props from the custom Link components and aligns them with the
modern Next.js Link API.

The project uses Next.js 15, where legacyBehavior is discouraged and
unnecessary for the current Link usage. The routing and i18n logic remain
unchanged; this is a cleanup and modernization with no functional behavior
changes.

Changes were tested locally:

  • Internal navigation
  • Locale switching
  • External links (http/https)

Related issue(s)

Resolves #4748

Summary by CodeRabbit

  • Refactor

    • Removed legacyBehavior parameter from Link component.
  • Chores

    • Updated mermaid, Next.js, and ESLint configuration dependencies to latest compatible versions.

✏️ Tip: You can customize this high-level summary in your review settings.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 21, 2025

📝 Walkthrough

Walkthrough

The pull request removes the deprecated legacyBehavior prop from the custom Link component to align with modern Next.js 15 API standards, and upgrades three dependency versions to use range-based version specifications (mermaid, next, and eslint-config-next).

Changes

Cohort / File(s) Summary
Link component modernization
components/link.tsx
Removed legacyBehavior?: boolean field from LinkComponentProps, LinkComponent destructuring, and LinkText props. Eliminated all forwards of legacyBehavior to <Link> element across server-side rendering and i18n path handling branches. Updated documentation comments to remove legacyBehavior references.
Dependency version upgrades
package.json
Upgraded mermaid from 9.3.0 to ^11.12.2, next from 15.5.2 to ^15.5.9, and eslint-config-next from 14.1.0 to ^16.1.0 to enable range-based version resolution.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Old legacy chains we've cast away,
Link components dance in modern way,
Next.js fifteen shines so bright,
Deprecated props fade from sight!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning Package.json contains dependency version upgrades (mermaid 9.3.0→^11.12.2, next 15.5.2→^15.5.9, eslint-config-next 14.1.0→^16.1.0) that appear unrelated to the stated objective of removing legacyBehavior from Link components. Remove unrelated dependency version upgrades from this PR, or provide justification for why these changes are necessary for removing legacyBehavior.
Linked Issues check ❓ Inconclusive The PR meets the coding requirement from issue #4748: removing legacyBehavior from custom Link components. However, package.json shows unrelated dependency version upgrades (mermaid, next, eslint-config-next) that are not mentioned in the linked issue objectives. Clarify whether the dependency version upgrades in package.json are intentional and part of this PR's scope, or if they should be separated into a different PR.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: removing the deprecated legacyBehavior from custom Link components, which is the primary objective of this PR.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@netlify
Copy link

netlify bot commented Dec 21, 2025

Deploy Preview for asyncapi-website failed.

Built without sensitive environment variables

Name Link
🔨 Latest commit 7291309
🔍 Latest deploy log https://app.netlify.com/projects/asyncapi-website/deploys/69578a28aeef37000807a9bb

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
components/link.tsx (1)

7-14: Prepare for Next.js 16 by removing legacyBehavior from interface

The removal of the legacyBehavior prop from LinkComponentProps is a good forward-looking change. The legacyBehavior prop for next/link will be removed in Next.js 16. The modern approach removes the legacyBehavior prop and any child elements, with the Link component now handling styling and accessibility automatically.

🧹 Nitpick comments (1)
components/link.tsx (1)

37-37: Fix inconsistent spacing in Link component attributes.

There are formatting inconsistencies with extra spaces in the Link component attributes:

  • Line 37: Two spaces between '' and target
  • Line 58: Three spaces between href} and target
  • Line 81: Two spaces between href} and target, plus extra space before >
  • Line 95: Extra space before >
🔎 Proposed fix for consistent formatting
-      <Link href={props.href || ''}  target={target} rel={rel}>
+      <Link href={props.href || ''} target={target} rel={rel}>
         {children}
       </Link>
-      <Link href={href}   target={target} rel={rel}>
+      <Link href={href} target={target} rel={rel}>
         {children}
       </Link>
-    <Link href={href}  target={target} rel={rel} >
+    <Link href={href} target={target} rel={rel}>
       {children}
     </Link>
-    <Link href={href || ''} target={target} rel={rel} >
+    <Link href={href || ''} target={target} rel={rel}>
       {children}
     </Link>

Also applies to: 58-58, 81-81, 95-95

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 624747e and 3735071.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • components/link.tsx (6 hunks)
  • package.json (2 hunks)
🧰 Additional context used
🧠 Learnings (4)
📚 Learning: 2024-10-11T11:32:30.226Z
Learnt from: akshatnema
Repo: asyncapi/website PR: 3262
File: components/navigation/BlogPostItem.tsx:95-119
Timestamp: 2024-10-11T11:32:30.226Z
Learning: In the `BlogPostItem` component (`components/navigation/BlogPostItem.tsx`), nesting `<a>` tags inside the parent `Link` component leads to hydration issues; therefore, we should avoid nesting `<a>` tags inside `Link` components in this component.

Applied to files:

  • components/link.tsx
📚 Learning: 2024-10-11T11:17:32.246Z
Learnt from: akshatnema
Repo: asyncapi/website PR: 3262
File: components/navigation/BlogPostItem.tsx:80-87
Timestamp: 2024-10-11T11:17:32.246Z
Learning: In the `BlogPostItem` component, the parent `Link` wraps the entire content, so inner `Link` components around the title and excerpt are unnecessary.

Applied to files:

  • components/link.tsx
📚 Learning: 2024-10-11T07:38:35.745Z
Learnt from: akshatnema
Repo: asyncapi/website PR: 3262
File: components/newsroom/FeaturedBlogPost.tsx:90-92
Timestamp: 2024-10-11T07:38:35.745Z
Learning: In Next.js, nested `<a>` tags cause hydration issues due to invalid HTML. To fix this, avoid nesting `<a>` tags by replacing inner `<a>` tags with non-interactive elements like `<span>`, and use click handlers to maintain interactivity if needed.

Applied to files:

  • components/link.tsx
📚 Learning: 2024-10-11T10:46:58.882Z
Learnt from: akshatnema
Repo: asyncapi/website PR: 3262
File: components/Avatar.tsx:35-44
Timestamp: 2024-10-11T10:46:58.882Z
Learning: In Next.js, when avoiding nested `<a>` tags due to hydration issues, use accessible non-link elements like `<button>` or `<span>` with appropriate roles, `tabIndex`, and event handlers to maintain accessibility and SEO.

Applied to files:

  • components/link.tsx
⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Lighthouse CI
🔇 Additional comments (3)
components/link.tsx (2)

24-85: Implementation correctly follows Next.js 15 best practices.

The LinkComponent properly wraps children directly in the Next.js Link without nesting <a> tags, which aligns with both Next.js 15 API guidelines and the project's learnings about avoiding hydration issues from nested anchors.

Based on learnings, nested <a> tags cause hydration issues in Next.js, and this implementation correctly avoids that pattern.


87-99: LGTM! LinkText correctly updated for Next.js 15.

The LinkText component has been properly updated to remove legacyBehavior, maintaining the same functionality with the modern Next.js Link API.

package.json (1)

91-93: The caret range (^11.12.2) appropriately constrains the version to v11 only.

The original concern about major version breaking changes is theoretically valid. v10 introduced ESM-only support and dropped CommonJS, and v11 refactored the rendering engine with new layout features. However, the codebase contains no direct mermaid imports or API calls, and v11.12.2 is stable with real-world adoption. The caret range constrains updates within v11.x, mitigating uncontrolled breaking changes.

@SHUBHANSHU602 SHUBHANSHU602 changed the title Remove deprecated legacyBehavior from custom Link components chore:Remove deprecated legacyBehavior from custom Link components Dec 21, 2025
@SHUBHANSHU602 SHUBHANSHU602 changed the title chore:Remove deprecated legacyBehavior from custom Link components chore: remove deprecated legacyBehavior from custom Link components Dec 21, 2025
@asyncapi-bot
Copy link
Contributor

asyncapi-bot commented Dec 21, 2025

⚡️ Lighthouse report for the changes in this PR:

Category Score
🔴 Performance 36
🟢 Accessibility 98
🟢 Best practices 92
🟢 SEO 100
🔴 PWA 33

Lighthouse ran on https://deploy-preview-4752--asyncapi-website.netlify.app/

@princerajpoot20
Copy link
Member

@SHUBHANSHU602 ci is failing. Could you please have a look at it

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
config/tools-automated.json (1)

368-405: Remove duplicate AsyncAPI Studio entries with test repository URLs.

The file contains duplicate AsyncAPI Studio entries at lines 373 and 392 pointing to personal test repositories (Shurtu-gal/action-test-bed and TahaShahid203/async-api-issue) with null descriptions. These repositories do not contain .asyncapi-tool configuration files, indicating these are orphaned or incorrectly added entries. Since tools-automated.json appears to be auto-generated, these entries should be removed to prevent test/personal repositories from appearing in the tools list.

config/tools.json (1)

1375-1428: Remove duplicate AsyncAPI Studio entries with test repository URLs.

These two additional "AsyncAPI Studio" entries at lines 1375–1428 have null descriptions and point to personal test repositories (Shurtu-gal/action-test-bed and TahaShahid203/async-api-issue) instead of the official asyncapi/studio repository. These appear to be unintended test data in the production configuration and should be removed.

🧹 Nitpick comments (2)
components/navigation/FlyoutMenu.tsx (1)

17-17: Minor UX improvement, but unrelated to PR objective.

The change from overflow-x-scroll to overflow-x-auto is a good UX refinement (scrollbar appears only when needed rather than always visible). However, this change is unrelated to the stated PR goal of removing deprecated legacyBehavior props from Link components.

Consider isolating unrelated improvements in separate PRs to keep changes focused and easier to review.

public/locales/zh_cn/tools.json (1)

1-25: LGTM! Chinese CLI tools translations added.

The translation file provides comprehensive Chinese localization for the AsyncAPI CLI tool section, including installation instructions and feature descriptions.

Minor: Line 14 has an extra leading space before "new-files.name" which creates inconsistent indentation, though this doesn't affect JSON parsing.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4e21818 and 50b3039.

⛔ Files ignored due to path filters (1)
  • .github/workflows/scripts/mailchimp/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (16)
  • components/Accordion/AccordionItem.tsx
  • components/AlgoliaSearch.tsx
  • components/community/Header.tsx
  • components/icons/Dashboard.tsx
  • components/layout/BlogLayout.tsx
  • components/navigation/FlyoutMenu.tsx
  • config/meetings.json
  • config/tools-automated.json
  • config/tools.json
  • next-i18next.config.cjs
  • public/_redirects
  • public/locales/zh_cn/common.json
  • public/locales/zh_cn/landing-page.json
  • public/locales/zh_cn/tools.json
  • styles/globals.css
  • utils/i18n.ts
💤 Files with no reviewable changes (2)
  • config/meetings.json
  • styles/globals.css
✅ Files skipped from review due to trivial changes (1)
  • components/community/Header.tsx
🧰 Additional context used
🧠 Learnings (8)
📓 Common learnings
Learnt from: sammy200-ui
Repo: asyncapi/website PR: 4804
File: components/navigation/Filter.tsx:32-41
Timestamp: 2025-12-29T14:21:43.887Z
Learning: For the asyncapi/website repository, maintainer guidance is to use eslint-disable comments with explanatory text for cases where useEffect/useMemo dependencies are intentionally omitted by design.
📚 Learning: 2025-12-29T14:21:28.216Z
Learnt from: sammy200-ui
Repo: asyncapi/website PR: 4804
File: components/navigation/Filter.tsx:32-41
Timestamp: 2025-12-29T14:21:28.216Z
Learning: In the asyncapi/website repository, when you intentionally omit dependencies in React hooks (e.g., useEffect, useMemo), add an eslint-disable comment with an explanatory note above the line to justify the design choice. For example: // eslint-disable-next-line react-hooks/exhaustive-deps: intentionally omitting dependencies to avoid unnecessary re-runs. This helps reviewers understand the rationale and keeps lint guidance informative.

Applied to files:

  • components/navigation/FlyoutMenu.tsx
  • components/AlgoliaSearch.tsx
  • components/Accordion/AccordionItem.tsx
  • components/layout/BlogLayout.tsx
  • components/icons/Dashboard.tsx
📚 Learning: 2024-11-11T21:30:32.478Z
Learnt from: amanbhoria
Repo: asyncapi/website PR: 3373
File: components/AlgoliaSearch.tsx:313-313
Timestamp: 2024-11-11T21:30:32.478Z
Learning: In the `SearchButton` component within `components/AlgoliaSearch.tsx`, if the component re-renders on every button click and the `useEffect` runs accordingly, adding dependencies to the dependency array might not be necessary.

Applied to files:

  • components/AlgoliaSearch.tsx
📚 Learning: 2024-10-11T11:17:32.246Z
Learnt from: akshatnema
Repo: asyncapi/website PR: 3262
File: components/navigation/BlogPostItem.tsx:80-87
Timestamp: 2024-10-11T11:17:32.246Z
Learning: In the `BlogPostItem` component, the parent `Link` wraps the entire content, so inner `Link` components around the title and excerpt are unnecessary.

Applied to files:

  • components/layout/BlogLayout.tsx
📚 Learning: 2024-10-11T11:32:30.226Z
Learnt from: akshatnema
Repo: asyncapi/website PR: 3262
File: components/navigation/BlogPostItem.tsx:95-119
Timestamp: 2024-10-11T11:32:30.226Z
Learning: In the `BlogPostItem` component (`components/navigation/BlogPostItem.tsx`), nesting `<a>` tags inside the parent `Link` component leads to hydration issues; therefore, we should avoid nesting `<a>` tags inside `Link` components in this component.

Applied to files:

  • components/layout/BlogLayout.tsx
📚 Learning: 2025-12-23T06:30:43.275Z
Learnt from: katara-Jayprakash
Repo: asyncapi/website PR: 4760
File: components/layout/GenericPostLayout.tsx:50-52
Timestamp: 2025-12-23T06:30:43.275Z
Learning: In the asyncapi/website repository, `GenericPostLayout` (components/layout/GenericPostLayout.tsx) is used for rendering about pages, not blog posts, even though it accepts a post typed as `IPosts['blog'][number]`. The type is reused for convenience. Blog posts use `BlogLayout.tsx` instead. When reviewing EditPageButton usage in GenericPostLayout, `contentType='about'` is the correct value.

Applied to files:

  • components/layout/BlogLayout.tsx
📚 Learning: 2024-10-11T07:27:53.362Z
Learnt from: akshatnema
Repo: asyncapi/website PR: 3262
File: components/newsroom/FeaturedBlogPost.tsx:90-92
Timestamp: 2024-10-11T07:27:53.362Z
Learning: Using anchor tags for author names in 'FeaturedBlogPost' component leads to hydration issues on the website.

Applied to files:

  • components/layout/BlogLayout.tsx
📚 Learning: 2025-01-19T04:51:41.255Z
Learnt from: anshgoyalevil
Repo: asyncapi/website PR: 3557
File: tests/fixtures/markdown/check-edit-links-data.js:3-11
Timestamp: 2025-01-19T04:51:41.255Z
Learning: In the AsyncAPI website repository, the test data in `tests/fixtures/markdown/check-edit-links-data.js` intentionally includes inconsistent paths (with and without 'docs' prefix) to verify the script's ability to normalize and handle ambiguous path structures.

Applied to files:

  • config/tools.json
⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Redirect rules - asyncapi-website
  • GitHub Check: Header rules - asyncapi-website
  • GitHub Check: Pages changed - asyncapi-website
🔇 Additional comments (10)
components/AlgoliaSearch.tsx (1)

311-323: LGTM! Cleaner refactor that removes unnecessary state.

The refactoring from state-based rendering (Children state + useEffect) to direct render-time computation is a solid improvement. The logic is equivalent—computing children content inline when it's a cheap operation—and aligns with modern React best practices (derive rather than store when the computation is trivial). This eliminates potential stale-state issues and makes the code easier to reason about.

Based on learnings, this component re-renders frequently, so the simplified approach is well-suited here.

components/layout/BlogLayout.tsx (1)

83-87: Conditional canonical link implementation is correct.

The conditional rendering ensures the canonical link only appears when post.canonical has a value, which follows SEO best practices. The implementation is clean and properly uses the HtmlHead component from Next.js.

The removal of AddThis-related markup is appropriate cleanup, as AddThis has been deprecated and no remaining dependencies on it exist in the codebase.

components/Accordion/AccordionItem.tsx (1)

42-44: LGTM! SVG attributes correctly updated to React camelCase convention.

The SVG attributes have been properly updated from kebab-case to camelCase (stroke-widthstrokeWidth, etc.), which aligns with React JSX conventions and prevents potential warnings. This modernization is consistent with similar changes in Dashboard.tsx.

However, note that this change is unrelated to the PR's stated objective of removing deprecated Link props.

Also applies to: 52-54

components/icons/Dashboard.tsx (1)

17-19: LGTM! SVG attributes correctly updated to React camelCase convention.

The SVG attributes have been properly updated from kebab-case to camelCase, which aligns with React JSX conventions. This modernization is consistent with similar changes in AccordionItem.tsx.

However, note that this change is unrelated to the PR's stated objective of removing deprecated Link props.

utils/i18n.ts (1)

17-22: Chinese locale support is properly implemented.

All required locale files (common.json, landing-page.json, tools.json) exist in public/locales/zh_cn/, and next-i18next.config.cjs is correctly configured with the zh_cn locale. The implementation is complete.

Note: This feature is unrelated to the PR's stated objective of removing deprecated Link props. Consider whether this should be a separate change.

next-i18next.config.cjs (1)

7-17: LGTM! Chinese locale support added correctly.

The new zh_cn locale is properly registered in both the locales array and langMap. The corresponding translation files have been added in public/locales/zh_cn/.

Note: The locale identifier zh_cn uses an underscore, while BCP 47 standard typically uses hyphen (zh-CN). This appears intentional and consistent with the existing pattern in this configuration.

public/locales/zh_cn/landing-page.json (1)

1-74: LGTM! Chinese landing page translations added.

The translation file is well-structured with consistent key naming following the pattern from other locale files. The sections (main, features, adopters, community, sponsors, testimonials) align with the expected landing page structure.

public/locales/zh_cn/common.json (1)

1-28: LGTM! Chinese common translations added.

The translation file follows the expected structure with properly organized namespaces for newsletter, newsroom, and calendar sections. The translations appear complete for the common UI elements.

config/tools-automated.json (2)

32-53: LGTM! Zod Sockets tool entry added.

The new Zod Sockets entry is properly structured with valid repository URL and appropriate categorization (code-first, dsl, framework).


997-1014: LGTM! Official HTML Template entry added.

This adds the official asyncapi/html-template with isAsyncAPIOwner: true, which is correct for an official AsyncAPI organization template.


# Slack
/slack-invite https://join.slack.com/t/asyncapi/shared_invite/zt-3io4bbs42-8E_iWOfMDQ0NnG9A3BAG9A 302!
/slack-invite https://join.slack.com/t/asyncapi/shared_invite/zt-3m4pmrguv-SUN9Js4BkQHocIH54F59sA 302!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

curl -I -L "https://join.slack.com/t/asyncapi/shared_invite/zt-3m4pmrguv-SUN9Js4BkQHocIH54F59sA" 2>&1 | head -n 5

Repository: asyncapi/website

Length of output: 468


Scope creep: Move the Slack invite URL update to a separate PR.

The new Slack invite URL is valid and accessible, but this change is unrelated to the PR's stated objective of removing deprecated Link props. Operational updates like token rotation should be in separate PRs to keep changes focused and reviewable. Consider extracting this to its own PR.

🤖 Prompt for AI Agents
In public/_redirects around line 56, the Slack invite URL update is out-of-scope
for this PR; revert the change in this file back to the original redirect
(restore the previous URL/entry) so the PR focuses only on removing deprecated
Link props, and open a separate PR that contains the new Slack invite URL (with
a brief justification and any necessary rotation/ops notes).

@SHUBHANSHU602 SHUBHANSHU602 force-pushed the remove-legacy-link-behavior branch from 50b3039 to 3735071 Compare January 2, 2026 08:55
@SHUBHANSHU602 SHUBHANSHU602 force-pushed the remove-legacy-link-behavior branch from 3735071 to 7291309 Compare January 2, 2026 09:04
@SHUBHANSHU602
Copy link
Author

Hi, maintainers I’m closing this PR to avoid further noise. While rebasing and syncing with master, several unrelated changes got pulled in, which caused scope creep and failing checks unrelated to the original intent (legacyBehavior removal).

I’ll reopen this work as a clean, narrowly scoped PR or contribute via a new issue instead.

Thanks for the review and guidance

@SHUBHANSHU602 SHUBHANSHU602 deleted the remove-legacy-link-behavior branch January 2, 2026 09:10
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
package.json (1)

157-157: Critical: eslint-config-next 16 incompatible with Next.js 15 — incorrect version specified.

The upgrade to eslint-config-next ^16.1.0 is incompatible with the project's current setup:

  1. Version mismatch: eslint-config-next 16 is designed for Next.js 16.x, but the project uses Next.js ^15.5.9 (line 93).
  2. This will cause ESLint configuration failures since the package version must match the Next.js major version.

Update to eslint-config-next ^15.x to match Next.js 15.5.9:

Recommended fix
-    "eslint-config-next": "^16.1.0",
+    "eslint-config-next": "^15.5.0",
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 50b3039 and 7291309.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • components/link.tsx
  • package.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • components/link.tsx
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-04-20T16:05:16.482Z
Learnt from: anshgoyalevil
Repo: asyncapi/website PR: 3950
File: scripts/utils/check-locales.ts:122-129
Timestamp: 2025-04-20T16:05:16.482Z
Learning: In the AsyncAPI website project, Next.js throws errors at runtime when locale files are missing, making additional validation for missing files unnecessary in the check-locales script.

Applied to files:

  • package.json
⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Test NodeJS PR - macos-latest
🔇 Additional comments (1)
package.json (1)

93-93: LGTM: Next.js patch upgrade is appropriate.

The Next.js upgrade from 15.5.2 to ^15.5.9 is a patch-level update that aligns with the project's Next.js 15 usage and typically includes bug fixes and security improvements.

"markdown-toc": "^1.2.0",
"md5": "^2.3.0",
"mermaid": "9.3.0",
"mermaid": "^11.12.2",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for mermaid imports and usage in codebase

echo "=== Searching for mermaid imports ==="
rg -n "mermaid" --type ts --type tsx --type js --type jsx -B 1 -A 2 | head -50

echo -e "\n=== Searching in markdown/mdx files ==="
rg -n "```mermaid" --type md --type mdx -B 1 -A 5 | head -50

echo -e "\n=== Checking package.json for mermaid ==="
rg -n "mermaid" package.json

Repository: asyncapi/website

Length of output: 252


🌐 Web query:

mermaid v11 breaking changes from v9 migration guide

💡 Result:

Below are the main breaking changes you need to handle when migrating from Mermaid v9 → v11 (covers v10 and v11 changes). Apply the short migration action next to each item.

  • ESM-only (v10): Mermaid no longer ships CommonJS builds — imports must use ESM/module syntax or the v9-tagged CDN.
    Migration: switch to <script type="module"> imports or ESM bundler imports (or pin to @9 on CDN). [1]

  • mermaid.render API/type changes (v10): the return/type and signature of mermaid.render changed (TS types and function behavior).
    Migration: update call sites and TypeScript types to match v10+ signatures (check your usage of callbacks/returned SVG string). [1]

  • Build/bundle change (v11): project moved to esbuild and replaced previous UMD bundle with IIFE/ESM bundles — affects how Mermaid is bundled/included in environments.
    Migration: adjust bundler configs or include the new ESM/IIFE builds as appropriate for your environment. [2]

  • Default option changes (v11): some diagrams (git, sankey) changed default config — useMaxWidth now defaults to true.
    Migration: explicitly set useMaxWidth in your configuration if you require the old behavior. [2]

  • Engine/refactor behaviors (v11): rendering engine refactor introduces new layout options and config keys (e.g., mergeEdges, nodePlacementStrategy) and may change layout results.
    Migration: review diagrams for layout differences; add explicit configuration for layout algorithms or node placement to restore previous appearance where needed. [2][3]

Notes/sources:

  • v10 release notes (ESM, render changes). [1]
  • v11 release notes (esbuild/packaging, useMaxWidth defaults, engine refactor and new layout/config options). [2][3]

Sources
[1] Mermaid v10 release notes / changelog.
[2] Mermaid v11 release notes / changelog.
[3] Mermaid blog post: "Mermaid v11 is out!"


Remove unrelated mermaid dependency upgrade from this PR.

The mermaid upgrade from 9.3.0 to ^11.12.2 is unrelated to the stated PR objective of removing legacyBehavior from Link components. No mermaid usage was detected in the codebase, so this change introduces scope creep without addressing the PR's core modernization goal.

Remove this version bump from the PR to maintain focus on the Link component changes, or address it in a separate PR dedicated to dependency updates.

🤖 Prompt for AI Agents
In package.json around line 91, remove the unrelated "mermaid": "^11.12.2"
dependency change from this PR (revert that line to its previous state or delete
it entirely) so the PR only contains the Link legacyBehavior changes; if you
want to update mermaid, create a separate dependency-update PR with its own
changelog and justification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove deprecated legacyBehavior usage from custom Link components

3 participants