-
Notifications
You must be signed in to change notification settings - Fork 76
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
Document style of "support" comments #95
Comments
👍 to documenting that. This is my understanding of current de-facto rules (a little extended) that we could codify on a case by case basis (I'm omitting the
or
(the latter ignores information about version This convention would mean that unless the last version mention is followed by The main drawback of this convention is IMO that This is important for every project so cc @jquery/core @scottgonzalez @arschmitz @jzaefferer. |
BTW, if we don't come up to a concrete conclusion quickly I'd like to merge jquery/jquery#1837 in its current form; it's quite large and I don't want to have to continue to rebase it and solve conflicts with other PRs; it takes time for no reason. |
This shouldn't be a blocker for jquery/jquery#1837 |
@gibson042 comment from jquery/jquery#1837 (comment): I don't know that we've ever established a consensus on this, but I personally see more value in |
Shouldn't this say "up to version n"? Then I'd also always put a space after "Browser', so
I'm fine with replacing " and " with ", ". |
So hold on. Is that last example to support IE with jQuery 1.9? Or IE and
|
In that specific case, I'm not sure. @mikesherov wrote it, so hopefully he knows. It's related to focus and the behavior of We do have other examples of support comments that are more complex than just a browser:
|
It might be better to never allow two "setups" on the same // Support: IE<9
// Support: Opera in jQuery<1.7
// Support: Voiceover on OS X
// Support: JAWS on IE<=9 This would remove any ambiguity in the last example, and we'd know its only support for IE in jQuery <1.9 |
+1 for splitting across multiple support lines. |
I assumed only the information I wrote, i.e. we know the bug is in version There are interesting cases, though, where a bug doesn't exist in Android
This seems weird to me. I treat both parts as arguments to the |
Good idea. |
Yeah, 👍 on having only one setup per line. If there is a further explanatory comment for a specific setup, should each follow in a comment line below? e.g.: (totally made up comments) // Support: IE<9
// Event doesn't bubble properly
// Support: Opera in jQuery<1.7
// Core patch #2421 made this work properly in 1.7 |
@dmethvin: Yeah, definitely above the comment (that would match current |
Ideally, every bug would have a well-known range. In practice, it's not always expedient or even possible to check old versions, but fortunately those are the ones that matter least. So with the goal of documenting the most possible information, I propose the following:
e.g., comments for newly-introduced bugs would start on the bottom row and migrate upwards as new versions of the misbehaving software are released/checked and left when the behavior is ultimately fixed. Comments would not be modified when support is dropped for an old version, unless such rotation obviates the need for a fix entirely. |
It's useful to have this info if we already know the older version shares a bug, though. MS has been fixing IE11 bugs in patch releases so knowing the issue affects e.g. IE9-11 helps to know the workaround will still be needed even if the issue has been fixed in IE11 (which happens; see jquery/jquery#1901). |
As for support code targeting more than one piece of software:
// Support: IE<9
// Tolerate nodeList.length returning elements with id "length"
// Support: Safari<6+
// Tolerate nodeList[ number ] returning elements with id equal to the number (jQuery #14142) |
Agreed, which is one reason why I don't want to change support comments when we abandon old browsers. |
I meant that if we support IE9-11 and we just have I generally don't mind keeping info about unsupported browsers if the hack is still needed, though, if there are concrete reasons in favor of that. What are your reasons? |
But we would know.
|
Where do we stand on this? Have @mzgol and @gibson042 come to an agreement? |
I fear that |
If the bug still exists in some browser at the time the patch lands, we need some way to indicate that it's still a live bug. The |
@dmethvin Yes, I'm not commenting the |
How about:
We then just have to track those It probably highlights a need we'd have for some kind of test page that would reproduce the bugs we have workarounds for. Quite the endeavor though. |
It seems like we just need to be sure that when we review PRs that we make sure if it's an unresolved bug we use a |
So we have the following options with respect to
It's always easy/tempting to skip a |
I'd go for Not that there's anything wrong with that. |
I was really making the case for completeness in order to support (pun pun) the entire life-cycle of a support comment. So, obviously, we need 4 formats:
The important thing is how easy it should be to re-evaluate our support comments as we support more browsers. Let's take two imaginary bugs as an example:
Here is how an imaginary timeline could go and how the support comments would evolve accordingly:
The minutia of the format is non-important to me as long as the format makes it damn easy to understand and maintain the comments. Hope I make some kind of sense. |
In light of new info at jquery/testswarm#308 (comment) we should use |
The changes follow the spec proposed in: jquery/contribute.jquery.org#95 (comment)
The changes follow the spec proposed in: jquery/contribute.jquery.org#95 (comment)
The changes follow the spec proposed in: jquery/contribute.jquery.org#95 (comment)
The changes follow the spec proposed in: jquery/contribute.jquery.org#95 (comment)
The changes follow the spec proposed in: jquery/contribute.jquery.org#95 (comment)
The changes follow the spec proposed in: jquery/contribute.jquery.org#95 (comment)
The changes follow the spec proposed in: jquery/contribute.jquery.org#95 (comment)
The changes follow the spec proposed in: jquery/contribute.jquery.org#95 (comment)
I've been thinking about that and I can't get rid of the feeling that syntax like:
suggests the issue only appears in versions 42 or older. I think it'd be better to not use this form at all and keep:
but at the same time for unclosed ranges use:
What do you think? cc @gibson042 @timmywil @dmethvin @markelog @jbedard |
Works for me. It reads a little strangely when the "plus" version doesn't exist, but remains comprehensible. |
I agree |
Also, update support comments format to match format described in: jquery/contribute.jquery.org#95 (comment) with the change from: jquery/contribute.jquery.org#95 (comment) (open-ended ranges end with `+`). Further size reductions will be achieved when we drop Firefox 60, iOS 10 and pre-Chromium Edge versions. Fixes jquerygh-3950 Fixes jquerygh-4299
Also, update support comments format to match format described in: jquery/contribute.jquery.org#95 (comment) with the change from: jquery/contribute.jquery.org#95 (comment) (open-ended ranges end with `+`). Further size reductions will be achieved when we drop Firefox 60, iOS 10 and pre-Chromium Edge versions. Fixes jquerygh-3950 Fixes jquerygh-4299
Also, update support comments format to match format described in: jquery/contribute.jquery.org#95 (comment) with the change from: jquery/contribute.jquery.org#95 (comment) (open-ended ranges end with `+`). Further size reductions will be achieved when we drop Firefox 60, iOS 10 and pre-Chromium Edge versions. Fixes jquerygh-3950 Fixes jquerygh-4299
Also, update support comments format to match format described in: jquery/contribute.jquery.org#95 (comment) with the change from: jquery/contribute.jquery.org#95 (comment) (open-ended ranges end with `+`). Further size reductions will be achieved when we drop Firefox 60, iOS 10 and pre-Chromium Edge versions. Fixes jquerygh-3950 Fixes jquerygh-4299
Also, update support comments format to match format described in: jquery/contribute.jquery.org#95 (comment) with the change from: jquery/contribute.jquery.org#95 (comment) (open-ended ranges end with `+`). Further size reductions will be achieved when we drop Firefox 60, iOS 10 and pre-Chromium Edge versions. Fixes jquerygh-3950 Fixes jquerygh-4299
Also, update support comments format to match format described in: jquery/contribute.jquery.org#95 (comment) with the change from: jquery/contribute.jquery.org#95 (comment) (open-ended ranges end with `+`). Further size reductions will be achieved when we drop Firefox 60, iOS 10 and pre-Chromium Edge versions. Fixes jquerygh-3950 Fixes jquerygh-4299
Also, update support comments format to match format described in: jquery/contribute.jquery.org#95 (comment) with the change from: jquery/contribute.jquery.org#95 (comment) (open-ended ranges end with `+`). Further size reductions will be achieved when we drop Firefox 60, iOS 10 and pre-Chromium Edge versions. Fixes jquerygh-3950 Fixes jquerygh-4299
…& PhantomJS Also, update support comments format to match format described in: jquery/contribute.jquery.org#95 (comment) with the change from: jquery/contribute.jquery.org#95 (comment) (open-ended ranges end with `+`). Fixes jquerygh-3950 Fixes jquerygh-4299
…& PhantomJS Also, update support comments format to match format described in: jquery/contribute.jquery.org#95 (comment) with the change from: jquery/contribute.jquery.org#95 (comment) (open-ended ranges end with `+`). Fixes gh-3950 Fixes gh-4299 Closes gh-4347
Every time we have a rewrite or drop support for some browser we engage (at least in Core) in discussion of how to properly write those support comments:
We need clear understanding of how to write those comments, so we can leave those discussion behind and focus on code instead of flaming the pull/issue thread with pointless posts.
The text was updated successfully, but these errors were encountered: