Skip to content

Commit 4e35b16

Browse files
devoncarewmosuem
andauthored
update deps; simplify analysis options (#790)
* update deps; simplify analysis options * update package version * require dart 3.8; upgrade other deps * dartfmt --------- Co-authored-by: Moritz <[email protected]>
1 parent aebb65c commit 4e35b16

File tree

86 files changed

+2857
-1837
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+2857
-1837
lines changed

.github/workflows/dart.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717
strategy:
1818
matrix:
19-
sdk: [3.5, dev]
19+
sdk: [stable, dev]
2020
steps:
2121
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
2222
- uses: dart-lang/setup-dart@e51d8e571e22473a2ddebf0ef8a2123f0ab2c02c
@@ -27,7 +27,7 @@ jobs:
2727
- name: Install dependencies
2828
run: dart pub get
2929
- name: Check formatting (using dev dartfmt release)
30-
if: ${{ matrix.sdk == 'dev' }}
30+
if: ${{ matrix.sdk == 'stable' }}
3131
run: dart format --output=none --set-exit-if-changed .
3232
- name: Analyze code (introp and examples)
3333
run: |
@@ -60,7 +60,7 @@ jobs:
6060
strategy:
6161
matrix:
6262
os: [ubuntu-latest, macos-latest, windows-latest]
63-
sdk: [3.5, dev]
63+
sdk: [stable, dev]
6464
platform: [vm, chrome]
6565
exclude:
6666
# We only run Chrome tests on Linux. No need to run them

CHANGELOG.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1+
## 4.1.1-wip
2+
3+
- Require Dart 3.8.
4+
- Dart format all files for the new 3.8 formatter.
5+
- Require package:googleapis_auth
6+
- Require package:http 1.4.0
7+
- Require package:lints 6.0.0
8+
- Require package:protobuf 4.1.0
9+
110
## 4.1.0
2-
* Add a `serverInterceptors` argument to `ConnectionServer`. These interceptors are acting
3-
as middleware, wrapping a `ServiceMethod` invocation.
11+
12+
* Add a `serverInterceptors` argument to `ConnectionServer`. These interceptors
13+
are acting as middleware, wrapping a `ServiceMethod` invocation.
414
* Make sure that `CallOptions.mergeWith` is symmetric: given `WebCallOptions`
515
it should return `WebCallOptions`.
616

@@ -16,8 +26,8 @@
1626

1727
* Internal optimization to client code.
1828
* Small fixes, such as ports in testing and enabling `timeline_test.dart`.
19-
* When the keep alive manager runs into a timeout, it will finish the transport instead of closing
20-
the connection, as defined in the gRPC spec.
29+
* When the keep alive manager runs into a timeout, it will finish the transport
30+
instead of closing the connection, as defined in the gRPC spec.
2131
* Upgrade to `package:lints` version 5.0.0 and Dart SDK version 3.5.0.
2232
* Upgrade `example/grpc-web` code.
2333
* Update xhr transport to migrate off legacy JS/HTML apis.

analysis_options.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,5 @@ linter:
1717
- prefer_final_locals
1818
- prefer_relative_imports
1919
- prefer_single_quotes
20-
# Enable once 3.7 is stable.
21-
# - strict_top_level_inference
20+
- strict_top_level_inference
2221
- test_types_in_equals
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
11
include: ../../analysis_options.yaml
2-
3-
linter:
4-
rules:
5-
directives_ordering: false

example/googleapis/bin/logging.dart

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,19 @@
1616
import 'dart:async';
1717
import 'dart:io';
1818

19-
import 'package:grpc/grpc.dart';
20-
2119
import 'package:googleapis/src/generated/google/api/monitored_resource.pb.dart';
2220
import 'package:googleapis/src/generated/google/logging/type/log_severity.pb.dart';
2321
import 'package:googleapis/src/generated/google/logging/v2/log_entry.pb.dart';
2422
import 'package:googleapis/src/generated/google/logging/v2/logging.pbgrpc.dart';
23+
import 'package:grpc/grpc.dart';
2524

2625
Future<void> main() async {
2726
final serviceAccountFile = File('logging-service-account.json');
2827
if (!serviceAccountFile.existsSync()) {
29-
print('File logging-service-account.json not found. Please follow the '
30-
'steps in README.md to create it.');
28+
print(
29+
'File logging-service-account.json not found. Please follow the '
30+
'steps in README.md to create it.',
31+
);
3132
exit(-1);
3233
}
3334

@@ -37,19 +38,25 @@ Future<void> main() async {
3738
];
3839

3940
final authenticator = ServiceAccountAuthenticator(
40-
serviceAccountFile.readAsStringSync(), scopes);
41+
serviceAccountFile.readAsStringSync(),
42+
scopes,
43+
);
4144
final projectId = authenticator.projectId;
4245

4346
final channel = ClientChannel('logging.googleapis.com');
44-
final logging =
45-
LoggingServiceV2Client(channel, options: authenticator.toCallOptions);
47+
final logging = LoggingServiceV2Client(
48+
channel,
49+
options: authenticator.toCallOptions,
50+
);
4651

4752
final request = WriteLogEntriesRequest()
48-
..entries.add(LogEntry()
49-
..logName = 'projects/$projectId/logs/example'
50-
..severity = LogSeverity.INFO
51-
..resource = (MonitoredResource()..type = 'global')
52-
..textPayload = 'This is a log entry!');
53+
..entries.add(
54+
LogEntry()
55+
..logName = 'projects/$projectId/logs/example'
56+
..severity = LogSeverity.INFO
57+
..resource = (MonitoredResource()..type = 'global')
58+
..textPayload = 'This is a log entry!',
59+
);
5360
await logging.writeLogEntries(request);
5461

5562
await channel.shutdown();

example/googleapis/pubspec.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ description: Dart gRPC client sample for Google APIs
33
publish_to: none
44

55
environment:
6-
sdk: ">=2.12.0 <3.0.0"
6+
sdk: ^3.8.0
77

88
dependencies:
9-
async: ^2.2.0
10-
fixnum:
9+
async: ^2.13.0
10+
fixnum: ^1.1.1
1111
grpc:
1212
path: ../../
13-
protobuf: ">=3.0.0 <5.0.0"
13+
protobuf: ^4.1.0
1414

1515
dev_dependencies:
16-
lints: ^2.0.0
17-
test: ^1.6.4
16+
lints: ^6.0.0
17+
test: ^1.26.2
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
include: ../../analysis_options.yaml
2-
3-
linter:
4-
rules:
5-
directives_ordering: false
1+
include: package:lints/recommended.yaml

example/grpc-web/lib/app.dart

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,17 @@ class EchoApp {
3939
..message = message
4040
..messageCount = count
4141
..messageInterval = 500;
42-
_service.serverStreamingEcho(request).listen((response) {
43-
_addRightMessage(response.message);
44-
}, onError: (error) {
45-
_addRightMessage(error.toString());
46-
}, onDone: () => print('Closed connection to server.'));
42+
_service
43+
.serverStreamingEcho(request)
44+
.listen(
45+
(response) {
46+
_addRightMessage(response.message);
47+
},
48+
onError: (error) {
49+
_addRightMessage(error.toString());
50+
},
51+
onDone: () => print('Closed connection to server.'),
52+
);
4753
}
4854

4955
void _addLeftMessage(String message) {
@@ -55,13 +61,20 @@ class EchoApp {
5561
}
5662

5763
void _addMessage(String message, String cssClass) {
58-
document.querySelector('#first')!.after(HTMLDivElement()
59-
..classList.add('row')
60-
..append(HTMLHeadingElement.h2()
61-
..append(HTMLSpanElement()
62-
..classList.add('label')
63-
..classList.addAll(cssClass)
64-
..textContent = message)));
64+
document
65+
.querySelector('#first')!
66+
.after(
67+
HTMLDivElement()
68+
..classList.add('row')
69+
..append(
70+
HTMLHeadingElement.h2()..append(
71+
HTMLSpanElement()
72+
..classList.add('label')
73+
..classList.addAll(cssClass)
74+
..textContent = message,
75+
),
76+
),
77+
);
6578
}
6679
}
6780

example/grpc-web/pubspec.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ description: Dart gRPC-Web sample client
33
publish_to: none
44

55
environment:
6-
sdk: ^3.5.0
6+
sdk: ^3.8.0
77

88
dependencies:
99
grpc:
1010
path: ../../
11-
protobuf: ">=3.0.0 <5.0.0"
12-
web: ^1.1.0
11+
protobuf: ^4.1.0
12+
web: ^1.1.1
1313

1414
dev_dependencies:
15-
build_runner: ^2.4.13
16-
build_web_compilers: ^4.0.11
17-
lints: ^5.0.0
15+
build_runner: ^2.4.15
16+
build_web_compilers: ^4.1.5
17+
lints: ^6.0.0
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
include: ../../analysis_options.yaml
2-
3-
linter:
4-
rules:
5-
directives_ordering: false
1+
include: package:lints/recommended.yaml

0 commit comments

Comments
 (0)