-
Notifications
You must be signed in to change notification settings - Fork 569
Standardize web terminology. #1013
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="utf-8"> | ||
| <title>Druid web example</title> | ||
| <style> | ||
| html, | ||
| body, | ||
| canvas { | ||
| margin: 0px; | ||
| padding: 0px; | ||
| width: 100%; | ||
| height: 100%; | ||
| overflow: hidden; | ||
| } | ||
| </style> | ||
| </head> | ||
| <body> | ||
| <noscript>This page contains WebAssembly and JavaScript content, please enable JavaScript in your | ||
| browser.</noscript> | ||
| <canvas id="canvas"></canvas> | ||
| <script type="module" src="./index.js" type="application/javascript"></script> | ||
| </body> | ||
| </html> |
2 changes: 1 addition & 1 deletion
2
druid/examples/hello_wasm_web/index.js → druid/examples/hello_web/index.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| # Druid web examples | ||
|
|
||
| This crate generates and builds all the necessary files for deploying `druid` examples to the web. | ||
|
|
||
| ## Building | ||
|
|
||
| You will need `cargo` and `wasm-pack` for building the code and a simple | ||
| server like [`http`](https://crates.io/crates/https) for serving the web pages. | ||
|
|
||
| First build with | ||
|
|
||
| ``` | ||
| > wasm-pack build --target web --dev | ||
| ``` | ||
|
|
||
| This step has two main functions: | ||
|
|
||
| 1. It generates an HTML document for each of the `druid` examples with a script that | ||
| calls the appropriate function in the JavaScript module exposing the raw Wasm. | ||
| 2. It builds the Wasm binary which exposes all functions annotated with `#[wasm_bindgen]`. | ||
| 3. It builds the JavaScript module that loads the Wasm binary and binds all the exposed | ||
| functions to JavaScript functions so they can be called directly from JavaScript. | ||
|
|
||
| To preview the build in a web browser, run | ||
|
|
||
| ``` | ||
| > http | ||
| ``` | ||
|
|
||
| which should start serving the crate root folder containing `index.html`. | ||
|
|
||
| Finally, point your browser to the appropriate localhost url (usually http://localhost:8000) and you | ||
| should see a list of HTML documents -- one for each example. | ||
|
|
||
| When you make changes to the project, re-run `wasm-pack build --target web --dev` and you can | ||
| see the changes in your browser when you refresh -- no need to restart `http`. | ||
|
|
||
| ## New Examples | ||
|
|
||
| New examples that can be built against the web target should have an associated | ||
| `impl_example!(<example_name>)` entry added to `lib.rs`. Examples that don't | ||
| support the web target should be specified in the `EXCEPTIONS` list defined | ||
| at the top of the `build.rs` script. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.