Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

feat(jQuery): upgrade to jQuery to 2.0 [WIP] #4271

Closed
wants to merge 1 commit into from

Conversation

jankuca
Copy link
Contributor

@jankuca jankuca commented Oct 3, 2013

jQuery 2.0 removes jQuery.cache which prevents the angular-mocks logic to clean up after each test (to remove element data). There are two tests that fail because of this change. One way to fix this might be monkey-patching jQuery#data with a proxy which would keep track of all elements and data that need to be cleaned.

jQuery 2.0 removes `jQuery.cache` which prevents the angular-mocks logic to clean up after each test (to remove element data). There are two tests that fail because of this change. One way to fix this might be monkey-patching `jQuery#data` with a proxy which would keep track of all elements and data that need to be cleaned.
@mary-poppins
Copy link

FYI @jankuca you have nice hair.

@ghost ghost assigned jankuca Oct 3, 2013
@mgol
Copy link
Member

mgol commented Oct 12, 2013

@jankuca Why not just use jQuery.cleanData(jQuery.find('*'))? Am I missing something?

@tbertenshaw
Copy link

Incidentally won't moving to jQuery 2.x remove support for ie8. Reading the 1.3 bog @IgorMinar says ie8 fixes and testing will be stopping, but that existing ie8 code will remain.

@mgol
Copy link
Member

mgol commented Feb 7, 2014

I'd like to take care of that. Since we're dropping IE8 in 1.3, it'd be strange to keep targetting jQuery 1.x.

@tbertenshaw jQuery 2.x & 1.x branches are API-compatible so the switch shouldn't matter a lot. In fact, I'm using Angular 1.2 with jQuery 2.1 and it seems to work fine.

Note that 1.3 won't work correctly in IE8 anyway unless someone steps up to maintain a branch (we haven't seen volunteers so far, though). If the a browser is not tested, the code naturally starts breaking in it in more & more ways.

@tbertenshaw
Copy link

@mzgol (should mention that I'm all for creating a version which doesn't have ie8's legacy, as long as there is still a version with this support as often the choice is out of our hands)

I thought Angular v1.3 was containing existing ie8 workarounds but not spending any time on fixing any new ie8 issues. But I thought jQuery v2.0 didn't work on ie8?.
http://blog.jquery.com/2013/04/18/jquery-2-0-released/

http://blog.angularjs.org/2013/12/angularjs-13-new-release-approaches.html

Just trying to ensure i know what i can/not use and where.

@caitp
Copy link
Contributor

caitp commented Feb 13, 2014

@tbertenshaw, jQuery has been pretty good about keeping up a consistent API, so generally you should be able to use an older version if you need to, or none at all.

@tbertenshaw
Copy link

@caitp ahh think the penny has dropped (sorry i think i missed your point @mzgol)
so you mean angular 1.3 should potentially be able to use a jQuery 1.10.

@mgol
Copy link
Member

mgol commented Feb 13, 2014

Yes, that's what I meant. :) But jQuery 2.x should be our first focus here
considering majority of cases, we should make sure it works fine.

On Thursday, February 13, 2014, tbertenshaw [email protected]
wrote:

@caitp https://github.com/caitp ahh think the penny has dropped (sorry
i think i missed your point @mzgol https://github.com/mzgol)
so you mean angular 1.3 should potentially be able to use a jQuery 1.10.


Reply to this email directly or view it on GitHubhttps://github.com//pull/4271#issuecomment-34981182
.

Michał Gołębiowski

@IgorMinar
Copy link
Contributor

@mzgol can you take ownership of this PR please?

  • rebase it against head
  • update to the latest jquery 2.x
  • get the tests to pass

@IgorMinar
Copy link
Contributor

I'd like to get this in beta-3 or beta-4 if possible. let me know if you think that's doable.

@mgol
Copy link
Member

mgol commented Mar 18, 2014

@IgorMinar I'll look into it once I get back from the short vacation, probably around Monday.

@IgorMinar
Copy link
Contributor

@mzgol sounds good!

@mgol
Copy link
Member

mgol commented Apr 29, 2014

Working on it. First, I need to have #7288 merged and then the patch from this PR is not needed.

@mgol
Copy link
Member

mgol commented Apr 29, 2014

Two test failures on jQuery 2 have nothing to do with not being able to clean up data on gc'd elements but with the .data() being re-implemented in a secure way. One can no longer do tricks like changing the internal node[jQuery.expando] value to one from a different element and hope this will make the data from the other element to be interpreted as from the first one.

I'll try to figure out how to refactor the compile replaceWith function so that this issue is circumvented.

@mgol
Copy link
Member

mgol commented Apr 30, 2014

I'm making Angular jQuery 2-compatible in #7311; please review.

@kevinSuttle
Copy link

Trying to parse all of the threads. Is 1.3.x jQuery 2.x compliant?

@caitp
Copy link
Contributor

caitp commented Jun 10, 2014

Not yet, @kevinSuttle

@kevinSuttle
Copy link

@caitp Thanks. Any idea of timeline, or where that support will be posted when it's announced?

@mgol
Copy link
Member

mgol commented Jun 11, 2014

@kevinSuttle

Any idea of timeline, or where that support will be posted when it's announced?

Short answer: when I find time for it. :) Should be soon & certainly before 1.3.0 is released to provide time for testing.

@mgol mgol changed the title feat(jQuery): upgrade to jQuery 2.0 [WIP] feat(jQuery): upgrade to jQuery to 2.1.1 Jul 30, 2014
@mgol mgol changed the title feat(jQuery): upgrade to jQuery to 2.1.1 feat(jQuery): upgrade to jQuery to 2.x [WIP] Jul 30, 2014
@mgol mgol changed the title feat(jQuery): upgrade to jQuery to 2.x [WIP] feat(jQuery): upgrade to jQuery to 2.0 [WIP] Jul 30, 2014
@mgol
Copy link
Member

mgol commented Jul 30, 2014

Closed in favor of #7311

@mgol mgol closed this Jul 30, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants