From 5b210b3fdf1b8b1161cda84f7c7d2e4ba62b6ec2 Mon Sep 17 00:00:00 2001 From: Bradlee Speice Date: Fri, 24 Jul 2020 14:16:59 -0400 Subject: [PATCH] Remove old binaryen/percy projects --- README.md | 9 +- binaryen/.compilerc | 42 - binaryen/.eslintrc | 9 - binaryen/.gitignore | 5 - binaryen/Cargo.toml | 15 - binaryen/build.sh | 27 - binaryen/package.json | 66 - binaryen/src/lib.rs | 16 - binaryen/static/app_loader.js | 8 - binaryen/static/index.html | 11 - binaryen/static/index.js | 52 - binaryen/yarn.lock | 7750 ----------------- percy/.compilerc | 42 - percy/.eslintrc | 9 - percy/.gitignore | 4 - percy/Cargo.toml | 12 - percy/build.sh | 25 - percy/package.json | 66 - percy/src/lib.rs | 20 - percy/static/app_loader.js | 10 - percy/static/index.html | 11 - percy/static/index.js | 52 - percy/yarn.lock | 7736 ---------------- percy_patched_webpack/.compilerc | 42 - percy_patched_webpack/.eslintrc | 9 - percy_patched_webpack/.gitignore | 4 - percy_patched_webpack/Cargo.toml | 12 - .../WasmMainTemplatePlugin.patched.js | 372 - percy_patched_webpack/build.sh | 27 - percy_patched_webpack/package.json | 66 - percy_patched_webpack/src/lib.rs | 20 - percy_patched_webpack/static/app_loader.js | 10 - percy_patched_webpack/static/index.html | 11 - percy_patched_webpack/static/index.js | 52 - percy_patched_webpack/yarn.lock | 7736 ---------------- 35 files changed, 7 insertions(+), 24351 deletions(-) delete mode 100644 binaryen/.compilerc delete mode 100644 binaryen/.eslintrc delete mode 100644 binaryen/.gitignore delete mode 100644 binaryen/Cargo.toml delete mode 100755 binaryen/build.sh delete mode 100644 binaryen/package.json delete mode 100644 binaryen/src/lib.rs delete mode 100644 binaryen/static/app_loader.js delete mode 100644 binaryen/static/index.html delete mode 100644 binaryen/static/index.js delete mode 100644 binaryen/yarn.lock delete mode 100644 percy/.compilerc delete mode 100644 percy/.eslintrc delete mode 100644 percy/.gitignore delete mode 100644 percy/Cargo.toml delete mode 100755 percy/build.sh delete mode 100644 percy/package.json delete mode 100644 percy/src/lib.rs delete mode 100644 percy/static/app_loader.js delete mode 100644 percy/static/index.html delete mode 100644 percy/static/index.js delete mode 100644 percy/yarn.lock delete mode 100644 percy_patched_webpack/.compilerc delete mode 100644 percy_patched_webpack/.eslintrc delete mode 100644 percy_patched_webpack/.gitignore delete mode 100644 percy_patched_webpack/Cargo.toml delete mode 100644 percy_patched_webpack/WasmMainTemplatePlugin.patched.js delete mode 100755 percy_patched_webpack/build.sh delete mode 100644 percy_patched_webpack/package.json delete mode 100644 percy_patched_webpack/src/lib.rs delete mode 100644 percy_patched_webpack/static/app_loader.js delete mode 100644 percy_patched_webpack/static/index.html delete mode 100644 percy_patched_webpack/static/index.js delete mode 100644 percy_patched_webpack/yarn.lock diff --git a/README.md b/README.md index 20262c0..5ccd498 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,10 @@ # Electron applications in Rust -Each app is a starter example, and can be run with `yarn install && yarn start`. +It's 2020, and a lot has changed. -`stdweb` and `yew` examples currently don't run. \ No newline at end of file +- With the advent of Webpack 5, the previous issues with using WASM in Electron have been vanquished. I can only assume some form of sorcery was involved. All examples have been updated to use the new version. +- `wasm32-unknown-unknown` targets are enabled for stable Rust +- The previous [`percy`](https://github.com/chinedufn/percy) example has been removed. While work continues on the project, there haven't been any releases. +- A new framework [`seed`](https://github.com/seed-rs/seed) as been added as an example. + +Each app is a starter example, and can be run with `yarn install && yarn start`. \ No newline at end of file diff --git a/binaryen/.compilerc b/binaryen/.compilerc deleted file mode 100644 index 1ecba6f..0000000 --- a/binaryen/.compilerc +++ /dev/null @@ -1,42 +0,0 @@ -{ - "env": { - "development": { - "application/javascript": { - "presets": [ - [ - "env", - { - "targets": { - "electron": 2 - } - } - ], - "react" - ], - "plugins": [ - "transform-async-to-generator" - ], - "sourceMaps": "inline" - } - }, - "production": { - "application/javascript": { - "presets": [ - [ - "env", - { - "targets": { - "electron": 2 - } - } - ], - "react" - ], - "plugins": [ - "transform-async-to-generator" - ], - "sourceMaps": "none" - } - } - } -} \ No newline at end of file diff --git a/binaryen/.eslintrc b/binaryen/.eslintrc deleted file mode 100644 index 64f1252..0000000 --- a/binaryen/.eslintrc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "eslint-config-airbnb", - "rules": { - "import/extensions": 0, - "import/no-extraneous-dependencies": 0, - "import/no-unresolved": [2, { "ignore": ["electron"] }], - "linebreak-style": 0 - } -} diff --git a/binaryen/.gitignore b/binaryen/.gitignore deleted file mode 100644 index 1b732f8..0000000 --- a/binaryen/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -node_modules/ -Cargo.lock -target/ -dist/ -binaryen/ \ No newline at end of file diff --git a/binaryen/Cargo.toml b/binaryen/Cargo.toml deleted file mode 100644 index 7bedb6c..0000000 --- a/binaryen/Cargo.toml +++ /dev/null @@ -1,15 +0,0 @@ -[package] -authors = ["Bradlee Speice"] -categories = ["wasm"] -description = "A no-framework WASM Electron app" -license = "Apache-2.0/MIT" -name = "stdweb_electron" -readme = "./README.md" -repository = "https://github.com/rustwasm/rust-webpack-template" -version = "0.1.0" - -[lib] -crate-type = ["cdylib"] - -[dependencies] -stdweb = "0.4" diff --git a/binaryen/build.sh b/binaryen/build.sh deleted file mode 100755 index 018412b..0000000 --- a/binaryen/build.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -DIR="$(dirname $0)" -WASM_DIR="$DIR/target/wasm32-unknown-unknown" -WASM_NAME="$(cat "$DIR/Cargo.toml" | grep name | sed 's/name = "//' | sed 's/"//g')" -APP_DIR="$DIR/dist/" - -if [ ! -f "$DIR/binaryen/bin/wasm2js" ]; then - git clone "https://github.com/WebAssembly/binaryen" "$DIR/binaryen" - pushd "$DIR/binaryen" - cmake . && make -j8 - popd -fi - -if [ ! -d "$APP_DIR" ]; then - mkdir "$APP_DIR" -fi -cp "$DIR/static/"* "$APP_DIR" - -if [ -z "$(which cargo)" ]; then - echo 'Must install `cargo` before proceeding. Please see https://rustup.rs/ for more information.' - exit 1 -fi - -cargo +nightly build --target=wasm32-unknown-unknown && \ - "$DIR/binaryen/bin/wasm2js" --pedantic "$WASM_DIR/debug/stdweb_electron.wasm" -o "$APP_DIR/stdweb_electron.js" && \ - "$DIR/node_modules/webpack-cli/bin/cli.js" --mode=development "$APP_DIR/stdweb_electron.js" -o "$APP_DIR/bundle.js" diff --git a/binaryen/package.json b/binaryen/package.json deleted file mode 100644 index 410bc45..0000000 --- a/binaryen/package.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "name": "electron_percy_wasm", - "productName": "electron_percy_wasm", - "version": "1.0.0", - "description": "My Electron application description", - "main": "dist/index.js", - "scripts": { - "prestart": "./build.sh", - "start": "electron-forge start", - "package": "electron-forge package", - "make": "electron-forge make", - "lint": "eslint src" - }, - "keywords": [], - "author": "bspeice", - "license": "MIT", - "config": { - "forge": { - "make_targets": { - "win32": [ - "squirrel" - ], - "darwin": [ - "zip" - ], - "linux": [ - "deb", - "rpm" - ] - }, - "electronPackagerConfig": { - "packageManager": "yarn" - }, - "electronWinstallerConfig": { - "name": "electron_percy_wasm" - }, - "electronInstallerDebian": {}, - "electronInstallerRedhat": {}, - "github_repository": { - "owner": "", - "name": "" - }, - "windowsStoreConfig": { - "packageName": "", - "name": "electron_percy_wasm" - } - } - }, - "dependencies": { - "electron-compile": "^6.4.3", - "webpack": "^4.17.1", - "webpack-cli": "^3.1.0" - }, - "devDependencies": { - "babel-plugin-transform-async-to-generator": "^6.24.1", - "babel-preset-env": "^1.7.0", - "babel-preset-react": "^6.24.1", - "electron-forge": "^5.2.2", - "electron-prebuilt-compile": "2.0.7", - "eslint": "^3", - "eslint-config-airbnb": "^15", - "eslint-plugin-import": "^2", - "eslint-plugin-jsx-a11y": "^5", - "eslint-plugin-react": "^7" - } -} diff --git a/binaryen/src/lib.rs b/binaryen/src/lib.rs deleted file mode 100644 index c942926..0000000 --- a/binaryen/src/lib.rs +++ /dev/null @@ -1,16 +0,0 @@ -extern crate stdweb; - -use stdweb::web::document; -use stdweb::web::INode; -use stdweb::web::IElement; - -pub fn run() { - stdweb::initialize(); - - let doc = document(); - let val = doc.create_element("p").unwrap(); - val.set_attribute("innerHTML", "IT IS ALIVE").unwrap(); - doc.body().unwrap().append_child(&val); - - stdweb::event_loop(); -} diff --git a/binaryen/static/app_loader.js b/binaryen/static/app_loader.js deleted file mode 100644 index b3c1404..0000000 --- a/binaryen/static/app_loader.js +++ /dev/null @@ -1,8 +0,0 @@ -const app = import("./stdweb_electron") -app.then(module => { - console.log("Finished resolving application bundle") - module.run() -}, (e) => { - console.log("Unable to resolve application bundle: ") - console.log(e) -}) \ No newline at end of file diff --git a/binaryen/static/index.html b/binaryen/static/index.html deleted file mode 100644 index 2f354c0..0000000 --- a/binaryen/static/index.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - -

Loading...

- -