diff --git a/.gitignore b/.gitignore index a63876566..d10138e0f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ # --- Files --- **/*.ts -**/*.js **.wasm **/*.rs.bk **/*.log @@ -14,5 +13,3 @@ # --- IDE metadata --- **/.idea **/.vscode - - diff --git a/Cargo.lock b/Cargo.lock index d8768e38e..e5f30ec46 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -78,7 +78,7 @@ dependencies = [ name = "counter" version = "0.1.0" dependencies = [ - "seed 0.3.1", + "seed 0.3.2", "wasm-bindgen 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", "web-sys 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -269,7 +269,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "seed" -version = "0.3.1" +version = "0.3.2" dependencies = [ "console_error_panic_hook 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)", @@ -316,7 +316,7 @@ name = "server-interaction" version = "0.1.0" dependencies = [ "futures 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)", - "seed 0.3.1", + "seed 0.3.2", "serde 1.0.90 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", @@ -379,7 +379,7 @@ dependencies = [ name = "todomvc" version = "0.1.0" dependencies = [ - "seed 0.3.1", + "seed 0.3.2", "serde 1.0.90 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", "web-sys 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", @@ -574,7 +574,7 @@ dependencies = [ name = "window-events" version = "0.1.0" dependencies = [ - "seed 0.3.1", + "seed 0.3.2", "wasm-bindgen 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)", "web-sys 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/Makefile.toml b/Makefile.toml index f993297fa..2ab10437a 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -1,6 +1,7 @@ [env] # all workspace members can use this Makefile CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = "true" +PORT = "8000" # ---- BUILD & CREATE WASMS ---- [tasks.build] @@ -30,39 +31,39 @@ dependencies = ["build", "build_examples", "create_wasms"] [tasks.e_counter] extend = "serve" -args = ["./examples/counter"] +args = ["./examples/counter", "--port", "${PORT}"] # need special start? [tasks.e_server_integration] extend = "serve" -args = ["./examples/server_integration"] +args = ["./examples/server_integration", "--port", "${PORT}"] [tasks.e_server_interaction] extend = "serve" -args = ["./examples/server_interaction"] +args = ["./examples/server_interaction", "--port", "${PORT}"] [tasks.e_todomvc] extend = "serve" -args = ["./examples/todomvc"] +args = ["./examples/todomvc", "--port", "${PORT}"] # need special start? [tasks.e_websocket] extend = "serve" -args = ["./examples/websocket"] +args = ["./examples/websocket", "--port", "${PORT}"] [tasks.e_window_events] extend = "serve" -args = ["./examples/window_events"] +args = ["./examples/window_events", "--port", "${PORT}"] + +# ---- PRIVATE TASKS - run only inside another task ---- +# private atribute is ignored (bug?) [tasks.serve] description = "Start server for given example" -install_crate = { crate_name = "https", binary = "http", test_arg = "--help" } +install_crate = { crate_name = "microserver", binary = "microserver", test_arg = "-h" } workspace = false -command = "http" -args = ["./examples/[change_in_child_task]"] - -# ---- PRIVATE TASKS - run only inside another task ---- -# private atribute is ignored (bug?) +command = "microserver" +args = ["./examples/[change_in_child_task]", "--port", "${PORT}"] [tasks.build_example] description = "Build example" diff --git a/examples/counter/index.html b/examples/counter/index.html index 123a9f2f5..407ee71a9 100644 --- a/examples/counter/index.html +++ b/examples/counter/index.html @@ -1,36 +1,40 @@ - - - + + + - + - + Counter example - - -
+ + + + +
- + - - - + + diff --git a/examples/counter/public/text-polyfill.min.js b/examples/counter/public/text-polyfill.min.js new file mode 100644 index 000000000..63b7d4641 --- /dev/null +++ b/examples/counter/public/text-polyfill.min.js @@ -0,0 +1,5 @@ +(function(l){function m(b){b=void 0===b?"utf-8":b;if("utf-8"!==b)throw new RangeError("Failed to construct 'TextEncoder': The encoding label provided ('"+b+"') is invalid.");}function k(b,a){b=void 0===b?"utf-8":b;a=void 0===a?{fatal:!1}:a;if("utf-8"!==b)throw new RangeError("Failed to construct 'TextDecoder': The encoding label provided ('"+b+"') is invalid.");if(a.fatal)throw Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.");}if(l.TextEncoder&&l.TextDecoder)return!1; +Object.defineProperty(m.prototype,"encoding",{value:"utf-8"});m.prototype.encode=function(b,a){a=void 0===a?{stream:!1}:a;if(a.stream)throw Error("Failed to encode: the 'stream' option is unsupported.");a=0;for(var h=b.length,f=0,c=Math.max(32,h+(h>>1)+7),e=new Uint8Array(c>>3<<3);a=d){if(a=d)continue}f+4>e.length&&(c+=8,c*=1+a/b.length*2,c=c>>3<<3, +g=new Uint8Array(c),g.set(e),e=g);if(0===(d&4294967168))e[f++]=d;else{if(0===(d&4294965248))e[f++]=d>>6&31|192;else if(0===(d&4294901760))e[f++]=d>>12&15|224,e[f++]=d>>6&63|128;else if(0===(d&4292870144))e[f++]=d>>18&7|240,e[f++]=d>>12&63|128,e[f++]=d>>6&63|128;else continue;e[f++]=d&63|128}}return e.slice(0,f)};Object.defineProperty(k.prototype,"encoding",{value:"utf-8"});Object.defineProperty(k.prototype,"fatal",{value:!1});Object.defineProperty(k.prototype,"ignoreBOM",{value:!1});k.prototype.decode= +function(b,a){a=void 0===a?{stream:!1}:a;if(a.stream)throw Error("Failed to decode: the 'stream' option is unsupported.");b=new Uint8Array(b);a=0;for(var h=b.length,f=[];a>>10&1023|55296),c=56320| +c&1023);f.push(c)}}return String.fromCharCode.apply(null,f)};l.TextEncoder=m;l.TextDecoder=k})("undefined"!==typeof window?window:"undefined"!==typeof global?global:this); diff --git a/examples/server_interaction/index.html b/examples/server_interaction/index.html index 3e447ca5f..bb5721e26 100644 --- a/examples/server_interaction/index.html +++ b/examples/server_interaction/index.html @@ -1,36 +1,40 @@ - - - + + + - + - + Server interaction - - -
+ + + + +
- + - - - + + diff --git a/examples/server_interaction/public/text-polyfill.min.js b/examples/server_interaction/public/text-polyfill.min.js new file mode 100644 index 000000000..63b7d4641 --- /dev/null +++ b/examples/server_interaction/public/text-polyfill.min.js @@ -0,0 +1,5 @@ +(function(l){function m(b){b=void 0===b?"utf-8":b;if("utf-8"!==b)throw new RangeError("Failed to construct 'TextEncoder': The encoding label provided ('"+b+"') is invalid.");}function k(b,a){b=void 0===b?"utf-8":b;a=void 0===a?{fatal:!1}:a;if("utf-8"!==b)throw new RangeError("Failed to construct 'TextDecoder': The encoding label provided ('"+b+"') is invalid.");if(a.fatal)throw Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.");}if(l.TextEncoder&&l.TextDecoder)return!1; +Object.defineProperty(m.prototype,"encoding",{value:"utf-8"});m.prototype.encode=function(b,a){a=void 0===a?{stream:!1}:a;if(a.stream)throw Error("Failed to encode: the 'stream' option is unsupported.");a=0;for(var h=b.length,f=0,c=Math.max(32,h+(h>>1)+7),e=new Uint8Array(c>>3<<3);a=d){if(a=d)continue}f+4>e.length&&(c+=8,c*=1+a/b.length*2,c=c>>3<<3, +g=new Uint8Array(c),g.set(e),e=g);if(0===(d&4294967168))e[f++]=d;else{if(0===(d&4294965248))e[f++]=d>>6&31|192;else if(0===(d&4294901760))e[f++]=d>>12&15|224,e[f++]=d>>6&63|128;else if(0===(d&4292870144))e[f++]=d>>18&7|240,e[f++]=d>>12&63|128,e[f++]=d>>6&63|128;else continue;e[f++]=d&63|128}}return e.slice(0,f)};Object.defineProperty(k.prototype,"encoding",{value:"utf-8"});Object.defineProperty(k.prototype,"fatal",{value:!1});Object.defineProperty(k.prototype,"ignoreBOM",{value:!1});k.prototype.decode= +function(b,a){a=void 0===a?{stream:!1}:a;if(a.stream)throw Error("Failed to decode: the 'stream' option is unsupported.");b=new Uint8Array(b);a=0;for(var h=b.length,f=[];a>>10&1023|55296),c=56320| +c&1023);f.push(c)}}return String.fromCharCode.apply(null,f)};l.TextEncoder=m;l.TextDecoder=k})("undefined"!==typeof window?window:"undefined"!==typeof global?global:this); diff --git a/examples/todomvc/index.html b/examples/todomvc/index.html index 1efbeb8e6..717a78945 100644 --- a/examples/todomvc/index.html +++ b/examples/todomvc/index.html @@ -1,35 +1,38 @@ - - + + Seed • TodoMVC - + - - -
+ + + + +
- + - + - - - + + diff --git a/examples/todomvc/index.css b/examples/todomvc/public/index.css similarity index 100% rename from examples/todomvc/index.css rename to examples/todomvc/public/index.css diff --git a/examples/todomvc/public/text-polyfill.min.js b/examples/todomvc/public/text-polyfill.min.js new file mode 100644 index 000000000..63b7d4641 --- /dev/null +++ b/examples/todomvc/public/text-polyfill.min.js @@ -0,0 +1,5 @@ +(function(l){function m(b){b=void 0===b?"utf-8":b;if("utf-8"!==b)throw new RangeError("Failed to construct 'TextEncoder': The encoding label provided ('"+b+"') is invalid.");}function k(b,a){b=void 0===b?"utf-8":b;a=void 0===a?{fatal:!1}:a;if("utf-8"!==b)throw new RangeError("Failed to construct 'TextDecoder': The encoding label provided ('"+b+"') is invalid.");if(a.fatal)throw Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.");}if(l.TextEncoder&&l.TextDecoder)return!1; +Object.defineProperty(m.prototype,"encoding",{value:"utf-8"});m.prototype.encode=function(b,a){a=void 0===a?{stream:!1}:a;if(a.stream)throw Error("Failed to encode: the 'stream' option is unsupported.");a=0;for(var h=b.length,f=0,c=Math.max(32,h+(h>>1)+7),e=new Uint8Array(c>>3<<3);a=d){if(a=d)continue}f+4>e.length&&(c+=8,c*=1+a/b.length*2,c=c>>3<<3, +g=new Uint8Array(c),g.set(e),e=g);if(0===(d&4294967168))e[f++]=d;else{if(0===(d&4294965248))e[f++]=d>>6&31|192;else if(0===(d&4294901760))e[f++]=d>>12&15|224,e[f++]=d>>6&63|128;else if(0===(d&4292870144))e[f++]=d>>18&7|240,e[f++]=d>>12&63|128,e[f++]=d>>6&63|128;else continue;e[f++]=d&63|128}}return e.slice(0,f)};Object.defineProperty(k.prototype,"encoding",{value:"utf-8"});Object.defineProperty(k.prototype,"fatal",{value:!1});Object.defineProperty(k.prototype,"ignoreBOM",{value:!1});k.prototype.decode= +function(b,a){a=void 0===a?{stream:!1}:a;if(a.stream)throw Error("Failed to decode: the 'stream' option is unsupported.");b=new Uint8Array(b);a=0;for(var h=b.length,f=[];a>>10&1023|55296),c=56320| +c&1023);f.push(c)}}return String.fromCharCode.apply(null,f)};l.TextEncoder=m;l.TextDecoder=k})("undefined"!==typeof window?window:"undefined"!==typeof global?global:this); diff --git a/examples/websocket/index.html b/examples/websocket/index.html index 116dd300c..8814f15cc 100644 --- a/examples/websocket/index.html +++ b/examples/websocket/index.html @@ -1,19 +1,27 @@ - - + + seed websocket example + + +
- + diff --git a/examples/websocket/public/text-polyfill.min.js b/examples/websocket/public/text-polyfill.min.js new file mode 100644 index 000000000..63b7d4641 --- /dev/null +++ b/examples/websocket/public/text-polyfill.min.js @@ -0,0 +1,5 @@ +(function(l){function m(b){b=void 0===b?"utf-8":b;if("utf-8"!==b)throw new RangeError("Failed to construct 'TextEncoder': The encoding label provided ('"+b+"') is invalid.");}function k(b,a){b=void 0===b?"utf-8":b;a=void 0===a?{fatal:!1}:a;if("utf-8"!==b)throw new RangeError("Failed to construct 'TextDecoder': The encoding label provided ('"+b+"') is invalid.");if(a.fatal)throw Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.");}if(l.TextEncoder&&l.TextDecoder)return!1; +Object.defineProperty(m.prototype,"encoding",{value:"utf-8"});m.prototype.encode=function(b,a){a=void 0===a?{stream:!1}:a;if(a.stream)throw Error("Failed to encode: the 'stream' option is unsupported.");a=0;for(var h=b.length,f=0,c=Math.max(32,h+(h>>1)+7),e=new Uint8Array(c>>3<<3);a=d){if(a=d)continue}f+4>e.length&&(c+=8,c*=1+a/b.length*2,c=c>>3<<3, +g=new Uint8Array(c),g.set(e),e=g);if(0===(d&4294967168))e[f++]=d;else{if(0===(d&4294965248))e[f++]=d>>6&31|192;else if(0===(d&4294901760))e[f++]=d>>12&15|224,e[f++]=d>>6&63|128;else if(0===(d&4292870144))e[f++]=d>>18&7|240,e[f++]=d>>12&63|128,e[f++]=d>>6&63|128;else continue;e[f++]=d&63|128}}return e.slice(0,f)};Object.defineProperty(k.prototype,"encoding",{value:"utf-8"});Object.defineProperty(k.prototype,"fatal",{value:!1});Object.defineProperty(k.prototype,"ignoreBOM",{value:!1});k.prototype.decode= +function(b,a){a=void 0===a?{stream:!1}:a;if(a.stream)throw Error("Failed to decode: the 'stream' option is unsupported.");b=new Uint8Array(b);a=0;for(var h=b.length,f=[];a>>10&1023|55296),c=56320| +c&1023);f.push(c)}}return String.fromCharCode.apply(null,f)};l.TextEncoder=m;l.TextDecoder=k})("undefined"!==typeof window?window:"undefined"!==typeof global?global:this); diff --git a/examples/window_events/index.html b/examples/window_events/index.html index 721fd8bf4..2f43eb763 100644 --- a/examples/window_events/index.html +++ b/examples/window_events/index.html @@ -1,36 +1,40 @@ - - - + + + - + - + Window-events example - - -
+ + + + +
- + - - - + + diff --git a/examples/window_events/public/text-polyfill.min.js b/examples/window_events/public/text-polyfill.min.js new file mode 100644 index 000000000..63b7d4641 --- /dev/null +++ b/examples/window_events/public/text-polyfill.min.js @@ -0,0 +1,5 @@ +(function(l){function m(b){b=void 0===b?"utf-8":b;if("utf-8"!==b)throw new RangeError("Failed to construct 'TextEncoder': The encoding label provided ('"+b+"') is invalid.");}function k(b,a){b=void 0===b?"utf-8":b;a=void 0===a?{fatal:!1}:a;if("utf-8"!==b)throw new RangeError("Failed to construct 'TextDecoder': The encoding label provided ('"+b+"') is invalid.");if(a.fatal)throw Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.");}if(l.TextEncoder&&l.TextDecoder)return!1; +Object.defineProperty(m.prototype,"encoding",{value:"utf-8"});m.prototype.encode=function(b,a){a=void 0===a?{stream:!1}:a;if(a.stream)throw Error("Failed to encode: the 'stream' option is unsupported.");a=0;for(var h=b.length,f=0,c=Math.max(32,h+(h>>1)+7),e=new Uint8Array(c>>3<<3);a=d){if(a=d)continue}f+4>e.length&&(c+=8,c*=1+a/b.length*2,c=c>>3<<3, +g=new Uint8Array(c),g.set(e),e=g);if(0===(d&4294967168))e[f++]=d;else{if(0===(d&4294965248))e[f++]=d>>6&31|192;else if(0===(d&4294901760))e[f++]=d>>12&15|224,e[f++]=d>>6&63|128;else if(0===(d&4292870144))e[f++]=d>>18&7|240,e[f++]=d>>12&63|128,e[f++]=d>>6&63|128;else continue;e[f++]=d&63|128}}return e.slice(0,f)};Object.defineProperty(k.prototype,"encoding",{value:"utf-8"});Object.defineProperty(k.prototype,"fatal",{value:!1});Object.defineProperty(k.prototype,"ignoreBOM",{value:!1});k.prototype.decode= +function(b,a){a=void 0===a?{stream:!1}:a;if(a.stream)throw Error("Failed to decode: the 'stream' option is unsupported.");b=new Uint8Array(b);a=0;for(var h=b.length,f=[];a>>10&1023|55296),c=56320| +c&1023);f.push(c)}}return String.fromCharCode.apply(null,f)};l.TextEncoder=m;l.TextDecoder=k})("undefined"!==typeof window?window:"undefined"!==typeof global?global:this);