[ 
https://issues.apache.org/jira/browse/THRIFT-5554?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Roelof Naude updated THRIFT-5554:
---------------------------------
    Description: 
The generated typescript service file does not include types from included 
definitions.

An example of this is the Service.thrift in the test directory:

 
{code:java}
import { Service } from "./Service_types";


export declare class ServiceClient {
.
.
.
testEpisode(arg: Type1): Type1;
}
{code}
In the above Type1 is not known.

t_js_generator::render_ts_includes performs for nodejs and bails out of not 
generating for nodejs. This created the above issue for the browser based use 
case.

if this test is removed we get the required behavior:
{code:java}
import Types_ttypes = require('./Types_types');
import { Service } from "./Service_types";

export declare class ServiceClient {
.
.
.
testEpisode(arg: Types_ttypes.Type1): Types_ttypes.Type1;
} {code}
The above is most likely not all that is required. Given a sufficient complex 
definition other changes may be required.

 

Not sure if we are just using it wrong?

 

  was:
The generated typescript service file does not include types from included 
definitions.

An example of this is the Service.thrift in the test directory:

 
{code:java}
import { Service } from "./Service_types";


export declare class ServiceClient {
.
.
.
testEpisode(arg: Type1): Type1;
}
{code}
In the above Type1 is not known.

t_js_generator::render_ts_includes performs for nodejs and bails out of not 
generating for nodejs. This created the above issue for the browser based use 
case.

if this test is removed we get the required behavior:
{code:java}
import Types_ttypes = require('./Types_types');
import { Service } from "./Service_types";

export declare class ServiceClient {
.
.
.
testEpisode(arg: Types_ttypes.Type1): Types_ttypes.Type1;
} {code}
Not sure if we are just using it wrong?

 


> Typescript does not import all types
> ------------------------------------
>
>                 Key: THRIFT-5554
>                 URL: https://issues.apache.org/jira/browse/THRIFT-5554
>             Project: Thrift
>          Issue Type: Bug
>          Components: TypeScript - Library
>    Affects Versions: 0.16.0
>            Reporter: Roelof Naude
>            Priority: Major
>
> The generated typescript service file does not include types from included 
> definitions.
> An example of this is the Service.thrift in the test directory:
>  
> {code:java}
> import { Service } from "./Service_types";
> export declare class ServiceClient {
> .
> .
> .
> testEpisode(arg: Type1): Type1;
> }
> {code}
> In the above Type1 is not known.
> t_js_generator::render_ts_includes performs for nodejs and bails out of not 
> generating for nodejs. This created the above issue for the browser based use 
> case.
> if this test is removed we get the required behavior:
> {code:java}
> import Types_ttypes = require('./Types_types');
> import { Service } from "./Service_types";
> export declare class ServiceClient {
> .
> .
> .
> testEpisode(arg: Types_ttypes.Type1): Types_ttypes.Type1;
> } {code}
> The above is most likely not all that is required. Given a sufficient complex 
> definition other changes may be required.
>  
> Not sure if we are just using it wrong?
>  



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to