Uploaded image for project: 'Fluid Infusion'
  1. Fluid Infusion
  2. FLUID-4911

Remove requireStub in favor of the default pattern (logical or).

    Details

    • Type: Task
    • Status: Reopened
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 3.0
    • Component/s: Framework
    • Labels:
      None

      Description

      Infusion's Node.js module ships with requireStub.js, which is currently used in the GPII universal repository to enable our tests to run in both Node.js and in the browser. Its purpose is primarily to provide a stubbed version of Node.js's require() function, mapping between module names and global namespace names (e.g. "infusion" -> fluid).

      Colin suggested that it would be simpler to just use the following boilerplate when accessing modules that are designed to work and be tested in both the browser and Node:

      var globalName = globalName || require("moduleName");

      Using this idiom avoids the need for requireStub.js, so it can be removed from Infusion.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              yura Yura Zenevich
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: