Skip to content

Commit

Permalink
chore(deps)!: upgrade rxdart to v0.28.0 (#612)
Browse files Browse the repository at this point in the history
* chore(deps)!: upgrade rxdart to v0.28.0

* chore: fix tests
  • Loading branch information
knaeckeKami authored Sep 26, 2024
1 parent 6276001 commit 7d39cc7
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 17 deletions.
6 changes: 5 additions & 1 deletion examples/pokemon_explorer/test/dangling_reference_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class _MyWidget extends StatelessWidget {
}

void main() {
testWidgets("test description", (WidgetTester tester) async {
testWidgets("skips dangling references", (WidgetTester tester) async {
final client = Client(
cache: Cache(possibleTypes: possibleTypesMap),
link: Link.function((request, [forward]) {
Expand Down Expand Up @@ -93,5 +93,9 @@ void main() {
expect(find.widgetWithText(ListTile, 'name0'), findsOneWidget);
expect(find.widgetWithText(ListTile, 'name1'), findsNothing);
expect(find.widgetWithText(ListTile, 'name2'), findsOneWidget);

await tester.runAsync(() {
return tester.pump(Duration.zero);
});
});
}
3 changes: 3 additions & 0 deletions examples/pokemon_explorer/test/timer_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ void main() {
},
);
await tester.pumpWidget(_MyWidget(client));
await tester.runAsync(() {
return tester.pump(Duration.zero);
});
},
variant: policies,
);
Expand Down
2 changes: 1 addition & 1 deletion packages/ferry/lib/src/request_controller_typed_link.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class RequestControllerTypedLink extends TypedLink {
/// Temporarily add a listener so that [prev] doesn't shut down when
/// switchMap is updating the stream.
final sub = prev?.listen(null);
scheduleMicrotask(() => sub?.cancel());
Future.delayed(Duration.zero, () => sub?.cancel());
},
).switchMap(
(req) {
Expand Down
2 changes: 1 addition & 1 deletion packages/ferry/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ topics:
- ferry
dependencies:
gql: '>=0.14.0 <2.0.0'
rxdart: ^0.27.1
rxdart: ^0.28.0
gql_link: '>=0.5.0 <2.0.0'
gql_exec: '>=0.4.0 <2.0.0'
meta: ^1.3.0
Expand Down
17 changes: 10 additions & 7 deletions packages/ferry/test/client/json_operation_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,21 @@ void main() {

addTearDown(client.dispose);

final req =
JsonOperationRequest(operation: Operation(document: gql.parseString(r'''
final req = JsonOperationRequest(
operation: Operation(document: gql.parseString(r'''
query Reviews {
reviews(episode: $episode, first: $first, offset: $offset) {
id
stars
}
}''')), fetchPolicy: FetchPolicy.CacheFirst, vars: {
'episode': 'NEWHOPE',
'first': 3,
'offset': 0,
});
}''')),
fetchPolicy: FetchPolicy.CacheFirst,
vars: {
'episode': 'NEWHOPE',
'first': 3,
'offset': 0,
},
);

final result = await client.request(req).first;

Expand Down
4 changes: 2 additions & 2 deletions packages/ferry_cache/lib/src/utils/operation_root_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Map<String, dynamic> operationRootData<TData, TVars>(
) {
final fieldNames = operationFieldNames(
request.operation.document,
request.operation.operationName!,
(request.vars as dynamic).toJson(),
request.operation.operationName,
request.varsToJson(),
typePolicies,
possibleTypes,
);
Expand Down
2 changes: 1 addition & 1 deletion packages/ferry_cache/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ topics:
dependencies:
ferry_exec: ^0.6.1-dev.1
meta: ^1.3.0
rxdart: ^0.27.1
rxdart: ^0.28.0
normalize: ^0.9.1
ferry_store: ^0.6.0-dev.0
collection: ^1.15.0
Expand Down
2 changes: 1 addition & 1 deletion packages/ferry_hive_store/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ topics:
dependencies:
hive: ^2.0.0
ferry_store: ^0.6.0-dev.0
rxdart: ^0.27.1
rxdart: ^0.28.0
collection: ^1.15.0
dev_dependencies:
test: ^1.16.8
Expand Down
2 changes: 1 addition & 1 deletion packages/ferry_store/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ topics:
- gql
- ferry
dependencies:
rxdart: ^0.27.1
rxdart: ^0.28.0
collection: ^1.15.0
dev_dependencies:
test: ^1.16.8
Expand Down
14 changes: 14 additions & 0 deletions packages/ferry_test_graphql2/lib/queries/books.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@



query GetBooks {
books {
title
... on Textbook {
courses
}
... on ColoringBook {
colors
}
}
}
2 changes: 1 addition & 1 deletion packages/ferry_test_graphql2/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ dev_dependencies:
pedantic: ^1.11.0
built_value_generator: ^8.1.1
dart_style: ^2.3.2
ferry_generator:
ferry_generator: ^0.12.0


Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import 'package:normalize/src/policies/type_policy.dart';
/// Returns the root field names for a given operation.
List<String> operationFieldNames<TData, TVars>(
DocumentNode document,
String operationName,
String? operationName,
Map<String, dynamic> vars,
Map<String, TypePolicy> typePolicies,
Map<String, Set<String>> possibleTypes,
Expand Down

0 comments on commit 7d39cc7

Please sign in to comment.