Skip to content

Commit 985ce59

Browse files
committed
Merge package:sse into the tools monorepo
2 parents faf2b86 + 32f019e commit 985ce59

23 files changed

+10132
-0
lines changed

pkgs/sse/.github/dependabot.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Dependabot configuration file.
2+
version: 2
3+
4+
updates:
5+
- package-ecosystem: github-actions
6+
directory: /
7+
schedule:
8+
interval: monthly
9+
labels:
10+
- autosubmit
11+
groups:
12+
github-actions:
13+
patterns:
14+
- "*"
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: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Dart 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+
fail-fast: false
22+
matrix:
23+
sdk: [dev]
24+
steps:
25+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
26+
- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
27+
with:
28+
sdk: ${{ matrix.sdk }}
29+
- id: install
30+
name: Install dependencies
31+
run: dart pub get
32+
- name: Check formatting
33+
run: dart format --output=none --set-exit-if-changed .
34+
if: always() && steps.install.outcome == 'success'
35+
- name: Analyze code
36+
run: dart analyze --fatal-infos
37+
if: always() && steps.install.outcome == 'success'
38+
39+
# Run tests on a matrix consisting of two dimensions:
40+
# 1. OS: ubuntu-latest, (macos-latest, windows-latest)
41+
# 2. release channel: dev
42+
test:
43+
needs: analyze
44+
runs-on: ${{ matrix.os }}
45+
strategy:
46+
fail-fast: false
47+
matrix:
48+
# Add macos-latest and/or windows-latest if relevant for this package.
49+
os: [ubuntu-latest]
50+
sdk: [3.3, dev]
51+
steps:
52+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
53+
- uses: dart-lang/setup-dart@e630b99d28a3b71860378cafdc2a067c71107f94
54+
with:
55+
sdk: ${{ matrix.sdk }}
56+
- uses: nanasess/setup-chromedriver@42cc2998329f041de87dc3cfa33a930eacd57eaa
57+
- id: install
58+
name: Install dependencies
59+
run: dart pub get
60+
- name: Run VM tests
61+
run: dart test --platform vm --test-randomize-ordering-seed=random -j 1
62+
if: always() && steps.install.outcome == 'success'

pkgs/sse/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.dart_tool
2+
pubspec.lock
3+
test/web/index.dart.js.deps

pkgs/sse/AUTHORS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Below is a list of people and organizations that have contributed
2+
# to the Dart project. Names should be added to the list like so:
3+
#
4+
# Name/Organization <email address>
5+
6+
Google Inc.

pkgs/sse/CHANGELOG.md

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
## 4.1.7-wip
2+
3+
## 4.1.6
4+
5+
- Require package `web: '>=0.5.0 <2.0.0'`.
6+
7+
## 4.1.5
8+
9+
- Drop unneeded dependency on `package:js`.
10+
- Update the minimum Dart SDK version to `3.3.0`.
11+
- Support the latest `package:web`.
12+
13+
## 4.1.4
14+
15+
- Fix incorrect cast causing failure with `dart2wasm`.
16+
17+
## 4.1.3
18+
19+
- Update the minimum Dart SDK version to `3.2.0`.
20+
21+
## 4.1.2
22+
23+
- Send `fetch` requests instead of `XHR` requests.
24+
- Add an optional `debugKey` parameter to `SseClient` to include in logging.
25+
- Add a dependency on `package:js`.
26+
- Update the minimum Dart SDK version to `2.16.0`.
27+
28+
## 4.1.1
29+
30+
- Apply `keepAlive` logic to `SocketException`s.
31+
- Switch from using `package:pedantic` to `package:lints`
32+
- Rev the minimum required SDK to 2.15.
33+
- Populate the pubspec `repository` field.
34+
35+
## 4.1.0
36+
37+
- Limit the number of concurrent requests to prevent Chrome from automatically
38+
dropping them on the floor.
39+
40+
## 4.0.0
41+
42+
- Support null safety.
43+
44+
## 3.8.3
45+
46+
- Require the latest shelf and remove dead code.
47+
48+
## 3.8.2
49+
50+
- Complete `onConnected` with an error if the `SseClient` receives an error
51+
before the connection is successfully opened.
52+
53+
## 3.8.1
54+
55+
- Fix an issue where closing the `SseConnection` stream would result in an
56+
error.
57+
58+
## 3.8.0
59+
60+
- Add `onConnected` to replace `onOpen`.
61+
- Fix an issue where failed requests would not add a `done` event to the
62+
connection `sink`.
63+
64+
## 3.7.0
65+
66+
- Deprecate the client's `onOpen` getter. Messages will now be buffered until a
67+
connection is established.
68+
69+
## 3.6.1
70+
71+
- Drop dependency on `package:uuid`.
72+
73+
## 3.6.0
74+
75+
- Improve performance by buffering out of order messages in the server instead
76+
of the client.
77+
78+
\*\* Note \*\* This is not modelled as a breaking change as the server can
79+
handle messages from older clients. However, clients should be using the latest
80+
server if they require order guarantees.
81+
82+
## 3.5.0
83+
84+
- Add new `shutdown` methods on `SseHandler` and `SseConnection` to allow
85+
closing connections immediately, ignoring any keep-alive periods.
86+
87+
## 3.4.0
88+
89+
- Remove `onClose` from `SseConnection` and ensure the corresponding
90+
`sink.close` correctly fires.
91+
92+
## 3.3.0
93+
94+
- Add an `onClose` event to the `SseConnection`. This allows consumers to listen
95+
to this event in lue of `sseConnection.sink.done` as that is not guaranteed to
96+
fire.
97+
98+
## 3.2.2
99+
100+
- Fix an issue where `keepAlive` may cause state errors when attempting to send
101+
messages on a closed stream.
102+
103+
## 3.2.1
104+
105+
- Fix an issue where `keepAlive` would only allow a single reconnection.
106+
107+
## 3.2.0
108+
109+
- Re-expose `isInKeepAlivePeriod` flag on `SseConnection`. This flag will be
110+
`true` when a connection has been dropped and is in the keep-alive period
111+
waiting for a client to reconnect.
112+
113+
## 3.1.2
114+
115+
- Fix an issue where the `SseClient` would not send a `done` event when there
116+
was an error with the SSE connection.
117+
118+
## 3.1.1
119+
120+
- Make `isInKeepAlive` on `SseConnection` private.
121+
122+
**Note that this is a breaking change but in actuality no one should be
123+
depending on this API.**
124+
125+
## 3.1.0
126+
127+
- Add optional `keepAlive` parameter to the `SseHandler`. If `keepAlive` is
128+
supplied, the connection will remain active for this period after a disconnect
129+
and can be reconnected transparently. If there is no reconnect within that
130+
period, the connection will be closed normally.
131+
132+
## 3.0.0
133+
134+
- Add retry logic.
135+
136+
**Possible Breaking Change Error messages may now be delayed up to 5 seconds in
137+
the client.**
138+
139+
## 2.1.2
140+
141+
- Remove `package:http` dependency.
142+
143+
## 2.1.1
144+
145+
- Use proper headers delimiter.
146+
147+
## 2.1.0
148+
149+
- Support Firefox.
150+
151+
## 2.0.3
152+
153+
- Fix an issue where messages could come out of order.
154+
155+
## 2.0.2
156+
157+
- Support the latest `package:stream_channel`.
158+
- Require Dart SDK `>=2.1.0 <3.0.0`.
159+
160+
## 2.0.1
161+
162+
- Update to `package:uuid` version 2.0.
163+
164+
## 2.0.0
165+
166+
- No longer expose `close` and `onClose` on an `SseConnection`. This is simply
167+
handled by the underlying `stream` / `sink`.
168+
- Fix a bug where resources of the `SseConnection` were not properly closed.
169+
170+
## 1.0.0
171+
172+
- Internal cleanup.
173+
174+
## 0.0.1
175+
176+
- Initial commit.

pkgs/sse/CONTRIBUTING.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
Want to contribute? Great! First, read this page (including the small print at
2+
the end).
3+
4+
### Before you contribute
5+
6+
Before we can use your code, you must sign the
7+
[Google Individual Contributor License Agreement](https://cla.developers.google.com/about/google-individual)
8+
(CLA), which you can do online. The CLA is necessary mainly because you own the
9+
copyright to your changes, even after your contribution becomes part of our
10+
codebase, so we need your permission to use and distribute your code. We also
11+
need to be sure of various other things—for instance that you'll tell us if you
12+
know that your code infringes on other people's patents. You don't have to sign
13+
the CLA until after you've submitted your code for review and a member has
14+
approved it, but you must do it before we can put your code into our codebase.
15+
16+
Before you start working on a larger contribution, you should get in touch with
17+
us first through the issue tracker with your idea so that we can help out and
18+
possibly guide you. Coordinating up front makes it much easier to avoid
19+
frustration later on.
20+
21+
### Code reviews
22+
23+
All submissions, including submissions by project members, require review.
24+
25+
### File headers
26+
27+
All files in the project must start with the following header.
28+
29+
```
30+
// Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
31+
// for details. All rights reserved. Use of this source code is governed by a
32+
// BSD-style license that can be found in the LICENSE file.
33+
```
34+
35+
### The small print
36+
37+
Contributions made by corporations are covered by a different agreement than the
38+
one above, the
39+
[Software Grant and Corporate Contributor License Agreement](https://developers.google.com/open-source/cla/corporate).

pkgs/sse/LICENSE

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Copyright 2019, 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)