Skip to content

Commit 175cfbf

Browse files
committed
Merge branch 'main' into tinyglobby
2 parents cac8d48 + abd04a2 commit 175cfbf

File tree

86 files changed

+1775
-345
lines changed

Some content is hidden

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

86 files changed

+1775
-345
lines changed

.github/workflows/argos.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
3434
with:
3535
node-version: lts/*
36+
cache: yarn
3637

3738
- name: Install dependencies
3839
run: yarn || yarn || yarn

.github/workflows/dependency-review.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ jobs:
1515
- name: Checkout
1616
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
1717
- name: Dependency Review
18-
uses: actions/dependency-review-action@ce3cf9537a52e8119d91fd484ab5b8a807627bf8 # 4.6.0
18+
uses: actions/dependency-review-action@da24556b548a50705dd671f47852072ea4c105d9 # 4.7.1

.github/workflows/lighthouse-report.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
2828
with:
2929
node-version: lts/*
30+
cache: yarn
3031

3132
- name: Install dependencies
3233
run: yarn || yarn || yarn

.github/workflows/tests-e2e.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
runs-on: ubuntu-latest
3939
strategy:
4040
matrix:
41-
node: ['18.0', '20', '22']
41+
node: ['18.0', '20', '22', '24']
4242
steps:
4343
- name: Checkout
4444
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

.github/workflows/tests-windows.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
runs-on: windows-latest
2828
strategy:
2929
matrix:
30-
node: ['18.0', '20', '22']
30+
node: ['18.0', '20', '22', '24']
3131
steps:
3232
- name: Support longpaths
3333
run: git config --system core.longpaths true
@@ -37,6 +37,7 @@ jobs:
3737
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
3838
with:
3939
node-version: ${{ matrix.node }}
40+
cache: yarn
4041
- name: Installation
4142
run: yarn || yarn || yarn
4243
- name: Docusaurus Jest Tests

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
runs-on: ubuntu-latest
2828
strategy:
2929
matrix:
30-
node: ['18.0', '20', '22']
30+
node: ['18.0', '20', '22', '24']
3131
steps:
3232
- name: Checkout
3333
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,6 @@ website/i18n/**/*
4848

4949
website/rspack-tracing.json
5050
website/bundler-cpu-profile.json
51+
website/profile.json.gz
52+
53+

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@
3131
"build:website:deployPreview": "yarn build:website:deployPreview:testWrap && yarn build:website:deployPreview:build",
3232
"build:website:fast": "yarn workspace website build:fast",
3333
"build:website:fast:rsdoctor": "yarn workspace website build:fast:rsdoctor",
34-
"build:website:fast:profile": "yarn workspace website build:fast:profile",
3534
"build:website:en": "yarn workspace website build --locale en",
35+
"profile:bundle:cpu": "yarn workspace website profile:bundle:cpu:profile",
36+
"profile:bundle:samply": "yarn workspace website profile:bundle:samply",
3637
"clear:website": "yarn workspace website clear",
3738
"serve:website": "yarn workspace website serve",
3839
"serve:website:baseUrl": "serve website",

packages/create-docusaurus/templates/shared/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,40 @@
22

33
This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.
44

5-
### Installation
5+
## Installation
66

77
```bash
8-
$ yarn
8+
yarn
99
```
1010

11-
### Local Development
11+
## Local Development
1212

1313
```bash
14-
$ yarn start
14+
yarn start
1515
```
1616

1717
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
1818

19-
### Build
19+
## Build
2020

2121
```bash
22-
$ yarn build
22+
yarn build
2323
```
2424

2525
This command generates static content into the `build` directory and can be served using any static contents hosting service.
2626

27-
### Deployment
27+
## Deployment
2828

2929
Using SSH:
3030

3131
```bash
32-
$ USE_SSH=true yarn deploy
32+
USE_SSH=true yarn deploy
3333
```
3434

3535
Not using SSH:
3636

3737
```bash
38-
$ GIT_USER=<Your GitHub username> yarn deploy
38+
GIT_USER=<Your GitHub username> yarn deploy
3939
```
4040

4141
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.

packages/docusaurus-bundler/src/currentBundler.ts

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,46 @@ export async function getProgressBarPlugin({
104104

105105
return WebpackBar;
106106
}
107+
108+
export async function registerBundlerTracing({
109+
currentBundler,
110+
}: {
111+
currentBundler: CurrentBundler;
112+
}): Promise<() => Promise<void>> {
113+
if (currentBundler.name === 'rspack') {
114+
const Rspack = await importRspack();
115+
116+
// See https://rspack.dev/contribute/development/profiling
117+
// File can be opened with https://ui.perfetto.dev/
118+
if (process.env.DOCUSAURUS_RSPACK_TRACE) {
119+
// We use the env variable as the "filter" attribute
120+
// See values here: https://rspack.dev/contribute/development/tracing#tracing-filter
121+
let filter = process.env.DOCUSAURUS_RSPACK_TRACE;
122+
123+
if (filter === 'true' || filter === '1') {
124+
// Default value recommended by the Rspack team
125+
// It's also what the CLI uses for the "overview" preset:
126+
// https://github.com/web-infra-dev/rspack/blob/v1.3.10/packages/rspack-cli/src/utils/profile.ts
127+
filter = 'info';
128+
}
129+
130+
await Rspack.experiments.globalTrace.register(
131+
filter,
132+
'chrome',
133+
'./rspack-tracing.json',
134+
);
135+
136+
console.info(`Rspack tracing registered, filter=${filter}`);
137+
138+
return async () => {
139+
await Rspack.experiments.globalTrace.cleanup();
140+
console.log(`Rspack tracing cleaned up, filter=${filter}`);
141+
};
142+
}
143+
}
144+
145+
// We don't support Webpack tracing at the moment
146+
return async () => {
147+
// noop
148+
};
149+
}

0 commit comments

Comments
 (0)