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

Yunchi Luo updated THRIFT-3547:
-------------------------------
    Description: 
NodeJS uses file paths rather than namespaces to manage modules. However, the 
Thrift generated code ignores file paths.

I.e. if we have

foo.thrift:
include "../../shared.thrift";

It will turn into

foo_types.js:
var shared_types = require("./shared.thrift");

This forces us to put all generated node code in the same directory. It's 
problematic since if we happen to have

a/foo.thrift
b/foo.thrift

One file will have to overwrite the other...

I'm happy to make a patch for this, but unclear to me how much of a breaking 
change this would be for people, if it is at all.

  was:
NodeJS uses file paths rather than namespaces to manage modules. However, the 
Thrift compiler ignores file paths.

I.e. if we have

foo.thrift:
include "../../shared.thrift";

It will turn into

foo_types.js:
var shared_types = require("./shared.thrift");

This forces us to put all generated node code in the same directory. It's 
problematic since if we happen to have

a/foo.thrift
b/foo.thrift

One file will have to overwrite the other...

I'm happy to make a patch for this, but unclear to me how much of a breaking 
change this would be for people, if it is at all.


> NodeJS generated require() paths should mirror include paths
> ------------------------------------------------------------
>
>                 Key: THRIFT-3547
>                 URL: https://issues.apache.org/jira/browse/THRIFT-3547
>             Project: Thrift
>          Issue Type: Bug
>          Components: Node.js - Compiler
>    Affects Versions: 0.9.3
>            Reporter: Yunchi Luo
>
> NodeJS uses file paths rather than namespaces to manage modules. However, the 
> Thrift generated code ignores file paths.
> I.e. if we have
> foo.thrift:
> include "../../shared.thrift";
> It will turn into
> foo_types.js:
> var shared_types = require("./shared.thrift");
> This forces us to put all generated node code in the same directory. It's 
> problematic since if we happen to have
> a/foo.thrift
> b/foo.thrift
> One file will have to overwrite the other...
> I'm happy to make a patch for this, but unclear to me how much of a breaking 
> change this would be for people, if it is at all.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to