Skip to content

Commit

Permalink
Fix bugs
Browse files Browse the repository at this point in the history
Signed-off-by: trdthg <trdthg@outlook.com>
  • Loading branch information
trdthg committed Oct 11, 2022
1 parent 7c3b34a commit dcada79
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 17 deletions.
2 changes: 0 additions & 2 deletions .env

This file was deleted.

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
*.iml
target
launch.json
.local-chromium
.local-chromium
.env
19 changes: 19 additions & 0 deletions book/src/en/feature/lang_chrono.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# chrono

Codegen optionally support [chrono crate](https://docs.rs/chrono) with feature `chrono`.

| :crab: Rust | :dart: Dart |
| ----------- | ----------- |
| `DateTime<Utc>` | `DateTime` *utc* |
| `DateTime<Local>` | `DateTime` *local timezone* |
| `NaiveDateTime` | `DateTime` *utc assumed* |
| `Duration` | `Duration` |

:warning: Please note that:

- on native platforms, *microseconds* unit is used.
- on web platform, *milliseconds* unit is used (due to JS limitation with dates).

:bulb: Also a `DateTime<Local>` will always be translated into local time of the device, which might not be what you want if you expect them to be sent *as-is*.

> In that case, you could implement it in your codebase by sending a `u32` (timezone offset) alongside the `i64` (timestamp) over the wire, or open a issue / PR here to further discuss it. The reason why this choice was originally made is to have all `DateTime<Utc>`, `DateTime<Local>` and `NaiveDateTime` been represented by a single `i64`.
11 changes: 11 additions & 0 deletions book/src/en/feature/lang_uuid.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# uuid

Codegen optionally support [uuid crate](https://docs.rs/uuid) with feature `uuid`.

| :crab: Rust | :dart: Dart |
| ----------- | ----------- |
| `Uuid` | `UuidValue` see package [uuid](https://pub.dev/packages/uuid) |

:warning: Please note that you need to add package [uuid](https://pub.dev/packages/uuid/install) to your Dart/Flutter dependencies in `pubspec.yaml` as well.

:bulb: `Vec<Uuid>` implementation detail : all the uuids get concatenated as a single array of bytes for performance optimization.
14 changes: 7 additions & 7 deletions frb_example/pure_dart/dart/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ packages:
name: _fe_analyzer_shared
url: "https://pub.dartlang.org"
source: hosted
version: "47.0.0"
version: "49.0.0"
analyzer:
dependency: transitive
description:
name: analyzer
url: "https://pub.dartlang.org"
source: hosted
version: "4.7.0"
version: "5.1.0"
archive:
dependency: transitive
description:
Expand Down Expand Up @@ -210,7 +210,7 @@ packages:
name: freezed
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0+1"
version: "2.1.1"
freezed_annotation:
dependency: "direct main"
description:
Expand Down Expand Up @@ -476,21 +476,21 @@ packages:
name: test
url: "https://pub.dartlang.org"
source: hosted
version: "1.21.4"
version: "1.21.6"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.12"
version: "0.4.14"
test_core:
dependency: "direct main"
description:
name: test_core
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.16"
version: "0.4.18"
timing:
dependency: transitive
description:
Expand Down Expand Up @@ -548,4 +548,4 @@ packages:
source: hosted
version: "3.1.1"
sdks:
dart: ">=2.17.0 <3.0.0"
dart: ">=2.18.0 <3.0.0"
14 changes: 7 additions & 7 deletions frb_example/pure_dart_multi/dart/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ packages:
name: _fe_analyzer_shared
url: "https://pub.dartlang.org"
source: hosted
version: "47.0.0"
version: "49.0.0"
analyzer:
dependency: transitive
description:
name: analyzer
url: "https://pub.dartlang.org"
source: hosted
version: "4.7.0"
version: "5.1.0"
archive:
dependency: transitive
description:
Expand Down Expand Up @@ -210,7 +210,7 @@ packages:
name: freezed
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0+1"
version: "2.1.1"
freezed_annotation:
dependency: "direct main"
description:
Expand Down Expand Up @@ -476,21 +476,21 @@ packages:
name: test
url: "https://pub.dartlang.org"
source: hosted
version: "1.21.4"
version: "1.21.6"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.12"
version: "0.4.14"
test_core:
dependency: transitive
description:
name: test_core
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.16"
version: "0.4.18"
timing:
dependency: transitive
description:
Expand Down Expand Up @@ -548,4 +548,4 @@ packages:
source: hosted
version: "3.1.1"
sdks:
dart: ">=2.17.0 <3.0.0"
dart: ">=2.18.0 <3.0.0"

0 comments on commit dcada79

Please sign in to comment.