Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-3547

NodeJS generated require() paths should mirror include paths

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 0.9.3
    • None
    • Node.js - Compiler
    • None

    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.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              yunchi Yunchi Luo
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: