-
Notifications
You must be signed in to change notification settings - Fork 18
global breaks flickr.com #20
Comments
The referenced code - https://github.com/moment/moment/blob/94ad539f965689289af54b6493abca0a65ab4ce6/moment.js#L15 - should work identically with Is that what Flickr is doing? If so, lots of things might be broken by their build process :-/ |
In that case, moment should not be wrapping YUI, since that would break in node. I realize this doesn't change the web compatibility issue - but it does highlight the incorrect assumptions that were made when wrapping @evilpie are there any other reports? I feel like we should be able to evangelize to Yahoo and get them to update Flickr, and similarly, update |
The |
Given that, it sounds like we just need to get Flickr/Yahoo to update the version of |
Unless I'm misreading the code (entirely possible), #20 (comment) looks wrong to me. Flickr's moment.js code is identical to that on trunk, and that's been on trunk since moment/moment@1601cb1 two years ago. The seeming difference between
and
is purely the result of minifying: applying de Morgan's Laws, removing parentheses that aren't necessary by language precedence order, and trimming strict-equality operators to loose equality when both operands always have the same type. The issue here is purely that Flickr is embedding moment.js code, that uses |
@jswalden thanks, I think your conclusion is correct. |
Another example has popped up in Firefox: bug 1326032 |
This is all very sad. Sounds like we can't go with the name |
Also, JIRA, in https://bugzilla.mozilla.org/show_bug.cgi?id=1328218 (due to moment.js). |
I should mention we removed |
@evilpie : I agree with https://bugzilla.mozilla.org/show_bug.cgi?id=1317422#c18 |
I don't think so. Consider two scripts included in HTML, they can have different strictness, but they still have the same global object, with the "global" on it. |
We might be able to add it in Modules, but adding it in strict mode wouldn't work - you may forget that a Script can have |
You are misreading the code. Those lines are not at all there in trunk, i.e., in https://github.com/moment/moment/blob/master/moment.js They're there in version 2.0.9 which was tagged 2015-01-02, but were removed when version 2.10.2 which was tagged 2015-04-09, introduced a UMD wrapper. So yes; this would be resolved by Yahoo/Flickr/etc. updating their codebase. |
@ljharb Modules have the same global object as non-modules. You'd add this in the global lexical tier? That would be a new one. Is there anything else we might want to add this way? Adding it only in modules would give this feature significantly diminished utility as well. What if we named this 'self'? Have we seen evidence that that would break the Node world? |
I can try to add Edit: |
I won't be actually pursuing "add it only in Modules", I agree the utility would be greatly reduced. The proper solution here is either to come up with a web-compatible top-level name that has "global" in it ("self" is a terrible name), or to namespace it under a new or existing web-compatible top-level name. |
It looks like we have reason to introduce |
If we want to avoid a namespace my suggestion is to pursue something not perfect but less likely to break web compat as |
|
@targos it looked like the CIGTM run failed a bunch of the jobs? |
@leobalter |
FYI Safari Technology Preview 21 was just released and it features support for the |
@kdzwinel can you comment on the firefox bug related to jira? It should be broken in both places if this is indeed the cause. |
And backed out: https://bugs.webkit.org/show_bug.cgi?id=166915 |
(Turns out it requires a newer Jira version to get the failure) |
@sag1v there’s precedent for |
A few more ideas, which have their own pros and cons:
|
@svdb0 at this point, it needs to be a global variable - it can't be something applicable to any object - double underscores aren't what i'd call "aesthetically pleasing" - a metaproperty or keyword wouldn't be replaceable by secure realm tools like caja, so it has to be an identifier. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
To me, And people already using The biggest problem so far is -- there are many people still using So I believe the only thing we need to do is making FAQIsn't
|
Since |
|
@sffc "the global" is a noun too; despite originally being an adjective, like it or not it's been nouned (yes, "noun" has been verbed; and yes, so has "verbed") by the JS community. |
I don't think 'global' is arbitrary as it matches the usage, and means what everyone's been saying since programming was a thing even in other languages. Maybe that's just my opinion. I don't know. Compat is king as well so relevant semantics could be moot. Though the same argument could be made for code base semantics being arbitrary. What about calling the top level 'arch', 'prime', or 'main'? I don't know if those could be considered arbitrary, but they certainly have a ring to them. I like 'arch' in particular which is also a noun, and adjective. Arch variables? A single letter would also be viable like 'g', or 'G', or perhaps 'z' the uncommon letter. 'zoo' would provide some entertainment value, and is an occasionally applicable metaphor. :) Sorry for butting in this late in the game. BTW 'self' seems semantically odd to me. Is 'global' supposed to be scoped to the current frame like 'window'? 'universe' like @sffc suggests sounds nifty. |
|
@ljharb If people like |
@dcgudeman that's not clear; it's the global object/global |
@ljharb That makes sense. So would a name like |
It remains to be seen what will work. Specific suggestions aren't really helpful at this stage, though. |
What is this stage? @ljharb You said
But that was weeks ago. Is that still the current stage? I hope I don't come across as impatient. I'm just interested in the process. |
@hollowdoor There is no public update so far, and by public not even specific information I see shared within TC39. Although, the public agenda already show @ljharb will present something new in the next TC39 meeting, happening at the end of July. https://github.com/tc39/agendas/blob/master/2018/07.md I'm looking forward to it. |
@hollowdoor it’s taken well over a year so far, so “weeks” isn’t much :-) |
Right on. Maybe I'm a little too excited about this particular feature. :) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
..oops forgive my misunderstanding & thanks for the clarification
|
Hey, How about amending the proposal to specifically disable
I'm sure there won't be any downsides to this idea... Edit: This is a joke, please don't do this. |
@demurgos flickr is just the largest case; https://bugzilla.mozilla.org/show_bug.cgi?id=1326032 was on a different site. Individual sites are symptomatic of a larger problem; it can't really be papered over in that way. |
@ljharb |
If people will forgive a bit more off-topic digression, they may enjoy perusing how a suggestion very similar to @demurgos's joke actually made its way into Chrome: https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/dom/events/event_target.cc?l=252&rcl=37b6757f5f82d379b43903728641081141f94217. (And indeed, will likely make its way into web standards.) |
@domenic that seems similar to what I suggested earlier in the thread. @ljharb appears to have some disagreement with the solution linked to, though 😉 |
See bug 1325907 . Just the existence of
global
seems to break flickr.com. This caused by code in the popular moment/moment library.The text was updated successfully, but these errors were encountered: