[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16704934#comment-16704934 ] James E. King III commented on THRIFT-3143: --- It's possible. The 0.12.0 release train already started, but stalled, and we might restart it, in which case it would get included. > add typescript directory support > > > Key: THRIFT-3143 > URL: https://issues.apache.org/jira/browse/THRIFT-3143 > Project: Thrift > Issue Type: New Feature > Components: Node.js - Compiler >Reporter: Kazuki Yasufuku >Assignee: James E. King III >Priority: Major > Fix For: 1.0 > > > Current typescript support is only work for browser, and generated d.ts uses > internal module. > So, it's hard to use for typescript in node.js. > To solve probrem, I make a pull request that generate typescript code > directory. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16704884#comment-16704884 ] Mustafa Şenol Coşar commented on THRIFT-3143: - Hi [~jking3], Are this changes going to be included in the next release? Thanks, -Mustafa > add typescript directory support > > > Key: THRIFT-3143 > URL: https://issues.apache.org/jira/browse/THRIFT-3143 > Project: Thrift > Issue Type: New Feature > Components: Node.js - Compiler >Reporter: Kazuki Yasufuku >Assignee: James E. King III >Priority: Major > Fix For: 1.0 > > > Current typescript support is only work for browser, and generated d.ts uses > internal module. > So, it's hard to use for typescript in node.js. > To solve probrem, I make a pull request that generate typescript code > directory. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16704409#comment-16704409 ] ASF GitHub Bot commented on THRIFT-3143: mustafa-cosar commented on issue #1630: THRIFT-3143: Add nodets support URL: https://github.com/apache/thrift/pull/1630#issuecomment-443130971 Thanks for merging it. Here is the necessary info (the cross test covers the following cases): - nodets - since: 0.12.0 (next release, I guess) - lang/lib levels: Min: TypeScript 3.1.6 - Low level transports: Socket - Transport wrappers: TLS - Protocols: binary - Servers: Simple This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > add typescript directory support > > > Key: THRIFT-3143 > URL: https://issues.apache.org/jira/browse/THRIFT-3143 > Project: Thrift > Issue Type: New Feature > Components: Node.js - Compiler >Reporter: Kazuki Yasufuku >Assignee: James E. King III >Priority: Major > Fix For: 1.0 > > > Current typescript support is only work for browser, and generated d.ts uses > internal module. > So, it's hard to use for typescript in node.js. > To solve probrem, I make a pull request that generate typescript code > directory. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16703759#comment-16703759 ] ASF GitHub Bot commented on THRIFT-3143: jeking3 closed pull request #1630: THRIFT-3143: Add nodets support URL: https://github.com/apache/thrift/pull/1630 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/Makefile.am b/Makefile.am index cdb8bd2f5b..511452dfc8 100755 --- a/Makefile.am +++ b/Makefile.am @@ -54,7 +54,7 @@ empty := space := $(empty) $(empty) comma := , -CROSS_LANGS = @MAYBE_CPP@ @MAYBE_C_GLIB@ @MAYBE_CL@ @MAYBE_D@ @MAYBE_JAVA@ @MAYBE_CSHARP@ @MAYBE_PYTHON@ @MAYBE_PY3@ @MAYBE_RUBY@ @MAYBE_HASKELL@ @MAYBE_PERL@ @MAYBE_PHP@ @MAYBE_GO@ @MAYBE_NODEJS@ @MAYBE_DART@ @MAYBE_ERLANG@ @MAYBE_LUA@ @MAYBE_RS@ @MAYBE_DOTNETCORE@ +CROSS_LANGS = @MAYBE_CPP@ @MAYBE_C_GLIB@ @MAYBE_CL@ @MAYBE_D@ @MAYBE_JAVA@ @MAYBE_CSHARP@ @MAYBE_PYTHON@ @MAYBE_PY3@ @MAYBE_RUBY@ @MAYBE_HASKELL@ @MAYBE_PERL@ @MAYBE_PHP@ @MAYBE_GO@ @MAYBE_NODEJS@ @MAYBE_DART@ @MAYBE_ERLANG@ @MAYBE_LUA@ @MAYBE_RS@ @MAYBE_DOTNETCORE@ @MAYBE_NODETS@ CROSS_LANGS_COMMA_SEPARATED = $(subst $(space),$(comma),$(CROSS_LANGS)) if WITH_PY3 diff --git a/compiler/cpp/src/thrift/generate/t_js_generator.cc b/compiler/cpp/src/thrift/generate/t_js_generator.cc index 840168ef53..61782b9d8b 100644 --- a/compiler/cpp/src/thrift/generate/t_js_generator.cc +++ b/compiler/cpp/src/thrift/generate/t_js_generator.cc @@ -64,7 +64,7 @@ class t_js_generator : public t_oop_generator { bool with_ns_ = false; -for( iter = parsed_options.begin(); iter != parsed_options.end(); ++iter) { +for (iter = parsed_options.begin(); iter != parsed_options.end(); ++iter) { if( iter->first.compare("node") == 0) { gen_node_ = true; } else if( iter->first.compare("jquery") == 0) { @@ -80,10 +80,6 @@ class t_js_generator : public t_oop_generator { } } -if (gen_node_ && gen_ts_) { - throw "Invalid switch: [-gen js:node,ts] options not compatible"; -} - if (gen_es6_ && gen_jquery_) { throw "Invalid switch: [-gen js:es6,jquery] options not compatible"; } @@ -203,6 +199,7 @@ class t_js_generator : public t_oop_generator { */ std::string js_includes(); + std::string ts_includes(); std::string render_includes(); std::string declare_field(t_field* tfield, bool init = false, bool obj = false); std::string function_signature(t_function* tfunction, @@ -285,7 +282,7 @@ class t_js_generator : public t_oop_generator { * TypeScript Definition File helper functions */ - string ts_function_signature(t_function* tfunction, bool include_callback); + string ts_function_signature(t_function* tfunction, bool include_callback, bool optional_callback); string ts_get_type(t_type* type); /** @@ -302,11 +299,11 @@ class t_js_generator : public t_oop_generator { string ts_declare() { return (ts_module_.empty() ? "declare " : ""); } /** - * Returns "?" if the given field is optional. + * Returns "?" if the given field is optional or has a default value. * @param t_field The field to check * @return string */ - string ts_get_req(t_field* field) { return (field->get_req() == t_field::T_OPTIONAL ? "?" : ""); } + string ts_get_req(t_field* field) {return (field->get_req() == t_field::T_OPTIONAL || field->get_value() != NULL ? "?" : ""); } /** * Returns the documentation, if the provided documentable object has one. @@ -415,7 +412,7 @@ void t_js_generator::init_generator() { f_types_ << js_includes() << endl << render_includes() << endl; if (gen_ts_) { -f_types_ts_ << autogen_comment() << endl; +f_types_ts_ << autogen_comment() << ts_includes() << endl; } if (gen_node_) { @@ -457,6 +454,20 @@ string t_js_generator::js_includes() { return ""; } +/** + * Prints standard ts imports + */ +string t_js_generator::ts_includes() { + if (gen_node_) { +return string( +"import thrift = require('thrift');\n" +"import Thrift = thrift.Thrift;\n" +"import Q = thrift.Q;\n"); + } + + return ""; +} + /** * Renders all the imports necessary for including another Thrift program */ @@ -518,8 +529,8 @@ void t_js_generator::generate_enum(t_enum* tenum) { indent_up(); - vector constants = tenum->get_constants(); - vector::iterator c_iter; + vector const& constants = tenum->get_constants(); + vector::const_iterator c_iter; for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) { int value = (*c_iter)->get_value(); if (gen_ts_) { @@ -720,6 +731,11 @@ void t_js_generator::generate_js_struct_definition(ostream& out, string prefix =
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16703757#comment-16703757 ] ASF GitHub Bot commented on THRIFT-3143: jeking3 commented on issue #1630: THRIFT-3143: Add nodets support URL: https://github.com/apache/thrift/pull/1630#issuecomment-442981575 Sure, let me know what information needs to go into: https://thrift.apache.org/docs/Languages This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > add typescript directory support > > > Key: THRIFT-3143 > URL: https://issues.apache.org/jira/browse/THRIFT-3143 > Project: Thrift > Issue Type: New Feature > Components: Node.js - Compiler >Reporter: Kazuki Yasufuku >Priority: Major > > Current typescript support is only work for browser, and generated d.ts uses > internal module. > So, it's hard to use for typescript in node.js. > To solve probrem, I make a pull request that generate typescript code > directory. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=1670#comment-1670 ] ASF GitHub Bot commented on THRIFT-3143: mustafa-cosar commented on issue #1630: THRIFT-3143: Add nodets support URL: https://github.com/apache/thrift/pull/1630#issuecomment-442870437 Hi @jeking3 I have a green build but I had to disable `hs-nodets` test. If it is OK with you, can we merge this PR and then I can take a deeper look into the test with my colleagues? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > add typescript directory support > > > Key: THRIFT-3143 > URL: https://issues.apache.org/jira/browse/THRIFT-3143 > Project: Thrift > Issue Type: New Feature > Components: Node.js - Compiler >Reporter: Kazuki Yasufuku >Priority: Major > > Current typescript support is only work for browser, and generated d.ts uses > internal module. > So, it's hard to use for typescript in node.js. > To solve probrem, I make a pull request that generate typescript code > directory. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16701358#comment-16701358 ] ASF GitHub Bot commented on THRIFT-3143: jeking3 edited a comment on issue #1630: THRIFT-3143: Add nodets support URL: https://github.com/apache/thrift/pull/1630#issuecomment-442305147 Do the best you can, and then add the rest to the known failures list. The builds need to pass. If something environmental or unrelated to your changes comes up, I can restart a job. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > add typescript directory support > > > Key: THRIFT-3143 > URL: https://issues.apache.org/jira/browse/THRIFT-3143 > Project: Thrift > Issue Type: New Feature > Components: Node.js - Compiler >Reporter: Kazuki Yasufuku >Priority: Major > > Current typescript support is only work for browser, and generated d.ts uses > internal module. > So, it's hard to use for typescript in node.js. > To solve probrem, I make a pull request that generate typescript code > directory. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16701355#comment-16701355 ] ASF GitHub Bot commented on THRIFT-3143: jeking3 commented on issue #1630: THRIFT-3143: Add nodets support URL: https://github.com/apache/thrift/pull/1630#issuecomment-442305147 Do the best you can, and then add the rest to the known failures list. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > add typescript directory support > > > Key: THRIFT-3143 > URL: https://issues.apache.org/jira/browse/THRIFT-3143 > Project: Thrift > Issue Type: New Feature > Components: Node.js - Compiler >Reporter: Kazuki Yasufuku >Priority: Major > > Current typescript support is only work for browser, and generated d.ts uses > internal module. > So, it's hard to use for typescript in node.js. > To solve probrem, I make a pull request that generate typescript code > directory. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16700503#comment-16700503 ] ASF GitHub Bot commented on THRIFT-3143: mustafa-cosar edited a comment on issue #1630: THRIFT-3143: Add nodets support URL: https://github.com/apache/thrift/pull/1630#issuecomment-442055696 I did some improvements to the tests script so most timeouts are fixed. the `erl-nodets` and `d-nodets` tests fail but their `nodejs` counterparts are in `known_failures_Linux.json` so they should be added as well. There is one test that I couldn't figure out: In `hs-nodets` test, the client logs that all the tests are successful and it does call `connection.end()`. However it still times out for some reason... This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > add typescript directory support > > > Key: THRIFT-3143 > URL: https://issues.apache.org/jira/browse/THRIFT-3143 > Project: Thrift > Issue Type: New Feature > Components: Node.js - Compiler >Reporter: Kazuki Yasufuku >Priority: Major > > Current typescript support is only work for browser, and generated d.ts uses > internal module. > So, it's hard to use for typescript in node.js. > To solve probrem, I make a pull request that generate typescript code > directory. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16700400#comment-16700400 ] ASF GitHub Bot commented on THRIFT-3143: mustafa-cosar commented on issue #1630: THRIFT-3143: Add nodets support URL: https://github.com/apache/thrift/pull/1630#issuecomment-442055696 I did some improvements to the tests script so most timeouts are fixed. the `erl-nodets` and `d-nodets` tests fail but their `nodejs` counterparts are in `known_failures.Linux.json` so they should be added as well. There is one test that I couldn't figure out: In `hs-nodets` test, the client logs that all the tests are successful and it does call `connection.end()`. However it still times out for some reason... This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > add typescript directory support > > > Key: THRIFT-3143 > URL: https://issues.apache.org/jira/browse/THRIFT-3143 > Project: Thrift > Issue Type: New Feature > Components: Node.js - Compiler >Reporter: Kazuki Yasufuku >Priority: Major > > Current typescript support is only work for browser, and generated d.ts uses > internal module. > So, it's hard to use for typescript in node.js. > To solve probrem, I make a pull request that generate typescript code > directory. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16699027#comment-16699027 ] ASF GitHub Bot commented on THRIFT-3143: mustafa-cosar commented on issue #1630: THRIFT-3143: Add nodets support URL: https://github.com/apache/thrift/pull/1630#issuecomment-441659089 The `nodets` uses `nodejs` as a basis so known failures for `nodejs` probably applies to `nodets` as well. I will check if there are any that `nodejs` doesn't fail. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > add typescript directory support > > > Key: THRIFT-3143 > URL: https://issues.apache.org/jira/browse/THRIFT-3143 > Project: Thrift > Issue Type: New Feature > Components: Node.js - Compiler >Reporter: Kazuki Yasufuku >Priority: Major > > Current typescript support is only work for browser, and generated d.ts uses > internal module. > So, it's hard to use for typescript in node.js. > To solve probrem, I make a pull request that generate typescript code > directory. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16698925#comment-16698925 ] ASF GitHub Bot commented on THRIFT-3143: jeking3 commented on issue #1630: THRIFT-3143: Add nodets support URL: https://github.com/apache/thrift/pull/1630#issuecomment-441640052 There are still 41 failing cross tests: ``` === *** Following 41 failures were unexpected ***: If it is introduced by you, please fix it before submitting the code. === server-client: protocol: transport: result: c_glib-nodets binarybuffered-ip failure(timeout) c_glib-nodets multi-binary buffered-ip failure(timeout) d-nodetsbinarybuffered-ip failure(1) go-nodets binarybuffered-ip failure(timeout) java-nodets binarybuffered-ip failure(timeout) java-nodets multi-binary buffered-ip failure(timeout) hs-nodets binarybuffered-ip failure(timeout) py-nodets accel-binary buffered-ip failure(timeout) py-nodets binarybuffered-ip failure(timeout) py3-nodets accel-binary buffered-ip failure(timeout) py3-nodets binarybuffered-ip failure(timeout) cpp-nodets binarybuffered-ip failure(timeout) cpp-nodets multi-binary buffered-ip failure(timeout) rb-nodets accel-binary buffered-ip failure(timeout) rb-nodets binarybuffered-ip failure(timeout) csharp-nodets binarybuffered-ip failure(timeout) netcore-nodets binarybuffered-ip failure(timeout) perl-nodets multi-binary buffered-ip failure(timeout) perl-nodets binarybuffered-ip failure(timeout) erl-nodets binarybuffered-ip failure(timeout) rs-nodets binarybuffered-ip failure(timeout) rs-nodets multi-binary buffered-ip failure(timeout) nodets-c_glib binarybuffered-ip failure(1) nodets-cl binarybuffered-ip failure(1) nodets-dbinarybuffered-ip failure(1) nodets-go binarybuffered-ip failure(1) nodets-hs binarybuffered-ip failure(1) nodets-py binary-accel buffered-ip failure(1) nodets-py binarybuffered-ip failure(1) nodets-java binarybuffered-ip failure(64) nodets-nodejs binarybuffered-ip failure(1) nodets-cpp binarybuffered-ip failure(64) nodets-py3 binary-accel buffered-ip failure(1) nodets-py3 binarybuffered-ip failure(1) nodets-php binary-accel buffered-ip failure(255) nodets-php binarybuffered-ip failure(255) nodets-csharp binarybuffered-ip failure(64) nodets-lua binarybuffered-ip failure(timeout) nodets-rs binarybuffered-ip failure(1) nodets-perl binarybuffered-ip failure(111) nodets-nodets binarybuffered-ip failure(timeout) === ``` This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > add typescript directory support > > > Key: THRIFT-3143 > URL: https://issues.apache.org/jira/browse/THRIFT-3143 > Project: Thrift > Issue Type: New Feature > Components: Node.js - Compiler >
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16698592#comment-16698592 ] ASF GitHub Bot commented on THRIFT-3143: mustafa-cosar edited a comment on issue #1630: THRIFT-3143: Add nodets support URL: https://github.com/apache/thrift/pull/1630#issuecomment-441549384 OK, I tried locally with `cpp,java,nodejs` servers and clients. The cross tests with above languages passed. @jeking3 If there is no other failure, can we merge this? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > add typescript directory support > > > Key: THRIFT-3143 > URL: https://issues.apache.org/jira/browse/THRIFT-3143 > Project: Thrift > Issue Type: New Feature > Components: Node.js - Compiler >Reporter: Kazuki Yasufuku >Priority: Major > > Current typescript support is only work for browser, and generated d.ts uses > internal module. > So, it's hard to use for typescript in node.js. > To solve probrem, I make a pull request that generate typescript code > directory. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16698591#comment-16698591 ] ASF GitHub Bot commented on THRIFT-3143: mustafa-cosar commented on issue #1630: THRIFT-3143: Add nodets support URL: https://github.com/apache/thrift/pull/1630#issuecomment-441549384 OK, I tried locally with cpp,java,nodejs servers and clients. The cross tests with above languages passed. @jeking3 If there is no other failure, can we merge this? This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > add typescript directory support > > > Key: THRIFT-3143 > URL: https://issues.apache.org/jira/browse/THRIFT-3143 > Project: Thrift > Issue Type: New Feature > Components: Node.js - Compiler >Reporter: Kazuki Yasufuku >Priority: Major > > Current typescript support is only work for browser, and generated d.ts uses > internal module. > So, it's hard to use for typescript in node.js. > To solve probrem, I make a pull request that generate typescript code > directory. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16697155#comment-16697155 ] ASF GitHub Bot commented on THRIFT-3143: jeking3 commented on issue #1630: THRIFT-3143: Add nodets support URL: https://github.com/apache/thrift/pull/1630#issuecomment-441246486 You can run the cross test locally if you use the docker build container. First you prepare the environment: ``` user@ubuntu:~/thrift$ docker pull thrift/thrift-build:ubuntu-bionic user@ubuntu:~/thrift$ docker run -v $(pwd):/thrift/src:rw -it thrift/thrift-build:ubuntu-bionic /bin/bash root@8d4584e2e789:/thrift/src# ./bootstrap.sh root@8d4584e2e789:/thrift/src# ./configure root@8d4584e2e789:/thrift/src# make precross ``` Next you can run a specific combination of tests: ``` root@8d4584e2e789:/thrift/src# test/test.py --retry-count 5 --skip-known-failures --server cpp --client nodets ``` That will help you prepare your next pull request for success. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > add typescript directory support > > > Key: THRIFT-3143 > URL: https://issues.apache.org/jira/browse/THRIFT-3143 > Project: Thrift > Issue Type: New Feature > Components: Node.js - Compiler >Reporter: Kazuki Yasufuku >Priority: Major > > Current typescript support is only work for browser, and generated d.ts uses > internal module. > So, it's hard to use for typescript in node.js. > To solve probrem, I make a pull request that generate typescript code > directory. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16697063#comment-16697063 ] ASF GitHub Bot commented on THRIFT-3143: mustafa-cosar edited a comment on issue #1630: THRIFT-3143: Add nodets support URL: https://github.com/apache/thrift/pull/1630#issuecomment-441179965 Hi @jeking3 I added nodets to cross test suite ...or not. I think I missed something, the test didn't run. I will check why. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > add typescript directory support > > > Key: THRIFT-3143 > URL: https://issues.apache.org/jira/browse/THRIFT-3143 > Project: Thrift > Issue Type: New Feature > Components: Node.js - Compiler >Reporter: Kazuki Yasufuku >Priority: Major > > Current typescript support is only work for browser, and generated d.ts uses > internal module. > So, it's hard to use for typescript in node.js. > To solve probrem, I make a pull request that generate typescript code > directory. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16696504#comment-16696504 ] ASF GitHub Bot commented on THRIFT-3143: mustafa-cosar commented on issue #1630: THRIFT-3143: Add nodets support URL: https://github.com/apache/thrift/pull/1630#issuecomment-441179965 Hi @jeking3 I added nodets to cross test suite This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > add typescript directory support > > > Key: THRIFT-3143 > URL: https://issues.apache.org/jira/browse/THRIFT-3143 > Project: Thrift > Issue Type: New Feature > Components: Node.js - Compiler >Reporter: Kazuki Yasufuku >Priority: Major > > Current typescript support is only work for browser, and generated d.ts uses > internal module. > So, it's hard to use for typescript in node.js. > To solve probrem, I make a pull request that generate typescript code > directory. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16695779#comment-16695779 ] ASF GitHub Bot commented on THRIFT-3143: mustafa-cosar edited a comment on issue #1630: THRIFT-3143: Add nodets support URL: https://github.com/apache/thrift/pull/1630#issuecomment-440996256 I reverted C++11 features and rebased. One of the tests failed because of a lisp test. Not related to my changes. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > add typescript directory support > > > Key: THRIFT-3143 > URL: https://issues.apache.org/jira/browse/THRIFT-3143 > Project: Thrift > Issue Type: New Feature > Components: Node.js - Compiler >Reporter: Kazuki Yasufuku >Priority: Major > > Current typescript support is only work for browser, and generated d.ts uses > internal module. > So, it's hard to use for typescript in node.js. > To solve probrem, I make a pull request that generate typescript code > directory. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16695778#comment-16695778 ] ASF GitHub Bot commented on THRIFT-3143: mustafa-cosar commented on issue #1630: THRIFT-3143: Add nodets support URL: https://github.com/apache/thrift/pull/1630#issuecomment-440996256 One of the tests failed because of a lisp test. Not related to my changes. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > add typescript directory support > > > Key: THRIFT-3143 > URL: https://issues.apache.org/jira/browse/THRIFT-3143 > Project: Thrift > Issue Type: New Feature > Components: Node.js - Compiler >Reporter: Kazuki Yasufuku >Priority: Major > > Current typescript support is only work for browser, and generated d.ts uses > internal module. > So, it's hard to use for typescript in node.js. > To solve probrem, I make a pull request that generate typescript code > directory. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16693800#comment-16693800 ] ASF GitHub Bot commented on THRIFT-3143: jeking3 commented on a change in pull request #1630: THRIFT-3143: Add nodets support URL: https://github.com/apache/thrift/pull/1630#discussion_r235175049 ## File path: compiler/cpp/src/thrift/generate/t_js_generator.cc ## @@ -302,11 +298,11 @@ class t_js_generator : public t_oop_generator { string ts_declare() { return (ts_module_.empty() ? "declare " : ""); } /** - * Returns "?" if the given field is optional. + * Returns "?" if the given field is optional or has a default value. * @param t_field The field to check * @return string */ - string ts_get_req(t_field* field) { return (field->get_req() == t_field::T_OPTIONAL ? "?" : ""); } + string ts_get_req(t_field* field) {return (field->get_req() == t_field::T_OPTIONAL || field->get_value() != nullptr ? "?" : ""); } Review comment: This is still a C++03 compatible project and you have at least one C++11 concept in one of the files. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > add typescript directory support > > > Key: THRIFT-3143 > URL: https://issues.apache.org/jira/browse/THRIFT-3143 > Project: Thrift > Issue Type: New Feature > Components: Node.js - Compiler >Reporter: Kazuki Yasufuku >Priority: Major > > Current typescript support is only work for browser, and generated d.ts uses > internal module. > So, it's hard to use for typescript in node.js. > To solve probrem, I make a pull request that generate typescript code > directory. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16693174#comment-16693174 ] ASF GitHub Bot commented on THRIFT-3143: mustafa-cosar opened a new pull request #1630: THRIFT-3143: Add nodets support URL: https://github.com/apache/thrift/pull/1630 These changes should be backwards compatible since it only adds new functionality and doesn't touch existing functionality. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org > add typescript directory support > > > Key: THRIFT-3143 > URL: https://issues.apache.org/jira/browse/THRIFT-3143 > Project: Thrift > Issue Type: New Feature > Components: Node.js - Compiler >Reporter: Kazuki Yasufuku >Priority: Major > > Current typescript support is only work for browser, and generated d.ts uses > internal module. > So, it's hard to use for typescript in node.js. > To solve probrem, I make a pull request that generate typescript code > directory. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16689985#comment-16689985 ] Buğra Gedik commented on THRIFT-3143: - Thanks, we'll get it ready soon. > add typescript directory support > > > Key: THRIFT-3143 > URL: https://issues.apache.org/jira/browse/THRIFT-3143 > Project: Thrift > Issue Type: New Feature > Components: Node.js - Compiler >Reporter: Kazuki Yasufuku >Priority: Major > > Current typescript support is only work for browser, and generated d.ts uses > internal module. > So, it's hard to use for typescript in node.js. > To solve probrem, I make a pull request that generate typescript code > directory. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16689951#comment-16689951 ] James E. King III commented on THRIFT-3143: --- 0.12.0 started a month ago, but never finished. We'll likely "try again" sometime soon. I don't set the Fix Version until it is merged. > add typescript directory support > > > Key: THRIFT-3143 > URL: https://issues.apache.org/jira/browse/THRIFT-3143 > Project: Thrift > Issue Type: New Feature > Components: Node.js - Compiler >Reporter: Kazuki Yasufuku >Priority: Major > > Current typescript support is only work for browser, and generated d.ts uses > internal module. > So, it's hard to use for typescript in node.js. > To solve probrem, I make a pull request that generate typescript code > directory. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16689942#comment-16689942 ] Buğra Gedik commented on THRIFT-3143: - [~jking3] Can we set the fix Version/s to {{0.12.0}}? > add typescript directory support > > > Key: THRIFT-3143 > URL: https://issues.apache.org/jira/browse/THRIFT-3143 > Project: Thrift > Issue Type: New Feature > Components: Node.js - Compiler >Reporter: Kazuki Yasufuku >Priority: Major > > Current typescript support is only work for browser, and generated d.ts uses > internal module. > So, it's hard to use for typescript in node.js. > To solve probrem, I make a pull request that generate typescript code > directory. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16683082#comment-16683082 ] Buğra Gedik commented on THRIFT-3143: - [~jking3] We are working on this. Is there a Thrift release expected sometime soon? If so, we would hurry up a little bit to get this in. > add typescript directory support > > > Key: THRIFT-3143 > URL: https://issues.apache.org/jira/browse/THRIFT-3143 > Project: Thrift > Issue Type: New Feature > Components: Node.js - Compiler >Reporter: Kazuki Yasufuku >Priority: Major > > Current typescript support is only work for browser, and generated d.ts uses > internal module. > So, it's hard to use for typescript in node.js. > To solve probrem, I make a pull request that generate typescript code > directory. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16647860#comment-16647860 ] James E. King III commented on THRIFT-3143: --- The comments from [~jensg] support going in that direction. I don't know of any other plans. > add typescript directory support > > > Key: THRIFT-3143 > URL: https://issues.apache.org/jira/browse/THRIFT-3143 > Project: Thrift > Issue Type: New Feature > Components: Node.js - Compiler >Reporter: Kazuki Yasufuku >Priority: Major > > Current typescript support is only work for browser, and generated d.ts uses > internal module. > So, it's hard to use for typescript in node.js. > To solve probrem, I make a pull request that generate typescript code > directory. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16647042#comment-16647042 ] Buğra Gedik commented on THRIFT-3143: - Hey [~jking3], as Unscrambl we are planning to revive this and support the -gen js:node,ts option (JS code targeted at node.js, with TS type mappings) given that the following are already supported: -gen js (JS code for browsers), -gen js:ts (JS code for browsers with TS type mappings), and -gen js:node (JS code for node.js). The existing PR mentioned here attempted to create a separate code generator, which seems wrong. It seems it was abandoned. I assume you'll be open to this. Are there any other plans for supporting JS code generation for node.js with TS type mappings? > add typescript directory support > > > Key: THRIFT-3143 > URL: https://issues.apache.org/jira/browse/THRIFT-3143 > Project: Thrift > Issue Type: New Feature > Components: Node.js - Compiler >Reporter: Kazuki Yasufuku >Priority: Major > > Current typescript support is only work for browser, and generated d.ts uses > internal module. > So, it's hard to use for typescript in node.js. > To solve probrem, I make a pull request that generate typescript code > directory. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16336685#comment-16336685 ] ASF GitHub Bot commented on THRIFT-3143: Github user asfgit closed the pull request at: https://github.com/apache/thrift/pull/488 > add typescript directory support > > > Key: THRIFT-3143 > URL: https://issues.apache.org/jira/browse/THRIFT-3143 > Project: Thrift > Issue Type: New Feature > Components: Node.js - Compiler >Reporter: Kazuki Yasufuku >Priority: Major > > Current typescript support is only work for browser, and generated d.ts uses > internal module. > So, it's hard to use for typescript in node.js. > To solve probrem, I make a pull request that generate typescript code > directory. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16336665#comment-16336665 ] ASF GitHub Bot commented on THRIFT-3143: Github user jeking3 commented on the issue: https://github.com/apache/thrift/pull/488 This pull request is being closed due to lack of activity. You can re-open it after rebasing on the current master if you would like it to be reconsidered. > add typescript directory support > > > Key: THRIFT-3143 > URL: https://issues.apache.org/jira/browse/THRIFT-3143 > Project: Thrift > Issue Type: New Feature > Components: Node.js - Compiler >Reporter: Kazuki Yasufuku >Priority: Major > > Current typescript support is only work for browser, and generated d.ts uses > internal module. > So, it's hard to use for typescript in node.js. > To solve probrem, I make a pull request that generate typescript code > directory. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15963731#comment-15963731 ] ASF GitHub Bot commented on THRIFT-3143: Github user jeking3 commented on the issue: https://github.com/apache/thrift/pull/488 I'd recommend that you rebase your changes on the latest origin/master and push to make sure they are compatible with the development tip and pass all tests. > add typescript directory support > > > Key: THRIFT-3143 > URL: https://issues.apache.org/jira/browse/THRIFT-3143 > Project: Thrift > Issue Type: New Feature > Components: Node.js - Compiler >Reporter: Kazuki Yasufuku > > Current typescript support is only work for browser, and generated d.ts uses > internal module. > So, it's hard to use for typescript in node.js. > To solve probrem, I make a pull request that generate typescript code > directory. -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15375840#comment-15375840 ] ASF GitHub Bot commented on THRIFT-3143: Github user estk commented on the issue: https://github.com/apache/thrift/pull/488 Bump. Is anyone working on this? > add typescript directory support > > > Key: THRIFT-3143 > URL: https://issues.apache.org/jira/browse/THRIFT-3143 > Project: Thrift > Issue Type: New Feature > Components: Node.js - Compiler >Reporter: Kazuki Yasufuku > > Current typescript support is only work for browser, and generated d.ts uses > internal module. > So, it's hard to use for typescript in node.js. > To solve probrem, I make a pull request that generate typescript code > directory. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15335044#comment-15335044 ] ASF GitHub Bot commented on THRIFT-3143: Github user jeking3 commented on the issue: https://github.com/apache/thrift/pull/488 I'd recommend that you rebase your changes on the latest origin/master and push to make sure they are compatible with the development tip and pass all tests. > add typescript directory support > > > Key: THRIFT-3143 > URL: https://issues.apache.org/jira/browse/THRIFT-3143 > Project: Thrift > Issue Type: New Feature > Components: Node.js - Compiler >Reporter: Kazuki Yasufuku > > Current typescript support is only work for browser, and generated d.ts uses > internal module. > So, it's hard to use for typescript in node.js. > To solve probrem, I make a pull request that generate typescript code > directory. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15333154#comment-15333154 ] ASF GitHub Bot commented on THRIFT-3143: Github user HIRANO-Satoshi commented on the issue: https://github.com/apache/thrift/pull/488 Does anyone merge it? I think I need this. > add typescript directory support > > > Key: THRIFT-3143 > URL: https://issues.apache.org/jira/browse/THRIFT-3143 > Project: Thrift > Issue Type: New Feature > Components: Node.js - Compiler >Reporter: Kazuki Yasufuku > > Current typescript support is only work for browser, and generated d.ts uses > internal module. > So, it's hard to use for typescript in node.js. > To solve probrem, I make a pull request that generate typescript code > directory. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15324594#comment-15324594 ] ASF GitHub Bot commented on THRIFT-3143: Github user endel commented on the issue: https://github.com/apache/thrift/pull/488 My approach is not very clean as it simply ignores node.js existance, it is meant only to run in the browser: https://github.com/endel/thrift/commit/32357443b5bfb5663ef3c45036c1680c08d04953 > add typescript directory support > > > Key: THRIFT-3143 > URL: https://issues.apache.org/jira/browse/THRIFT-3143 > Project: Thrift > Issue Type: New Feature > Components: Node.js - Compiler >Reporter: Kazuki Yasufuku > > Current typescript support is only work for browser, and generated d.ts uses > internal module. > So, it's hard to use for typescript in node.js. > To solve probrem, I make a pull request that generate typescript code > directory. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15324557#comment-15324557 ] ASF GitHub Bot commented on THRIFT-3143: Github user endel commented on the issue: https://github.com/apache/thrift/pull/488 Thanks for your work @wilfrem. I think this pull-request should be reviewed and maybe accepted, since JavaScript is evolving so fast - which makes the current JavaScript/Node generators unusable in modern build tools for the browser, for example. Having a TypeScript generator could solve this problem. I did some changes in the `import` section, which seems to be broken in the current version. Here's the patch to import the actual references needed: ```patch diff --git a/compiler/cpp/src/generate/t_ts_generator.cc b/compiler/cpp/src/generate/t_ts_generator.cc index 2100f7f..44fbeb5 100644 --- a/compiler/cpp/src/generate/t_ts_generator.cc +++ b/compiler/cpp/src/generate/t_ts_generator.cc @@ -343,9 +341,36 @@ string t_ts_generator::render_includes() { if (gen_node_) { const vector& includes = program_->get_includes(); for (size_t i = 0; i < includes.size(); ++i) { - result += "import " + includes[i]->get_name() + "_ttypes = require('./" + includes[i]->get_name() -+ "_types')\n"; + + // Import all exposed enums/structs/types from defined module + std::vector imports; + + const std::vector & typedefs = includes[i]->get_typedefs(); + for (size_t j = 0; j < typedefs.size(); ++j) { +imports.push_back(typedefs[j]->get_type()->get_name()); + } + + const std::vector & enums = includes[i]->get_enums(); + for (size_t j = 0; j < enums.size(); ++j) { +imports.push_back(enums[j]->get_name()); + } + + const std::vector & structs = includes[i]->get_structs(); + for (size_t j = 0; j < structs.size(); ++j) { +imports.push_back(structs[j]->get_name()); + } + + std::stringstream modules; + for(size_t j = 0; j < imports.size(); ++j) + { +if(j != 0) + modules << ", "; +modules << imports[j]; + } + + result += "import { " + modules.str() + " } from './" + includes[i]->get_name() + ".ts'\n"; } + if (includes.size() > 0) { result += "\n"; } ``` > add typescript directory support > > > Key: THRIFT-3143 > URL: https://issues.apache.org/jira/browse/THRIFT-3143 > Project: Thrift > Issue Type: New Feature > Components: Node.js - Compiler >Reporter: Kazuki Yasufuku > > Current typescript support is only work for browser, and generated d.ts uses > internal module. > So, it's hard to use for typescript in node.js. > To solve probrem, I make a pull request that generate typescript code > directory. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15143548#comment-15143548 ] ASF GitHub Bot commented on THRIFT-3143: Github user LoungeFlyZ commented on the pull request: https://github.com/apache/thrift/pull/488#issuecomment-183066967 This would be great to get in. Is anyone able to take a look at it? > add typescript directory support > > > Key: THRIFT-3143 > URL: https://issues.apache.org/jira/browse/THRIFT-3143 > Project: Thrift > Issue Type: New Feature > Components: Node.js - Compiler >Reporter: Kazuki Yasufuku > > Current typescript support is only work for browser, and generated d.ts uses > internal module. > So, it's hard to use for typescript in node.js. > To solve probrem, I make a pull request that generate typescript code > directory. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14624033#comment-14624033 ] Kaspar Fenner commented on THRIFT-3143: --- Current compiler doesn't support TypeScript code generation for Node.js: {code} if (!gen_node_) { iter = parsed_options.find(ts); gen_ts_ = (iter != parsed_options.end()); } else { gen_ts_ = false; } {code} I think, having separate generators for this is not a good thing, as it is basically still the same language, and if there is an issue, we'd have to fix it in two locations. We already have a general issue here with the JS and Node.js libraries which have two different implementations. That means we need also two different TypeScript.d.ts definition files. I think that could get quite confusing, especially if you want to use NodeJS on the backend and the browser JS on the frontend, all in the same project. My hope is that we can somehow bring these two JS use cases (frontend/backend) together and need only one implementation of the library and code generator. Maybe browserify is really the way to go. But I don't know if it can solve all the issues. What do you think, [~wilfrem] - you said that extending the JavaScript generator to generate TypeScript for Node.js could be quite complex? I thought, the differences should be minimal for the .d.ts files. I even thought that the Node.js / JS difference is only the module/namespace definition. Maybe we need to add options for CommonJS and AMD like the TypeScript compiler has. And what about the ES6 module format, do we need to support that too? I guess this needs some proper investigation. add typescript directory support Key: THRIFT-3143 URL: https://issues.apache.org/jira/browse/THRIFT-3143 Project: Thrift Issue Type: New Feature Components: Node.js - Compiler Reporter: Kazuki Yasufuku Current typescript support is only work for browser, and generated d.ts uses internal module. So, it's hard to use for typescript in node.js. To solve probrem, I make a pull request that generate typescript code directory. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14543741#comment-14543741 ] Kazuki Yasufuku commented on THRIFT-3143: - --gen js:ts generate Typescript definition files for browser. not for node.js compatible. I want to use thrift in server-side typescript with node.js, so I make this patch. I think if I make a patch that able to --gen js:ts:node, javascript codebase become more complex. And it is easier to create typescript codebase than add js:ts:node (and can also support js:ts:jquery). add typescript directory support Key: THRIFT-3143 URL: https://issues.apache.org/jira/browse/THRIFT-3143 Project: Thrift Issue Type: New Feature Components: Node.js - Compiler Reporter: Kazuki Yasufuku Current typescript support is only work for browser, and generated d.ts uses internal module. So, it's hard to use for typescript in node.js. To solve probrem, I make a pull request that generate typescript code directory. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14543613#comment-14543613 ] Jens Geyer commented on THRIFT-3143: Try it. {{thrift --help}} gives you: {code} js (Javascript): jquery: Generate jQuery compatible code. node:Generate node.js compatible code. ts: Generate TypeScript definition files. {code} add typescript directory support Key: THRIFT-3143 URL: https://issues.apache.org/jira/browse/THRIFT-3143 Project: Thrift Issue Type: New Feature Components: Node.js - Compiler Reporter: Kazuki Yasufuku Current typescript support is only work for browser, and generated d.ts uses internal module. So, it's hard to use for typescript in node.js. To solve probrem, I make a pull request that generate typescript code directory. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14543614#comment-14543614 ] Jens Geyer commented on THRIFT-3143: Try it. {{thrift --help}} gives you: {code} js (Javascript): jquery: Generate jQuery compatible code. node:Generate node.js compatible code. ts: Generate TypeScript definition files. {code} add typescript directory support Key: THRIFT-3143 URL: https://issues.apache.org/jira/browse/THRIFT-3143 Project: Thrift Issue Type: New Feature Components: Node.js - Compiler Reporter: Kazuki Yasufuku Current typescript support is only work for browser, and generated d.ts uses internal module. So, it's hard to use for typescript in node.js. To solve probrem, I make a pull request that generate typescript code directory. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14543617#comment-14543617 ] Jens Geyer commented on THRIFT-3143: Try it. {{thrift --help}} gives you: {code} js (Javascript): jquery: Generate jQuery compatible code. node:Generate node.js compatible code. ts: Generate TypeScript definition files. {code} add typescript directory support Key: THRIFT-3143 URL: https://issues.apache.org/jira/browse/THRIFT-3143 Project: Thrift Issue Type: New Feature Components: Node.js - Compiler Reporter: Kazuki Yasufuku Current typescript support is only work for browser, and generated d.ts uses internal module. So, it's hard to use for typescript in node.js. To solve probrem, I make a pull request that generate typescript code directory. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14543616#comment-14543616 ] Jens Geyer commented on THRIFT-3143: Try it. {{thrift --help}} gives you: {code} js (Javascript): jquery: Generate jQuery compatible code. node:Generate node.js compatible code. ts: Generate TypeScript definition files. {code} add typescript directory support Key: THRIFT-3143 URL: https://issues.apache.org/jira/browse/THRIFT-3143 Project: Thrift Issue Type: New Feature Components: Node.js - Compiler Reporter: Kazuki Yasufuku Current typescript support is only work for browser, and generated d.ts uses internal module. So, it's hard to use for typescript in node.js. To solve probrem, I make a pull request that generate typescript code directory. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14543755#comment-14543755 ] Jens Geyer commented on THRIFT-3143: Maybe it#s only the syntax: it is {{-gen js:ts,node}} not {{-gen js:ts:node}} add typescript directory support Key: THRIFT-3143 URL: https://issues.apache.org/jira/browse/THRIFT-3143 Project: Thrift Issue Type: New Feature Components: Node.js - Compiler Reporter: Kazuki Yasufuku Current typescript support is only work for browser, and generated d.ts uses internal module. So, it's hard to use for typescript in node.js. To solve probrem, I make a pull request that generate typescript code directory. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14543861#comment-14543861 ] Kazuki Yasufuku commented on THRIFT-3143: - current thrift(0.9.2) --gen js:ts,node option generate only node.js, not generate typescript code and d.ts. (--gen js:ts:node generate only js code for browser at current version 0.9.2) add typescript directory support Key: THRIFT-3143 URL: https://issues.apache.org/jira/browse/THRIFT-3143 Project: Thrift Issue Type: New Feature Components: Node.js - Compiler Reporter: Kazuki Yasufuku Current typescript support is only work for browser, and generated d.ts uses internal module. So, it's hard to use for typescript in node.js. To solve probrem, I make a pull request that generate typescript code directory. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14543495#comment-14543495 ] Kazuki Yasufuku commented on THRIFT-3143: - Does that mean that t_js_generator.cc generate also typescript code(not d.ts)? add typescript directory support Key: THRIFT-3143 URL: https://issues.apache.org/jira/browse/THRIFT-3143 Project: Thrift Issue Type: New Feature Components: Node.js - Compiler Reporter: Kazuki Yasufuku Current typescript support is only work for browser, and generated d.ts uses internal module. So, it's hard to use for typescript in node.js. To solve probrem, I make a pull request that generate typescript code directory. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14541839#comment-14541839 ] Roger Meier commented on THRIFT-3143: - Is copying really necessary? I would like to have a combined javascript codebase, especially for maintenance reasons. add typescript directory support Key: THRIFT-3143 URL: https://issues.apache.org/jira/browse/THRIFT-3143 Project: Thrift Issue Type: New Feature Components: Node.js - Compiler Reporter: Kazuki Yasufuku Current typescript support is only work for browser, and generated d.ts uses internal module. So, it's hard to use for typescript in node.js. To solve probrem, I make a pull request that generate typescript code directory. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (THRIFT-3143) add typescript directory support
[ https://issues.apache.org/jira/browse/THRIFT-3143?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14537894#comment-14537894 ] ASF GitHub Bot commented on THRIFT-3143: GitHub user wilfrem opened a pull request: https://github.com/apache/thrift/pull/488 THRIFT-3143 Current typescript support is only work for browser, and generated d.ts uses internal module. So, it's hard to use for typescript in node.js. To solve probrem, generate typescript code directory. You can merge this pull request into a Git repository by running: $ git pull https://github.com/wilfrem/thrift THRIFT-3143 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/thrift/pull/488.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #488 commit b7d008c7e8bd565850d4bc1be48c77eb1cac19b9 Author: wilfrem wilf...@gmail.com Date: 2015-04-20T10:24:50Z copy from t_js_generator.cc to t_ts_generator.cc and minimal modify for passing build commit 60566e2b54d595731894e13cb6b34dd515dd039f Author: wilfrem wilf...@gmail.com Date: 2015-04-20T11:13:55Z fix enum/const/namespace commit 05971859bd20dd9740a938c230071db6ae0b941b Author: wilfrem wilf...@gmail.com Date: 2015-04-20T13:13:28Z implement struct commit e9f2e5ed079130e306df37c9550744335918f5ef Author: wilfrem wilf...@gmail.com Date: 2015-04-21T07:22:48Z implement all things left commit 7687fbd9f4d4a1eecb368404561cc46c2641e24a Author: wilfrem wilf...@gmail.com Date: 2015-04-22T10:12:20Z fix to pass compile commit ac1ea84d93228b39eca9d4393627b8f783d56d03 Author: wilfrem wilf...@gmail.com Date: 2015-04-22T12:58:05Z bugfix commit bc3537e3d8a91b648308ab741c2156e3db60b2b6 Author: wilfrem wilf...@gmail.com Date: 2015-05-08T05:36:21Z bugfix commit ed7c4a3028cd9897ae9379181f3f2146be0b78f8 Author: wilfrem wilf...@gmail.com Date: 2015-05-08T07:04:45Z bugfix commit 14e5d0740fbf15cf94f1c9c11072bf4be0fde368 Author: wilfrem wilf...@gmail.com Date: 2015-05-11T05:42:22Z bugfix commit 730ff83f75f4123b166d2313e56c27280608fe35 Author: wilfrem wilf...@gmail.com Date: 2015-05-11T09:54:33Z add test for node-typescript add typescript directory support Key: THRIFT-3143 URL: https://issues.apache.org/jira/browse/THRIFT-3143 Project: Thrift Issue Type: New Feature Components: Node.js - Compiler Reporter: Kazuki Yasufuku Current typescript support is only work for browser, and generated d.ts uses internal module. So, it's hard to use for typescript in node.js. To solve probrem, I make a pull request that generate typescript code directory. -- This message was sent by Atlassian JIRA (v6.3.4#6332)