Skip to content
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

Merged
merged 5 commits into from
Mar 30, 2023

Conversation

achingbrain
Copy link
Owner

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

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
@achingbrain achingbrain merged commit b6d8422 into master Mar 30, 2023
@achingbrain achingbrain deleted the fix/return-iterators-from-sync-values branch March 30, 2023 16:44
github-actions bot pushed a commit that referenced this pull request Mar 30, 2023
## [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))
@github-actions
Copy link

🎉 This PR is included in version it-all-v3.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

github-actions bot pushed a commit that referenced this pull request Mar 30, 2023
## [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))
@github-actions
Copy link

🎉 This PR is included in version it-take-v3.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

github-actions bot pushed a commit that referenced this pull request Mar 30, 2023
## [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))
@github-actions
Copy link

🎉 This PR is included in version it-to-buffer-v4.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

github-actions bot pushed a commit that referenced this pull request Mar 30, 2023
## [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))
@github-actions
Copy link

🎉 This PR is included in version it-reduce-v3.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

github-actions bot pushed a commit that referenced this pull request Mar 30, 2023
## [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))
@github-actions
Copy link

🎉 This PR is included in version it-peekable-v3.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

github-actions bot pushed a commit that referenced this pull request Mar 30, 2023
## [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))
@github-actions
Copy link

🎉 This PR is included in version it-foreach-v2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

github-actions bot pushed a commit that referenced this pull request Mar 30, 2023
## [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))
@github-actions
Copy link

🎉 This PR is included in version it-map-v3.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

github-actions bot pushed a commit that referenced this pull request Mar 30, 2023
## [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))
@github-actions
Copy link

🎉 This PR is included in version it-drain-v3.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

github-actions bot pushed a commit that referenced this pull request Mar 30, 2023
## [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))
@github-actions
Copy link

🎉 This PR is included in version it-merge-v3.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

github-actions bot pushed a commit that referenced this pull request Mar 30, 2023
## [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))
@github-actions
Copy link

🎉 This PR is included in version it-last-v3.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

github-actions bot pushed a commit that referenced this pull request Mar 30, 2023
## [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))
@github-actions
Copy link

🎉 This PR is included in version it-skip-v3.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

github-actions bot pushed a commit that referenced this pull request Mar 30, 2023
## [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))
@github-actions
Copy link

🎉 This PR is included in version it-length-v3.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

github-actions bot pushed a commit that referenced this pull request Mar 30, 2023
## [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))
@github-actions
Copy link

🎉 This PR is included in version it-sort-v3.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

github-actions bot pushed a commit that referenced this pull request Mar 30, 2023
## [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))
github-actions bot pushed a commit that referenced this pull request Mar 30, 2023
## [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))
@github-actions
Copy link

🎉 This PR is included in version it-parallel-batch-v3.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

github-actions bot pushed a commit that referenced this pull request Mar 30, 2023
## [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))
github-actions bot pushed a commit that referenced this pull request Mar 30, 2023
## [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))
@github-actions
Copy link

🎉 This PR is included in version it-first-v3.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

github-actions bot pushed a commit that referenced this pull request Mar 30, 2023
## [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))
@github-actions
Copy link

🎉 This PR is included in version it-batched-bytes-v2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

github-actions bot pushed a commit that referenced this pull request Mar 30, 2023
## [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))
@github-actions
Copy link

🎉 This PR is included in version it-flat-batch-v3.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

achingbrain added a commit that referenced this pull request Mar 31, 2023
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
achingbrain added a commit that referenced this pull request Mar 31, 2023
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
github-actions bot pushed a commit that referenced this pull request Mar 31, 2023
## [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)
Copy link

🎉 This PR is included in version 1.0.0 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant