1639 Commits

Author SHA1 Message Date
Alex Crichton
df809df9a5
Bump to 0.2.63 (#2163)
* Update `syn` version requirement

Require latest version to fix issues with nightly.

* Bump to 0.2.63
2020-05-27 10:07:18 -05:00
Rahul Butani
3dd8f3d2ac
Handle the possibility that the class name is in its own Group (#2159)
* Handle the possibility that the class name is in its own Group

rust-lang/rust#72388 makes this happen

* Handle Groups in more places

* fmt!

* Add some functions to handle Groups

As suggested by @alexcrichton [here](https://gist.github.com/alexcrichton/3c93ab2547d45d9caa3b72309cd4262b).
2020-05-26 15:08:56 -05:00
Tanner Rogalsky
047b4209ad
Explictly drop instead of relying on RAII. (#2144) 2020-05-18 15:24:21 -05:00
Alex Crichton
996e92f3ae
Mass rename anyref to externref (#2142)
Updates a mess of dependencies and tracks the most recent version of the
reference types specification.
2020-05-18 09:36:30 -05:00
Alex Crichton
61e8fc0d38 Update tests for new anyref syntax 2020-05-18 05:02:31 -07:00
str4d
6ba8c6c2ec
Add Blob.stream() method (#2140)
This enables a ReadableStream to be obtained for a file, which can then
be handled with e.g. https://github.com/MattiasBuelens/wasm-streams

    let file: web_sys::File = ...;
    let stream = wasm_streams::readable::ReadableStream::from(
        file.stream()
            .unchecked_into::<wasm_streams::readable::sys::ReadableStream>(),
    );

WebIDL source: https://w3c.github.io/FileAPI/#blob-section
Docs: https://developer.mozilla.org/en-US/docs/Web/API/Blob/stream
2020-05-18 06:59:16 -05:00
Alex Crichton
8e3d6fe619
Update the walrus dependency (#2125)
This commit updates the `walrus` crate used in `wasm-bindgen`. The major
change here is how `walrus` handles element segments, exposing segments
rather than trying to keep a contiugous array of all the elements and
doing the splitting itself. That means that we need to do mroe logic
here in `wasm-bindgen` to juggle indices, segments, etc.
2020-05-06 12:57:02 -05:00
Alex Crichton
dc54c0fb25
Fix name collisions with test functions and intrinsics (#2123)
There was an unfortunate collision with how test symbols were named and
the various bindings functions exported by wasm-bindgen. This commit
fixes these issues by using a separate prefix for `#[wasm_bindgen_test]`
than other `#[wasm_bindgen]` functions which should avoid the name
clash.

Closes #2121
2020-05-04 16:20:41 -05:00
Alex Crichton
d896446edc
Bump to 0.2.62 (#2119) 2020-05-01 10:34:36 -05:00
Pauan
7bee6a8c19
Fixing require to be ignored by Webpack (#2115)
* Fixing require to be ignored by Webpack

* Making the module.require even more dynamic, to trick Webpack
2020-04-29 13:59:49 -05:00
Alex Crichton
6d61cd8b76
Bump to 0.2.61 (#2113) 2020-04-29 11:22:35 -05:00
Pauan
e16f7e41bf
Adding in wrapper file to fix circular dependency with Webpack 5 (#2110)
* Adding in wrapper file to fix circular dependency with Webpack 5

* Running rustfmt

* Fixing unit tests
2020-04-29 10:55:28 -05:00
Alex Crichton
69aef24acf Fix CI builds for now 2020-04-27 08:15:55 -07:00
Pauan
541e8f5359
No longer error for npm dependencies with web (#2103)
* No longer error for npm dependencies with web

* Fixing build error
2020-04-27 10:14:05 -05:00
Vojtěch Pejša
4ff154fbfc Generate web-sys with old ClipboardEvent removed. 2020-04-23 07:15:47 +02:00
Vojtěch Pejša
d5da20c795 Remove old ClipboardEvent webidl 2020-04-23 07:12:39 +02:00
Vojtěch Pejša
e7361d8a36 Generate Clipboard APIs 2020-04-23 07:12:29 +02:00
Vojtěch Pejša
1d84a842cc Add clipboard webidl 2020-04-23 07:10:57 +02:00
Pauan
a22bbca92c
Making WebIDL generation deterministic (#2101)
* Making webidl generation deterministic

* Fixing line endings

* Regenerating WebIDL

* Running rustfmt
2020-04-22 20:01:40 -05:00
Pauan
7bc9147258
Improving the code generation for catch (#2098)
* Improving the code generation for catch

* Fixing newlines

* Running rustfmt

* Updating unit tests

* Fixing build error
2020-04-22 09:14:00 -05:00
Pauan
a93b778b5c
Fixing bug with Firefox extension content scripts (#2099) 2020-04-22 09:12:14 -05:00
a1trl9
3c40492fa3
exhausively match JSImportName (#2090) 2020-04-20 09:10:33 -05:00
Josh Groves
4900732f60
Add setBindGroup to immutable slice whitelist (#2087) 2020-04-17 10:08:35 -05:00
a1trl9
ad85de50c6
try to fix global / modulaized import ns conflict (#2057)
* use global import map for rename

* fix same ns import

* cargo fmt

* add basic test

* move generate_identifier, add comments, add tests

* remove leading &mut

* remove unnecessary bail

* use import_name for global and some refine

* Add back in error handling, clean up instruction iteration

* Remove unnecessary patch statements

Co-authored-by: Alex Crichton <alex@alexcrichton.com>
2020-04-15 08:28:29 -05:00
0xd4d
826538922f
Copy more doc comments to JS/TS files, unescape comments (#2070)
* Copy more doc comments to JS/TS files, unescape comments

* Move unescape code to macro-support
2020-04-13 13:51:32 -05:00
Josh Groves
fc86589715
Update to latest WebGPU WebIDL (#2080) 2020-04-13 09:30:37 -05:00
0xd4d
2b128288c7
Add ability to rename enums (js_name = new_name) (#2071)
* Add ability to rename enums (js_name = new_name)

* Add a test
2020-04-13 09:14:41 -05:00
a1trl9
b9f78aba57
try to fix js_name error when both getter and setter used (#2074)
* try to fix js_name error when both `getter` and `setter` used

* add tests
2020-04-10 11:57:36 -05:00
Alex Crichton
a19c8a3fe0
Bump to 0.2.60 (#2051)
* Bump to 0.2.60

* Try to fix CI

* Fix CI syntax
2020-03-25 16:33:36 -05:00
kevthecoder
2b29650920
Webxrdevice (#2000)
* crates/web-sys/webidls/enabled/WebXRDevice.webidl

* Add WebXR Web IDL.

* Add WebXr example.

* Workaround in WebXR for FrozenArray and XRWebGLLayer constructor.

* Remove commented code.

* Attempt to improve WebXr example.

* Add WebXr as unstable WebIDL.

* Fixes for XRWebGLLayer.

* Tidy up WebXR example code.

* Update WebXr example docs.

Co-authored-by: Kev Kirkland <kev.kirkland@elucidata.co.uk>
2020-03-17 09:14:05 -05:00
Alex Crichton
ceac51f260 Fix a test for upstream changes 2020-03-17 07:02:50 -07:00
Pauan
5acd6a3451
Merge pull request #1986 from clearloop/master
Add typescript_type attribute
2020-03-13 03:02:06 +01:00
Ashley
8a3bdbd8ee
Allow changing the wasm-bindgen-test-runner timeout via an env variable (#2036)
* Add WASM_BINDGEN_TEST_TIMEOUT

* Formatting
2020-03-10 10:36:00 -05:00
Josh Groves
035902ab51
Update to latest WebGPU WebIDL (#2037) 2020-03-10 09:27:48 -05:00
daxpedda
5534253280
Fix undefined error in worker. (#2038) 2020-03-10 09:13:50 -05:00
clearloop
003dc45d76 add: docs for typescript_type 2020-03-04 15:32:40 +08:00
clearloop
84f5fe2c00 add: tests for typescript_type attribute 2020-03-04 14:17:53 +08:00
Pauan
7a7b412bae
Merge pull request #2029 from Pauan/fixing-typescript-emit
Fixing the TypeScript type for the init function
2020-03-04 06:40:16 +01:00
Pauan
b99ab10696 Running rustfmt 2020-03-04 06:20:58 +01:00
Pauan
5a752e5b84
Adding in typescript_type to the js_sys types (#2028) 2020-03-03 22:52:40 -06:00
Pauan
d193b2db8f Improving the TypeScript types for the init function 2020-03-04 05:23:05 +01:00
Alex Crichton
db8d3e4412
Bump to 0.2.59 (#2026)
Wow this is a big release!
2020-03-03 10:55:51 -06:00
Joey Watts
7ffb5ed70c
Add skip_typescript attribute to prevent .d.ts emit (#2016)
* Add skip_typescript attribute to prevent .d.ts emit

* Add guide page for typescript attribute
2020-03-03 09:34:28 -06:00
Pauan
3f4acc453b
Dramatically improving the build time of web-sys (#2012)
* Pre-generating web-sys

* Fixing build errors

* Minor refactor for the unit tests

* Changing to generate #[wasm_bindgen} annotations

* Fixing code generation

* Adding in main bin to wasm-bindgen-webidl

* Fixing more problems

* Adding in support for unstable APIs

* Fixing bug with code generation

* More code generation fixes

* Improving the webidl program

* Removing unnecessary cfg from the generated code

* Splitting doc comments onto separate lines

* Improving the generation for unstable features

* Adding in support for string values in enums

* Now runs rustfmt on the mod.rs file

* Fixing codegen for constructors

* Fixing webidl-tests

* Fixing build errors

* Another fix for build errors

* Renaming typescript_name to typescript_type

* Adding in docs for typescript_type

* Adding in CI script to verify that web-sys is up to date

* Fixing CI script

* Fixing CI script

* Don't suppress git diff output

* Remove duplicate definitions of `Location`

Looks to be a preexisting bug in wasm-bindgen?

* Regenerate webidl

* Try to get the git diff command right

* Handle named constructors in WebIDL

* Remove stray rustfmt.toml

* Add back NamedConstructorBar definition in tests

* Run stable rustfmt over everything

* Don't run Cargo in a build script

Instead refactor things so webidl-tests can use the Rust-code-generation
as a library in a build script. Also fixes `cargo fmt` in the
repository.

* Fixup generated code

* Running web-sys checks on stable

* Improving the code generation a little

* Running rustfmt

Co-authored-by: Alex Crichton <alex@alexcrichton.com>
2020-03-02 17:39:36 -06:00
Nikhil Benesch
eb04cf2dda
Upgrade weedle to v0.11 (#2024) 2020-03-02 15:31:02 -06:00
Alex Crichton
381660c49b
Run rustfmt and keep it running on CI (#2023)
Thought we did this awhile back, but looks like we forgot to do so!
2020-03-02 11:44:14 -06:00
Chinedu Francis Nwafili
bab83a7ff4
Whitelist send_with_u8_array slice (#2015)
* Whitelist send_with_u8_array slice

Fixes #2014

* Fix send slice

* Remove chromedriver comment

* Get slice tests running in CI
2020-03-02 09:13:15 -06:00
Ingvar Stepanyan
1e75e415b3
Fix TypedArray::subarray docs (#2021)
Looks like these were mistakenly copy-pasted from the `TypedArray::set` method.
2020-03-02 08:57:02 -06:00
Chris Johnson
93cb6cb65d
Symlink LICENSE files in crates (#2018) 2020-02-28 17:41:28 -06:00
Alex Crichton
654af576c7 Tweak some CI things for unstable APIs 2020-02-26 14:36:23 -08:00