Skip to content

Commit 30466bb

Browse files
authored
Merge branch 'main' into fix/metro-windows-path-comparisons
2 parents 6a06be6 + 1288d6e commit 30466bb

197 files changed

Lines changed: 4760 additions & 4666 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/docs-improve.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'website-new': patch
3+
'@module-federation/rspress-plugin': patch
4+
---
5+
6+
docs: improve guides, configuration, and integrations content
7+
8+
- Unify internal links to absolute `/path/to/page.html` form (drop relative paths and `/zh` / `/en` prefixes).
9+
- Restructure configuration option pages for consistent formatting.
10+
- Refresh integration guides for Modern.js, Next.js, Angular, Vue, and React.
11+
- Reorganize runtime API and hooks reference, and rewrite advanced/start/data guides.
12+
- Sync all updates between EN and ZH locales.
13+
- Bump `@rspress/shared` runtime dep and `@rspress/core` peer to `2.0.14`.

apps/website-new/README.md

Lines changed: 44 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,63 @@
11
# website-new
22

3-
This is the example application for Module Federation core.
3+
This is a website built with Rspress and Webpack 5 Module Federation, serving as a playground for testing and demonstrating the capabilities of Module Federation in a real-world application.
44

5-
## Usage
6-
7-
Run the development server and navigate to the provided localhost URL.
5+
## Scripts
86

9-
## Troubleshooting
7+
- `pnpm dev`: Start dev server
8+
- `pnpm build`: Build production bundle
109

11-
Clear `.nx` cache if you encounter unexpected build issues.
10+
## Configuration
1211

13-
## Build
12+
Check `rspress.config.ts` for federation settings.
1413

15-
Output will be located in the `dist` or `.next` folder.
14+
## Authoring docs: where to put reusable mdx
1615

17-
## Scripts
16+
The docs site has two kinds of reusable mdx pieces. Pick the right bucket so links keep working under both `/en` and `/zh`.
1817

19-
- `pnpm start`: Start dev server
20-
- `pnpm build`: Build production bundle
21-
22-
## Configuration
18+
```
19+
docs/
20+
_snippets/ # shared, language-agnostic code snippets
21+
install-kit.mdx
22+
rspack/create-config.mdx
23+
node/*.mdx
24+
...
25+
en/
26+
_components/ # English-only doc fragments
27+
runtime/index.mdx
28+
secondary-build.mdx
29+
...
30+
zh/
31+
_components/ # Chinese-only doc fragments
32+
runtime/index.mdx
33+
...
34+
```
2335

24-
Check `webpack.config.js` or `next.config.js` for federation settings.
36+
**Use `docs/_snippets/` when the file is:**
2537

26-
## Description
38+
- A pure code/command snippet (bash output, ts/js config example)
39+
- Reusable across languages with no prose
40+
- Possibly parameterized via `props` (e.g. `install-kit.mdx` uses `${props.pkgName}`)
2741

28-
This package demonstrates a specific use case of Module Federation within the ecosystem.
42+
**Use `docs/<lang>/_components/` when the file contains:**
2943

30-
## Features
44+
- Localized prose / explanatory text
45+
- Cross-page markdown links like `/guide/...` — these must live under `docs/<lang>/` so rspress prefixes them with the correct locale, otherwise the zh site will jump to en pages
3146

32-
- Remote loading
33-
- Shared dependencies
34-
- Type safety
47+
### Import aliases
3548

36-
---
49+
`rspress.config.ts` provides:
3750

38-
_Optimized by Aiden_
51+
- `@components``src/components/` — real React components (`.tsx`)
52+
- `@docs``docs/` — used to import the mdx partials above
3953

40-
## Installation
54+
Examples:
4155

42-
```bash
43-
pnpm install
56+
```mdx
57+
import Collapse from '@components/Collapse'; // tsx component
58+
import InstallKit from '@docs/_snippets/install-kit'; // shared snippet
59+
import Runtime from '@docs/zh/_components/runtime/index'; // zh fragment
60+
import Runtime from '@docs/en/_components/runtime/index'; // en fragment
4461
```
62+
63+
Both `_snippets/` and `_components/` are excluded from routing by rspress's default `excludeConvention` (`**/_[^_]*`), so they never produce a public page.
File renamed without changes.

apps/website-new/src/components/common/configure/array-shared.mdx renamed to apps/website-new/docs/_snippets/configure/array-shared.mdx

File renamed without changes.

apps/website-new/src/components/common/configure/object-shared.mdx renamed to apps/website-new/docs/_snippets/configure/object-shared.mdx

File renamed without changes.
File renamed without changes.

apps/website-new/src/components/common/node/host-rspack-config.mdx renamed to apps/website-new/docs/_snippets/node/host-rspack-config.mdx

File renamed without changes.

apps/website-new/src/components/common/node/host-usage.mdx renamed to apps/website-new/docs/_snippets/node/host-usage.mdx

File renamed without changes.

apps/website-new/src/components/common/node/remote-rslib-config.mdx renamed to apps/website-new/docs/_snippets/node/remote-rslib-config.mdx

File renamed without changes.

apps/website-new/src/components/common/node/remote-rspack-config.mdx renamed to apps/website-new/docs/_snippets/node/remote-rspack-config.mdx

File renamed without changes.

0 commit comments

Comments
 (0)