Closed Bug 660634 Opened 13 years ago Closed 13 years ago

Google library API style imports

Categories

(addons.mozilla.org Graveyard :: Add-on Builder, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: arky, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
Build Identifier: 

It would be good idea to allow developers to import jquery and other libraries with simple require viz...  

require(jquery, 1.4.x);

Reproducible: Always
Darn! Pressed the wrong button. Not a security bug, just a feature request.
Group: client-services-security
require() statements are specifically for modules that adhere to the CommonJS standard and are of use in the add-on context only. This means that require() doesn't exist in Page Mod code (and other such web content code) that is executed in web pages.

jQuery is a simple DOM DSL and offers little to nothing in the way of JavaScript language enhancement. Additionally, jQuery is not CommonJS compatible, mostly because it does not understand a non-DOM environment. If you wanted something like jQuery that could enhance your add-on code, you could use a framework that enhances the JavaScript language like MooTools. MooTools offers a "Server" build that is Node.js compatible and adheres to the CommonJS standard, you could include that to have some more advanced features within your add-ons context - http://mootools.net/download
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → INVALID
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.