Skip to content

Commit 79db766

Browse files
committed
Merge package:web_socket_channel into the http monorepo
2 parents e166181 + 2e21115 commit 79db766

25 files changed

+1972
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Dependabot configuration file.
2+
# See https://docs.github.com/en/code-security/dependabot/dependabot-version-updates
3+
version: 2
4+
5+
updates:
6+
- package-ecosystem: github-actions
7+
directory: /
8+
schedule:
9+
interval: monthly
10+
labels:
11+
- autosubmit
12+
groups:
13+
github-actions:
14+
patterns:
15+
- "*"
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# A workflow to close issues where the author hasn't responded to a request for
2+
# more information; see https://github.com/actions/stale.
3+
4+
name: No Response
5+
6+
# Run as a daily cron.
7+
on:
8+
schedule:
9+
# Every day at 8am
10+
- cron: '0 8 * * *'
11+
12+
# All permissions not specified are set to 'none'.
13+
permissions:
14+
issues: write
15+
pull-requests: write
16+
17+
jobs:
18+
no-response:
19+
runs-on: ubuntu-latest
20+
if: ${{ github.repository_owner == 'dart-lang' }}
21+
steps:
22+
- uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e
23+
with:
24+
# Don't automatically mark inactive issues+PRs as stale.
25+
days-before-stale: -1
26+
# Close needs-info issues and PRs after 14 days of inactivity.
27+
days-before-close: 14
28+
stale-issue-label: "needs-info"
29+
close-issue-message: >
30+
Without additional information we're not able to resolve this issue.
31+
Feel free to add more info or respond to any questions above and we
32+
can reopen the case. Thanks for your contribution!
33+
stale-pr-label: "needs-info"
34+
close-pr-message: >
35+
Without additional information we're not able to resolve this PR.
36+
Feel free to add more info or respond to any questions above.
37+
Thanks for your contribution!
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# A CI configuration to auto-publish pub packages.
2+
3+
name: Publish
4+
5+
on:
6+
pull_request:
7+
branches: [ master ]
8+
push:
9+
tags: [ 'v[0-9]+.[0-9]+.[0-9]+' ]
10+
11+
jobs:
12+
publish:
13+
if: ${{ github.repository_owner == 'dart-lang' }}
14+
uses: dart-lang/ecosystem/.github/workflows/publish.yaml@main
15+
permissions:
16+
id-token: write # Required for authentication using OIDC
17+
pull-requests: write # Required for writing the pull request note
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: CI
2+
3+
on:
4+
# Run on PRs and pushes to the default branch.
5+
push:
6+
branches: [ master ]
7+
pull_request:
8+
branches: [ master ]
9+
schedule:
10+
- cron: "0 0 * * 0"
11+
12+
env:
13+
PUB_ENVIRONMENT: bot.github
14+
15+
jobs:
16+
# Check code formatting and static analysis on a single OS (linux)
17+
# against Dart dev.
18+
analyze:
19+
runs-on: ubuntu-latest
20+
strategy:
21+
matrix:
22+
sdk: [dev]
23+
steps:
24+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
25+
- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
26+
with:
27+
sdk: ${{ matrix.sdk }}
28+
- id: install
29+
name: Install dependencies
30+
run: dart pub get
31+
- name: Check formatting
32+
run: dart format --output=none --set-exit-if-changed .
33+
if: always() && steps.install.outcome == 'success'
34+
- name: Analyze code
35+
run: dart analyze
36+
if: always() && steps.install.outcome == 'success'
37+
38+
test:
39+
needs: analyze
40+
runs-on: ${{ matrix.os }}
41+
strategy:
42+
fail-fast: false
43+
matrix:
44+
os: [ubuntu-latest]
45+
sdk: [3.3, dev]
46+
steps:
47+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
48+
- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
49+
with:
50+
sdk: ${{ matrix.sdk }}
51+
- id: install
52+
name: Install dependencies
53+
run: dart pub get
54+
- name: Run VM tests
55+
run: dart test --platform vm
56+
if: always() && steps.install.outcome == 'success'
57+
- name: Run Chrome tests
58+
run: dart test --platform chrome
59+
if: always() && steps.install.outcome == 'success'
60+
- name: Run Chrome tests - wasm
61+
run: dart test --platform chrome --compiler dart2wasm
62+
if: always() && steps.install.outcome == 'success' && matrix.sdk == 'dev'
63+
64+
# Run analysis against the oldest supported pub constraints.
65+
downgrade:
66+
runs-on: ubuntu-latest
67+
steps:
68+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
69+
- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
70+
- run: dart pub downgrade
71+
- run: dart analyze

pkgs/web_socket_channel/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.dart_tool/
2+
.packages
3+
pubspec.lock

pkgs/web_socket_channel/CHANGELOG.md

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
## 3.0.1
2+
3+
- Remove unnecessary `dependency_overrides`.
4+
- Remove obsolete documentation for `WebSocketChannel.new`.
5+
- Update package `web: '>=0.5.0 <2.0.0'`.
6+
7+
## 3.0.0
8+
9+
- Provide an adapter around `package:web_socket` `WebSocket`s and make it the
10+
default implementation for `WebSocketChannel.connect`.
11+
- **BREAKING**: Remove `WebSocketChannel` constructor.
12+
- **BREAKING**: Make `WebSocketChannel` an `abstract interface`.
13+
- **BREAKING**: `IOWebSocketChannel.ready` will throw
14+
`WebSocketChannelException` instead of `WebSocketException`.
15+
16+
## 2.4.5
17+
18+
- use secure random number generator for frame masking.
19+
20+
## 2.4.4
21+
22+
- Require Dart `^3.3`
23+
- Require `package:web` `^0.5.0`.
24+
25+
## 2.4.3
26+
27+
- `HtmlWebSocketChannel`: Relax the type of the websocket parameter to the
28+
constructor in order to mitigate a breaking change introduced in `2.4.1`.
29+
30+
## 2.4.2 (retracted)
31+
32+
- Allow `web: '>=0.3.0 <0.5.0'`
33+
34+
## 2.4.1
35+
36+
- Update the examples to use `WebSocketChannel.ready` and clarify that
37+
`WebSocketChannel.ready` should be awaited before sending data over the
38+
`WebSocketChannel`.
39+
- Mention `ready` in the docs for `connect`.
40+
- Bump minimum Dart version to 3.2.0
41+
- Move to `pkg:web` to support WebAssembly compilation.
42+
43+
## 2.4.0
44+
45+
- Add a `customClient` parameter to the `IOWebSocketChannel.connect` factory,
46+
which allows the user to provide a custom `HttpClient` instance to use for the
47+
WebSocket connection
48+
- Bump minimum Dart version to 2.15.0
49+
50+
## 2.3.0
51+
52+
- Added a Future `ready` property to `WebSocketChannel`, which completes when
53+
the connection is established
54+
- Added a `connectTimeout` parameter to the `IOWebSocketChannel.connect` factory,
55+
which controls the timeout of the WebSocket Future.
56+
- Use platform agnostic code in README example.
57+
58+
## 2.2.0
59+
60+
- Add `HtmlWebSocketChannel.innerWebSocket` getter to access features not exposed
61+
through the shared `WebSocketChannel` interface.
62+
63+
## 2.1.0
64+
65+
- Add `IOWebSocketChannel.innerWebSocket` getter to access features not exposed
66+
through the shared `WebSocketChannel` interface.
67+
68+
## 2.0.0
69+
70+
- Support null safety.
71+
- Require Dart 2.12.
72+
73+
## 1.2.0
74+
75+
* Add `protocols` argument to `WebSocketChannel.connect`. See the docs for
76+
`WebSocket.connet`.
77+
* Allow the latest crypto release (`3.x`).
78+
79+
## 1.1.0
80+
81+
* Add `WebSocketChannel.connect` factory constructor supporting platform
82+
independent creation of WebSockets providing the lowest common denominator
83+
of support on dart:io and dart:html.
84+
85+
## 1.0.15
86+
87+
* bug fix don't pass protocols parameter to WebSocket.
88+
89+
## 1.0.14
90+
91+
* Updates to handle `Socket implements Stream<Uint8List>`
92+
93+
## 1.0.13
94+
95+
* Internal changes for consistency with the Dart SDK.
96+
97+
## 1.0.12
98+
99+
* Allow `stream_channel` version 2.x
100+
101+
## 1.0.11
102+
103+
* Fixed description in pubspec.
104+
105+
* Fixed lints in README.md.
106+
107+
## 1.0.10
108+
109+
* Fixed links in README.md.
110+
111+
* Added an example.
112+
113+
* Fixed analysis lints that affected package score.
114+
115+
## 1.0.9
116+
117+
* Set max SDK version to `<3.0.0`.
118+
119+
## 1.0.8
120+
121+
* Remove use of deprecated constant name.
122+
123+
## 1.0.7
124+
125+
* Support the latest dev SDK.
126+
127+
## 1.0.6
128+
129+
* Declare support for `async` 2.0.0.
130+
131+
## 1.0.5
132+
133+
* Increase the SDK version constraint to `<2.0.0-dev.infinity`.
134+
135+
## 1.0.4
136+
137+
* Support `crypto` 2.0.0.
138+
139+
## 1.0.3
140+
141+
* Fix all strong-mode errors and warnings.
142+
143+
* Fix a bug where `HtmlWebSocketChannel.close()` would crash on non-Dartium
144+
browsers if the close code and reason weren't provided explicitly.
145+
146+
## 1.0.2
147+
148+
* Properly use `BASE64` from `dart:convert` rather than `crypto`.
149+
150+
## 1.0.1
151+
152+
* Add support for `crypto` 1.0.0.
153+
154+
## 1.0.0
155+
156+
* Initial version
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
Want to contribute? Great! First, read this page (including the small print at
2+
the end).
3+
4+
### Before you contribute
5+
Before we can use your code, you must sign the
6+
[Google Individual Contributor License Agreement](https://cla.developers.google.com/about/google-individual)
7+
(CLA), which you can do online. The CLA is necessary mainly because you own the
8+
copyright to your changes, even after your contribution becomes part of our
9+
codebase, so we need your permission to use and distribute your code. We also
10+
need to be sure of various other things—for instance that you'll tell us if you
11+
know that your code infringes on other people's patents. You don't have to sign
12+
the CLA until after you've submitted your code for review and a member has
13+
approved it, but you must do it before we can put your code into our codebase.
14+
15+
Before you start working on a larger contribution, you should get in touch with
16+
us first through the issue tracker with your idea so that we can help out and
17+
possibly guide you. Coordinating up front makes it much easier to avoid
18+
frustration later on.
19+
20+
### Code reviews
21+
All submissions, including submissions by project members, require review.
22+
23+
### File headers
24+
All files in the project must start with the following header.
25+
26+
// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
27+
// for details. All rights reserved. Use of this source code is governed by a
28+
// BSD-style license that can be found in the LICENSE file.
29+
30+
### The small print
31+
Contributions made by corporations are covered by a different agreement than the
32+
one above, the
33+
[Software Grant and Corporate Contributor License Agreement](https://developers.google.com/open-source/cla/corporate).

pkgs/web_socket_channel/LICENSE

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Copyright 2016, the Dart project authors.
2+
3+
Redistribution and use in source and binary forms, with or without
4+
modification, are permitted provided that the following conditions are
5+
met:
6+
7+
* Redistributions of source code must retain the above copyright
8+
notice, this list of conditions and the following disclaimer.
9+
* Redistributions in binary form must reproduce the above
10+
copyright notice, this list of conditions and the following
11+
disclaimer in the documentation and/or other materials provided
12+
with the distribution.
13+
* Neither the name of Google LLC nor the names of its
14+
contributors may be used to endorse or promote products derived
15+
from this software without specific prior written permission.
16+
17+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

0 commit comments

Comments
 (0)