-
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
Merged
Merged
2.0.0 #6
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
4ef95ad
2.0.0
jonathantneal 99d2ecf
2.0.0: Use explicit regex
jonathantneal 4db67e0
2.0.0: Advise against assigning promises to the document
jonathantneal ea1cb48
2.0.0: Safely generate the file on prepublish
jonathantneal 9994f65
2.0.0: Clarify discouragement
jonathantneal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
node_modules | ||
npm-debug.log | ||
document-promises.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
# Changes to document-promises | ||
|
||
### 2.0.0 (October 25, 2016) | ||
|
||
- Re-implemented as a ponyfill | ||
|
||
### 1.0.0 (October 20, 2016) | ||
|
||
- Initial version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
let promisify = (type, readyState) => { | ||
return new Promise((resolve) => { | ||
let listener = () => { | ||
if (readyState.test(document.readyState)) { | ||
document.removeEventListener(type, listener); | ||
|
||
resolve(); | ||
} | ||
}; | ||
|
||
document.addEventListener(type, listener); | ||
|
||
listener(); | ||
}); | ||
}; | ||
|
||
export let interactive = promisify('readystatechange', /^(?:interactive|complete)$/); | ||
export let contentLoaded = promisify('DOMContentLoaded', /^(?:interactive|complete)$/); | ||
export let loaded = promisify('readystatechange', /^complete$/); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,50 @@ | ||
{ | ||
"name": "document-promises", | ||
"version": "1.0.0", | ||
"version": "2.0.0", | ||
"description": "Document loading states as Promises", | ||
"author": "Jonathan Neal <[email protected]> (http://jonathantneal.com)", | ||
"license": "CC0-1.0", | ||
"repository": "jonathantneal/document-promises", | ||
"homepage": "https://github.com/jonathantneal/document-promises#readme", | ||
"bugs": "https://github.com/jonathantneal/document-promises/issues", | ||
"main": "document-promises.js", | ||
"jsnext:main": "document-promises.es6", | ||
"files": [ | ||
"document-promises.es6", | ||
"document-promises.js", | ||
"LICENSE.md" | ||
], | ||
"scripts": { | ||
"test": "eslint document-promises.js && jscs document-promises.js" | ||
"build": "babel document-promises.es6 --out-file document-promises.js", | ||
"test": "eslint document-promises.es6 && jscs document-promises.es6" | ||
}, | ||
"engines": { | ||
"node": ">=4.0.0" | ||
}, | ||
"devDependencies": { | ||
"babel-cli": "^6.18.0", | ||
"babel-preset-es2015": "^6.18.0", | ||
"eslint": "^3.8.1", | ||
"eslint-config-10up": "github:jonathantneal/eslint-config-10up", | ||
"jscs": "^3.0.7" | ||
"jscs": "^3.0.7", | ||
"jscs-config-10up": "github:jonathantneal/jscs-config-10up" | ||
}, | ||
"babel": { | ||
"presets": [ | ||
[ | ||
"es2015", { | ||
"loose": true, | ||
"modules": "commonjs" | ||
} | ||
] | ||
] | ||
}, | ||
"eslintConfig": { | ||
"extends": "10up", | ||
"rules": { | ||
"consistent-this": [ | ||
2, | ||
"document" | ||
] | ||
"parserOptions": { | ||
"ecmaVersion": 6, | ||
"impliedStrict": true, | ||
"sourceType": "module" | ||
} | ||
}, | ||
"jscsConfig": { | ||
|
@@ -44,8 +59,5 @@ | |
"interactive", | ||
"state", | ||
"promise" | ||
], | ||
"dependencies": { | ||
"jscs-config-10up": "github:jonathantneal/jscs-config-10up" | ||
} | ||
] | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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).