Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-5859] MobileWeb: Implement require() function

GitHub Issuen/a
TypeNew Feature
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2011-12-02T17:54:48.000+0000
Affected Version/sRelease 1.8.0
Fix Version/sSprint 2011-48, Release 1.8.0.1
ComponentsMobileWeb
Labelsstage
ReporterChris Barber
AssigneeChris Barber
Created2011-10-25T10:03:46.000+0000
Updated2017-03-03T22:28:24.000+0000

Description

Need to add support for the require() function. This function will accept a string of the module to load, then synchronously fetches the module, evaluates the module, caches the API, and returns the API.

Attachments

FileDateSize
testmodule.js2011-11-17T14:41:27.000+000051
timob-8589 test.zip2011-11-23T15:13:45.000+00005375

Comments

  1. Chris Barber 2011-11-15

    https://github.com/appcelerator/titanium_mobile/pull/702
  2. Chris Barber 2011-11-17

    Found another bug with evaluating string modules.
  3. Chris Barber 2011-11-17

    Fixed. Pull request: https://github.com/appcelerator/titanium_mobile/pull/729
  4. Chris Barber 2011-11-17

    Added testmodule.js that you simply console.debug(require("testmodule")). It should output an object { a: function() }, but instead outputs function().
  5. Chris Barber 2011-11-23

    Pull request: https://github.com/appcelerator/titanium_mobile/pull/759
  6. Chris Barber 2011-11-23

    Added comprehensive test of require() and Ti.include() including relative paths.
  7. Lee Morris 2017-03-03

    Closing as duplicate.

JSON Source