Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add Docusaurus to ecosystem #8336

Merged
merged 2 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 18 additions & 48 deletions website/docs/en/guide/start/quick-start.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -112,70 +112,40 @@ If you need to migrate from an existing project to Rspack or Rsbuild, you can re
- [Migrating from Vite to Rsbuild](https://rsbuild.dev/guide/migration/vite)
- [Migrating from Storybook](/guide/migration/storybook)

## Community ecosystem

There are already some Rspack-based toolchains in the community:

- If you want to build a static site, you can try [Rspress](https://rspress.dev).
- If you want to build a library or UI component, you can try [Rslib](https://github.com/web-infra-dev/rslib).
- If you want to analyze the build process and build artifacts, you can try [Rsdoctor](https://rsdoctor.dev).
- If you're looking for a full-stack React framework, you can try [Modern.js](https://modernjs.dev/en/).
- If you want a fast and production-ready setup that works in a monorepo, you can try [Nx](https://nx.dev).

> Visit [awesome-rspack](https://github.com/web-infra-dev/awesome-rspack) to discover more projects within the Rspack ecosystem.
## Ecosystem

### Rspress

Rspress is a static site generator based on Rspack. It provides a complete solution for building static sites and includes the following features:

- 🚀 Fast Startup: Based on Rust-based build tool and markdown/mdx compiler, the build speed is extremely fast, bringing you the ultimate development experience.
- 📚 MDX Support: MDX is a powerful way to write content, allowing you to use React components in Markdown.
- 📦 Built-in Full Text Search: Automatically generates a full-text search index for you during building process, providing out-of-the-box full-text search capabilities.
- 🌈 Static Site Generation: In production, it automatically builds into static HTML files, which can be easily deployed anywhere.
- 🔌 Providing Plugin System: Providing a plugin system, you can customize the build process and theme according to your needs.

Learn more about Rspress in the [official documentation](https://rspress.dev).

### Modern.js

[Modern.js Framework](https://modernjs.dev/en/) is a Rspack-based progressive React framework that provides a complete solution for building web applications. It supports nested routes, server-side rendering, and provides out-of-the-box CSS solutions such as styled components and Tailwind CSS.
[Rspress](https://rspress.dev) is a static site generator based on Rsbuild, React and MDX. It comes with a default documentation theme, and you can quickly build a documentation site with Rspress. You can also customize the theme to meet your personalized static site needs, such as blog sites, product homepages, etc.

Learn more about Modern.js in the [official documentation](https://modernjs.dev/en/guides/get-started/introduction).
### Rslib

### Using Nx
[Rslib](https://github.com/web-infra-dev/rslib) is a library development tool based on Rsbuild, which reuses the carefully designed build configuration and plugin system of Rsbuild. It allows developers to create JavaScript libraries in a simple and intuitive way.

The fastest way to get up to speed quickly and leverage Rspack and React in a production-ready setting is to use the dedicated [Rspack Nx plugin](https://www.npmjs.com/package/@nx/rspack). This gives you a pre-configured setup, integrating Rspack with React, TypeScript, ESLint, Jest, and Cypress for e2e testing.
### Rsdoctor

Run the following command to set up a new Nx workspace with React and Rspack:
[Rsdoctor](https://rsdoctor.dev/) is a build analyzer that can visually display the build process, such as compilation time, code changes before and after compilation, module reference relationships, duplicate modules, etc.

<Tabs values={[{ label: 'npm' }, { label: 'yarn' }, { label: 'pnpm' }]}>
<Tab>
### Modern.js

```sh
npx create-nx-workspace myrspackapp --preset=@nx/rspack
```
[Modern.js](https://modernjs.dev/en/) is a Rspack-based progressive React framework that supports nested routes, SSR, and provides out-of-the-box CSS solutions such as styled components and Tailwind CSS.

</Tab>
### Nx

<Tab>
[Nx](https://nx.dev/) is a powerful open-source build system that provides tools and techniques for enhancing developer productivity, optimizing CI performance, and maintaining code quality.

```sh
yarn create nx-workspace myrspackapp --preset=@nx/rspack --pm=yarn
```
Rspack team and Nx team have collaborated to provide the [Rspack Nx plugin](https://nx.dev/nx-api/rspack). This plugin contains executors, generators, and utilities for managing Rspack projects in an Nx Workspace.

</Tab>
### Docusaurus

<Tab>
[Docusaurus](https://docusaurus.io/) is a project for building, deploying, and maintaining open source project websites easily.

```sh
pnpm create nx-workspace myrspackapp --preset=@nx/rspack --pm=pnpm
```
Docusaurus v3.6 supports Rspack as the bundler, see [Docusaurus Faster](https://docusaurus.io/blog/releases/3.6#docusaurus-faster) for details.

</Tab>
</Tabs>
### Storybook

The pre-configured setup is already ready to work with Rspack, TypeScript, TSX and React. In addition it also comes with Jest and Cypress for testing and ESLint for linting.
[Storybook Rsbuild](https://storybook.rsbuild.dev/) allows you to use Rsbuild as the build tool for Storybook, and provides UI framework integrations like React and Vue.

Once created you can simply `npm start` (or `pnpm start` or `yarn start`) to start the development server. You can also run `npm run build` (or `pnpm run build` or `yarn run build`) to build the application for production and similarly run `npm run test` (or `pnpm run test` or `yarn run test`) to run the unit tests.
### More

> You can learn more about Nx at [https://nx.dev](https://nx.dev).
Visit [awesome-rspack](https://github.com/web-infra-dev/awesome-rspack) to discover more projects within the Rspack ecosystem.
66 changes: 18 additions & 48 deletions website/docs/zh/guide/start/quick-start.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -117,70 +117,40 @@ npm init -y
- [从 Vite 迁移到 Rsbuild](https://rsbuild.dev/zh/guide/migration/vite)
- [从 Storybook 迁移](/guide/migration/storybook)

## 社区生态

社区中已经有一些基于 Rspack 的工具链:

- 如果你需要开发一个静态站点(如文档站),可以尝试 [Rspress](https://rspress.dev)。
- 如果你需要开发一个工具库或组件库,可以尝试 [Rslib](https://github.com/web-infra-dev/rslib)。
- 如果你需要分析构建过程和构建产物,可以尝试 [Rsdoctor](https://rsdoctor.dev)。
- 如果你需要一个 React 全栈框架来构建 Web 应用,可以尝试 [Modern.js](https://modernjs.dev/)。
- 如果你需要在 Monorepo 中使用 Rspack,打造快速、可扩展的构建系统,可以尝试 [Nx](https://nx.dev)。

> 访问 [awesome-rspack](https://github.com/web-infra-dev/awesome-rspack) 来发现更多 Rspack 生态中的项目。
## 生态

### Rspress

Rspress 是一个基于 Rspack 的静态站点生成器,它包含如下的特性:

- 🚀 快速构建:基于 Rust 构建工具和 Markdown/MDX 编译器,构建速度极快,为你带来更舒适的开发体验。
- 📚 MDX 支持:MDX 是一种强大的内容编写方式,允许你在 Markdown 中使用 React 组件。
- 📦 内置全文搜索:在构建过程中自动生成全文搜索索引,提供开箱即用的全文搜索能力。
- 🌈 静态站点生成:在生产环境中,它会自动构建成静态 HTML 文件,可以轻松部署到任何地方。
- 🔌 提供插件系统:提供一个插件系统,你可以根据自己的需要定制构建过程和自定义主题。

你可以访问 [官网](https://rspress.dev) 了解更多关于 Rspress 的信息。

### Modern.js

[Modern.js](https://modernjs.dev/) 是字节跳动 Web 工程体系的开源版本,它提供了一个基于 Rspack 实现的渐进式 React 框架,并为开发 Web 应用提供了完整的解决方案。框架支持嵌套路由、服务器端渲染(SSR),并提供开箱即用的 CSS 解决方案,比如 styled-components 和 Tailwind CSS。
[Rspress](https://rspress.dev) 是一个基于 Rsbuild、React 和 MDX 的静态站点生成器,内置了一套默认的文档主题,你可以通过 Rspress 来快速搭建一个文档站点,同时也可以自定义主题,来满足个性化静态站需求,比如博客站、产品主页等。

请阅读 [官方文档](https://modernjs.dev/guides/get-started/introduction) 来了解更多关于 Modern.js 的信息。
### Rslib

### 使用 Nx
[Rslib](https://github.com/web-infra-dev/rslib) 是一个基于 Rsbuild 的 npm 库开发工具,它复用了 Rsbuild 精心设计的构建配置和插件系统,使开发者能够以简单直观的方式创建 JavaScript 库。

Nx 是一个快速、可扩展的构建系统,Rspack 团队与 Nx 团队合作提供了 [Rspack Nx 插件](https://www.npmjs.com/package/@nx/rspack)。该插件会给你一个预设项目,将 Rspack 与 React、TypeScript、ESLint、Jest 和用于 e2e 测试的 Cypress 整合在一起,使你能迅速搭建一个用于生产环境的应用。
### Rsdoctor

运行以下命令,用 React 和 Rspack 建立一个新的 Nx workspace
[Rsdoctor](https://rsdoctor.dev/) 是一个针对 Rspack 的构建分析器,可以直观地展示构建过程,例如编译时间、编译前后的代码变化、模块引用关系、重复模块等。如果您需要排查构建产物或构建时编译问题,可以使用 Rsdoctor

<Tabs values={[{ label: 'npm' }, { label: 'yarn' }, { label: 'pnpm' }]}>
<Tab>
### Modern.js

```sh
npx create-nx-workspace myrspackapp --preset=@nx/rspack
```
[Modern.js](https://modernjs.dev/) 是一个基于 Rspack 实现的渐进式 React 框架,支持嵌套路由、服务器端渲染(SSR)和模块联邦,并提供开箱即用的 CSS 解决方案。

</Tab>
### Nx

<Tab>
[Nx](https://nx.dev/) 是一个强大的开源构建系统,提供了工具来提升生产力、优化 CI 性能和维护代码质量。

```sh
yarn create nx-workspace myrspackapp --preset=@nx/rspack --pm=yarn
```
Rspack 团队与 Nx 团队合作提供了 [Rspack Nx 插件](https://nx.dev/nx-api/rspack)。该插件包含在 Nx Workspace 中管理 Rspack 项目的执行器、生成器和实用工具。

</Tab>
### Docusaurus

<Tab>
[Docusaurus](https://docusaurus.io/) 是一个用于快速构建、部署和维护开源项目网站的工具。

```sh
pnpm create nx-workspace myrspackapp --preset=@nx/rspack --pm=pnpm
```
Docusaurus v3.6 支持使用 Rspack 作为打包工具,详见 [Docusaurus Faster](https://docusaurus.io/blog/releases/3.6#docusaurus-faster)。

</Tab>
</Tabs>
### Storybook

这个预设项目已经包含了 Rspack、TypeScript、TSX 和 React。此外,它还配备了用于测试的 JestCypress 、用于代码规范校验的 ESLint
[Storybook Rsbuild](https://storybook.rsbuild.dev/) 允许你使用 Rsbuild 作为 Storybook 的构建工具,并提供了 ReactVue 等 UI 框架的集成

创建成功后,你可以直接用 `npm start` 来启动开发服务器。你也可以运行 `npm run build` 来为生产环境构建应用程序、运行 `npm run test` 来运行单元测试。
### 更多

> 你可以在 [https://nx.dev](https://nx.dev) 了解更多关于 Nx 的信息
访问 [awesome-rspack](https://github.com/web-infra-dev/awesome-rspack) 来发现更多 Rspack 生态中的项目
Loading