Skip to content

Commit 4855996

Browse files
committed
Release 1.0.2
- Small documentation and README improvements.
1 parent cffcb68 commit 4855996

File tree

5 files changed

+37
-26
lines changed

5 files changed

+37
-26
lines changed

CHANGELOG.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1+
## 1.0.2
2+
3+
- Small documentation and README improvements.
4+
15
## 1.0.1
26

37
- Sync with the status of the stable branch on August 14, 2022. No significant changes from upstream, only documentation changes.
4-
- Improve the `compute` package's README and documentation
5-
- Clarify that this packages is synced with the `stable` branch
8+
- Improve the `compute` package's README and documentation.
9+
- Clarify that this packages is synced with the `stable` branch.
610

711
## 1.0.0
812

9-
- Stable release
13+
- Stable release.
1014

1115
## 0.1.0
1216

13-
- Initial version
17+
- Initial version.

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,21 @@ is a lot of boilerplate code when all you want to do is spawn an isolate, comput
2323

2424
Flutter's `compute` function is a very useful abstraction over isolates that can be useful in all kinds of Dart apps.
2525

26-
Unfortunately, Flutter's `compute` function is not available for a Dart package is it doesn't use Flutter.
27-
Examples where this can be the case are command-line and server-side applications.
26+
Unfortunately, Flutter's `compute` function is not available for a Dart package that doesn't use Flutter,
27+
for example command-line and server-side applications.
2828

2929
This package addresses this issue. It extracts the `compute` function from Flutter and makes it available
30-
for all Dart projects, so if you wish to perform some computation on a separate isolate and use its return value
31-
in a command line tool, or any kind of non-Flutter Dart project, now you can!
30+
for all Dart projects, so if you wish to perform some computation on a separate isolate and use its return value, now you can!
3231

3332
## Disclaimers
3433

3534
Do not assume that using `compute` will automatically speed up your code:
36-
you should benchmark your Dart applications *with* and *without* the `compute` function,
35+
you should benchmark your Dart applications *with and without the `compute` function*,
3736
and only switch to using `compute` if it really speeds up your application.
3837

3938
Keep in mind, that by using `compute`, you lose some flexibility that working directly with isolates would enable you.
4039

41-
The package is safe to be used on web, but there will be no real isolates spawned
40+
The package is safe to be used on web, but there will be no real isolates spawned.
4241

4342
Changes are synced with Flutter's stable branch only (and they are currently synced manually).
4443

lib/compute.dart

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,32 @@
1-
/// When working with isolates, wiring up the `SendPort`s, the `ReceivePort`s correctly
2-
/// is a lot of boilerplate code when all you want to do is spawn an isolate, compute something, and use the computed value.
1+
/// When working with isolates, wiring up the `SendPort`s, the `ReceivePort`s
2+
/// correctly is a lot of boilerplate code when all you want to do is spawn an
3+
/// isolate, compute something, and use the computed value.
34
///
4-
/// Flutter's `compute` function is a very useful abstraction over isolates that can be useful in all kinds of Dart apps.
5+
/// Flutter's `compute` function is a very useful abstraction over isolates that
6+
/// can be useful in all kinds of Dart apps.
57
///
6-
/// Unfortunately, Flutter's `compute` function is not available for a Dart package is it doesn't use Flutter.
7-
/// Examples where this can be the case are command-line and server-side applications.
8+
/// Unfortunately, Flutter's `compute` function is not available for a Dart
9+
/// package that doesn't use Flutter, for example command-line and server-side
10+
/// applications.
811
///
9-
/// This package addresses this issue. It extracts the `compute` function from Flutter and makes it available
10-
/// for all Dart projects, so if you wish to perform some computation on a separate isolate and use its return value
11-
/// in a command line tool, or any kind of non-Flutter Dart project, now you can!
12+
/// This package addresses this issue. It extracts the `compute` function from
13+
/// Flutter and makes it available for all Dart projects, so if you wish to
14+
/// perform some computation on a separate isolate and use its return value,
15+
/// now you can!
16+
///
17+
/// **Disclaimers**
1218
///
1319
/// Do not assume that using `compute` will automatically speed up your code:
14-
/// you should benchmark your Dart applications *with* and *without* the `compute` function,
15-
/// and only switch to using `compute` if it really speeds up your application.
20+
/// you should benchmark your Dart applications
21+
/// *with and without the `compute` function*, and only switch to using
22+
/// `compute` if it really speeds up your application.
1623
///
17-
/// Keep in mind, that by using `compute`, you lose some flexibility that working directly with isolates would enable you.
24+
/// Keep in mind, that by using `compute`, you lose some flexibility that
25+
/// working directly with isolates would enable you.
1826
///
19-
/// The package is safe to be used on web, but there will be no real isolates spawned
27+
/// The package is safe to be used on web, but there will be no real isolates
28+
/// spawned.
2029
///
21-
/// Changes are synced with Flutter's stable branch only (and they are currently synced manually).
30+
/// Changes are synced with Flutter's stable branch only (and they are currently
31+
/// synced manually).
2232
export 'src/compute.dart';

lib/src/compute.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ typedef ComputeImpl = Future<R> Function<Q, R>(
7676
///
7777
/// {@youtube 560 315 https://www.youtube.com/watch?v=5AxWC49ZMzs}
7878
///
79-
/// {@tool snippet}
8079
/// The following code uses the [compute] function to check whether a given
8180
/// integer is a prime number.
8281
///
@@ -97,7 +96,6 @@ typedef ComputeImpl = Future<R> Function<Q, R>(
9796
/// return true;
9897
/// }
9998
/// ```
100-
/// {@end-tool}
10199
///
102100
/// The function used as `callback` must be one that can be sent to an isolate.
103101
/// {@template flutter.foundation.compute.callback}

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: compute
22
description: Flutter's compute function made available for all non-Flutter Dart programs
3-
version: 1.0.1
3+
version: 1.0.2
44
repository: https://github.com/dartsidedev/compute
55
homepage: https://github.com/vincevargadev
66
issue_tracker: https://github.com/dartsidedev/compute/issues

0 commit comments

Comments
 (0)