Commit Graph

1633 Commits

Author SHA1 Message Date
4e806bab70 Fix docs for DataView::get*int32* 2019-03-20 18:32:34 +00:00
c5260f29aa Merge TypedArray definitions into a macro 2019-03-20 17:25:35 +00:00
42c1cdd8bf Merge branch 'master' into reexporting_in_2018 2019-03-18 21:38:18 +01:00
2177dee9e4 Merge pull request #1353 from alexcrichton/raw-module
Add a `raw_module` attribute to `#[wasm_bindgen]`
2019-03-18 12:48:14 -05:00
ae47665b4d Merge pull request #1356 from c410-f3r/ts-tests
Improve TS tests
2019-03-18 10:10:21 -05:00
69bbf597af Allow reexporting proc macro output in the 2018 edition
Trying to use a proc macro from a 2018 edition crate in a 2018 edition crate that reexports wasm bindgen's output failed before this commit with "could not find `wasm_bindgen` in `{{root}}`".

This commit was made with 

rg " ::wasm_bindgen::" --files-with-matches | xargs sed -i 's/::wasm_bindgen::/wasm_bindgen::/g'
2019-03-18 10:43:48 +01:00
dc50a5ab58 Improve TS tests 2019-03-15 22:15:04 -03:00
4e32b5e430 add read_optional_enum_attribute to webidl-tests/enums 2019-03-15 14:27:18 -06:00
0d592fffb0 Add a raw_module attribute to #[wasm_bindgen]
This allows subverting the checks and resolution performed by the
`module` attribute added as part of [RFC 6] and has been discussed in #1343.

Closes #1343

[RFC 6]: https://github.com/rustwasm/rfcs/pull/6
2019-03-15 08:08:09 -07:00
1014bdb5df Merge remote-tracking branch 'upstream/master' into enable-rtc-rtp-transceiver 2019-03-14 13:24:24 -06:00
e6c42d4155 fix 2019-03-14 12:50:50 -06:00
bf273a2035 fix 2019-03-14 12:30:08 -06:00
9178231b60 impl OptionFromWasmAbi and OptionIntoWasmAbi for ImportEnum, enable RTCRtpTransceiver.webidl, add add rtc_rtp_transceiver_direction test 2019-03-14 12:15:02 -06:00
91ea972c03 Take &str instead of String in argument fn 2019-03-14 12:21:41 -03:00
59c1b2a565 Merge branch 'master' into arg-names 2019-03-14 09:30:14 -03:00
70f5373348 Preserve argument names 2019-03-14 08:46:42 -03:00
228f58dca3 Bump to 0.2.39 2019-03-13 11:02:27 -07:00
5192b95bf3 Workaround an upstream nom bug
This commit works around Geal/nom#843 where the API of the `nom` crate
changes based on feature selection, meaning we need to be compatible
even if another crate in the crate graph enables a feature.

Ideally this'd be fixed in upstream `nom`, and it looks like it will in
the next major version! For now a local catch-all directive should help
out.
2019-03-12 12:22:24 -07:00
03fa00d201 Make the slice argument of texImage2D and related functions immutable
This also adds immutable slice whitelisting for Uint8Array, ArrayBufferView, and BufferSource, and removes Uint8ArrayMut.
2019-03-08 15:25:52 -08:00
a7e7f8b5e1 Merge pull request #1328 from alexcrichton/switch-to-web
Switch the `--browser` argument to `--web`
2019-03-07 15:25:26 -06:00
e5ec474896 Update crates/cli-support/src/js/mod.rs
Co-Authored-By: alexcrichton <alex@alexcrichton.com>
2019-03-07 15:25:20 -06:00
0b7fab4474 Merge pull request #1331 from c410-f3r/span-impls
Remove PartialEq and Eq from Function
2019-03-07 13:32:42 -06:00
f00c74aeb0 Merge pull request #1330 from Vlad-Shcherbina/mkdir_pkg
Create --out_dir (usually "pkg") if it does not exist
2019-03-07 12:08:37 -06:00
ded4fdf52d Remove PartialEq and Eq from Function 2019-03-07 15:00:55 -03:00
2a2581188a Create out_dir (usually "pkg") if it does not exist 2019-03-07 19:56:57 +03:00
cd3781cb73 Switch the --browser argument to --web
This commit reverts part of the implementation of [RFC 6]. That RFC
specified that the `--browser` flag was going to be repurposed for the
new "natively loadable as ES module output", but unfortunately the
breakage is far broader than initially expected. It turns out that
`wasm-pack` passes `--browser` by default which means that a change to
break `--browser` would break all historical versions of `wasm-pack`
which is a bit much for now.

To solve this the `--browser` flag is going back to what it represents
on the current released version of `wasm-bindgen` (optimize away some
node.js checks in a few places for bundler-style output) and a new
`--web` flag is being introduced as the new deployment strategy.

[RFC 6]: https://github.com/rustwasm/rfcs/pull/6

Closes #1318
2019-03-07 08:26:36 -08:00
17bd1969b6 Merge pull request #1323 from alexcrichton/bump-walrus
Update walrus to 0.5.0
2019-03-06 22:34:28 -06:00
795bf7c6b1 Update walrus to 0.5.0 2019-03-06 15:09:20 -08:00
fa0a3610af issue-1317-typed-array-typo-fixed 2019-03-06 22:12:48 +03:00
9f6c2a6125 Merge pull request #1314 from alexcrichton/typescript-tests
Start testing TypeScript output on CI
2019-03-05 17:20:00 -06:00
d6e3770350 Scope snippets within a crate
Use the same crate identifier for manually included snippets as well as
inline snippets to help with debugging.
2019-03-05 14:53:14 -08:00
c463cc96df Clean up the super long finalize function 2019-03-05 14:40:05 -08:00
f3f3ebee3a Remove unsafe usage in backend/src/encode.rs
Using `unsafe` was just a little too eager there so let's use an
off-the-shelf solution for solving the actual problem we have, which is
to allocate strings with a lifetime of `Interner` rather than
deduplicating strings.
2019-03-05 12:28:14 -08:00
93a1301c9f Don't explicitly hide _INCLUDED_FILES
It's already hidden from docs!
2019-03-05 12:17:42 -08:00
bdcfcb49b1 Log webdriver command we execute 2019-03-05 09:33:22 -08:00
235bc7c889 Start testing TypeScript output on CI
This commit starts to add some simple tests for our TypeScript output of
the wasm-bindgen CLI, currently just running `tsc` to make sure syntax
looks good and types are emitted as expected. This'll hopefully be able
to get expanded over time with bug reports as they come in as well as
ensure that we don't regress anything in egregious manners!

Closes #922
2019-03-05 08:57:52 -08:00
20f1e503d3 Fix the webidl-tests crate 2019-03-05 08:00:47 -08:00
5de3189411 Fix js-sys and web-sys tests 2019-03-05 08:00:47 -08:00
7e62aff1ce Fix a case where snippet is specified twice
When importing a file across multiple locations in a module make sure it
doesn't trip an assert and it works as expected.
2019-03-05 08:00:47 -08:00
6283169a30 Paths are relative to CARGO_MANIFEST_DIR
The cwd is different for workspaces, so use the manifest env var
instead.
2019-03-05 08:00:47 -08:00
b762948456 Implement the local JS snippets RFC
This commit is an implementation of [RFC 6] which enables crates to
inline local JS snippets into the final output artifact of
`wasm-bindgen`. This is accompanied with a few minor breaking changes
which are intended to be relatively minor in practice:

* The `module` attribute disallows paths starting with `./` and `../`.
  It requires paths starting with `/` to actually exist on the filesystem.
* The `--browser` flag no longer emits bundler-compatible code, but
  rather emits an ES module that can be natively loaded into a browser.

Otherwise be sure to check out [the RFC][RFC 6] for more details, and
otherwise this should implement at least the MVP version of the RFC!
Notably at this time JS snippets with `--nodejs` or `--no-modules` are
not supported and will unconditionally generate an error.

[RFC 6]: https://github.com/rustwasm/rfcs/pull/6

Closes #1311
2019-03-05 08:00:47 -08:00
a659f27c07 Bump to 0.2.38 2019-03-04 09:11:23 -08:00
7ad5426714 Update tests after nightly fix 2019-03-04 02:14:57 +00:00
1299a2086f Merge pull request #1307 from alexcrichton/fix-name
Fix name of "current thread ID" intrinsic
2019-03-01 12:48:53 -06:00
dad0de4f8b Work around a nightly regression 2019-03-01 10:48:03 -08:00
1031d9dea6 Work around rust-lang/rust#58853 2019-03-01 10:47:27 -08:00
9ac8a974a9 Fix name of "current thread ID" intrinsic
This was accidentally renamed in the transition to `walrus`, but
upstream rust-lang/rust still uses the old name so let's switch back to
that.
2019-03-01 09:22:30 -08:00
233525d7d6 Fix passStringToWasm with shared memory
Looks like `TextEncoder#encodeInto` isn't compatible when the buffer
passed in is backed by a `SharedArrayBuffer`, so if the module has a
shared thread skip the `encodeInto` optimization entirely.
2019-02-28 14:58:10 -08:00
c62f6529d8 Merge pull request #1304 from alexcrichton/fix-init
Fix a `__wbindgen_placeholder__` module leaking through
2019-02-28 13:39:56 -06:00
da168dc7f5 Merge pull request #1302 from tyleranton/export-comments-ts
Add doc comments export for typescript
2019-02-28 09:34:11 -06:00