aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorNathan Mitchell <thecsapprentice.business@gmail.com>2018-05-31 08:29:58 -0700
committerWouter van Oortmerssen <aardappel@gmail.com>2018-05-31 08:29:58 -0700
commitb4ca4d3cdea7dbfb78342514151a495b451a7f6f (patch)
tree9db92264c42fd1f95049a92d9d6481caecd0fb09 /docs
parent0848f58cdd848d2353b1c0a070f1f6c932d2458f (diff)
downloadflatbuffers-b4ca4d3cdea7dbfb78342514151a495b451a7f6f.tar.gz
Javascript: Add suppport for ES6 style exports (#4754)
* Add suppport for ES6 style exports Adds support for ECMAScript 6 module exports during Javascript generation. This is useful as many development projects are switching to this new standard and away from custom module solutions. By integrating support into flatbuffers, users do not need to perform additional post-processing of generated files in order to use flatbuffers output directly in their codebases. Reference to ECMAScript 6 modules: https://www.ecma-international.org/ecma-262/6.0/#sec-exports Changes: * Added `--es6-js-export` option to cli parser tool * Added conditional code to generate a ES6 style export line, replacing the normal NodeJS/RequireJS line. * Fixed missing export statements Added exports for definition and struct names that were not inside namespaces * Updated Compiler.md with new generator option Added entry to Compiler.md in docs for the `--es6-js-export` flag, including a brief description of the effects and usefulness.
Diffstat (limited to 'docs')
-rw-r--r--docs/source/Compiler.md4
1 files changed, 4 insertions, 0 deletions
diff --git a/docs/source/Compiler.md b/docs/source/Compiler.md
index 6401c44d..a7302320 100644
--- a/docs/source/Compiler.md
+++ b/docs/source/Compiler.md
@@ -101,6 +101,10 @@ Additional options:
instead of Node.js style exporting. Needed for compatibility with the
Google closure compiler (useful for JS).
+- `--es6-js-export` : Generates ECMAScript v6 style export definitions
+ instead of Node.js style exporting. Useful when integrating flatbuffers
+ with modern Javascript projects.
+
- `--raw-binary` : Allow binaries without a file_indentifier to be read.
This may crash flatc given a mismatched schema.