Browse Source

Fix HTTP web demo (#3407)

* Revert ttf-parser from 0.19.2 to 0.19.1

0.19.2's doesn't work with wasm in debug builds

* Update to poll-promise 0.3.0

* Publish new web demo

* Fix typo in changelog

* Explain why image_viewer is not part of the official web demo app

* Fix typos

* Make rfd native-only dependency
pull/3421/head
Emil Ernerfeldt 1 year ago
committed by GitHub
parent
commit
d975c1a401
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      CHANGELOG.md
  2. 9
      Cargo.lock
  3. 7
      crates/egui_demo_app/Cargo.toml
  4. 2
      crates/egui_extras/CHANGELOG.md
  5. 2
      crates/egui_plot/CHANGELOG.md
  6. 58
      docs/egui_demo_app.js
  7. BIN
      docs/egui_demo_app_bg.wasm
  8. 3
      scripts/build_demo_web.sh
  9. 2
      scripts/generate_changelog.py

2
CHANGELOG.md

@ -14,7 +14,7 @@ This release contains a simple and powerful image API:
// Load from web:
ui.image("https://www.example.com/some_image.png");
// Included image in the binary using `include_bytes`:
// Include image in the binary using `include_bytes`:
ui.image(egui::include_image!("../assets/ferris.svg"));
// With options:

9
Cargo.lock

@ -2910,10 +2910,11 @@ dependencies = [
[[package]]
name = "poll-promise"
version = "0.2.0"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fcf2a02372dfae23c9c01267fb296b8a3413bb4e45fbd589c3ac73c6dcfbb305"
checksum = "5f6a58fecbf9da8965bcdb20ce4fd29788d1acee68ddbb64f0ba1b81bccdb7df"
dependencies = [
"document-features",
"static_assertions",
]
@ -3856,9 +3857,9 @@ dependencies = [
[[package]]
name = "ttf-parser"
version = "0.19.2"
version = "0.19.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49d64318d8311fc2668e48b63969f4343e0a85c4a109aa8460d6672e364b8bd1"
checksum = "a464a4b34948a5f67fddd2b823c62d9d92e44be75058b99939eae6c5b6960b33"
[[package]]
name = "tts"

7
crates/egui_demo_app/Cargo.toml

@ -18,6 +18,9 @@ crate-type = ["cdylib", "rlib"]
[features]
default = ["glow", "persistence"]
# image_viewer adds about 0.9 MB of WASM
web_app = ["http", "persistence", "web_screen_reader"]
http = ["ehttp", "image", "poll-promise", "egui_extras/image"]
image_viewer = ["image", "egui_extras/all_loaders", "rfd"]
persistence = ["eframe/persistence", "egui/persistence", "serde"]
@ -50,7 +53,6 @@ bytemuck = { version = "1.7.1", optional = true }
egui_extras = { version = "0.23.0", path = "../egui_extras", features = [
"image",
] }
rfd = { version = "0.11", optional = true }
# feature "http":
ehttp = { version = "0.3.1", optional = true }
@ -58,7 +60,7 @@ image = { version = "0.24", optional = true, default-features = false, features
"jpeg",
"png",
] }
poll-promise = { version = "0.2", optional = true, default-features = false }
poll-promise = { version = "0.3", optional = true, default-features = false }
# feature "persistence":
serde = { version = "1", optional = true, features = ["derive"] }
@ -67,6 +69,7 @@ serde = { version = "1", optional = true, features = ["derive"] }
# native:
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
env_logger = "0.10"
rfd = { version = "0.11", optional = true }
# web:
[target.'cfg(target_arch = "wasm32")'.dependencies]

2
crates/egui_extras/CHANGELOG.md

@ -7,7 +7,7 @@ Changes since the last release can be found by running the `scripts/generate_cha
## 0.23.0 - 2023-09-27
* `egui_extras::install_image_loaders` [#3297](https://github.com/emilk/egui/pull/3297) [#3315](https://github.com/emilk/egui/pull/3315) [#3328](https://github.com/emilk/egui/pull/3328) (thanks [@jprochazk](https://github.com/jprochazk)!)
* Add syntax highlighing feature to `egui_extras` [#3333](https://github.com/emilk/egui/pull/3333) [#3388](https://github.com/emilk/egui/pull/3388)
* Add syntax highlighting feature to `egui_extras` [#3333](https://github.com/emilk/egui/pull/3333) [#3388](https://github.com/emilk/egui/pull/3388)
* Add `TableBuilder::drag_to_scroll` [#3100](https://github.com/emilk/egui/pull/3100) (thanks [@KYovchevski](https://github.com/KYovchevski)!)
* Add opt-in `puffin` feature to `egui-extras` [#3307](https://github.com/emilk/egui/pull/3307)
* Always depend on `log` crate [#3336](https://github.com/emilk/egui/pull/3336)

2
crates/egui_plot/CHANGELOG.md

@ -5,7 +5,7 @@ This file is updated upon each release.
Changes since the last release can be found by running the `scripts/generate_changelog.py` script.
## 0.23.0 - 2023-09-27 - Initial release, after beeing forked out from `egui`
## 0.23.0 - 2023-09-27 - Initial release, after being forked out from `egui`
* Draw axis labels and ticks outside of plotting window [#2284](https://github.com/emilk/egui/pull/2284) (thanks [@JohannesProgrammiert](https://github.com/JohannesProgrammiert)!)
* Add `PlotUi::response()` to replace `plot_clicked()` etc [#3223](https://github.com/emilk/egui/pull/3223)
* Add rotation feature to plot images [#3121](https://github.com/emilk/egui/pull/3121) (thanks [@ThundR67](https://github.com/ThundR67)!)

58
docs/egui_demo_app.js

@ -221,13 +221,9 @@ function makeMutClosure(arg0, arg1, dtor, f) {
return real;
}
function __wbg_adapter_30(arg0, arg1) {
wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h54fbb157f59a2683(arg0, arg1);
}
function __wbg_adapter_33(arg0, arg1) {
try {
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h9fa0c407dfa9f6e4(retptr, arg0, arg1);
wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hd926101060f0783e(retptr, arg0, arg1);
var r0 = getInt32Memory0()[retptr / 4 + 0];
var r1 = getInt32Memory0()[retptr / 4 + 1];
if (r1) {
@ -238,8 +234,12 @@ function __wbg_adapter_33(arg0, arg1) {
}
}
function __wbg_adapter_33(arg0, arg1) {
wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h5e12b61ce76cf0a6(arg0, arg1);
}
function __wbg_adapter_36(arg0, arg1, arg2) {
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h055a2b486a30731f(arg0, arg1, addHeapObject(arg2));
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h2000f7e9add97f30(arg0, arg1, addHeapObject(arg2));
}
function makeClosure(arg0, arg1, dtor, f) {
@ -446,7 +446,7 @@ function __wbg_get_imports() {
const ret = arg0;
return addHeapObject(ret);
};
imports.wbg.__wbg_error_ef675d96d0bf24dc = function(arg0, arg1) {
imports.wbg.__wbg_error_e38422e56bbd072c = function(arg0, arg1) {
let deferred0_0;
let deferred0_1;
try {
@ -457,11 +457,11 @@ function __wbg_get_imports() {
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
}
};
imports.wbg.__wbg_new_475b88b4c50a6bba = function() {
imports.wbg.__wbg_new_e7fbaa407e13d590 = function() {
const ret = new Error();
return addHeapObject(ret);
};
imports.wbg.__wbg_stack_d45172f0caa39e17 = function(arg0, arg1) {
imports.wbg.__wbg_stack_21698d2a5852e13e = function(arg0, arg1) {
const ret = getObject(arg1).stack;
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
const len1 = WASM_VECTOR_LEN;
@ -472,17 +472,17 @@ function __wbg_get_imports() {
const ret = getObject(arg0);
return addHeapObject(ret);
};
imports.wbg.__wbg_trace_822e2ec9f55bdc14 = function(arg0, arg1) {
console.trace(getStringFromWasm0(arg0, arg1));
};
imports.wbg.__wbg_debug_02a842456bfd3d07 = function(arg0, arg1) {
console.debug(getStringFromWasm0(arg0, arg1));
imports.wbg.__wbg_warn_a95766347500bf17 = function(arg0, arg1) {
console.warn(getStringFromWasm0(arg0, arg1));
};
imports.wbg.__wbg_info_9914de2e2314812b = function(arg0, arg1) {
imports.wbg.__wbg_info_7589c99c14cdc5ef = function(arg0, arg1) {
console.info(getStringFromWasm0(arg0, arg1));
};
imports.wbg.__wbg_warn_0d84cc9f60d72161 = function(arg0, arg1) {
console.warn(getStringFromWasm0(arg0, arg1));
imports.wbg.__wbg_debug_97244d3ec765cb44 = function(arg0, arg1) {
console.debug(getStringFromWasm0(arg0, arg1));
};
imports.wbg.__wbg_trace_71659133a99ab3e3 = function(arg0, arg1) {
console.trace(getStringFromWasm0(arg0, arg1));
};
imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
const obj = getObject(arg1);
@ -1685,28 +1685,28 @@ function __wbg_get_imports() {
const ret = wasm.memory;
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper3454 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 1227, __wbg_adapter_30);
imports.wbg.__wbindgen_closure_wrapper3452 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 1232, __wbg_adapter_30);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper3455 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 1227, __wbg_adapter_33);
imports.wbg.__wbindgen_closure_wrapper3453 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 1232, __wbg_adapter_33);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper3457 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 1227, __wbg_adapter_36);
imports.wbg.__wbindgen_closure_wrapper3456 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 1232, __wbg_adapter_36);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper3609 = function(arg0, arg1, arg2) {
const ret = makeClosure(arg0, arg1, 1302, __wbg_adapter_39);
imports.wbg.__wbindgen_closure_wrapper3605 = function(arg0, arg1, arg2) {
const ret = makeClosure(arg0, arg1, 1300, __wbg_adapter_39);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper3611 = function(arg0, arg1, arg2) {
const ret = makeClosure(arg0, arg1, 1302, __wbg_adapter_39);
imports.wbg.__wbindgen_closure_wrapper3607 = function(arg0, arg1, arg2) {
const ret = makeClosure(arg0, arg1, 1300, __wbg_adapter_39);
return addHeapObject(ret);
};
imports.wbg.__wbindgen_closure_wrapper3658 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 1330, __wbg_adapter_44);
imports.wbg.__wbindgen_closure_wrapper3654 = function(arg0, arg1, arg2) {
const ret = makeMutClosure(arg0, arg1, 1328, __wbg_adapter_44);
return addHeapObject(ret);
};

BIN
docs/egui_demo_app_bg.wasm

Binary file not shown.

3
scripts/build_demo_web.sh

@ -12,8 +12,7 @@ export RUSTFLAGS=--cfg=web_sys_unstable_apis
CRATE_NAME="egui_demo_app"
# NOTE: persistence use up about 400kB (10%) of the WASM!
FEATURES="http,persistence,web_screen_reader"
FEATURES="web_app"
OPEN=false
OPTIMIZE=false

2
scripts/generate_changelog.py

@ -160,7 +160,7 @@ def main() -> None:
title = pr_info.pr_title if pr_info else title
labels = pr_info.labels if pr_info else []
if 'exclude from changlog' in labels:
if 'exclude from changelog' in labels:
continue
if 'typo' in labels:
# We get so many typo PRs. Let's not flood the changelog with them.

Loading…
Cancel
Save