Skip to content

docs: add section about extending plugin API#6397

Merged
chenjiahan merged 2 commits intomainfrom
plugin_api_doc_1021
Oct 21, 2025
Merged

docs: add section about extending plugin API#6397
chenjiahan merged 2 commits intomainfrom
plugin_api_doc_1021

Conversation

@chenjiahan
Copy link
Member

Summary

Add documentation for exposing custom methods to Rsbuild plugins using rsbuild.expose() and accessing them via api.useExposed().

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings October 21, 2025 11:13
@netlify
Copy link

netlify bot commented Oct 21, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit b15c74b
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/68f76be07af8990008975af3
😎 Deploy Preview https://deploy-preview-6397--rsbuild.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 56 (🟢 up 8 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds documentation for extending the Rsbuild plugin API by exposing custom methods from the Rsbuild instance to plugins. The documentation explains how to use rsbuild.expose() to share custom functionality and api.useExposed() to access it from within plugins.

  • Adds new section "Extending the Plugin API" to plugin development documentation
  • Provides code examples demonstrating the expose/useExposed pattern for sharing state and methods
  • Includes both English and Chinese translations

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
website/docs/zh/plugins/dev/index.mdx Added Chinese documentation for extending plugin API with rsbuild.expose() and api.useExposed()
website/docs/en/plugins/dev/index.mdx Added English documentation for extending plugin API with rsbuild.expose() and api.useExposed()

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@chenjiahan chenjiahan merged commit b42ade1 into main Oct 21, 2025
14 checks passed
@chenjiahan chenjiahan deleted the plugin_api_doc_1021 branch October 21, 2025 11:22
@chenjiahan chenjiahan mentioned this pull request Oct 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant