Skip to content

Commit 98d2ce1

Browse files
Merge branch 'master' into changelog-migration-addition
2 parents b092cf2 + 8af333b commit 98d2ce1

1,435 files changed

Lines changed: 104107 additions & 32625 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.

.cargo/config.toml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
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-
# This section needs to be last.
5-
# GitHub Actions modifies this section.
6-
[unstable]
7-
doctest-xcompile = true
4+
[target.'cfg(all(target_arch = "wasm32", target_os = "wasi"))']
5+
runner = 'wasmtime -W unknown-imports-trap=y'
6+
7+
[target.wasm32-unknown-unknown]
8+
rustflags = ['--cfg', 'getrandom_backend="wasm_js"']

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.mdx linguist-detectable=false

.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/auto-approve-maintainer-pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ jobs:
1616
steps:
1717
- name: Check if organization member
1818
id: is_organization_member
19-
uses: JamesSingleton/is-organization-member@1.0.1
19+
uses: JamesSingleton/is-organization-member@1.1.0
2020
with:
2121
organization: "yewstack"
2222
username: ${{ github.event.pull_request.user.login }}
2323
token: ${{ secrets.GITHUB_TOKEN }}
2424

2525
- name: Auto approve
26-
uses: hmarr/auto-approve-action@v3
26+
uses: hmarr/auto-approve-action@v4
2727
if: ${{ steps.is_organization_member.outputs.result == 'true' || github.actor == 'dependabot[bot]' }}
2828
with:
2929
github-token: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Benchmark - core
2+
3+
on:
4+
pull_request:
5+
branches: [master]
6+
paths:
7+
- .github/workflows/benchmark-core.yml
8+
- "packages/yew/**"
9+
- "tools/benchmark-core/**"
10+
11+
jobs:
12+
benchmark-core:
13+
name: Benchmark - core
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout master
18+
uses: actions/checkout@v6
19+
with:
20+
repository: "yewstack/yew"
21+
ref: master
22+
path: yew-master
23+
24+
- name: Checkout pull request
25+
uses: actions/checkout@v6
26+
with:
27+
path: current-pr
28+
29+
- name: Setup toolchain
30+
uses: dtolnay/rust-toolchain@master
31+
with:
32+
toolchain: stable
33+
34+
- name: Restore Rust cache for yew packages
35+
uses: Swatinem/rust-cache@v2
36+
with:
37+
workspaces: |
38+
yew-master
39+
current-pr
40+
41+
- name: Run pull request benchmark
42+
working-directory: current-pr/tools/benchmark-core
43+
run: cargo bench -q > ../output.log
44+
45+
- name: Run master benchmark
46+
working-directory: yew-master/tools/benchmark-core
47+
run: cargo bench -q > ../output.log
48+
49+
- name: Write Pull Request ID
50+
run: |
51+
echo "${{ github.event.number }}" > .PR_NUMBER
52+
53+
- name: Upload Artifact
54+
uses: actions/upload-artifact@v7
55+
with:
56+
name: benchmark-core
57+
include-hidden-files: true
58+
path: |
59+
.PR_NUMBER
60+
yew-master/tools/output.log
61+
current-pr/tools/output.log
62+
retention-days: 1

.github/workflows/benchmark-ssr.yml

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

43
on:
@@ -20,14 +19,14 @@ jobs:
2019

2120
steps:
2221
- name: Checkout master
23-
uses: actions/checkout@v4
22+
uses: actions/checkout@v6
2423
with:
2524
repository: "yewstack/yew"
2625
ref: master
2726
path: yew-master
2827

2928
- name: Checkout pull request
30-
uses: actions/checkout@v4
29+
uses: actions/checkout@v6
3130
with:
3231
path: current-pr
3332

@@ -37,34 +36,30 @@ 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+
workspaces: |
43+
yew-master
44+
current-pr
5145
5246
- name: Run pull request benchmark
53-
run: cargo run --profile=bench -- --output-path ../output.json
5447
working-directory: current-pr/tools/benchmark-ssr
48+
run: cargo run --profile=bench -- --output-path ../output.json
5549

5650
- name: Run master benchmark
57-
run: cargo run --profile=bench -- --output-path ../output.json
5851
working-directory: yew-master/tools/benchmark-ssr
52+
run: cargo run --profile=bench -- --output-path ../output.json
5953

6054
- name: Write Pull Request ID
6155
run: |
6256
echo "${{ github.event.number }}" > .PR_NUMBER
6357
6458
- name: Upload Artifact
65-
uses: actions/upload-artifact@v3
59+
uses: actions/upload-artifact@v7
6660
with:
6761
name: benchmark-ssr
62+
include-hidden-files: true
6863
path: |
6964
.PR_NUMBER
7065
yew-master/tools/output.json

.github/workflows/benchmark.yml

Lines changed: 46 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,23 @@ 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:
25-
- uses: actions/checkout@v4
26+
- uses: actions/checkout@v6
2627
with:
2728
path: "yew"
2829

29-
- uses: actions/checkout@v4
30+
- uses: actions/checkout@v6
3031
with:
3132
repository: krausest/js-framework-benchmark
3233
path: "js-framework-benchmark"
@@ -37,91 +38,108 @@ 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
45-
uses: actions/setup-node@v3
45+
uses: actions/setup-node@v6
4646
with:
47-
node-version: 18
47+
node-version: "lts/Jod"
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+
save-if: ${{ github.ref == 'refs/heads/master' }}
55+
workspaces: |
56+
yew
57+
58+
- name: Setup chrome
59+
id: setup-chrome
60+
uses: browser-actions/setup-chrome@v2
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: |
71-
wasm-pack build \
82+
RUSTFLAGS='--cfg getrandom_backend="wasm_js"' wasm-pack build \
7283
--release \
7384
--target web \
7485
--no-typescript \
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: |
93-
wasm-pack build \
104+
RUSTFLAGS='--cfg getrandom_backend="wasm_js"' wasm-pack build \
94105
--release \
95106
--target web \
96107
--no-typescript \
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+
# https://chromium.googlesource.com/chromium/src/+/main/docs/security/apparmor-userns-restrictions.md
122+
- run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns
123+
124+
- name: Run js-framework-benchmark/webdriver-ts npm run bench
111125
working-directory: js-framework-benchmark/webdriver-ts
112-
run: xvfb-run npm run bench -- --framework keyed/yew keyed/yew-hooks --runner playwright
126+
run: xvfb-run npm run bench -- --framework keyed/yew keyed/yew-hooks --runner playwright --chromeBinary "$CHROME_PATH"
127+
env:
128+
CHROME_PATH: ${{ steps.setup-chrome.outputs.chrome-path }}
113129

114-
- name: transform results to be fit for display benchmark-action/github-action-benchmark@v1
130+
- name: Transform results to be fit for display benchmark-action/github-action-benchmark@v1
115131
run: |
116132
mkdir artifacts/
117133
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
134+
echo "$EVENT_INFO" > artifacts/.PR_INFO
119135
env:
120136
EVENT_INFO: ${{ toJSON(github.event) }}
121137

122138
- name: Upload result artifacts
123-
uses: actions/upload-artifact@v3
139+
uses: actions/upload-artifact@v7
124140
with:
125141
name: results
126142
path: artifacts/
127143
if-no-files-found: error
144+
include-hidden-files: true
145+
retention-days: 1

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

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

2422
- name: Setup toolchain
2523
uses: dtolnay/rust-toolchain@master
@@ -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@v7
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@v7
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

0 commit comments

Comments
 (0)