dioxus icon indicating copy to clipboard operation
dioxus copied to clipboard

JS included by wasm_bindgen binding is not updated

Open maun opened this issue 9 months ago • 2 comments

Problem

Given the following binding:

#[wasm_bindgen(module = "assets/bundle.js")]
unsafe extern "C" {
    pub fn test1();
}

And the file assets/bundle.js

function test1() {
  console.log("test");
}
export {
  test1
};

Everything works as expected. Problems occur when for example test1is renamed to test2 in bundle.js and the binding declaration, dx serve continues to use the old, cached, version for the javascript code, but still tries to call test2.

  • Hot reloading does not help
  • Manual rebuilding with r does not help
  • Restarting dx serve does not help
  • Removing the target directory works
  • Changing the referenced script name in #[wasm_bindgen(module = "assets/bundle.js")] to something else and back again works

Error in browser:

Uncaught (in promise) LinkError: import object field 'test2' is not a Function 

When not changing the function name, but the content, also the old version is used (without the LinkError).

Environment:

  • Dioxus version: 0.6.3
  • Rust version: 1.85.1
  • OS info: macOS
  • App platform: web, fullstack

maun avatar Mar 26 '25 20:03 maun

原本的第4条:与Calibre结合,能够访问局域网下的calibre私人服务器。(这个也不是特别必要,要是能够实现的话就是锦上添花了。)能够更方便地直接下载library电子书库里的书籍文件,同时也可以和书籍的标签分类功能相结合。 不过这一条似乎在前面的issue里有提到过,就不重复了。

henrysheep256 avatar Mar 12 '25 04:03 henrysheep256

  1. 对齐方式正在开发
  2. 分类可以将一本书拖动到另一本书上即可
  3. 图书文件可能是无法整理的,目前提供了存储空间管理的页面,在更多设置中

Anxcye avatar Apr 27 '25 03:04 Anxcye