Skip to content

Commit 408f6f6

Browse files
committed
Merge branch 'master' into mdx
2 parents 34dfb94 + 69e3b5f commit 408f6f6

File tree

595 files changed

+49516
-7749
lines changed

Some content is hidden

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

595 files changed

+49516
-7749
lines changed

.cargo/config.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
[target.'cfg(target_arch = "wasm32")']
1+
[target.'cfg(all(target_arch = "wasm32", not(target_os = "wasi")))']
22
runner = 'wasm-bindgen-test-runner'
33

4+
[target.'cfg(all(target_arch = "wasm32", target_os = "wasi"))']
5+
runner = 'wasmtime -W unknown-imports-trap=y'
6+
47
# This section needs to be last.
58
# GitHub Actions modifies this section.
69
[unstable]

.github/ISSUE_TEMPLATE/documentation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ assignees: ''
1111

1212
This is about:
1313
- [ ] A typo
14-
- [ ] Innaccurate/misleading documentation (e.g. technically incorrect advice)
14+
- [ ] Inaccurate/misleading documentation (e.g. technically incorrect advice)
1515
- [ ] Undocumented code
1616
- [ ] Outdated documentation
1717
- [ ] Other

.github/workflows/benchmark-core.yml

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
---
21
name: Benchmark - core
32

43
on:
@@ -32,38 +31,31 @@ jobs:
3231
with:
3332
toolchain: stable
3433

35-
- name: Restore Rust cache for master
34+
- name: Restore Rust cache for yew packages
3635
uses: Swatinem/rust-cache@v2
3736
with:
38-
working-directory: yew-master
39-
key: master
40-
41-
- name: Restore Rust cache for current pull request
42-
uses: Swatinem/rust-cache@v2
43-
with:
44-
working-directory: current-pr
45-
key: pr
37+
shared-key: yew-packages
38+
workspaces: |
39+
yew-master
40+
current-pr
4641
4742
- name: Run pull request benchmark
48-
run: cargo bench -q > ../output.log
4943
working-directory: current-pr/tools/benchmark-core
44+
run: cargo bench -q > ../output.log
5045

5146
- name: Run master benchmark
52-
run: cargo bench -q > ../output.log
53-
continue-on-error: true
5447
working-directory: yew-master/tools/benchmark-core
55-
56-
- name: Make sure master's output log exists
57-
run: touch yew-master/tools/output.log
48+
run: cargo bench -q > ../output.log
5849

5950
- name: Write Pull Request ID
6051
run: |
6152
echo "${{ github.event.number }}" > .PR_NUMBER
6253
6354
- name: Upload Artifact
64-
uses: actions/upload-artifact@v3
55+
uses: actions/upload-artifact@v4
6556
with:
6657
name: benchmark-core
58+
include-hidden-files: true
6759
path: |
6860
.PR_NUMBER
6961
yew-master/tools/output.log

.github/workflows/benchmark-ssr.yml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
---
21
name: Benchmark - SSR
32

43
on:
@@ -37,34 +36,31 @@ jobs:
3736
toolchain: stable
3837
targets: wasm32-unknown-unknown
3938

40-
- name: Restore Rust cache for master
39+
- name: Restore Rust cache for yew packages
4140
uses: Swatinem/rust-cache@v2
4241
with:
43-
working-directory: yew-master
44-
key: master
45-
46-
- name: Restore Rust cache for current pull request
47-
uses: Swatinem/rust-cache@v2
48-
with:
49-
working-directory: current-pr
50-
key: pr
42+
shared-key: yew-packages
43+
workspaces: |
44+
yew-master
45+
current-pr
5146
5247
- name: Run pull request benchmark
53-
run: cargo run --profile=bench -- --output-path ../output.json
5448
working-directory: current-pr/tools/benchmark-ssr
49+
run: cargo run --profile=bench -- --output-path ../output.json
5550

5651
- name: Run master benchmark
57-
run: cargo run --profile=bench -- --output-path ../output.json
5852
working-directory: yew-master/tools/benchmark-ssr
53+
run: cargo run --profile=bench -- --output-path ../output.json
5954

6055
- name: Write Pull Request ID
6156
run: |
6257
echo "${{ github.event.number }}" > .PR_NUMBER
6358
6459
- name: Upload Artifact
65-
uses: actions/upload-artifact@v3
60+
uses: actions/upload-artifact@v4
6661
with:
6762
name: benchmark-ssr
63+
include-hidden-files: true
6864
path: |
6965
.PR_NUMBER
7066
yew-master/tools/output.json

.github/workflows/benchmark.yml

Lines changed: 36 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@ on:
1111
- "website/**"
1212
types: [labeled, synchronize, opened, reopened]
1313

14-
permissions:
15-
# deployments permission to deploy GitHub pages website
16-
deployments: write
17-
# contents permission to update benchmark contents in gh-pages branch
18-
contents: write
14+
# Cancel outstanding benchmarks on pull requests
15+
# https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#example-using-a-fallback-value
16+
concurrency:
17+
group: ${{ github.head_ref || github.run_id }}
18+
cancel-in-progress: true
1919

2020
jobs:
2121
benchmark:
22+
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'performance')
2223
runs-on: ubuntu-latest
2324

2425
steps:
@@ -37,35 +38,45 @@ jobs:
3738
toolchain: stable
3839
targets: wasm32-unknown-unknown
3940

40-
- uses: jetli/wasm-pack-action@v0.4.0
41-
with:
42-
version: "latest"
41+
- name: Setup wasm-pack
42+
uses: jetli/wasm-pack-action@v0.4.0
4343

4444
- name: Setup Node
4545
uses: actions/setup-node@v4
4646
with:
47-
node-version: 18
47+
node-version: ">=18"
4848
cache: "npm"
4949
cache-dependency-path: js-framework-benchmark/package-lock.json
5050

51-
- uses: Swatinem/rust-cache@v2
51+
- name: Restore Rust cache for yew packages
52+
uses: Swatinem/rust-cache@v2
53+
with:
54+
shared-key: yew-packages
55+
workspaces: |
56+
yew
57+
58+
- name: Setup chrome
59+
id: setup-chrome
60+
uses: browser-actions/setup-chrome@v1
61+
with:
62+
install-chromedriver: true
5263

53-
- name: setup js-framework-benchmark
64+
- name: Setup js-framework-benchmark
5465
working-directory: js-framework-benchmark
5566
run: |
5667
npm ci
5768
npm run install-server
5869
npm run install-webdriver-ts
5970
60-
- name: setup benchmark-struct benchmark
71+
- name: Setup benchmark-struct benchmark
6172
run: |
6273
ls -lauh
6374
rm *.js
6475
rm *.wasm
6576
echo "STRUCT_BUILD_DIR=$PWD" >> $GITHUB_ENV
6677
working-directory: js-framework-benchmark/frameworks/keyed/yew/bundled-dist/
6778

68-
- name: build benchmark-struct app
79+
- name: Build benchmark-struct app
6980
working-directory: yew/tools/benchmark-struct
7081
run: |
7182
wasm-pack build \
@@ -75,19 +86,19 @@ jobs:
7586
--out-name js-framework-benchmark-yew \
7687
--out-dir $STRUCT_BUILD_DIR
7788
78-
- name: show built benchmark-struct benchmark files
89+
- name: Show built benchmark-struct benchmark files
7990
run: |
8091
ls -lauh js-framework-benchmark/frameworks/keyed/yew/bundled-dist/
8192
82-
- name: setup yew-hooks benchmark
93+
- name: Setup yew-hooks benchmark
8394
run: |
8495
ls -lauh
8596
rm *.js
8697
rm *.wasm
8798
echo "HOOKS_BUILD_DIR=$PWD" >> $GITHUB_ENV
8899
working-directory: js-framework-benchmark/frameworks/keyed/yew-hooks/bundled-dist/
89100

90-
- name: build benchmark-hooks app
101+
- name: Build benchmark-hooks app
91102
working-directory: yew/tools/benchmark-hooks
92103
run: |
93104
wasm-pack build \
@@ -97,31 +108,33 @@ jobs:
97108
--out-name js-framework-benchmark-yew-hooks \
98109
--out-dir $HOOKS_BUILD_DIR
99110
100-
- name: show built benchmark-hooks benchmark files
111+
- name: Show built benchmark-hooks benchmark files
101112
run: |
102113
ls -lauh js-framework-benchmark/frameworks/keyed/yew-hooks/bundled-dist/
103114
104-
- name: run js-framework-benchmark server
115+
- name: Run js-framework-benchmark server
105116
working-directory: js-framework-benchmark
106117
run: |
107118
npm start &
108119
sleep 5
109120
110-
- name: js-framework-benchmark/webdriver-ts npm run bench
121+
- name: Run js-framework-benchmark/webdriver-ts npm run bench
111122
working-directory: js-framework-benchmark/webdriver-ts
112-
run: xvfb-run npm run bench -- --framework keyed/yew keyed/yew-hooks --runner playwright
123+
run: xvfb-run npm run bench -- --framework keyed/yew keyed/yew-hooks --runner playwright --chromeBinary "${{ steps.setup-chrome.outputs.chrome-path }}"
113124

114-
- name: transform results to be fit for display benchmark-action/github-action-benchmark@v1
125+
- name: Transform results to be fit for display benchmark-action/github-action-benchmark@v1
115126
run: |
116127
mkdir artifacts/
117128
jq -s . js-framework-benchmark/webdriver-ts/results/*.json | cargo run --manifest-path yew/Cargo.toml --release -p process-benchmark-results > artifacts/results.json
118-
echo "$EVENT_INFO" > artifacts/PR_INFO
129+
echo "$EVENT_INFO" > artifacts/.PR_INFO
119130
env:
120131
EVENT_INFO: ${{ toJSON(github.event) }}
121132

122133
- name: Upload result artifacts
123-
uses: actions/upload-artifact@v3
134+
uses: actions/upload-artifact@v4
124135
with:
125136
name: results
126137
path: artifacts/
127138
if-no-files-found: error
139+
include-hidden-files: true
140+
retention-days: 1

.github/workflows/build-api-docs.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ on:
1616
jobs:
1717
build:
1818
runs-on: ubuntu-latest
19-
env:
20-
PR_INFO_FILE: ".PR_INFO"
2119
steps:
2220
- uses: actions/checkout@v4
2321

@@ -46,7 +44,7 @@ jobs:
4644
cp -r target/doc/* api-docs/dist/next
4745
4846
- name: Upload build artifact
49-
uses: actions/upload-artifact@v3
47+
uses: actions/upload-artifact@v4
5048
with:
5149
name: api-docs
5250
path: api-docs/
@@ -55,12 +53,13 @@ jobs:
5553
- if: github.event_name == 'pull_request'
5654
name: Build pr info
5755
run: |
58-
echo "${{ github.event.number }}" > $PR_INFO_FILE
56+
echo "${{ github.event.number }}" > .PR_INFO
5957
6058
- if: github.event_name == 'pull_request'
6159
name: Upload pr info
62-
uses: actions/upload-artifact@v3
60+
uses: actions/upload-artifact@v4
6361
with:
6462
name: pr-info
65-
path: "${{ env.PR_INFO_FILE }}"
63+
include-hidden-files: true
64+
path: .PR_INFO
6665
retention-days: 1

.github/workflows/build-website.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ jobs:
1717
build:
1818
name: Build Website
1919
runs-on: ubuntu-latest
20-
env:
21-
PR_INFO_FILE: ".PR_INFO"
2220
steps:
2321
- uses: actions/checkout@v4
2422

@@ -30,7 +28,7 @@ jobs:
3028
- name: Install dependencies
3129
run: |
3230
cd website
33-
npm install
31+
npm ci
3432
3533
- name: Run prettier
3634
run: |
@@ -48,7 +46,7 @@ jobs:
4846
npm run build
4947
5048
- name: Upload build artifact
51-
uses: actions/upload-artifact@v3
49+
uses: actions/upload-artifact@v4
5250
with:
5351
name: website
5452
path: website/build/
@@ -57,12 +55,13 @@ jobs:
5755
- if: github.event_name == 'pull_request'
5856
name: Build pr info
5957
run: |
60-
echo "${{ github.event.number }}" > $PR_INFO_FILE
58+
echo "${{ github.event.number }}" > .PR_INFO
6159
6260
- if: github.event_name == 'pull_request'
6361
name: Upload pr info
64-
uses: actions/upload-artifact@v3
62+
uses: actions/upload-artifact@v4
6563
with:
6664
name: pr-info
67-
path: "${{ env.PR_INFO_FILE }}"
65+
include-hidden-files: true
66+
path: .PR_INFO
6867
retention-days: 1

.github/workflows/clippy.yml

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ jobs:
1616
feature-soundness:
1717
name: Feature Soundness
1818
runs-on: ubuntu-latest
19+
# if normal clippy doesn't succeed, do not try to lint feature soundness
20+
needs: clippy
21+
1922
strategy:
2023
fail-fast: false
2124
matrix:
@@ -32,27 +35,16 @@ jobs:
3235
components: clippy
3336

3437
- uses: Swatinem/rust-cache@v2
38+
with:
39+
shared-key: clippy
3540

3641
- name: Lint feature soundness
3742
if: matrix.profile == 'dev'
38-
run: bash ../../ci/feature-soundness.sh
39-
working-directory: packages/yew
43+
run: bash ./ci/feature-soundness.sh
4044

4145
- name: Lint feature soundness
4246
if: matrix.profile == 'release'
43-
run: bash ../../ci/feature-soundness-release.sh
44-
working-directory: packages/yew
45-
46-
- name: Run release clippy
47-
if: matrix.profile == 'release'
48-
run: |
49-
ls packages | xargs -I {} \
50-
cargo clippy \
51-
-p {} \
52-
--all-targets \
53-
--all-features \
54-
--workspace \
55-
-- -D warnings
47+
run: bash ./ci/feature-soundness-release.sh
5648

5749
clippy:
5850
name: Clippy Workspace
@@ -73,6 +65,8 @@ jobs:
7365
components: clippy
7466

7567
- uses: Swatinem/rust-cache@v2
68+
with:
69+
shared-key: clippy
7670

7771
- name: Run clippy
7872
run: |

0 commit comments

Comments
 (0)