Google library API style imports

RESOLVED INVALID

Status

RESOLVED INVALID
8 years ago
4 years ago

People

(Reporter: arky, Unassigned)

Tracking

Details

(Reporter)

Description

8 years ago
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
(Reporter)

Comment 1

8 years ago
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
Last Resolved: 8 years ago
Resolution: --- → INVALID
(Assignee)

Updated

4 years ago
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.