Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File upload - simplify a bit with gloo::file::FileList::from #1

Open
wants to merge 45 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
504f690
simplify a little with gloo::file::FileList::from
knzai Jul 20, 2024
5625a2f
a little less repetition
knzai Jul 20, 2024
a51196e
trim the web_sys feature flags a bit
knzai Jul 20, 2024
1db7edb
drop the clone
knzai Jul 21, 2024
d19fc67
more golf
knzai Jul 21, 2024
af68646
Fix CI (#3679)
kawadakk Jul 25, 2024
08aef70
Update implicit-clone to 0.5.0 (#3682)
cecton Jul 25, 2024
62567cc
feat(macro): add `inert` to the boolean attributes list (#3678)
kawadakk Jul 25, 2024
4b3c223
Bump actions/upload-artifact from 3 to 4 (#3576)
dependabot[bot] Jul 25, 2024
89c9dfe
Allow `Self` in prop fields (#3569)
its-the-shrimp Jul 25, 2024
37e668b
Fix CI for 1.80 (#3691)
ranile Jul 25, 2024
d13ee88
Fix typos in introduction.mdx (#3605)
rmschindler Jul 26, 2024
43a78bd
remove repetitive words (#3628)
gcmutator Jul 26, 2024
7ba977e
Fix typo in the docs (#3631)
astariul Jul 26, 2024
b8d3e21
Raise MSRV to 1.76 (#3693)
ranile Aug 3, 2024
620d907
fix example serving (#3701)
WorldSEnder Aug 3, 2024
c5d4861
Add use_ref (#3548)
ColonelThirtyTwo Aug 3, 2024
4faa150
use_future_with: simplify code a bit by using read-only use_memo rath…
Ekleog Aug 3, 2024
d5088ee
Bump the cargo-deps group across 1 directory with 52 updates (#3705)
dependabot[bot] Aug 3, 2024
73d519e
Bump openssl from 0.10.60 to 0.10.66 (#3690)
dependabot[bot] Aug 4, 2024
3871418
Modernize github workflows (#3711)
WorldSEnder Aug 22, 2024
aa21119
Bump the cargo-deps group across 1 directory with 23 updates (#3713)
dependabot[bot] Aug 22, 2024
aecde4b
Provide reference ref for benchmark action and make it less spammy (#…
WorldSEnder Aug 23, 2024
c0c8963
Bump quote from 1.0.36 to 1.0.37 in the cargo-deps group (#3714)
dependabot[bot] Aug 23, 2024
2e3a0c3
Bump oleksiyrudenko/gha-git-credentials from 2.1.1 to 2.1.2 (#3696)
dependabot[bot] Aug 23, 2024
1ba7f0b
Bump the cargo-deps group with 5 updates (#3717)
dependabot[bot] Aug 30, 2024
6481524
Bump jetli/trunk-action from 0.4.0 to 0.5.0 (#3722)
dependabot[bot] Sep 1, 2024
86c6c8a
Bump softprops/action-gh-release from 1 to 2 (#3720)
dependabot[bot] Sep 1, 2024
1f1c5c2
Bump baptiste0928/cargo-install from 2 to 3 (#3721)
dependabot[bot] Sep 1, 2024
e9d80ae
Bump the website-deps group across 1 directory with 17 updates (#3723)
dependabot[bot] Sep 2, 2024
15ac51c
Fix hidden files not being uploaded with actions/upload-artifact upgr…
WorldSEnder Sep 5, 2024
4da1263
Fix CI. (#3727)
finnbear Sep 15, 2024
5a46ee2
Bump the cargo-deps group across 1 directory with 13 updates (#3732)
dependabot[bot] Sep 20, 2024
2e464ed
Bump the cargo-deps group with 6 updates (#3738)
dependabot[bot] Sep 29, 2024
03c0f7e
Bump the website-deps group in /website with 5 updates (#3740)
dependabot[bot] Oct 1, 2024
2b49f4b
Bump the cargo-deps group with 7 updates (#3741)
dependabot[bot] Oct 4, 2024
b2cba91
Fixed a type, edditing to editing (#3539)
raahimfareed Oct 11, 2024
7be9d17
Fix queries in ssr_router example (#3587)
Oliver-Bilbie Oct 11, 2024
3c7e3e3
yew-router: Dynamic basename. (#3725)
finnbear Oct 12, 2024
4f58457
chore(website): code block typo (#3574)
rockyzhengwu Oct 12, 2024
530e805
Update editor-setup.mdx (#3585)
Tushar12222 Oct 12, 2024
e99492e
node refs example link updated (#3540)
giripriyadarshan Oct 12, 2024
197e2d5
Make UseFutureHandle Clone (#3529)
AdamSteinberg1 Oct 12, 2024
d388dd6
Merge branch 'master' into fork/knzai/file_upload
ranile Oct 12, 2024
bdd1f7e
fmt
ranile Oct 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 8 additions & 17 deletions .github/workflows/benchmark-core.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
name: Benchmark - core

on:
Expand Down Expand Up @@ -32,36 +31,28 @@ jobs:
with:
toolchain: stable

- name: Restore Rust cache for master
- name: Restore Rust cache for yew packages
uses: Swatinem/rust-cache@v2
with:
working-directory: yew-master
key: master

- name: Restore Rust cache for current pull request
uses: Swatinem/rust-cache@v2
with:
working-directory: current-pr
key: pr
shared-key: yew-packages
workspaces: |
yew-master
current-pr

- name: Run pull request benchmark
run: cargo bench -q > ../output.log
working-directory: current-pr/tools/benchmark-core
run: cargo bench -q > ../output.log

- name: Run master benchmark
run: cargo bench -q > ../output.log
continue-on-error: true
working-directory: yew-master/tools/benchmark-core

- name: Make sure master's output log exists
run: touch yew-master/tools/output.log
run: cargo bench -q > ../output.log

- name: Write Pull Request ID
run: |
echo "${{ github.event.number }}" > .PR_NUMBER

- name: Upload Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: benchmark-core
path: |
Expand Down
21 changes: 8 additions & 13 deletions .github/workflows/benchmark-ssr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
name: Benchmark - SSR

on:
Expand Down Expand Up @@ -37,32 +36,28 @@ jobs:
toolchain: stable
targets: wasm32-unknown-unknown

- name: Restore Rust cache for master
- name: Restore Rust cache for yew packages
uses: Swatinem/rust-cache@v2
with:
working-directory: yew-master
key: master

- name: Restore Rust cache for current pull request
uses: Swatinem/rust-cache@v2
with:
working-directory: current-pr
key: pr
shared-key: yew-packages
workspaces: |
yew-master
current-pr

- name: Run pull request benchmark
run: cargo run --profile=bench -- --output-path ../output.json
working-directory: current-pr/tools/benchmark-ssr
run: cargo run --profile=bench -- --output-path ../output.json

- name: Run master benchmark
run: cargo run --profile=bench -- --output-path ../output.json
working-directory: yew-master/tools/benchmark-ssr
run: cargo run --profile=bench -- --output-path ../output.json

- name: Write Pull Request ID
run: |
echo "${{ github.event.number }}" > .PR_NUMBER

- name: Upload Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: benchmark-ssr
path: |
Expand Down
59 changes: 36 additions & 23 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ on:
- "website/**"
types: [labeled, synchronize, opened, reopened]

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

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

steps:
Expand All @@ -37,35 +38,45 @@ jobs:
toolchain: stable
targets: wasm32-unknown-unknown

- uses: jetli/[email protected]
with:
version: "latest"
- name: Setup wasm-pack
uses: jetli/[email protected]

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
node-version: ">=18"
cache: "npm"
cache-dependency-path: js-framework-benchmark/package-lock.json

- uses: Swatinem/rust-cache@v2
- name: Restore Rust cache for yew packages
uses: Swatinem/rust-cache@v2
with:
shared-key: yew-packages
workspaces: |
yew

- name: Setup chrome
id: setup-chrome
uses: browser-actions/setup-chrome@v1
with:
install-chromedriver: true

- name: setup js-framework-benchmark
- name: Setup js-framework-benchmark
working-directory: js-framework-benchmark
run: |
npm ci
npm run install-server
npm run install-webdriver-ts

- name: setup benchmark-struct benchmark
- name: Setup benchmark-struct benchmark
run: |
ls -lauh
rm *.js
rm *.wasm
echo "STRUCT_BUILD_DIR=$PWD" >> $GITHUB_ENV
working-directory: js-framework-benchmark/frameworks/keyed/yew/bundled-dist/

- name: build benchmark-struct app
- name: Build benchmark-struct app
working-directory: yew/tools/benchmark-struct
run: |
wasm-pack build \
Expand All @@ -75,19 +86,19 @@ jobs:
--out-name js-framework-benchmark-yew \
--out-dir $STRUCT_BUILD_DIR

- name: show built benchmark-struct benchmark files
- name: Show built benchmark-struct benchmark files
run: |
ls -lauh js-framework-benchmark/frameworks/keyed/yew/bundled-dist/

- name: setup yew-hooks benchmark
- name: Setup yew-hooks benchmark
run: |
ls -lauh
rm *.js
rm *.wasm
echo "HOOKS_BUILD_DIR=$PWD" >> $GITHUB_ENV
working-directory: js-framework-benchmark/frameworks/keyed/yew-hooks/bundled-dist/

- name: build benchmark-hooks app
- name: Build benchmark-hooks app
working-directory: yew/tools/benchmark-hooks
run: |
wasm-pack build \
Expand All @@ -97,31 +108,33 @@ jobs:
--out-name js-framework-benchmark-yew-hooks \
--out-dir $HOOKS_BUILD_DIR

- name: show built benchmark-hooks benchmark files
- name: Show built benchmark-hooks benchmark files
run: |
ls -lauh js-framework-benchmark/frameworks/keyed/yew-hooks/bundled-dist/

- name: run js-framework-benchmark server
- name: Run js-framework-benchmark server
working-directory: js-framework-benchmark
run: |
npm start &
sleep 5

- name: js-framework-benchmark/webdriver-ts npm run bench
- name: Run js-framework-benchmark/webdriver-ts npm run bench
working-directory: js-framework-benchmark/webdriver-ts
run: xvfb-run npm run bench -- --framework keyed/yew keyed/yew-hooks --runner playwright
run: xvfb-run npm run bench -- --framework keyed/yew keyed/yew-hooks --runner playwright --chromeBinary "${{ steps.setup-chrome.outputs.chrome-path }}"

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

- name: Upload result artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: results
path: artifacts/
if-no-files-found: error
include-hidden-files: true
retention-days: 1
10 changes: 4 additions & 6 deletions .github/workflows/build-api-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ on:
jobs:
build:
runs-on: ubuntu-latest
env:
PR_INFO_FILE: ".PR_INFO"
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -46,7 +44,7 @@ jobs:
cp -r target/doc/* api-docs/dist/next

- name: Upload build artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: api-docs
path: api-docs/
Expand All @@ -55,12 +53,12 @@ jobs:
- if: github.event_name == 'pull_request'
name: Build pr info
run: |
echo "${{ github.event.number }}" > $PR_INFO_FILE
echo "${{ github.event.number }}" > .PR_INFO

- if: github.event_name == 'pull_request'
name: Upload pr info
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: pr-info
path: "${{ env.PR_INFO_FILE }}"
path: .PR_INFO
retention-days: 1
12 changes: 5 additions & 7 deletions .github/workflows/build-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ jobs:
build:
name: Build Website
runs-on: ubuntu-latest
env:
PR_INFO_FILE: ".PR_INFO"
steps:
- uses: actions/checkout@v4

Expand All @@ -30,7 +28,7 @@ jobs:
- name: Install dependencies
run: |
cd website
npm install
npm ci

- name: Run prettier
run: |
Expand All @@ -48,7 +46,7 @@ jobs:
npm run build

- name: Upload build artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: website
path: website/build/
Expand All @@ -57,12 +55,12 @@ jobs:
- if: github.event_name == 'pull_request'
name: Build pr info
run: |
echo "${{ github.event.number }}" > $PR_INFO_FILE
echo "${{ github.event.number }}" > .PR_INFO

- if: github.event_name == 'pull_request'
name: Upload pr info
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: pr-info
path: "${{ env.PR_INFO_FILE }}"
path: .PR_INFO
retention-days: 1
24 changes: 9 additions & 15 deletions .github/workflows/clippy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ jobs:
feature-soundness:
name: Feature Soundness
runs-on: ubuntu-latest
# if normal clippy doesn't succeed, do not try to lint feature soundness
needs: clippy

strategy:
fail-fast: false
matrix:
Expand All @@ -32,27 +35,16 @@ jobs:
components: clippy

- uses: Swatinem/rust-cache@v2
with:
shared-key: clippy

- name: Lint feature soundness
if: matrix.profile == 'dev'
run: bash ../../ci/feature-soundness.sh
working-directory: packages/yew
run: bash ./ci/feature-soundness.sh

- name: Lint feature soundness
if: matrix.profile == 'release'
run: bash ../../ci/feature-soundness-release.sh
working-directory: packages/yew

- name: Run release clippy
if: matrix.profile == 'release'
run: |
ls packages | xargs -I {} \
cargo clippy \
-p {} \
--all-targets \
--all-features \
--workspace \
-- -D warnings
run: bash ./ci/feature-soundness-release.sh

clippy:
name: Clippy Workspace
Expand All @@ -73,6 +65,8 @@ jobs:
components: clippy

- uses: Swatinem/rust-cache@v2
with:
shared-key: clippy

- name: Run clippy
run: |
Expand Down
Loading