Skip to content
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

Simplify the example a bit #105

Merged
merged 3 commits into from
May 21, 2020
Merged

Conversation

17cupsofcoffee
Copy link
Contributor

Here's a few tweaks that make the example a bit simpler/up-to-date:

  • A seperate wasm_main is no longer required due to Add first-class support for binary crates rustwasm/wasm-bindgen#1843.
  • The prelude import wasn't actually being used anywhere.
  • Nightly is no longer required to build this project, so I removed that from the instructions.
  • --no-modules has been replaced with --target web, which doesn't rely on global variables and allows support for JS snippets.
    • The only caveat to this is that the generates JS is a ES module instead of a basic JS file - but any browser that supports WASM will also support ES modules, so I don't think this is an issue in practice.

Copy link
Owner

@grovesNL grovesNL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thank you! I think the prelude used to be needed for wasm_bindgen(start).

bors r+

bors bot added a commit that referenced this pull request May 14, 2020
105: Simplify the example a bit r=grovesNL a=17cupsofcoffee

Here's a few tweaks that make the example a bit simpler/up-to-date:

* A seperate `wasm_main` is no longer required due to rustwasm/wasm-bindgen#1843.
* The prelude import wasn't actually being used anywhere.
* Nightly is no longer required to build this project, so I removed that from the instructions.
* `--no-modules` has been replaced with `--target web`, which doesn't rely on global variables and allows support for [JS snippets](https://rustwasm.github.io/docs/wasm-bindgen/reference/js-snippets.html).
    * The only caveat to this is that the generates JS is a ES module instead of a basic JS file - but any browser that supports WASM will also support ES modules, so I don't think this is an issue in practice.

Co-authored-by: Joe Clay <27cupsofcoffee@gmail.com>
@17cupsofcoffee
Copy link
Contributor Author

I think the prelude used to be needed for wasm_bindgen(start).

Ah yeah, that makes sense!

@bors
Copy link
Contributor

bors bot commented May 14, 2020

Build failed:

  • continuous-integration/travis-ci/push

@grovesNL
Copy link
Owner

The CI failure is unrelated, cargo-web fails to build on Rust 1.37.0. We'll need to bump it to a higher version and change the minimum Rust version in README.

@grovesNL
Copy link
Owner

grovesNL commented May 14, 2020

It looks like Rust 1.38.0 stabilizes ptr_cast, so we can move to 1.38 as the minimum version. I think we just need to switch 1.37 to 1.38 in .travis.yml and README if you'd like to make this change.

@17cupsofcoffee
Copy link
Contributor Author

Done!

@grovesNL
Copy link
Owner

Apparently cfg(doctest) (stabilized in 1.40) is also used in a dependency somewhere. Hopefully there's nothing else :/

@17cupsofcoffee
Copy link
Contributor Author

17cupsofcoffee commented May 14, 2020

Done (looks like xml-rs added the doc tests in a patch release about a month ago, and that's used by gl_generator) - third time's the charm, hopefully...

@grovesNL
Copy link
Owner

bors r+

@bors
Copy link
Contributor

bors bot commented May 21, 2020

Build succeeded:

  • continuous-integration/travis-ci/push

@bors bors bot merged commit 722a850 into grovesNL:master May 21, 2020
@17cupsofcoffee 17cupsofcoffee deleted the simplify-example branch May 21, 2020 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants