-
Notifications
You must be signed in to change notification settings - Fork 7
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
2.0.0 #6
2.0.0 #6
Conversation
2a9821f
to
4ef95ad
Compare
}); | ||
}; | ||
|
||
export let interactive = promisify('readystatechange', /r|m/); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know the r|m
regexp bit is a clever minifaction.
However, I've seen regexes go wrong with readyState
so maybe explicit is better.
For example MDN states that there's loading
, interactive
, and complete
,
but I think IE may have others like uninitialized
and loaded
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m fine with that. Would something like /^(interactive|complete)$/
and /^complete$/
be sufficient?
I would hope no-one rejects this polyfill because of the additional 10 gzipped bytes it costs to be explicit. And strangely, /^(complete)$/
costs less.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, yep.
Something like /^(?:interactive|complete)$/
and /^complete$/
would be great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See 99d2ecf
@@ -50,7 +50,7 @@ contentLoaded.then(function () { | |||
}); | |||
``` | |||
|
|||
Developers may also polyfill the proposal at their own risk. | |||
Developers are strongly advised not to assign these promises to `document`, as the standard may still change substantially and such code would be future-incompatible. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@domenic ^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks <3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're dealing in unknowns the bit "would be future-incompatible" should prolly be qualified as "could be future-incompatible".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, "would" is correct in the context of a clause that starts "the standard may still change substantially".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I donno, maybe things could evolve in a compatible way (it's an unknown after all).
Document Promises 2.0.0 would no longer attach properties to the document by default. This would be because no major browsers have yet implemented the behavior, as discussed in #4. Developers may instead import the features individually and use them as they wish.
Which might then be used individually.
Or may be used as polyfills at the developer’s own risk.