-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1266 from dart-lang/merge-stream_channel-package
Merge `package:stream_channel`
- Loading branch information
Showing
33 changed files
with
3,200 additions
and
0 deletions.
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,5 @@ | ||
--- | ||
name: "package:stream_channel" | ||
about: "Create a bug or file a feature request against package:stream_channel." | ||
labels: "package:stream_channel" | ||
--- |
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,74 @@ | ||
name: package:stream_channel | ||
|
||
on: | ||
# Run on PRs and pushes to the default branch. | ||
push: | ||
branches: [ main ] | ||
paths: | ||
- '.github/workflows/stream_channel.yaml' | ||
- 'pkgs/stream_channel/**' | ||
pull_request: | ||
branches: [ main ] | ||
paths: | ||
- '.github/workflows/stream_channel.yaml' | ||
- 'pkgs/stream_channel/**' | ||
schedule: | ||
- cron: "0 0 * * 0" | ||
|
||
env: | ||
PUB_ENVIRONMENT: bot.github | ||
|
||
defaults: | ||
run: | ||
working-directory: pkgs/stream_channel/ | ||
|
||
jobs: | ||
# Check code formatting and static analysis on a single OS (linux) | ||
# against Dart dev. | ||
analyze: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
sdk: [dev] | ||
steps: | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | ||
- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94 | ||
with: | ||
sdk: ${{ matrix.sdk }} | ||
- id: install | ||
name: Install dependencies | ||
run: dart pub get | ||
- name: Check formatting | ||
run: dart format --output=none --set-exit-if-changed . | ||
if: always() && steps.install.outcome == 'success' | ||
- name: Analyze code | ||
run: dart analyze --fatal-infos | ||
if: always() && steps.install.outcome == 'success' | ||
|
||
# Run tests on a matrix consisting of two dimensions: | ||
# 1. OS: ubuntu-latest, (macos-latest, windows-latest) | ||
# 2. release channel: dev | ||
test: | ||
needs: analyze | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# Add macos-latest and/or windows-latest if relevant for this package. | ||
os: [ubuntu-latest] | ||
sdk: [3.3, dev] | ||
steps: | ||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | ||
- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94 | ||
with: | ||
sdk: ${{ matrix.sdk }} | ||
- id: install | ||
name: Install dependencies | ||
run: dart pub get | ||
- name: Run VM tests | ||
run: dart test --platform vm | ||
if: always() && steps.install.outcome == 'success' | ||
- name: Run Chrome tests | ||
run: dart test --platform chrome | ||
if: always() && steps.install.outcome == 'success' |
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,10 @@ | ||
.buildlog | ||
.dart_tool/ | ||
.DS_Store | ||
.idea | ||
.pub/ | ||
.settings/ | ||
build/ | ||
packages | ||
.packages | ||
pubspec.lock |
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,6 @@ | ||
# Below is a list of people and organizations that have contributed | ||
# to the project. Names should be added to the list like so: | ||
# | ||
# Name/Organization <email address> | ||
|
||
Google Inc. |
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,158 @@ | ||
## 2.1.3 | ||
|
||
* Require Dart 3.3 | ||
* Move to `dart-lang/tools` monorepo. | ||
|
||
## 2.1.2 | ||
|
||
* Require Dart 2.19 | ||
* Add an example. | ||
* Fix a race condition in `IsolateChannel.connectReceive()` where the channel | ||
could hang forever if its sink was closed before the connection was established. | ||
|
||
## 2.1.1 | ||
|
||
* Require Dart 2.14 | ||
* Populate the pubspec `repository` field. | ||
* Handle multichannel messages where the ID element is a `double` at runtime | ||
instead of an `int`. When reading an array with `dart2wasm` numbers within the | ||
array are parsed as `double`. | ||
|
||
## 2.1.0 | ||
|
||
* Stable release for null safety. | ||
|
||
## 2.0.0 | ||
|
||
**Breaking changes** | ||
|
||
* `IsolateChannel` requires a separate import | ||
`package:stram_channel/isolate_channel.dart`. | ||
`package:stream_channel/stream_channel.dart` will now not trigger any platform | ||
concerns due to importing `dart:isolate`. | ||
* Remove `JsonDocumentTransformer` class. The `jsonDocument` top level is still | ||
available. | ||
* Remove `StreamChannelTransformer.typed`. Use `.cast` on the transformed | ||
channel instead. | ||
* Change `Future<dynamic>` returns to `Future<void>`. | ||
|
||
## 1.7.0 | ||
|
||
* Make `IsolateChannel` available through | ||
`package:stream_channel/isolate_channel.dart`. This will be the required | ||
import in the next release. | ||
* Require `2.0.0` or newer SDK. | ||
* Internal style changes. | ||
|
||
## 1.6.8 | ||
|
||
* Set max SDK version to `<3.0.0`, and adjust other dependencies. | ||
|
||
## 1.6.7+1 | ||
|
||
* Fix Dart 2 runtime types in `IsolateChannel`. | ||
|
||
## 1.6.7 | ||
|
||
* Update SDK version to 2.0.0-dev.17.0. | ||
* Add a type argument to `MultiChannel`. | ||
|
||
## 1.6.6 | ||
|
||
* Fix a Dart 2 issue with inner stream transformation in `GuaranteeChannel`. | ||
|
||
* Fix a Dart 2 issue with `StreamChannelTransformer.fromCodec()`. | ||
|
||
## 1.6.5 | ||
|
||
* Fix an issue with `JsonDocumentTransformer.bind` where it created an internal | ||
stream channel which didn't get a properly inferred type for its `sink`. | ||
|
||
## 1.6.4 | ||
|
||
* Fix a race condition in `MultiChannel` where messages from a remote virtual | ||
channel could get dropped if the corresponding local channel wasn't registered | ||
quickly enough. | ||
|
||
## 1.6.3 | ||
|
||
* Use `pumpEventQueue()` from test. | ||
|
||
## 1.6.2 | ||
|
||
* Declare support for `async` 2.0.0. | ||
|
||
## 1.6.1 | ||
|
||
* Fix the type of `StreamChannel.transform()`. This previously inverted the | ||
generic parameters, so it only really worked with transformers where both | ||
generic types were identical. | ||
|
||
## 1.6.0 | ||
|
||
* `Disconnector.disconnect()` now returns a future that completes when all the | ||
inner `StreamSink.close()` futures have completed. | ||
|
||
## 1.5.0 | ||
|
||
* Add `new StreamChannel.withCloseGuarantee()` to provide the specific guarantee | ||
that closing the sink causes the stream to close before it emits any more | ||
events. This is the only guarantee that isn't automatically preserved when | ||
transforming a channel. | ||
|
||
* `StreamChannelTransformer`s provided by the `stream_channel` package now | ||
properly provide the guarantee that closing the sink causes the stream to | ||
close before it emits any more events | ||
|
||
## 1.4.0 | ||
|
||
* Add `StreamChannel.cast()`, which soundly coerces the generic type of a | ||
channel. | ||
|
||
* Add `StreamChannelTransformer.typed()`, which soundly coerces the generic type | ||
of a transformer. | ||
|
||
## 1.3.2 | ||
|
||
* Fix all strong-mode errors and warnings. | ||
|
||
## 1.3.1 | ||
|
||
* Make `IsolateChannel` slightly more efficient. | ||
|
||
* Make `MultiChannel` follow the stream channel rules. | ||
|
||
## 1.3.0 | ||
|
||
* Add `Disconnector`, a transformer that allows the caller to disconnect the | ||
transformed channel. | ||
|
||
## 1.2.0 | ||
|
||
* Add `new StreamChannel.withGuarantees()`, which creates a channel with extra | ||
wrapping to ensure that it obeys the stream channel guarantees. | ||
|
||
* Add `StreamChannelController`, which can be used to create custom | ||
`StreamChannel` objects. | ||
|
||
## 1.1.1 | ||
|
||
* Fix the type annotation for `StreamChannel.transform()`'s parameter. | ||
|
||
## 1.1.0 | ||
|
||
* Add `StreamChannel.transformStream()`, `StreamChannel.transformSink()`, | ||
`StreamChannel.changeStream()`, and `StreamChannel.changeSink()` to support | ||
changing only the stream or only the sink of a channel. | ||
|
||
* Be more explicit about `JsonDocumentTransformer`'s error-handling behavior. | ||
|
||
## 1.0.1 | ||
|
||
* Fix `MultiChannel`'s constructor to take a `StreamChannel`. This is | ||
technically a breaking change, but since 1.0.0 was only released an hour ago, | ||
we're treating it as a bug fix. | ||
|
||
## 1.0.0 | ||
|
||
* 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Copyright 2015, the Dart project authors. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are | ||
met: | ||
|
||
* Redistributions of source code must retain the above copyright | ||
notice, this list of conditions and the following disclaimer. | ||
* Redistributions in binary form must reproduce the above | ||
copyright notice, this list of conditions and the following | ||
disclaimer in the documentation and/or other materials provided | ||
with the distribution. | ||
* Neither the name of Google LLC nor the names of its | ||
contributors may be used to endorse or promote products derived | ||
from this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
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,20 @@ | ||
[![Build Status](https://github.com/dart-lang/tools/actions/workflows/stream_channel.yaml/badge.svg)](https://github.com/dart-lang/tools/actions/workflows/stream_channel.yaml) | ||
[![pub package](https://img.shields.io/pub/v/stream_channel.svg)](https://pub.dev/packages/stream_channel) | ||
[![package publisher](https://img.shields.io/pub/publisher/stream_channel.svg)](https://pub.dev/packages/stream_channel/publisher) | ||
|
||
This package exposes the `StreamChannel` interface, which represents a two-way | ||
communication channel. Each `StreamChannel` exposes a `Stream` for receiving | ||
data and a `StreamSink` for sending it. | ||
|
||
`StreamChannel` helps abstract communication logic away from the underlying | ||
protocol. For example, the [`test`][test] package re-uses its test suite | ||
communication protocol for both WebSocket connections to browser suites and | ||
Isolate connections to VM tests. | ||
|
||
[test]: https://pub.dev/packages/test | ||
|
||
This package also contains utilities for dealing with `StreamChannel`s and with | ||
two-way communications in general. For documentation of these utilities, see | ||
[the API docs][api]. | ||
|
||
[api]: https://pub.dev/documentation/stream_channel/latest/ |
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,5 @@ | ||
include: package:dart_flutter_team_lints/analysis_options.yaml | ||
|
||
analyzer: | ||
language: | ||
strict-casts: true |
Oops, something went wrong.