Commit Graph

15 Commits

Author SHA1 Message Date
Wouter van Oortmerssen b627b7c6c6 Undo PR: make flatbuffers.js into a UMD module (#4228)
This PR did not work in all JS environments and caused
downstream breakage.

Change-Id: Ib565129e26622d02bad2d45816bd05f6b961b994
2017-04-17 17:31:03 -07:00
Kamil Rojewski 28e7dbd3d3 TypeScript support (#4232)
* Eclipse ignore

* TypeScript support

* Prefixing enums

* Test results

* Merged JS and TS generators

* Fixed AppVeyor build problems

* Fixed more AppVeyor build problems

* Fixed more AppVeyor build problems

* Changed TS flag to options struct

* Storing options by value

* Removed unneeded const

* Re-export support for unions

* Uint support

* Casting bools to numbers for mutation

* TS shell tests

* Reverted generates js test file to original version

* Backing up js tests and properly generating test data
2017-04-10 10:01:13 -07:00
Iain van der Bloat adc50051e0 make flatbuffers.js into a UMD module (#4228) 2017-04-07 17:14:01 -07:00
Wouter van Oortmerssen 7a36419f24 Fixing closure compile compatibility when --gen-mutable is used.
Change-Id: I8bf575ba6dc795d2d2eec02fa8977dcc2594eaa6
2017-03-27 17:50:30 -07:00
litianzhao ebcfbbadf0 fix #4180: Long.prototype.toFloat64() overflow (#4182) 2017-02-20 11:20:56 -08:00
Wouter van Oortmerssen d7ba17dfe5 Changes to make flatbuffers javascript compatible with the closure compiler.
Change-Id: Iab8d66a8f34910029deb8a5ff5ec7ba50c5b3421
2017-02-08 17:14:35 -08:00
cajun-rat d8944e45a2 Fix Closure Compiler warnings (#4067)
* Make parameter order in jsdocs match function

When the order doesn't match the Google Closure Javascript compiler generates
warnings

* Prefix optional parameters with opt_

The Closure Compiler emits warnings when this isn't the case
2016-10-21 14:52:42 -07:00
Wouter van Oortmerssen 18d67ed83b Clarified in the docs how to get to the serialized bytes.
This was a frequent source of confusion, since in all implementations
the data doesn't start at offset 0 in the buffer.

Change-Id: I045966e65928e9acd9def84e215914ecb5510653
2016-08-10 17:53:40 -07:00
James Gilles 4a49493e27 js:add @namespace annotation to namespaces 2016-07-11 01:40:38 -04:00
Evan Wallace 31b30335f6 Fix #3773: Generated JS now avoids the flatbuffers object 2016-02-25 01:06:16 -08:00
Mark Klara 69a31b807a Revamping the FlatBuffers docs.
Adding an API reference for the supported languages.

General docs cleanup, including a new `tutorial` section that
supports all of the supported languages.

Added samples for each supported language to mirror the new
tutorial page.

Cleaned up all the links by making them `@ref` style links,
instead of referencing the names of the generated `.html` files.

Removed all generated files that were unnecessarily committed.

Also fixed the C# tests (two were failing due to a missing file).

Bug: b/25801305

Tested: Tested all samples on Ubuntu, Mac, and Android. Docs were
generated using doxygen and viewed on Chrome.

Change-Id: I2acaba6e332a15ae2deff5f26a4a25da7bd2c954
2016-01-19 14:31:17 -08:00
Evan Wallace 4bef5e89c4 Add UTF-8 support to the JavaScript API
This adds an optional argument to generated getters for string fields to
specify the encoding type and overloads the createString() function. It's
now possible to use either JavaScript UTF-16 string objects or C-style
UTF-8 byte arrays (Uint8Array) for string data.
2015-10-14 23:07:40 -07:00
Evan Wallace c3bfefca57 change DataView to bit twiddling for JavaScript 2015-10-14 21:15:57 -07:00
Evan Wallace e1e8d53df6 Add low-level fuzzer, fix 64-bit issue it found 2015-10-14 21:15:57 -07:00
Evan Wallace 224e33ed09 Add support for JavaScript code generation
This adds a JavaScript language target. The generated JavaScript uses Google
Closure Compiler type annotations and can be compiled using the advanced
compilation mode, which performs type checking and optimizations such as
inlining and dead code elimination. The generated JavaScript also exports all
generated symbols for use with Node.js and RequireJS. This export behavior
can be turned off with the --no-js-exports flag for use with Google Closure
Compiler.
2015-10-14 21:15:57 -07:00