Skip to content

Commit

Permalink
Released 2.0.4.
Browse files Browse the repository at this point in the history
bsutton committed Oct 17, 2022
1 parent 9342dd7 commit 78761e8
Showing 16 changed files with 365 additions and 162 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# 2.0.4
- upgraded to scope 3.0.0 as need a bug fix for async calls to Scope.run (it wouldn't wait). This required an upgrade to dcli 1.21.0 as it dependes on scope 3.0.0
- Added additional tests for the import command - still not fully tested.
- Change the import token regext to reflect tha tokens are no longer 36 chars long. Expected length i snow 56 chars.
- fix for login error message display
- Added code to log http headers when sending command and debug mode is enabled.

# 2.0.3
- update dcli

42 changes: 42 additions & 0 deletions blog.discarded.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@


### state management
``` consider removing
Flutter is a nice framework but the whole state management thing is a pain in the arse and is really Flutters Achilles' heel.
You only need to look a the very large no. of state managment libraries for Flutter to realize this is still an unsolved problem.
About half way through the project, one of the team suggested that we should be using BLOC. So we stopped for 4 weeks to roll BLOC into the app.
At the end of the 4 weeks we did a review of the resulting code.
BLOC had significantly increased the lines of code, increased code complexity and moved the state logic further from the UI which made static analysis harder (with no unit test benefits over the prior implementation).
The result was that we ripped BLOC out of the code base and went back to a hodgepodge of Provider, setState and an enhanced Future Builder.
I should note that this wasn't a trival app, having more than 50 unique screens, many of them with complex state.
```

## dart is a joy to behold
Dart on the other hand is a beautiful language.

For Flutter the combination of being cross platform and underpinned by a great language, leads me to
the conclusion that Flutter will become the dominate GUI framework (dispite it's state management issues).

``` later
I belive this to the extent, that with the launch of OnePub, I have bet my entire financial future on Flutter.
History will be the judge of my roll of the dice.
```

# dartastic revelations

Don't get me wrong, Dart does have its problems.

It's far too easy to forget to await a function call and isolates limit performance by not allowing shared memory for items like database caches.

``` remove?
The await issue is improving, with the introduction of additional lints, but we still have a way to go.
The Dart eco system, particularly on the backend, is however, still immature. It is getting better, but it is going to take time.
```
435 changes: 298 additions & 137 deletions blog.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/src/pub/entrypoint.dart
Original file line number Diff line number Diff line change
@@ -307,7 +307,7 @@ class Entrypoint {
.where((pubspec) => pubspec.dartSdkWasOverridden)
.map((pubspec) => pubspec.name)
.toList()
..sort())
..sort())
.join(', ');
if (overriddenPackages.isNotEmpty) {
log.message(log.yellow(
2 changes: 1 addition & 1 deletion lib/src/pub/source/git.dart
Original file line number Diff line number Diff line change
@@ -665,7 +665,7 @@ class GitDescription extends Description {
required this.relative,
required String? ref,
required String? path,
}) : ref = ref ?? 'HEAD',
}) : ref = ref ?? 'HEAD',
path = path ?? '.';

factory GitDescription({
4 changes: 1 addition & 3 deletions lib/src/pub/third_party/tar/src/writer.dart
Original file line number Diff line number Diff line change
@@ -287,9 +287,7 @@ class _SynchronousTarSink extends Sink<SynchronousTarEntry> {
_throwIfClosed();

_writeHeader(header, data.length);
_output
..add(data)
..add(_paddingBytes(data.length));
_output..add(data)..add(_paddingBytes(data.length));
}

@override
5 changes: 1 addition & 4 deletions lib/src/pub/utils.dart
Original file line number Diff line number Diff line change
@@ -247,10 +247,7 @@ Set<String> createDirectoryFilter(Iterable<String> dirs) {
return dirs.expand<String>((dir) {
var result = ['/$dir/'];
if (Platform.isWindows) {
result
..add('/$dir\\')
..add('\\$dir/')
..add('\\$dir\\');
result..add('/$dir\\')..add('\\$dir/')..add('\\$dir\\');
}
return result;
}).toSet();
2 changes: 1 addition & 1 deletion lib/src/pub/validator/leak_detection.dart
Original file line number Diff line number Diff line change
@@ -73,7 +73,7 @@ class LeakDetectionValidator extends Validator {
.map((leak) => leak.span.sourceUrl!.toFilePath(windows: false))
.toSet()
.toList(growable: false)
..sort();
..sort();
final s = files.length > 1 ? 's' : '';

errors.add([
4 changes: 1 addition & 3 deletions lib/src/util/send_command.dart
Original file line number Diff line number Diff line change
@@ -257,9 +257,7 @@ class EndpointResponse {
String toHex(List<int> bytes) {
final hex = StringBuffer();
for (final val in bytes) {
hex
..write(val.toRadixString(16).padLeft(2, '0'))
..write(' ');
hex..write(val.toRadixString(16).padLeft(2, '0'))..write(' ');
}
return hex.toString();
}
2 changes: 1 addition & 1 deletion lib/src/version/version.g.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/// GENERATED BY pub_release do not modify.
/// onepub version
String packageVersion = '2.0.3';
String packageVersion = '2.0.4';
2 changes: 1 addition & 1 deletion pubspec.lock
Original file line number Diff line number Diff line change
@@ -238,7 +238,7 @@ packages:
name: lint_hard
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
version: "1.0.4"
logging:
dependency: transitive
description:
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: onepub
version: 2.0.3
version: 2.0.4
homepage: https://onepub.dev
documentation: https://docs.onepub.dev
description: Command line tools for the OnePub private Dart/Flutter repository.
@@ -44,7 +44,7 @@ dependencies:
yaml: 3.1.0
yaml_edit: 2.0.2
dev_dependencies:
lint_hard: ^2.0.0
lint_hard: ^1.0.0
test: 1.17.12
executables:
onepub:
10 changes: 5 additions & 5 deletions test/fixtures/test_packag_1/pubspec.lock
Original file line number Diff line number Diff line change
@@ -63,7 +63,7 @@ packages:
name: circular_buffer
url: "https://pub.dartlang.org"
source: hosted
version: "0.11.0"
version: "0.9.1"
cli_util:
dependency: "direct dev"
description:
@@ -119,7 +119,7 @@ packages:
name: dcli_core
url: "https://pub.dartlang.org"
source: hosted
version: "1.32.0"
version: "1.20.3"
equatable:
dependency: "direct dev"
description:
@@ -203,7 +203,7 @@ packages:
name: js
url: "https://pub.dartlang.org"
source: hosted
version: "0.6.4"
version: "0.6.3"
json_annotation:
dependency: "direct dev"
description:
@@ -217,7 +217,7 @@ packages:
name: lint_hard
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
version: "1.0.4"
logging:
dependency: transitive
description:
@@ -478,4 +478,4 @@ packages:
source: hosted
version: "2.0.2"
sdks:
dart: ">=2.16.0 <3.0.0"
dart: ">=2.12.0 <3.0.0"
2 changes: 1 addition & 1 deletion test/fixtures/test_packag_1/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ dev_dependencies:
http_multi_server: ^3.0.1
http_parser: ^4.0.0
json_annotation: ^4.1.0
lint_hard: ^2.0.0
lint_hard: ^1.0.0
meta: ^1.7.0
oauth2: ^2.0.0
path: ^1.8.1
2 changes: 1 addition & 1 deletion test/fixtures/test_packag_2/pubspec.lock
Original file line number Diff line number Diff line change
@@ -7,6 +7,6 @@ packages:
name: lint_hard
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
version: "1.0.4"
sdks:
dart: ">=2.12.0 <3.0.0"
2 changes: 1 addition & 1 deletion test/fixtures/test_packag_2/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -6,4 +6,4 @@ description: A simple command-line application.
environment:
sdk: '>=2.12.0 <3.0.0'
dev_dependencies:
lint_hard: ^2.0.0
lint_hard: ^1.0.0

0 comments on commit 78761e8

Please sign in to comment.