From 44c2648c0613fab8f15887578cae44472d98d0c2 Mon Sep 17 00:00:00 2001 From: CodingTil <36734749+CodingTil@users.noreply.github.com> Date: Sat, 24 Feb 2024 14:14:29 +0100 Subject: [PATCH] Update submodule + Wasm-opt binaries --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- build_release.sh | 15 ++++++++++++++- fractal_rust | 2 +- src/components/project.rs | 2 +- 5 files changed, 19 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a811112..34bb7c1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -225,9 +225,9 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "comrak" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f18e72341e6cdc7489cffb76f993812a14a906db54dedb020044ccc211dcaae" +checksum = "6751998a48e2327773c95f6f8e03c6e77c0156ce539d74c17d2199ff3d05e197" dependencies = [ "clap", "derive_builder", diff --git a/Cargo.toml b/Cargo.toml index 5621ebe..399ea4f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [dependencies] -comrak = "0.20.0" +comrak = "0.21.0" gloo-utils = "0.2.0" include_dir = "0.7.3" once_cell = "1.17.1" diff --git a/build_release.sh b/build_release.sh index 8e2bafc..d46aa45 100755 --- a/build_release.sh +++ b/build_release.sh @@ -3,6 +3,9 @@ # Set option to exit on any error set -e +# Install binaryen +sudo apt install binaryen + # Get Rust curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y @@ -12,8 +15,11 @@ source $HOME/.cargo/env # Add wasm target rustup target add wasm32-unknown-unknown +# Get cargo binstall +curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash + # Get trunk -cargo install --locked trunk +cargo binstall trunk # Clean the project trunk clean @@ -30,3 +36,10 @@ cp -r $ROOT_DIR/fractal_rust/dist/* $ROOT_DIR/src/public/project_code/fractal_ru # Then build the main project cd $ROOT_DIR trunk build --release + +# Find all .wasm files in the current directory and subdirectories +find dist/ -name "*.wasm" | while read wasm_file; do + # Execute wasm-opt command on each file + wasm-opt -Oz -o "$wasm_file" "$wasm_file" +done + diff --git a/fractal_rust b/fractal_rust index cb1eaae..391b305 160000 --- a/fractal_rust +++ b/fractal_rust @@ -1 +1 @@ -Subproject commit cb1eaaefded2f5d5d7f6e3933315ab37c27c0c86 +Subproject commit 391b30551e07ee3a7abc49377aae8715eb691879 diff --git a/src/components/project.rs b/src/components/project.rs index c6ee868..a20e1e9 100644 --- a/src/components/project.rs +++ b/src/components/project.rs @@ -309,7 +309,7 @@ pub fn ProjectPost(props: &ProjectCardProps) -> Html {