-
Notifications
You must be signed in to change notification settings - Fork 96
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
Dropping old IEs #162
Open
naugtur
wants to merge
10
commits into
v3development
Choose a base branch
from
drop-IE8-9
base: v3development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Dropping old IEs #162
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
02352e8
remove all IE89 support I was aware of
naugtur 0e8eb3c
Merge branch 'change-browser-runner' into drop-IE8-9
naugtur d497b58
Merge branch 'v3development' into drop-IE8-9
naugtur ef01e83
remove useless new in front of Error
naugtur ae54268
one browserify dependency should be enough
naugtur 6f825fc
Merge remote-tracking branch 'origin/v3development' into drop-IE8-9
naugtur 3503d45
document differences between v2 and v3
naugtur ed98112
remove support for old IEs mishandling 204 with 1223 http status
naugtur 62495d6
revert methods list to more popular syntax
naugtur bb0ee82
Finnp patch 1 - Handle error events correctly (#164)
naugtur 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Migrating from v2 to v3 | ||
|
||
## JSON body | ||
If you used the `json` option to pass request body, now you need to set `body` to the object you want to send, and `json: true` | ||
|
||
## Old IEs | ||
If you need to support IE8 or IE9, stay on v2. |
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
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 |
---|---|---|
|
@@ -27,16 +27,14 @@ | |
"email": "[email protected]" | ||
}, | ||
"dependencies": { | ||
"browserify": "^13.3.0", | ||
"global": "~4.3.0", | ||
"is-function": "^1.0.1", | ||
"parse-headers": "^2.0.0", | ||
"xtend": "^4.0.0" | ||
}, | ||
"devDependencies": { | ||
"browser-run": "3.5.0", | ||
"browserify": "^13.1.1", | ||
"for-each": "^0.3.2", | ||
"browserify": "^13.3.0", | ||
"pre-commit": "1.2.2", | ||
"tap-spec": "^4.0.2", | ||
"tape": "^4.0.0" | ||
|
Oops, something went wrong.
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.
Why make a string and split instead of just creating an array?
["get","put","post","patch","head","delete"].map()
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.
It saves 6 characters :)
I'm generally avoiding using my old golfing tricks in real work, but this one seemed readable.
If it raises eyebrows, contrary to what I assumed, I sure have to change it.
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 think either are probably fine, although I am more used to seeing the array syntax.
If we want to prioritize file size to this extent, then I think there are other low-hanging fruit that would bring even bigger wins; i.e.; an "xhr.modern.js" file that would have zero polyfills (and just use
Object.assign
); that would save a bit more than 6 characters.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.
@jmeas an ES6 implementation would be generally a lot smaller, but then the only reason to use this instead of
.fetch
would be to get an xhr that you can abort. Not sure if that's enough value proposition to get any adoption.Support for not-so-old browsers is the key here.
Anyway, xhr.modern or xhr.es6 is a good idea to introduce next, once we get v3 shipped.
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.
@djake Seeing you both default to array syntax, I think I'll undo this golfing.
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.
👍
For the record, this is precisely why I use this lib. Promises provide a subset of functionality compared to regular XHR's, yet are simple to make from this callback-style API, so I'm surprised anyone chooses to use
fetch
!