-
-
Notifications
You must be signed in to change notification settings - Fork 941
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
Improve option normalization #1521
Conversation
Of course it still will be possible to call |
This comment has been minimized.
This comment has been minimized.
Also it will throw when passing a non-existing property on the Options. Migrate: -got({token: 'asdf'});
+got({context: {token: 'asdf'}}); |
It gives a significant performance boost in terms of normalization:
It's |
Ok, so So instead I did make the entire
|
Also the Options template now requires to pass an |
Ok, I've got the streams working, which is pretty nice! https://github.com/szmarczak/got/blob/8798afc0c5f3ac4bbecde9e49c83cb2cb33722d6/demo.js |
Is this a breaking change? |
probably yes but the final say should be when I finish this PR. I don't expect any breaking changes than option normalization (but it should still be 99% compatible for the end user). I'm short on time, preparing for uni exams hence I'm not so active since last week :( |
Closing in favor of #1667 |
This allows us to normalize options on-the-fly. This will replace
got.normalizeOptions
/Request.normalizeOptions
. The following should give a significant performance boost when calledAlso it will be a lot easier to test the options.
TODO
option.methodRewriting
mechanism (fixes Invert themethodRewriting
option logic #1307)Got options -> HTTP(S) options
Proxy
handler. Missinghas()
andownKeys()
.Checklist