Commit Graph

58 Commits

Author SHA1 Message Date
a20dd26dde Bump to 0.2.52 (#1833) 2019-10-24 16:08:45 -05:00
6d1dc813c4 Bump to 0.2.51 (#1797)
This notably brings in async/await support for current beta/nightly
users. Yay!
2019-09-26 14:07:28 -05:00
312f5d6dca chore: upgrade @wasm-tool/wasm-pack-plugin to 1.0.1 2019-08-27 18:20:24 +01:00
c2daa4f63c Bump to 0.2.50 2019-08-19 04:21:27 -07:00
c1d4fddeac Bump to 0.2.49 2019-08-14 08:32:02 -07:00
e596ef596c Bump to 0.2.48 2019-07-11 15:02:39 -07:00
d71ab78fc6 Bump to 0.2.47 2019-06-19 11:14:37 -07:00
8fc0a38402 Bump to 0.2.46 2019-06-14 11:44:58 -07:00
546f65e2f3 chore: bump again 2019-05-29 17:37:37 +01:00
f63238ee24 chore: update wasm-pack-plugin to 0.4.1 2019-05-29 17:09:26 +01:00
f3ec734310 docs: update docs link 2019-05-26 16:43:00 +09:00
137bbdf2e3 Bump to 0.2.45 2019-05-20 09:44:03 -07:00
773c6ff430 Bump to 0.2.44 2019-05-16 07:47:23 -07:00
f2429be07f Bump to 0.2.43 2019-04-29 08:28:41 -07:00
df6e15e3ab Bump to 0.2.42 2019-04-11 07:39:45 -07:00
02394724ea Bump to 0.2.41 2019-04-10 10:53:32 -07:00
6803c619bb Bump to 0.2.40 2019-03-21 17:08:48 -07:00
228f58dca3 Bump to 0.2.39 2019-03-13 11:02:27 -07:00
a659f27c07 Bump to 0.2.38 2019-03-04 09:11:23 -08:00
5e7187a95f chore: update pinned Webpack versions 2019-02-15 19:26:08 +01:00
e9f423d57e Bump to 0.2.37 2019-02-15 08:16:24 -08:00
802cfedcbd Bump to 0.2.36 2019-02-12 13:19:02 -08:00
d9cf9b3735 Bump to version 0.2.35 2019-02-12 11:36:19 -08:00
078257943d Bump to 0.2.34 2019-02-11 18:58:54 -08:00
78c4075e40 Bump to 0.2.33 2019-01-18 15:32:17 -08:00
32c611d16d Convert all examples to using wasm-pack
This commit migrates all our examples to using `wasm-pack build` to
compile their code and run `wasm-bindgen`. This should make it a bit
easier to understand the examples as there's less to follow during the
build step.

Webpack projects are all using `@wasm-tool/wasm-pack-plugin` as well so
the build step is simple `npm run serve`. Other examples which retain
`build.sh` are just using `wasm-pack build` now
2019-01-17 08:37:32 -08:00
31fdede9fc Bump to 0.2.32 2019-01-16 13:11:13 -08:00
b04f60cf2b Bump to 0.2.31 2019-01-09 09:17:50 -08:00
fbf000a508 Bump to 0.2.30 2019-01-07 07:47:07 -08:00
f29f78e302 [examples] performance - remove one more unnecessary import 2018-12-12 08:16:36 +01:00
a211e4af9c [examples] performance - port to rust 2018 2018-12-12 08:14:08 +01:00
63e3ba722d Bump to 0.2.29 2018-12-04 06:04:47 -08:00
a2aa28e4d3 Add a #[wasm_bindgen(start)] attribute
This commit adds a new attribute to `#[wasm_bindgen]`: `start`. The
`start` attribute can be used to indicate that a function should be
executed when the module is loaded, configuring the `start` function of
the wasm executable. While this doesn't necessarily literally configure
the `start` section, it does its best!

Only one crate in a crate graph may indicate `#[wasm_bindgen(start)]`,
so it's not recommended to be used in libraries but only end-user
applications. Currently this still must be used with the `crate-type =
["cdylib"]` annotation in `Cargo.toml`.

The implementation here is somewhat tricky because of the circular
dependency between our generated JS and the wasm file that we emit. This
circular dependency makes running initialization routines (like the
`start` shim) particularly fraught with complications because one may
need to run before the other but bundlers may not necessarily respect
it. Workarounds have been implemented for various emission strategies,
for example calling the start function directly after exports are wired
up with `--no-modules` and otherwise working around what appears to be
a Webpack bug with initializers running in a different order than we'd
like. In any case, this in theory doesn't show up to the end user!

Closes #74
2018-11-28 22:11:15 -08:00
22ca15f81e Bump to 0.2.28 2018-11-12 09:28:01 -08:00
56400c3738 Don't use path dependencies in examples
This commit updates all examples to not use `path` dependencies but
rather use versioned dependencies like would typically be found in the
wild. This should hopefully make the examples more copy-pastable and
less alien to onlookers!

The development of the examples remains the same where they continue to
use the `wasm-bindgen`, `js-sys`, `web-sys`, etc from in-tree. The
workspace-level `[patch]` section ensures that they use the in-tree
versions instead of the crates.io versions.
2018-11-07 11:27:43 -08:00
cfa4aa0e3e Promote CI jobs to using stable Rust
Everything should be stable now so let's test it!
2018-10-28 13:28:02 -07:00
959deeea5d Fix unimportant typo 2018-10-06 21:09:18 +02:00
717cfa303d Fix polyfill of TextEncoder and TextDecoder
This commit does a few things, including:

* Fixing the generated JS of `wasm-bindgen` to allow polyfills to work.
  (a minor tweak of the generated JS)

* All examples are updated to include a Webpack-specific polyfill for
  these two types to get examples working in Edge.

* A new page has been added to the guide about supported browsers. This
  mentions known caveats like IE 11 requiring `wasm2js` as well as
  documenting some `TextEncoder` and `TextDecoder` workarounds for Edge.

Closes #895
2018-09-30 10:16:20 -07:00
bc36b6f84b Add catch(console.error) to all examples
Some examples have been failing to load in some browsers, and this
ensures that whenever the promise to load Rust code fails we log any
errors happening instead of accidentally failing silently.

This helped debug a bit in #897
2018-09-28 13:55:07 -07:00
7ecf4aae87 cargo +nightly fmt --all
Rustfmt all the things!
2018-09-26 08:26:00 -07:00
052b41b84c update to "webpack-cli": "^3.1.1" 2018-09-25 18:50:27 -07:00
e353c1cf6f Build examples and deploy to gh-pages
Rejigger Travis slightly to take advantage of build stages to build the
`gh-pages` branch amongst a set of builders, and then when they're all
done we synchronize and deploy the site. For now use S3 as a backing
store for data between jobs.
2018-09-20 20:55:02 -07:00
3efe51eb8b Reorganize and rewrite examples
This commit is a large-ish scale reorganization of our examples. The
main goal here is to have a dedicated section of the guide for example,
and all examples will be listed there. Each example's `README` is now
just boilerplate pointing at the guide along with a blurb about how to
run it.

Some examples like `math` and `smorgasboard` have been deleted as they
didn't really serve much purpose, and others like `closures` have been
rewritten with `web-sys` instead of hand-bound bindings.

Overall it's hoped that this puts us in a good and consistent state for
our examples, with all of them being described in the guide, excerpts
are in the guide, and they're all relatively idiomatically using
`web-sys`.
2018-09-20 16:45:30 -07:00
89005f3469 Examples: use html-webpack-plugin 2018-09-11 08:42:22 +03:00
d4297ad2d3 Remove use_extern_macros features
This has now been stabilized!
2018-08-19 14:33:01 -07:00
906cd7adcc Remove usage of wasm_import_module feature
This is now stabilized! Also tweak usage of it to the stable version.
2018-07-21 19:00:40 -07:00
a949482e3a Remove usage of #[wasm_custom_section] (#509)
This has been stabilized on nightly as `#[link_section]`, so no need for an
unstable attribute any more. Yay!
2018-07-19 08:57:18 -05:00
ed05c7b945 Fix compile on latest nightly (#489) 2018-07-17 09:11:30 -05:00
6561fba947 Applied eslint from main .eslintrc to examples (#418)
* Changed eslintrc to be JSON file (Most projects use JSON version)
  * Added .eslintignore to ingore node_modules from subdirectories such as examples
  * Ran eslint --fix examples to fix all examples
  * Added npm script for running eslint against examples
  * Added npm script for running eslint against generated *out* code
  * Hooked npm scripts into travis ci to prevent examples from becoming inconsistent with future PR's
2018-07-08 01:02:10 -05:00
9127a0419f rustfmt all the things 2018-06-27 22:42:34 -07:00