-
Notifications
You must be signed in to change notification settings - Fork 18
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
fix!: return iterators from synchronous sources #55
Conversation
Crossing async boundaries is not free. If a synchronous iterator is passed to a function, it should not force the caller to await on the result. This PR updates some of the basic `it-*` modules to not create unecessary async when they don't have to. The return types of these functions are now derived from the input types so if you have linting rules that forbid awaiting on non-thenables those awaits will need to be removed. BREAKING CHANGE: if you pass a synchronous iterator to a function it will return a synchronous generator in response
## [it-all-v3.0.0](it-all-v2.0.1...it-all-v3.0.0) (2023-03-30) ### ⚠ BREAKING CHANGES * if you pass a synchronous iterator to a function it will return a synchronous generator in response ### Bug Fixes * return iterators from synchronous sources ([#55](#55)) ([b6d8422](b6d8422)) ### Trivial Changes * update project config, fix broken badges ([#53](#53)) ([e56c6ae](e56c6ae))
🎉 This PR is included in version it-all-v3.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [it-take-v3.0.0](it-take-v2.0.1...it-take-v3.0.0) (2023-03-30) ### ⚠ BREAKING CHANGES * if you pass a synchronous iterator to a function it will return a synchronous generator in response ### Bug Fixes * return iterators from synchronous sources ([#55](#55)) ([b6d8422](b6d8422)) ### Trivial Changes * update project config, fix broken badges ([#53](#53)) ([e56c6ae](e56c6ae)) ### Dependencies * update sibling dependencies ([8b60209](8b60209))
🎉 This PR is included in version it-take-v3.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [it-to-buffer-v4.0.0](it-to-buffer-v3.0.1...it-to-buffer-v4.0.0) (2023-03-30) ### ⚠ BREAKING CHANGES * if you pass a synchronous iterator to a function it will return a synchronous generator in response ### Bug Fixes * return iterators from synchronous sources ([#55](#55)) ([b6d8422](b6d8422)) ### Trivial Changes * update project config, fix broken badges ([#53](#53)) ([e56c6ae](e56c6ae))
🎉 This PR is included in version it-to-buffer-v4.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [it-reduce-v3.0.0](it-reduce-v2.0.1...it-reduce-v3.0.0) (2023-03-30) ### ⚠ BREAKING CHANGES * if you pass a synchronous iterator to a function it will return a synchronous generator in response ### Bug Fixes * return iterators from synchronous sources ([#55](#55)) ([b6d8422](b6d8422)) ### Trivial Changes * update project config, fix broken badges ([#53](#53)) ([e56c6ae](e56c6ae))
🎉 This PR is included in version it-reduce-v3.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [it-peekable-v3.0.0](it-peekable-v2.0.1...it-peekable-v3.0.0) (2023-03-30) ### ⚠ BREAKING CHANGES * if you pass a synchronous iterator to a function it will return a synchronous generator in response ### Bug Fixes * return iterators from synchronous sources ([#55](#55)) ([b6d8422](b6d8422)) ### Trivial Changes * update project config, fix broken badges ([#53](#53)) ([e56c6ae](e56c6ae)) ### Dependencies * update sibling dependencies ([8b60209](8b60209))
🎉 This PR is included in version it-peekable-v3.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [it-foreach-v2.0.0](it-foreach-v1.0.1...it-foreach-v2.0.0) (2023-03-30) ### ⚠ BREAKING CHANGES * if you pass a synchronous iterator to a function it will return a synchronous generator in response ### Bug Fixes * return iterators from synchronous sources ([#55](#55)) ([b6d8422](b6d8422)) ### Trivial Changes * update project config, fix broken badges ([#53](#53)) ([e56c6ae](e56c6ae)) ### Dependencies * update sibling dependencies ([5f72696](5f72696)) * update sibling dependencies ([8b60209](8b60209))
🎉 This PR is included in version it-foreach-v2.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [it-map-v3.0.0](it-map-v2.0.1...it-map-v3.0.0) (2023-03-30) ### ⚠ BREAKING CHANGES * if you pass a synchronous iterator to a function it will return a synchronous generator in response ### Bug Fixes * return iterators from synchronous sources ([#55](#55)) ([b6d8422](b6d8422)) ### Trivial Changes * update project config, fix broken badges ([#53](#53)) ([e56c6ae](e56c6ae)) ### Dependencies * update sibling dependencies ([5f72696](5f72696))
🎉 This PR is included in version it-map-v3.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [it-drain-v3.0.0](it-drain-v2.0.1...it-drain-v3.0.0) (2023-03-30) ### ⚠ BREAKING CHANGES * if you pass a synchronous iterator to a function it will return a synchronous generator in response ### Bug Fixes * return iterators from synchronous sources ([#55](#55)) ([b6d8422](b6d8422)) ### Trivial Changes * update project config, fix broken badges ([#53](#53)) ([e56c6ae](e56c6ae))
🎉 This PR is included in version it-drain-v3.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [it-merge-v3.0.0](it-merge-v2.0.1...it-merge-v3.0.0) (2023-03-30) ### ⚠ BREAKING CHANGES * if you pass a synchronous iterator to a function it will return a synchronous generator in response ### Bug Fixes * return iterators from synchronous sources ([#55](#55)) ([b6d8422](b6d8422)) ### Trivial Changes * update project config, fix broken badges ([#53](#53)) ([e56c6ae](e56c6ae)) ### Dependencies * update sibling dependencies ([8b60209](8b60209))
🎉 This PR is included in version it-merge-v3.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [it-last-v3.0.0](it-last-v2.0.1...it-last-v3.0.0) (2023-03-30) ### ⚠ BREAKING CHANGES * if you pass a synchronous iterator to a function it will return a synchronous generator in response ### Bug Fixes * return iterators from synchronous sources ([#55](#55)) ([b6d8422](b6d8422)) ### Trivial Changes * update project config, fix broken badges ([#53](#53)) ([e56c6ae](e56c6ae))
🎉 This PR is included in version it-last-v3.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [it-skip-v3.0.0](it-skip-v2.0.1...it-skip-v3.0.0) (2023-03-30) ### ⚠ BREAKING CHANGES * if you pass a synchronous iterator to a function it will return a synchronous generator in response ### Bug Fixes * return iterators from synchronous sources ([#55](#55)) ([b6d8422](b6d8422)) ### Trivial Changes * update project config, fix broken badges ([#53](#53)) ([e56c6ae](e56c6ae)) ### Dependencies * update sibling dependencies ([8b60209](8b60209))
🎉 This PR is included in version it-skip-v3.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [it-length-v3.0.0](it-length-v2.0.1...it-length-v3.0.0) (2023-03-30) ### ⚠ BREAKING CHANGES * if you pass a synchronous iterator to a function it will return a synchronous generator in response ### Bug Fixes * return iterators from synchronous sources ([#55](#55)) ([b6d8422](b6d8422)) ### Trivial Changes * update project config, fix broken badges ([#53](#53)) ([e56c6ae](e56c6ae))
🎉 This PR is included in version it-length-v3.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [it-sort-v3.0.0](it-sort-v2.0.1...it-sort-v3.0.0) (2023-03-30) ### ⚠ BREAKING CHANGES * if you pass a synchronous iterator to a function it will return a synchronous generator in response ### Bug Fixes * return iterators from synchronous sources ([#55](#55)) ([b6d8422](b6d8422)) ### Trivial Changes * update project config, fix broken badges ([#53](#53)) ([e56c6ae](e56c6ae)) ### Dependencies * update sibling dependencies ([8b60209](8b60209))
🎉 This PR is included in version it-sort-v3.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [it-batch-v3.0.0](it-batch-v2.0.1...it-batch-v3.0.0) (2023-03-30) ### ⚠ BREAKING CHANGES * if you pass a synchronous iterator to a function it will return a synchronous generator in response ### Bug Fixes * return iterators from synchronous sources ([#55](#55)) ([b6d8422](b6d8422)) ### Trivial Changes * update project config, fix broken badges ([#53](#53)) ([e56c6ae](e56c6ae)) ### Dependencies * update sibling dependencies ([8b60209](8b60209))
## [it-parallel-batch-v3.0.0](it-parallel-batch-v2.0.1...it-parallel-batch-v3.0.0) (2023-03-30) ### ⚠ BREAKING CHANGES * if you pass a synchronous iterator to a function it will return a synchronous generator in response ### Bug Fixes * return iterators from synchronous sources ([#55](#55)) ([b6d8422](b6d8422)) ### Trivial Changes * update project config, fix broken badges ([#53](#53)) ([e56c6ae](e56c6ae)) ### Dependencies * update sibling dependencies ([c7d90e8](c7d90e8)) * update sibling dependencies ([8b60209](8b60209))
🎉 This PR is included in version it-parallel-batch-v3.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [it-split-v3.0.0](it-split-v2.0.2...it-split-v3.0.0) (2023-03-30) ### ⚠ BREAKING CHANGES * if you pass a synchronous iterator to a function it will return a synchronous generator in response ### Bug Fixes * return iterators from synchronous sources ([#55](#55)) ([b6d8422](b6d8422)) ### Trivial Changes * update project config, fix broken badges ([#53](#53)) ([e56c6ae](e56c6ae)) ### Dependencies * update sibling dependencies ([8b60209](8b60209))
## [it-first-v3.0.0](it-first-v2.0.1...it-first-v3.0.0) (2023-03-30) ### ⚠ BREAKING CHANGES * if you pass a synchronous iterator to a function it will return a synchronous generator in response ### Bug Fixes * return iterators from synchronous sources ([#55](#55)) ([b6d8422](b6d8422)) ### Trivial Changes * update project config, fix broken badges ([#53](#53)) ([e56c6ae](e56c6ae))
🎉 This PR is included in version it-first-v3.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [it-batched-bytes-v2.0.0](it-batched-bytes-v1.0.1...it-batched-bytes-v2.0.0) (2023-03-30) ### ⚠ BREAKING CHANGES * if you pass a synchronous iterator to a function it will return a synchronous generator in response ### Bug Fixes * return iterators from synchronous sources ([#55](#55)) ([b6d8422](b6d8422)) ### Trivial Changes * update project config, fix broken badges ([#53](#53)) ([e56c6ae](e56c6ae)) ### Dependencies * update sibling dependencies ([8b60209](8b60209))
🎉 This PR is included in version it-batched-bytes-v2.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [it-flat-batch-v3.0.0](it-flat-batch-v2.0.1...it-flat-batch-v3.0.0) (2023-03-30) ### ⚠ BREAKING CHANGES * if you pass a synchronous iterator to a function it will return a synchronous generator in response ### Bug Fixes * return iterators from synchronous sources ([#55](#55)) ([b6d8422](b6d8422)) ### Trivial Changes * update project config, fix broken badges ([#53](#53)) ([e56c6ae](e56c6ae)) ### Dependencies * update sibling dependencies ([8b60209](8b60209))
🎉 This PR is included in version it-flat-batch-v3.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Applies the same changes from #55 to it-filter BREAKING CHANGE: if you pass a synchronous iterator to a function it will return a synchronous generator in response
Applies the same changes from #55 to it-filter BREAKING CHANGE: if you pass a synchronous iterator and a synchronous filter function it will return a synchronous generator in response
## [it-filter-v3.0.0](it-filter-v2.0.2...it-filter-v3.0.0) (2023-03-31) ### ⚠ BREAKING CHANGES * if you pass a synchronous iterator and a synchronous filter function it will return a synchronous generator in response ### Bug Fixes * return iterators from synchronous sources ([#58](#58)) ([cdd84b4](cdd84b4)), closes [#55](#55)
🎉 This PR is included in version 1.0.0 🎉 The release is available on npm package (@latest dist-tag) Your semantic-release bot 📦🚀 |
Crossing async boundaries is not free. If a synchronous iterator is passed to a function, it should not force the caller to await on the result.
This PR updates some of the basic
it-*
modules to not create unecessary async when they don't have to.The return types of these functions are now derived from the input types so if you have linting rules that forbid awaiting on non-thenables those awaits will need to be removed.
BREAKING CHANGE: if you pass a synchronous iterator to a function it will return a synchronous generator in response