-
Notifications
You must be signed in to change notification settings - Fork 568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wasm support #759
Wasm support #759
Commits on Apr 12, 2020
-
Add wasm backend + fix std::time dep
A basic wasm backend is added as a continuation of linebender#30. Since std::time isn't available on wasm, an additional dependency is added to abstract std::time::Instant to work with wasm.
Configuration menu - View commit details
-
Copy full SHA for 19c186f - Browse repository at this point
Copy the full SHA 19c186fView commit details -
This commit ensures that all examples run with minimal changes. More specifically we don't need to remove the .use_simple_logger() call on all Apps.
Configuration menu - View commit details
-
Copy full SHA for 30d66ba - Browse repository at this point
Copy the full SHA 30d66baView commit details -
The resize callback should be registered to the window, since resizing the window doesn't call the resize callback for canvases even if those do get resized.
Configuration menu - View commit details
-
Copy full SHA for cfb3627 - Browse repository at this point
Copy the full SHA cfb3627View commit details -
Added scrolling support + fixed hidpi handling
The scroll example now works as expected on hi and low dpi screens.
Configuration menu - View commit details
-
Copy full SHA for fbce712 - Browse repository at this point
Copy the full SHA fbce712View commit details -
Use explicit lifetime in StrOrChar
This makes passing it easier to pass owned strings when creating a new KeyEvent, which is necessary when interfacing with WASM.
Configuration menu - View commit details
-
Copy full SHA for 999ef45 - Browse repository at this point
Copy the full SHA 999ef45View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8ee237f - Browse repository at this point
Copy the full SHA 8ee237fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 659e136 - Browse repository at this point
Copy the full SHA 659e136View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4658a17 - Browse repository at this point
Copy the full SHA 4658a17View commit details -
Configuration menu - View commit details
-
Copy full SHA for 439b319 - Browse repository at this point
Copy the full SHA 439b319View commit details -
Prevent the browser from going back on backspace
This should be the default behavior to make text widgets usable. At a later iteration it may be better to only disable the browser from going back when a widget is selected that is expecting keyboard input where backspace is intended for something else. I expect this functionality would require some way of accessing the web_sys event from within a druid callback.
Configuration menu - View commit details
-
Copy full SHA for 85f400b - Browse repository at this point
Copy the full SHA 85f400bView commit details -
Fix key text + require console_log + adjust style
This commit addresses comments in the code review: Key text: - web_sys returns the name of each pressed key from which we can generate a viable printable string. This mechanism is revised to include all non-printable keys as listed in MDN. - notably, the tab character and numpad characters have gained printable text in this commit. console_log: - console_log is not required in wasm builds. - integrated console_log with the use_simple_logger api. `console_log` is initialized with log level `trace` as is done in simple logger by default. Style: - non std use statements are now before third party use statements. - key_to_text function signature refactor - specify the log module when calling log::{warn, error} explicitly.
Configuration menu - View commit details
-
Copy full SHA for 3316120 - Browse repository at this point
Copy the full SHA 3316120View commit details -
Configuration menu - View commit details
-
Copy full SHA for e2d8e00 - Browse repository at this point
Copy the full SHA e2d8e00View commit details -
Moved console_log dependency from druid-shell to druid, since this is where it is initialized. This fixes the wasm build.
Configuration menu - View commit details
-
Copy full SHA for 204230c - Browse repository at this point
Copy the full SHA 204230cView commit details -
Configuration menu - View commit details
-
Copy full SHA for c191012 - Browse repository at this point
Copy the full SHA c191012View commit details -
Configuration menu - View commit details
-
Copy full SHA for 844cbc2 - Browse repository at this point
Copy the full SHA 844cbc2View commit details -
Configuration menu - View commit details
-
Copy full SHA for a37c3b4 - Browse repository at this point
Copy the full SHA a37c3b4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2d67cd7 - Browse repository at this point
Copy the full SHA 2d67cd7View commit details -
Configuration menu - View commit details
-
Copy full SHA for 481b796 - Browse repository at this point
Copy the full SHA 481b796View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9b2a3d8 - Browse repository at this point
Copy the full SHA 9b2a3d8View commit details -
Fix windows build for druid-wasm-examples
This commit creates a symlink to the examples directory on demand.
Configuration menu - View commit details
-
Copy full SHA for fbd6073 - Browse repository at this point
Copy the full SHA fbd6073View commit details -
Added simple_logger dep for wasm
This allows the wasm examples to build even when the target arch is not wasm32.
Configuration menu - View commit details
-
Copy full SHA for 23424af - Browse repository at this point
Copy the full SHA 23424afView commit details -
Configuration menu - View commit details
-
Copy full SHA for 510a60a - Browse repository at this point
Copy the full SHA 510a60aView commit details -
Configuration menu - View commit details
-
Copy full SHA for e7e257c - Browse repository at this point
Copy the full SHA e7e257cView commit details -
Configuration menu - View commit details
-
Copy full SHA for cfe5153 - Browse repository at this point
Copy the full SHA cfe5153View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4b6150d - Browse repository at this point
Copy the full SHA 4b6150dView commit details -
Fix the build script for wasm examples
This addresses the CI failures caused by the weird build of the wasm examples. To elaborate: In order to include each of the examples in the wasm example, a symlink to the examples directory is created in build.rs along with the corresponding examples.rs module which declares examples known to work with wasm. To satisfy CI, the examples.rs committed to the repo must be empty since rustfmt does not call "build.rs".
Configuration menu - View commit details
-
Copy full SHA for 5609e38 - Browse repository at this point
Copy the full SHA 5609e38View commit details -
Add .gitignore to wasm examples + fix clippy bugs
The included .gitignore ignores the generated examples module. The examples.rs should remain committed, but it need not be ever changed.
Configuration menu - View commit details
-
Copy full SHA for 5ed32cb - Browse repository at this point
Copy the full SHA 5ed32cbView commit details -
Configuration menu - View commit details
-
Copy full SHA for ad3c7e8 - Browse repository at this point
Copy the full SHA ad3c7e8View commit details -
Configuration menu - View commit details
-
Copy full SHA for d101869 - Browse repository at this point
Copy the full SHA d101869View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8d05b09 - Browse repository at this point
Copy the full SHA 8d05b09View commit details -
Fix x11 keycodes StrOrChar conversion
The newly introduced lifetime parameter must be specified exmplicitly.
Configuration menu - View commit details
-
Copy full SHA for ea81ffe - Browse repository at this point
Copy the full SHA ea81ffeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 78b4631 - Browse repository at this point
Copy the full SHA 78b4631View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3cd4144 - Browse repository at this point
Copy the full SHA 3cd4144View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1dbb4e9 - Browse repository at this point
Copy the full SHA 1dbb4e9View commit details -
Add --no-run to
cargo test
for wasm targetswasm targets cannot be run in the normal way.
Configuration menu - View commit details
-
Copy full SHA for 2102f82 - Browse repository at this point
Copy the full SHA 2102f82View commit details -
Do not build the unit test module for wasm32
The tests cannot be run in the normal way anyways. Leaving this for a future PR to flush out.
Configuration menu - View commit details
-
Copy full SHA for 5021017 - Browse repository at this point
Copy the full SHA 5021017View commit details -
Configuration menu - View commit details
-
Copy full SHA for a143692 - Browse repository at this point
Copy the full SHA a143692View commit details
Commits on Apr 13, 2020
-
Add warnings for unimplemented file ops in web backend
This commit exposes the error of the missing implementation for file dialogs in the web backend using log::warn. This is a temporary solution until the `open_file_sync` and `save_as_sync` functions propagate the error downstream using Result instead of Option. Co-Authored-By: Leopold Luley <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e0949ff - Browse repository at this point
Copy the full SHA e0949ffView commit details -
Remove windows specific comment from web/window.rs
Co-Authored-By: Leopold Luley <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 0df38af - Browse repository at this point
Copy the full SHA 0df38afView commit details -
Ignore automatically generated html files in wasm example
Co-Authored-By: Leopold Luley <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 5f64d4b - Browse repository at this point
Copy the full SHA 5f64d4bView commit details -
Remove unused dialog module from web backend
The types in that module have since made their way into druid itself.
Configuration menu - View commit details
-
Copy full SHA for ee88c7f - Browse repository at this point
Copy the full SHA ee88c7fView commit details -
Remove TODO for adding to app state in web backend
This is most likely not needed.
Configuration menu - View commit details
-
Copy full SHA for ea79c84 - Browse repository at this point
Copy the full SHA ea79c84View commit details -
Rework the generated examples in the wasm example
This commit attempts a different approach at including the automatically generated examples from the parent directory. This method satisfies both rustfmt and cargo test as before, but it also doesn't modify any files in the source tree, keeping the diff clean after a build.
Configuration menu - View commit details
-
Copy full SHA for e072555 - Browse repository at this point
Copy the full SHA e072555View commit details -
Configuration menu - View commit details
-
Copy full SHA for d0bc9df - Browse repository at this point
Copy the full SHA d0bc9dfView commit details
Commits on Apr 14, 2020
-
Rename switch example js entry point for wasm build
This commit fixes the generated html file for the switch example to load "switch_demo" instead of "switch" for the switch example. The word switch conflicts with JavaScript's switch statement, which is the reason for this awkwardness.
Configuration menu - View commit details
-
Copy full SHA for 3a528fa - Browse repository at this point
Copy the full SHA 3a528faView commit details