Conversation
If jQuery is on the page and has the features debugkit needs, don't download another copy. If jQuery is absent make a blocking XHR request to fetch it and use eval LIKE A BOSS.
|
👍 |
There was a problem hiding this comment.
Think we'll need a better test than my original suggestion
"1.8.0" >= "1.8.1"
false
"1.8.1" >= "1.8.1"
true
"1.9.1" >= "1.8.1"
true
"1.10.0" >= "1.8.1"
false <---
"2.0.0" >= "1.8.1"
true
|
👍 Though as commented the version compare function needs some adjusting. Do we need min and max? Seems a bit risky to only provide a minimum and therefore leave the door open to using an incompatible major version i the future. I'm not sure of the right logic to suggest but e.g. a simple implementation could be like: |
|
Good point about limiting the upper boundary. I'll get that fixed. |
|
I think I have the boundary conditions fixed. |
Also widen the range of accepted versions.
|
I think I got it this time. I apologize about all the mistakes, my brain has been a bit mushy today. |
There was a problem hiding this comment.
since the minimum length of the two variables are used - this looks like it's unreachable
|
LGTM 👍 |
Don't double load jQuery. If the host page has jQuery with a compatible version loaded, don't load a second copy. Only when jQuery is missing, old, or super new will a second copy be loaded.
|
I understand DebugKit needs From And later From that line comment, it seem to be the desired intention, but I suggest You can test it here: |
Not using true only restores $, however userland code will probably also reference jQuery which will be the newer version. Refs #97
|
@bar Thanks for the bin, I added noConflict(true). |
|
You are fast 👍 I was just about to issue the PR :p |
If jQuery is on the page and has the features DebugKit needs, don't download another copy. If jQuery is absent make a blocking XHR request to fetch it and use eval LIKE A BOSS.