| commit | fc2c46ae82cf9c34a7c20bfaecaa759782ba1533 | [log] [tgz] |
|---|---|---|
| author | Lasse R.H. Nielsen <lrn@google.com> | Thu Jan 30 06:58:51 2025 -0800 |
| committer | Commit Queue <dart-scoped@luci-project-accounts.iam.gserviceaccount.com> | Thu Jan 30 06:58:51 2025 -0800 |
| tree | f7e506a45ea4451397d71de1ae92d1ed4a664e28 | |
| parent | f797e5f13841479c4f05e5af1248ef5fe2af673c [diff] |
Make Zone functions not call `register*`, but properly catch errors. Make `Zone.createTimer`, `Zone.createPeriodicTimer` and `Zone.scheduleMicrotask` not call register on the same zone. These are low-level functions that should not build on top of other low-level functions. Instead the function is registered in the `Timer` constructors and top-level `scheduleMicrotask` code, and the root zone's `createTimer` and `scheduleMicrotask` just make sure that the callback will run in its original zone, and that uncaught errors are handled in the correct zone. Avoids a double-registration that timers did. Significant clean-up. - The private `_Zone`, `_ZoneSpecification` and `_ZoneDelegate` subclasses are not necessary now that their superclasses are `final`. - Stopped using type aliases instead of function types and old-style function arguments. - Renamed some parameters to not be, fx, `f`. Avoided some closure allocations for microtasks by putting the zone into the queue entry, instead of wrapping the callback in a closure calling `zone.run`. This is a potentially visible change if any code uses the zone functions directly and expect them to invoke `Zone.register*`. (Suspiciously no test failed with this change. May need to add some.) Fixes #59913. CoreLibraryReviewExempt: Have had all +1s, just not at the same time. Bug: https://dartbug.com/59913 Change-Id: Ie3c87f5f22aedcbe30ab04718df98e1c0f0659c3 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/405020 Reviewed-by: Martin Kustermann <kustermann@google.com> Commit-Queue: Lasse Nielsen <lrn@google.com>
Dart is:
Approachable: Develop with a strongly typed programming language that is consistent, concise, and offers modern language features like null safety and patterns.
Portable: Compile to ARM, x64, or RISC-V machine code for mobile, desktop, and backend. Compile to JavaScript or WebAssembly for the web.
Productive: Make changes iteratively: use hot reload to see the result instantly in your running app. Diagnose app issues using DevTools.
Dart's flexible compiler technology lets you run Dart code in different ways, depending on your target platform and goals:
Dart Native: For programs targeting devices (mobile, desktop, server, and more), Dart Native includes both a Dart VM with JIT (just-in-time) compilation and an AOT (ahead-of-time) compiler for producing machine code.
Dart Web: For programs targeting the web, Dart Web includes both a development time compiler (dartdevc) and a production time compiler (dart2js).
Dart is free and open source.
See LICENSE and PATENT_GRANT.
Visit dart.dev to learn more about the language, tools, and to find codelabs.
Browse pub.dev for more packages and libraries contributed by the community and the Dart team.
Our API reference documentation is published at api.dart.dev, based on the stable release. (We also publish docs from our beta and dev channels, as well as from the primary development branch).
If you want to build Dart yourself, here is a guide to getting the source, preparing your machine to build the SDK, and building.
There are more documents in our repo at docs.
The easiest way to contribute to Dart is to file issues.
You can also contribute patches, as described in Contributing.
Future plans for Dart are included in the combined Dart and Flutter roadmap on the Flutter wiki.