Skip to content

Conversation

babu-ch
Copy link
Contributor

@babu-ch babu-ch commented Sep 13, 2025

#2257

Summary by CodeRabbit

  • Documentation
    • Added an SSR subsection under “Pre translations with extensions.”
    • Introduced “Configure plugin for SSR” guidance for @intlify/unplugin-vue-i18n, including a Vite configuration example illustrating how to enable SSR.
    • Clarifies setup steps to ensure SSR compatibility for internationalization workflows.
    • No changes to public APIs or runtime behavior.

Copy link

coderabbitai bot commented Sep 13, 2025

Walkthrough

Adds a new SSR subsection to the "Pre translations with extensions" documentation, showing how to enable SSR support in @intlify/unplugin-vue-i18n via Vite config by setting VueI18nPlugin({ ssr: true }). No code or API changes.

Changes

Cohort / File(s) Summary
Docs — Advanced Optimization (SSR config)
docs/guide/advanced/optimization.md
Added SSR guidance for @intlify/unplugin-vue-i18n with a Vite config example (VueI18nPlugin({ ssr: true })). Documentation-only update.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related issues

Poem

A rabbit taps keys with a hop and a cheer,
“SSR enabled!” it whispers in your ear.
Docs now guide the rendering night,
With ssr: true to set it right.
I nibble on carrots, merge with delight—
Pages now glow in server-side light. 🥕✨

Pre-merge checks and finishing touches

✅ 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 "docs: Add SSR configuration guide for vue-i18n plugin" accurately and concisely reflects the main change—a documentation addition that introduces an SSR configuration subsection and a Vite example for the vue-i18n plugin. It uses a clear "docs:" prefix and is specific enough for teammates to understand the primary purpose of the PR without extraneous detail. The title matches the raw_summary and PR objectives provided.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


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.

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: 0

🧹 Nitpick comments (4)
docs/guide/advanced/optimization.md (4)

181-186: Consider relocating this SSR subsection (or cross-linking) for discoverability.

This new SSR config guidance sits under “Pre translations with extensions,” but it applies to any SSR app using the unplugin. Suggest moving it under the earlier “unplugin-vue-i18n” section or adding a short cross-link there to avoid readers missing it.


188-200: Add a version note: SSR option requires vue-i18n ≥ 9.4.

Per the plugin docs, ssr works with vue-i18n v9.4+; adding a short tip avoids confusion for users on older versions.

Apply this diff to append a note after the code block:

 export default defineConfig({
   plugins: [
     VueI18nPlugin({
       ssr: true, // Enable SSR support
     }),
   ],
 })

+:::tip NOTE
+ssr requires vue-i18n v9.4 or later.
+:::

([npmjs.com](https://www.npmjs.com/package/%40intlify/unplugin-vue-i18n/v/1.6.0))

---

`188-200`: **Include a webpack example for parity.**

Many readers use webpack—mirroring the vite snippet improves coverage.

Apply this diff to add a webpack snippet right after the vite block:

```diff
 })

+```js
+// webpack.config.js
+const VueI18nPlugin = require('@intlify/unplugin-vue-i18n/webpack')
+
+module.exports = {

  • plugins: [
  • VueI18nPlugin({
  •  ssr: true, // Enable SSR support
    
  • })
  • ]
    +}
    +```
([npmjs.com](https://www.npmjs.com/package/%40intlify/unplugin-vue-i18n/v/1.6.0))

---

`186-196`: **Optional: mention v-t directive optimization requirement for SSR use-cases.**

When projects rely on the `v-t` directive during SSR, the plugin’s `optimizeTranslationDirective` should be enabled; adding a short pointer helps prevent SSR-only surprises.  

You could append a sentence: “If you use the v-t directive with SSR, also set optimizeTranslationDirective: true.” ([snyk.io](https://snyk.io/advisor/npm-package/%40intlify/unplugin-vue-i18n?utm_source=openai))

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used**: CodeRabbit UI

**Review profile**: CHILL

**Plan**: Pro

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 341ecee9a883d36dc43818e833a6048c65ab176b and 543c34a26489bf4f621761e9f73912afed2f47bd.

</details>

<details>
<summary>📒 Files selected for processing (1)</summary>

* `docs/guide/advanced/optimization.md` (1 hunks)

</details>

<details>
<summary>🔇 Additional comments (1)</summary><blockquote>

<details>
<summary>docs/guide/advanced/optimization.md (1)</summary><blockquote>

`182-200`: **Example looks correct for enabling SSR in the plugin.**

The `ssr: true` option is valid for `@intlify/unplugin-vue-i18n` and enables bundling the SSR build of vue-i18n. ✔️ ([npmjs.com](https://www.npmjs.com/package/%40intlify/unplugin-vue-i18n/v/1.6.0))

</blockquote></details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

Copy link
Member

@kazupon kazupon left a comment

Choose a reason for hiding this comment

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

Thank you!
LGTM!

@kazupon kazupon merged commit 109d23e into intlify:master Sep 14, 2025
1 check passed
@kazupon kazupon added the Type: Documentation A documetation fixes label Sep 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Documentation A documetation fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants