commit e53a938d5a204491c9005258001e70b26a6316ff Author: Bradlee Speice Date: Sat Aug 25 18:18:42 2018 -0400 Get Electron/Percy/WASM running diff --git a/electron_percy_wasm/.compilerc b/electron_percy_wasm/.compilerc new file mode 100644 index 0000000..1ecba6f --- /dev/null +++ b/electron_percy_wasm/.compilerc @@ -0,0 +1,42 @@ +{ + "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/electron_percy_wasm/.eslintrc b/electron_percy_wasm/.eslintrc new file mode 100644 index 0000000..64f1252 --- /dev/null +++ b/electron_percy_wasm/.eslintrc @@ -0,0 +1,9 @@ +{ + "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/electron_percy_wasm/.gitignore b/electron_percy_wasm/.gitignore new file mode 100644 index 0000000..c47d6c4 --- /dev/null +++ b/electron_percy_wasm/.gitignore @@ -0,0 +1,3 @@ +node_modules/ +Cargo.lock +target/ \ No newline at end of file diff --git a/electron_percy_wasm/Cargo.toml b/electron_percy_wasm/Cargo.toml new file mode 100644 index 0000000..ca6e9db --- /dev/null +++ b/electron_percy_wasm/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "electron_percy_wasm" +version = "0.1.0" +authors = ["Bradlee Speice "] + +[lib] +crate-type = ["cdylib"] + +[dependencies] +percy-webapis = "0.0.1" +virtual-dom-rs = "0.1" +wasm-bindgen = "0.2" \ No newline at end of file diff --git a/electron_percy_wasm/app/.gitignore b/electron_percy_wasm/app/.gitignore new file mode 100644 index 0000000..64995d2 --- /dev/null +++ b/electron_percy_wasm/app/.gitignore @@ -0,0 +1,4 @@ +*.wasm +*.bundle.js +bundle.js +electron_percy_wasm.js \ No newline at end of file diff --git a/electron_percy_wasm/app/app.js b/electron_percy_wasm/app/app.js new file mode 100644 index 0000000..96a2d31 --- /dev/null +++ b/electron_percy_wasm/app/app.js @@ -0,0 +1,5 @@ +import { main } from "./electron_percy_wasm" + +let rootNode = document.getElementById('root') +rootNode.parentElement.replaceChild(main(), rootNode) +rootNode = document.getElementById('root') \ No newline at end of file diff --git a/electron_percy_wasm/app/app_loader.js b/electron_percy_wasm/app/app_loader.js new file mode 100644 index 0000000..6485ea7 --- /dev/null +++ b/electron_percy_wasm/app/app_loader.js @@ -0,0 +1,7 @@ +const app = import("./app") +app.then(() => { + console.log("Finished resolving application bundle") +}, (e) => { + console.log("Unable to resolve application bundle: ") + console.log(e) +}) \ No newline at end of file diff --git a/electron_percy_wasm/app/index.html b/electron_percy_wasm/app/index.html new file mode 100644 index 0000000..d82f118 --- /dev/null +++ b/electron_percy_wasm/app/index.html @@ -0,0 +1,11 @@ + + + + + + + +
Loading...
+ +