#13119 closed bug (fixed)
Make jQuery releases available via npm
Reported by: | Rick Waldron | Owned by: | Timmy Willison |
---|---|---|---|
Priority: | high | Milestone: | 2.1 |
Component: | build | Version: | 2.0.3 |
Keywords: | Cc: | isaacs | |
Blocked by: | Blocking: |
Description
Recently, Domenic Denicola expressed a need for npm to offer "just jQuery", this due to all the existing jQuery-related packages are jQuery plus something else, which is useless if you want to use npm for client libs as well (which is a valuable use case)
Isaac Schlueter has reached out to the "jquery" and "jQuery" package owners to see if any are willing to give us the name to release jQuery on npm.
TODO:
- Update
window.jQuery = window.$ = jQuery;
to conditionally export tomodule.exports
orwindow
as needed. - Change the reference to
window
(in #1) to a safe global object reference. - Update jQuery Core Release Management to include an
npm publish
Change History (24)
comment:1 Changed 11 years ago by
Owner: | set to Rick Waldron |
---|---|
Status: | new → assigned |
comment:2 Changed 11 years ago by
Cc: | isaacs added |
---|---|
Milestone: | None → 1.9 |
comment:3 Changed 11 years ago by
Agreed on the utility. We need some unit tests or other insurance against inadvertent regressions.
comment:4 follow-up: 7 Changed 11 years ago by
The current PR will break if there is some other object called module with an exports property. This gist illustrates a bulletproof "node detector": https://gist.github.com/3906504
comment:5 Changed 11 years ago by
Component: | unfiled → build |
---|---|
Milestone: | 1.9 → 2.0 |
Priority: | undecided → high |
comment:6 Changed 11 years ago by
Is there a good reason to not expose jQuery/$ as a global when an AMD loader is present like the current PR does? That's a breaking change FWIW.
For comparison, other AMD compatible utilities like Lodash, Hogan.js, and the Backbone/Underscore AMD versions maintained by jrburke still create a global even in the presence of an AMD loader.
comment:7 Changed 11 years ago by
Replying to rwaldron:
The current PR will break if there is some other object called module with an exports property. This gist illustrates a bulletproof "node detector": https://gist.github.com/3906504
Wouldn't this also apply if 'define' is previously defined ? Given that both AMD and CommonJS export type (including nodejs' quirky one) are well defined standards, it seems fair to support both equally and to require other other coding paradigms to stay clear of those standard, doesn't it ?
Regarding the node detector, while it might be a nice solution it does look a little hacky and too node.js specific. What about other commonjs like implementations ?
comment:12 Changed 10 years ago by
Milestone: | 2.0 → 2.next |
---|
comment:13 Changed 10 years ago by
Milestone: | 2.next → 1.11/2.1 |
---|
It was decided we want that for jQuery 2.1.
comment:14 Changed 10 years ago by
Milestone: | 1.11/2.1 → 2.1 |
---|
comment:15 Changed 10 years ago by
Blocked by: | 14451 added |
---|
comment:17 Changed 10 years ago by
Should we unpublish https://npmjs.org/package/jQuery? It introduces additional noise and confuses users.
What do you think, isaacs?
comment:18 Changed 10 years ago by
jQuery 2.1.0-beta2 has been published to npm. \o/
Please, test & report issues with the package, if any.
comment:19 Changed 10 years ago by
Owner: | changed from Rick Waldron to Timmy Willison |
---|
Assigning to myself as a reminder to follow up concerning the "jQuery" repo.
comment:21 Changed 10 years ago by
Replying to anonymous:
any news?
This is done: https://npmjs.org/package/jquery
Please, test if you're interested so that we can see if everything is OK *before* releasing the final version.
comment:22 Changed 10 years ago by
Blocked by: | 14451 removed |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Version: | git → 2.0.3 |
Closing as no more work need be done to ensure the final release goes on NPM.
comment:23 follow-up: 24 Changed 10 years ago by
The packaged version does not work in the browser. I receive the following error:
ReferenceError: module is not defined module.exports = create('undefined' === typeof window ? undefined : window);
My expectation: jquery installed via npm should be easy to reference from a web page.
A UMD wrapper might be a technically sound way of solving this.
comment:24 Changed 10 years ago by
Replying to christoph.burgmer@…:
The packaged version does not work in the browser. I receive the following error:
ReferenceError: module is not defined module.exports = create('undefined' === typeof window ? undefined : window);
My expectation: jquery installed via npm should be easy to reference from a web page.
We need more information about the problem, that doesn't say much... Specifically: how are you installing jQuery, how do you include it in a web page, how do you refer to it, what tools do you use to manage jQuery etc.
PR submitted by Isaac Schlueter https://github.com/jquery/jquery/pull/1103