Skip to content

Commit 46c924f

Browse files
committed
revert unsuccesful refactor
1 parent 224e08b commit 46c924f

File tree

987 files changed

+62331
-12694
lines changed

Some content is hidden

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

987 files changed

+62331
-12694
lines changed

.cargo/config.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +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]
7-
doctest-xcompile = true

.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 }}

.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: 41 additions & 25 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,91 +38,106 @@ 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
5257
53-
- name: setup js-framework-benchmark
58+
- name: Setup chrome
59+
id: setup-chrome
60+
uses: browser-actions/setup-chrome@v1
61+
with:
62+
install-chromedriver: true
63+
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 "${{ steps.setup-chrome.outputs.chrome-path }}"
113127

114-
- name: transform results to be fit for display benchmark-action/github-action-benchmark@v1
128+
- name: Transform results to be fit for display benchmark-action/github-action-benchmark@v1
115129
run: |
116130
mkdir artifacts/
117131
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
132+
echo "$EVENT_INFO" > artifacts/.PR_INFO
119133
env:
120134
EVENT_INFO: ${{ toJSON(github.event) }}
121135

122136
- name: Upload result artifacts
123-
uses: actions/upload-artifact@v3
137+
uses: actions/upload-artifact@v4
124138
with:
125139
name: results
126140
path: artifacts/
127141
if-no-files-found: error
142+
include-hidden-files: true
143+
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: 17 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,13 +28,24 @@ jobs:
3028
- name: Install dependencies
3129
run: |
3230
cd website
33-
npm install
31+
npm ci
32+
3433
3534
- name: Run prettier
35+
id: fmt
36+
continue-on-error: true
3637
run: |
3738
cd website
3839
npm run fmt
3940
41+
- if: steps.fmt.outcome == 'failure'
42+
run: |
43+
cd website
44+
npm run fmt:write
45+
git diff
46+
exit 1
47+
48+
4049
- name: Check Translations
4150
run: |
4251
cd website
@@ -48,7 +57,7 @@ jobs:
4857
npm run build
4958
5059
- name: Upload build artifact
51-
uses: actions/upload-artifact@v3
60+
uses: actions/upload-artifact@v4
5261
with:
5362
name: website
5463
path: website/build/
@@ -57,12 +66,13 @@ jobs:
5766
- if: github.event_name == 'pull_request'
5867
name: Build pr info
5968
run: |
60-
echo "${{ github.event.number }}" > $PR_INFO_FILE
69+
echo "${{ github.event.number }}" > .PR_INFO
6170
6271
- if: github.event_name == 'pull_request'
6372
name: Upload pr info
64-
uses: actions/upload-artifact@v3
73+
uses: actions/upload-artifact@v4
6574
with:
6675
name: pr-info
67-
path: "${{ env.PR_INFO_FILE }}"
76+
include-hidden-files: true
77+
path: .PR_INFO
6878
retention-days: 1

0 commit comments

Comments
 (0)