-
Notifications
You must be signed in to change notification settings - Fork 20.6k
2.1.2-pre, ajax.js: environments that don't have 'location' variable will break #1788
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Comment author: dmethvin Since this is a regression, I'd like to fix it. However, we don't unit test or support jasmine-node so to have any chance to do this we'll need your help. Can you propose a fix as a pull request? |
This is now a regression in a patch-level release, it broke all our headless testing. I see the added milestone |
It shouldn't have been landed in 2.1.2. I'll investigate. |
@denis-sokolov could you write how exactly you are requiring jQuery in your code? |
@denis-sokolov it had been assigned to 3.0 and only a small number of things were pulled back for this 2.1.2 release. We expect 3.0 to be out in a month or two so it's not going to be a long wait. We also need to find a way to test this to prevent regressions, which is the root cause of the problem in the first place. |
Run jQuery in Node, it's simple: var jqueryFactory = require('jquery');
var doc = jsdom.jsdom(html);
var w = doc.parentWindow;
var $ = jqueryFactory(w); |
The best way to be sure this lands is to create a pull request. We do want it to happen. |
@mzgol has stated that you won't release a new patch quite quickly. I understand the release process is complex in a case of a big project like jQuery and I make no judgement on your decision. I want to make sure that you have the full information, however. |
Sorry, I assumed for a while that it's something that we broke in 2.1.1 and just didn't fix in 2.1.2 but now I see it was working correctly in 2.1.1: http://code.jquery.com/jquery-2.1.1.js. It was working a little by accident as in Node with jsdom the @denis-sokolov can you confirm that changing just this one line fixes the problem? |
This is the kind of thing i fear would happen, i think we should start running smoke tests on environments like this, i.e. jsdom, phantom, etc; |
Running the Promises/A+ tests in Node (see e1303a3) will fix this for Node but that's still the future. |
@mzgol, yes, after I changed that line, ran |
Yeah, although this is not an original intentent of it and does not cover other environments |
Agree that we need smoke tests for these environments, that the Promises/A+ tests will help there for node, and that we need to enable JSHint options to disable all but @denis-sokolov there's a lot of work involved in pushing a release including sending it to the CDN providers so I would prefer not to do that all over again. It was a 24-hour process to get here because of various issues with the process, not all of which are fixed and some of which require manual steps. I don't think we have a lot of node users at the moment and you can set your dependency specifically to 2.1.1 for now. Sorry. How exactly are you using jQuery on the node side? |
@dmethvin, I run automated tests and automated measurements on code that in production is run in browsers. I also am preparing to use my environment-agnostic modules to analyze HTML documents in a pure server-side application. |
OK; PR #1949 should serve as a basic smoke-test for non-browser environments; it still requires work, though. |
Originally reported by brianblocker at: http://bugs.jquery.com/ticket/15210
It appears that the change which removes the "IE workaround" on ajax.js now breaks environments that do not have window.location. To be specific:
(from https://github.com/jquery/jquery/blob/master/src/ajax.js#L44) ajaxLocation = location.href,
When I try to run automated tests using jasmine-node, location is undefined (because there is no "browser" sorta), and therefore the test breaks. Using the previous version (2.1.1-pre) works fine, but it appears that the change introduced in 2.1.2-pre now breaks the environment.
Issue reported for jQuery 2.1.1
The text was updated successfully, but these errors were encountered: