Commit Graph

2110 Commits

Author SHA1 Message Date
7c9973d9d1 guide: Add the wasm-bindgen guide
Essentially split up the monolithic README.md into an `mdbook`.
2018-06-19 12:05:27 -07:00
224d20337f Merge pull request #274 from fitzgen/js-sys
Expose objects and functions from the JavaScript global scope
2018-06-19 10:42:04 -07:00
7b0e779ffd test: remove unnecessary test.ts files
The testing infrastructure will add exactly this default `test.ts` when it isn't
explicitly specified.
2018-06-19 10:17:42 -07:00
a201cafdea test: Move Object-related js_globals tests to submodule file 2018-06-19 10:15:09 -07:00
d9cac3bd90 Don't document descriptor functions
They aren't part of any public API, and are just an implementation detail of
wasm-bindgen.
2018-06-18 16:44:19 -07:00
161fce9d50 Expose objects and functions from the JavaScript global scope
These are bindings to JavaScript's standard, built-in objects and their methods
and properties.

This does *not* include any Web, Node, or any other JS environment APIs. Only
the things that are guaranteed to exist in the global scope by the ECMAScript
standard.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects
2018-06-18 16:41:01 -07:00
132103eb06 cli-support: Ignore missing descriptor functions
This can happen when a nested dependency crate exports things but the root crate
doesn't use them. In these cases, it is fine to ignore the missing descriptor,
because the thing it describes was removed as dead code.
2018-06-18 16:41:01 -07:00
e4dcb8f85e Add associated constants for common JS values 2018-06-18 16:41:01 -07:00
7d1f26d7b0 Merge pull request #272 from ohanar/webidl_static
webidl: add support for static methods and attributes
2018-06-18 13:44:24 -07:00
e9ea2dabc1 add Validate ptr test 2018-06-18 15:34:48 -05:00
d123bedc20 change some asserts to assert_(eq|ne)s 2018-06-18 13:10:07 -07:00
e639a3f08f Update wasm-pack repository URL 2018-06-18 12:44:46 -07:00
749ac6502f add ptr validation 2018-06-17 20:13:56 -05:00
0938858aa8 webidl: add support for static attributes 2018-06-15 12:22:14 -07:00
fe5cde8636 webidl: add support for static methods 2018-06-15 12:09:42 -07:00
639ccd53ce Merge pull request #269 from ohanar/webidl_constructor
webidl: add support for (named) constructors
2018-06-15 11:35:29 -07:00
fe42656120 Merge pull request #268 from FreeMasen/format
Format
2018-06-15 11:23:47 -07:00
2d7e7cd73e Update js formatting 2018-06-15 12:55:37 -05:00
19d6cf1488 Copy doc comments from Rust to JS (#265)
* backend comments complete

* better matching

* gen comments

* Add example

* Move test bindings gen to own fn

* move build step into build fn

* add fn to read js, refactor gen_bindings/test to allow for this

* Add comments test

* Update readmes

* add comments to travis

* fix broken tests

* +x on build.sh

* fix wbg cmd in build.sh

* Address fitzgen's comments
2018-06-15 09:20:56 -07:00
cbec42e86c webidl: add support for named constructors 2018-06-14 16:20:20 -07:00
c65cb51fba webidl: add support for constructors 2018-06-14 16:15:25 -07:00
3ad9bac599 Merge pull request #267 from nikgraf/patch-1
clarify js part in the readme
2018-06-14 14:52:42 -07:00
400015a061 webidl: refactor method/getter/getter generation 2018-06-14 14:39:04 -07:00
005630929c clarify js part in the readme 2018-06-13 19:13:02 +02:00
0cd767c9d4 Merge pull request #266 from ohanar/webidl_attributes
WebIDL: add support for typedefs and interface attributes
2018-06-11 21:42:15 -07:00
9ad4956116 Merge pull request #264 from ohanar/webidl_integration_tests
webidl: add initial support for integration tests
2018-06-11 21:36:56 -07:00
be0e436c03 webidl: add basic support for attributes 2018-06-11 18:45:19 -07:00
d065f4b05d webidl: add support for typedefs 2018-06-11 18:43:45 -07:00
9b8c0b8fb9 small cleanup in testing framework 2018-06-11 18:00:33 -07:00
3710d87f3b Merge pull request #262 from ohanar/snake_case_methods
webidl: translate methods from camelCase to snake_case
2018-06-11 16:09:34 -07:00
077f50c6f2 webidl: add initial support for integration tests 2018-06-10 23:04:17 -07:00
04907477ba webidl: translate methods from camelCase to snake_case 2018-06-09 21:49:42 -07:00
71107b8e80 Merge pull request #236 from spastorino/remove-wrong-types-conversion
Remove wrong types conversion from typescript crate
2018-06-07 15:24:38 -03:00
37eaca47b4 Pretty print output on main example 2018-06-07 14:58:20 -03:00
d6ec2289fc Remove wrong types conversion from js to rust
We can revisit this when we have better tests.
2018-06-07 14:57:44 -03:00
1ea2d95d9e Merge pull request #230 from xtuc/fix-webpack-version
Bump webpack
2018-06-07 10:07:38 -07:00
e90f0e816d Merge pull request #229 from anderspitman/patch-1
Update README.md
2018-06-07 10:06:46 -07:00
a0aecec506 chore: update package lock 2018-06-06 10:11:02 +02:00
b67df02d01 feat: bump webpack 2018-06-06 10:07:02 +02:00
8ac5f2e6e6 Update README.md 2018-06-05 17:34:15 -07:00
065a4b28e3 Merge pull request #228 from spastorino/wasm-bindgen-typescript
Add prototype of wasm-bindgen-typescript
2018-06-05 16:06:45 -07:00
fa8961e56a Add prototype of wasm-bindgen-typescript 2018-06-04 17:28:12 -03:00
a02f9e0eed Merge pull request #227 from fitzgen/webidl
webidl: add features necessary to support Event.initEvent
2018-06-01 16:58:08 -07:00
8865e019f8 webidl: add features necessary to support Event.initEvent
1. Adds support for binding `DOMString` arguments to `&str`.

2. Ignore whether an argument is optional, and just always emit bindings for it.
2018-06-01 16:41:15 -07:00
cb5bd3b9c9 Merge pull request #225 from fitzgen/webidl
webidl: Add logging and use env_logger in the tests
2018-06-01 16:09:36 -07:00
8faebc56f2 webidl: Add logging and use env_logger in the tests 2018-06-01 16:09:15 -07:00
659583b40d Implement PartialEq for JsValue (#217)
Dispatch to JS's `===` operator internally
2018-06-01 16:47:45 -05:00
cb1e5cf136 Optimize JsValue::{from_bool, undefined, null} constructors (#220)
This commit optimizes constructing an instance of `JsValue` which is one of
`null`, `undefined`, `true`, or `false`. These are commonly created on the Rust
side of things and since there's only a limited set of values we can easily
prepopulate the global slab with a few entries and use hardcoded indices to
refer to these constants. This should avoid the need to travel into JS to insert
a `null` or and `undefined` into the global slab.
2018-06-01 16:46:42 -05:00
346d2fda22 Merge pull request #223 from fitzgen/webidl
webidl: emit methods for regular operations on interfaces
2018-06-01 14:22:11 -07:00
ad89d8457e Fix tests by pinning versions of webpack (#219)
Looks like a newer version of webpack has broken tests, so let's use
package-lock.json to pin to an older version while we wait for a fix.
2018-06-01 13:42:59 -05:00