THRIFT-4406: Optionally generate ES6 compatible JavaScript where service methods return Promises
includes tests and TypeScript support
Client: js
This closes #1452
diff --git a/lib/js/Gruntfile.js b/lib/js/Gruntfile.js
index e678cd5..577a393 100644
--- a/lib/js/Gruntfile.js
+++ b/lib/js/Gruntfile.js
@@ -51,7 +51,10 @@
},
ThriftGenDeepConstructor: {
command: '../../compiler/cpp/thrift -gen js -o test ../../test/JsDeepConstructorTest.thrift'
- }
+ },
+ ThriftGenES6: {
+ command: '../../compiler/cpp/thrift -gen js -gen js:es6 -o test ../../test/ThriftTest.thrift'
+ },
},
external_daemon: {
ThriftTestServer: {
@@ -133,6 +136,13 @@
'http://localhost:8088/test-deep-constructor.html'
]
}
+ },
+ ThriftWSES6: {
+ options: {
+ urls: [
+ 'http://localhost:8088/test-es6.html'
+ ]
+ }
}
},
jshint: {
@@ -162,13 +172,15 @@
'shell:ThriftGenDeepConstructor', 'qunit:ThriftDeepConstructor',
'qunit:ThriftJS', 'qunit:ThriftJS_TLS',
'qunit:ThriftWS',
- 'shell:ThriftGenJQ', 'qunit:ThriftJSJQ', 'qunit:ThriftJSJQ_TLS'
+ 'shell:ThriftGenJQ', 'qunit:ThriftJSJQ', 'qunit:ThriftJSJQ_TLS',
+ 'shell:ThriftGenES6', 'qunit:ThriftWSES6'
]);
grunt.registerTask('default', ['jshint', 'shell:InstallThriftJS', 'shell:InstallThriftNodeJSDep', 'shell:ThriftGen',
'external_daemon:ThriftTestServer', 'external_daemon:ThriftTestServer_TLS',
'qunit:ThriftJS', 'qunit:ThriftJS_TLS',
'qunit:ThriftWS',
'shell:ThriftGenJQ', 'qunit:ThriftJSJQ', 'qunit:ThriftJSJQ_TLS',
+ 'shell:ThriftGenES6', 'qunit:ThriftWSES6',
'concat', 'uglify', 'jsdoc'
]);
};