Changes between Initial Version and Version 1 of Ticket #14549, comment 1
- Timestamp:
- Nov 15, 2013, 12:38:22 PM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #14549, comment 1
initial v1 1 The reasoning behind the factory is here: http://bugs.jquery.com/ticket/13768. Originally, we were focusing on using jQuery in node, rather than with CommonJS in the browser. Simply requiring jQuery in Node would throw an error if there was not a _global_ window with a document present. This was subverted with the factory, which allows the user to create a window (with jsdom or the like) and then pass it into the factory to make everything work without having to havean obtrusive global window object.1 The reasoning behind the factory is here: http://bugs.jquery.com/ticket/13768. Originally, we were focusing on using jQuery in node, rather than with CommonJS in the browser. Simply requiring jQuery in Node would throw an error if there was not a _global_ window with a document present. This was subverted with the factory, which allows the user to create a window (with jsdom or the like) and then pass it into the factory to make everything work without the need for an obtrusive global window object. 2 2 3 Nonetheless, as I was saying in IRC, I think requir ejQuery with CommonJS in the browser will be our more common use case, thanks to browserify. I agree that if a global window is already present, we should execute the factory immediately. This would not interfere with the Node use cases.3 Nonetheless, as I was saying in IRC, I think requiring jQuery with CommonJS in the browser will be our more common use case, thanks to browserify. I agree that if a global window is already present, we should execute the factory immediately. This would not interfere with the Node use cases.