Skip to content
This repository was archived by the owner on May 13, 2023. It is now read-only.

Commit 47c25c1

Browse files
authored
fix: make isolate optional (#103)
* fix: make isolate optional * publish v1.2.1 * update changelog * update readme
1 parent d912bb6 commit 47c25c1

File tree

5 files changed

+13
-8
lines changed

5 files changed

+13
-8
lines changed

CHANGELOG.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1+
## [1.2.1]
2+
3+
- fix: remove the breaking change that was introduced in v1.2.0 [#103](https://github.com/supabase/postgrest-dart/pull/103)
4+
15
## [1.2.0]
26

3-
- feat: use isolates only for huge JSON and reuse isolates [#90](https://github.com/supabase/postgrest-dart/pull/90)
7+
- BREAKING: use isolates only for huge JSON and reuse isolates [#90](https://github.com/supabase/postgrest-dart/pull/90)
8+
* This breaking chnge has been removed in v1.2.1
49

510
## [1.1.1]
611

lib/src/postgrest_builder.dart

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class PostgrestBuilder<T, S> implements Future<T> {
3333
late Uri _url;
3434
PostgrestConverter<T, S>? _converter;
3535
late final Client? _httpClient;
36-
late final YAJsonIsolate _isolate;
36+
late final YAJsonIsolate? _isolate;
3737
// ignore: prefer_final_fields
3838
FetchOptions? _options;
3939

@@ -44,7 +44,7 @@ class PostgrestBuilder<T, S> implements Future<T> {
4444
String? method,
4545
dynamic body,
4646
Client? httpClient,
47-
required YAJsonIsolate isolate,
47+
YAJsonIsolate? isolate,
4848
FetchOptions? options,
4949
}) {
5050
_url = url;
@@ -212,8 +212,8 @@ class PostgrestBuilder<T, S> implements Future<T> {
212212
body = response.body;
213213
} else {
214214
try {
215-
if ((response.contentLength ?? 0) > 10000) {
216-
body = await _isolate.decode(response.body);
215+
if ((response.contentLength ?? 0) > 10000 && _isolate != null) {
216+
body = await _isolate!.decode(response.body);
217217
} else {
218218
body = jsonDecode(response.body);
219219
}

lib/src/postgrest_query_builder.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class PostgrestQueryBuilder<T> extends PostgrestBuilder<T, T> {
1515
String? schema,
1616
Client? httpClient,
1717
FetchOptions? options,
18-
required YAJsonIsolate isolate,
18+
YAJsonIsolate? isolate,
1919
}) : super(
2020
url: Uri.parse(url),
2121
headers: headers ?? {},

lib/src/version.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
const version = '1.2.0';
1+
const version = '1.2.1';

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: postgrest
22
description: PostgREST client for Dart. This library provides an ORM interface to PostgREST.
3-
version: 1.2.0
3+
version: 1.2.1
44
homepage: 'https://supabase.com'
55
repository: 'https://github.com/supabase/postgrest-dart'
66

0 commit comments

Comments
 (0)