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

Javascript episodic code generation

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.12.0
    • 0.13.0
    • Node.js - Compiler
    • None

    Description

      We can generate code without `-recurse` flag but the imports are not structured in a way to support episodic code generation, i.e., generated code imports the required modules from the current directory.

      We can specify a node module path during compilation to use so we can import the modules that are generated from an included .thrift file from that module.

      Example:

      `A.thrift` has struct `A`

      `B.thrift` includes `A.thrift` and uses struct `A`

      `A.thrift` is compiled separately and packaged into `packageA`

      When we compile `B.thrift` we specify path/to/packageA

      `B_types.js` has the following import:

          `var A = require("packageA/A_types");`

      Attachments

        Issue Links

          Activity

            People

              jking3 James E. King III
              mustafa-cosar Mustafa Şenol Coşar
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m