Skip to content

Conversation

@SEOKKAMONI
Copy link
Contributor

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Aug 14, 2025

⚠️ No Changeset found

Latest commit: 141242a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link

coderabbitai bot commented Aug 14, 2025

📝 Walkthrough

Summary by CodeRabbit

  • Documentation
    • Updated API Pipelining docs to reflect support for routes defined as strings or objects.
    • Clarified safer control flow: matching occurs only with a valid template and available loader.
    • Documented that loaders receive both params and config.
    • Reaffirmed break-after-first-success behavior in the pipeline.
    • Synchronized updates across English and Korean documentation pages.

Walkthrough

Documentation updates to API pipelining examples: route handling now accepts string or object, uses a nullable template with guards, defers parsing until template exists, requires loader presence, passes config with params to loader, and breaks after the first successful loader invocation.

Changes

Cohort / File(s) Summary
API Pipelining Docs
docs/pages/api-references/future-api/api-pipelining.en.mdx, docs/pages/api-references/future-api/api-pipelining.ko.mdx
Update examples to support string/object routes, add null-safety guards, compute match after template creation, require loader before proceeding, pass { params, config } to loader, and break after first successful step. No public API signature changes documented.

Sequence Diagram(s)

sequenceDiagram
  participant Pipeline as Pipeline Runner
  participant Activity as Activity
  participant Template as Route Template
  participant Matcher as Matcher
  participant Loader as Loader

  Pipeline->>Activity: Iterate activities
  alt route is string
    Pipeline->>Template: makeTemplate({ path })
  else route is object
    Pipeline->>Template: makeTemplate(route)
  end
  Pipeline-->>Pipeline: if no template -> continue
  Pipeline->>Matcher: parse(location), compute match
  Pipeline-->>Pipeline: if !match or !loader -> continue
  Pipeline->>Loader: loader({ params, config })
  Pipeline-->>Pipeline: break after first successful call
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@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: 2

🔭 Outside diff range comments (1)
docs/pages/api-references/future-api/api-pipelining.ko.mdx (1)

58-58: JSX에 불필요한 콤마가 있어 화면에 ','가 렌더링될 수 있습니다

내부의 <Stack ... />, 뒤 콤마는 JSX 자식으로 문자열 ','을 추가합니다. 제거하세요.

-        <Stack initialLoaderData={initialLoaderData} />,
+        <Stack initialLoaderData={initialLoaderData} />
🧹 Nitpick comments (2)
docs/pages/api-references/future-api/api-pipelining.en.mdx (1)

35-35: Clarify that initialLoaderData is a Promise when not awaited

Given the “do not await” guidance, initialLoaderData will hold a Promise. Consider reflecting this in the sample for clarity (helps readers understand why Suspense works).

Outside this range, you can adjust the declaration to make the intent explicit:

-  let initialLoaderData: unknown | null = null;
+  // Holds a Promise when a loader is matched (intentionally not awaited)
+  let initialLoaderData: Promise<unknown> | null = null;
docs/pages/api-references/future-api/api-pipelining.ko.mdx (1)

35-35: await하지 않으므로 Promise 타입임을 명확히 해주세요

주석대로 await하지 않으면 initialLoaderData에는 Promise가 들어갑니다. 독자의 이해를 돕기 위해 타입을 명시적으로 표현하는 것이 좋아요.

이 범위 밖 선언부를 다음과 같이 조정할 수 있어요:

-  let initialLoaderData: unknown | null = null;
+  // 매칭 시 loader의 Promise를 담습니다 (await하지 않음)
+  let initialLoaderData: Promise<unknown> | null = null;
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6dbc319 and 2ac2f8d.

📒 Files selected for processing (2)
  • docs/pages/api-references/future-api/api-pipelining.en.mdx (1 hunks)
  • docs/pages/api-references/future-api/api-pipelining.ko.mdx (1 hunks)
🔇 Additional comments (2)
docs/pages/api-references/future-api/api-pipelining.en.mdx (1)

25-27: Nice defensive gating and control-flow

The explicit t guard and deferring parse until after template creation look good. Gating on both match existence and loader presence keeps the loop tight and avoids unnecessary work.

Also applies to: 29-31

docs/pages/api-references/future-api/api-pipelining.ko.mdx (1)

25-27: 수비적인 가드와 제어 흐름 좋습니다

t 존재 여부를 먼저 확인하고, 템플릿 생성 이후에만 parse를 수행하는 점이 안전합니다. match와 loader 모두를 게이트하는 것도 불필요한 작업을 줄여줍니다.

Also applies to: 29-31

Comment on lines +19 to +23
if (typeof activity.route === "string") {
t = makeTemplate({ path: activity.route });
} else if (typeof activity.route === "object") {
t = makeTemplate(activity.route);
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Guard against null when treating route as an object

typeof null === "object". If activity.route can ever be nullish, makeTemplate(activity.route) would throw. Add a null check before the object branch.

-    } else if (typeof activity.route === "object") {
-      t = makeTemplate(activity.route);
+    } else if (activity.route && typeof activity.route === "object") {
+      t = makeTemplate(activity.route);
     }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (typeof activity.route === "string") {
t = makeTemplate({ path: activity.route });
} else if (typeof activity.route === "object") {
t = makeTemplate(activity.route);
}
if (typeof activity.route === "string") {
t = makeTemplate({ path: activity.route });
} else if (activity.route && typeof activity.route === "object") {
t = makeTemplate(activity.route);
}
🤖 Prompt for AI Agents
In docs/pages/api-references/future-api/api-pipelining.en.mdx around lines 19 to
23, the branch treats activity.route as an object but does not guard against
null (since typeof null === "object"), so calling makeTemplate(activity.route)
can throw; update the conditional to ensure activity.route is not nullish before
calling makeTemplate (e.g., check activity.route != null && typeof
activity.route === "object" or equivalent) so only actual objects are passed to
makeTemplate, and handle the null/undefined case as appropriate.

Comment on lines +19 to +23
if (typeof activity.route === "string") {
t = makeTemplate({ path: activity.route });
} else if (typeof activity.route === "object") {
t = makeTemplate(activity.route);
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

null을 객체로 취급하는 것을 방지하세요

typeof null === "object" 이므로, activity.route가 nullish일 경우 makeTemplate(activity.route)가 예외를 던질 수 있어요. 객체 분기에서 null 체크를 추가해 주세요.

-    } else if (typeof activity.route === "object") {
-      t = makeTemplate(activity.route);
+    } else if (activity.route && typeof activity.route === "object") {
+      t = makeTemplate(activity.route);
     }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (typeof activity.route === "string") {
t = makeTemplate({ path: activity.route });
} else if (typeof activity.route === "object") {
t = makeTemplate(activity.route);
}
if (typeof activity.route === "string") {
t = makeTemplate({ path: activity.route });
} else if (activity.route && typeof activity.route === "object") {
t = makeTemplate(activity.route);
}
🤖 Prompt for AI Agents
docs/pages/api-references/future-api/api-pipelining.ko.mdx lines 19-23: 현재 분기에서
typeof null === "object"여서 activity.route가 null일 때 makeTemplate(activity.route)를
호출하면 예외가 발생할 수 있습니다; 객체 분기 앞에서 activity.route가 null 또는 undefined가 아닌지 확인하거나
typeof activity.route === "object" && activity.route !== null로 조건을 변경해 null을 걸러낸
뒤 makeTemplate을 호출하도록 수정하세요.

Comment on lines +19 to +23
if (typeof activity.route === "string") {
t = makeTemplate({ path: activity.route });
} else if (typeof activity.route === "object") {
t = makeTemplate(activity.route);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the previous documentation, only a single case was provided as an example.
Since there was only one example, copying and pasting the example code from the document would result in an error.

image

However, in actual use cases, activity.route can be either an object or a string, so we need to handle both cases.

image

Therefore, we have updated the example code to accommodate the above scenarios.


// 1. Request API data (do not await)
initialLoaderData = activity.loader({ params: match as any });
initialLoaderData = activity.loader({ params: match as any, config });
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We also updated the code to inject config due to the type error shown in the image below.

image

@SEOKKAMONI SEOKKAMONI closed this Aug 21, 2025
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.

1 participant