You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Roelof Naude (Jira)" <ji...@apache.org> on 2022/04/12 09:51:00 UTC

[jira] [Updated] (THRIFT-5554) Typescript does not import all types

     [ 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}
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 perform a node test and bails out if not test. 

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}
> Not sure if we are just using it wrong?
>  



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