To contribute to this and future issues, feel free to contribute on GitHub or suggest content for next week on GitHub discussions.
To discuss this week's issue,
feel free to join us on the Unofficial Dart Community Discord
in the #this-week-in-dart
channel.
Dart 3 is scheduled for launch around mid 2023! The primary change is sound null safety will be required. There will also likely be some new features such as patterns and records, alongside some breaking changes.
To learn more about the path to Dart 3 as well as its planned features and breaking changes, checkout The road to Dart 3: A fully sound, null safe language.
The Dart analyzer has long had support for a few "strong mode" options,
including --no-implicit-dynamic
which reports an error
if type inference chooses dynamic
and no-implicit-casts
which reports an error when a cast is made implicitly.
These modes have been deprecated and are expected to be removed in Dart 3.
If you'd like these and other strict checks in your projects, you should migrate to the newer strict modes the analyzer supports. To learn more about their functionality and how to enable them, see Enabling additional type checks on dart.dev.
dart:convert
interface.38 unique authors have contributed 121 commits to the Dart SDK over the past two weeks.
The following are some handpicked, interesting changes:
Keep in mind, none of these changes are guaranteed to eventually land in a stable release.
The last week saw continued work on records and patterns in the SDK and its various tooling and compilers.
Give records a shot with a dev build of the SDK
and by enabling the records
experiment.
To learn how to enable experiments, see
Using experiment flags with command-line tools and
Using experiment flags with the Dart analyzer.
In other news, what was previously known as view classes, has been renamed to inline classes along with some other changes.
Inline classes can provide a replacement of the members available on instances of existing types, where the available members are determined by the static type. These can act as "zero-cost abstractions", not requiring a wrapper object.
To learn more about or comment on inline classes, see the Inline classes feature specification PR.
To learn more about and contribute to discussion around other potential changes to the Dart language, visit the Dart language repository.
The package of the week is package:isolate_agents!
package:isolate_agents
is a package intended
to make long-living isolates easier to work with.
The package introduces an Agent
class,
implementing the actor model for Dart,
enabling easier concurrent processing
with a built-in mechanism for communication.
To learn more about the package's background and functionality, check out the blog post isolate_agents: Easy Isolates for Flutter. For general information about concurrency, see Concurrency in Dart.
The package has not yet had a stable release and is looking for feedback on the design and implementation.
Dart's package ecosystem is growing fast, and we want to help foster that growth. If you know of any great open source projects, let us know by suggesting a package on GitHub discussions.
Share quotes and comments you see and hear about Dart on our quotes discussion board for future inclusion!
Check the Flutter Meetup Network and the Dart Language tag on Meetup to find an event near you or online and connect with other Dart developers!
Let us know about future events on the events discussion board to include here!
If you know of any jobs which use or are related to Dart, let us know in the Job postings for Dart discussion board, and we will be happy to include them here!
]]>This Week in Dart's aim is to be a useful collection of changes and news from across the Dart ecosystem and its surrounding community.
To contribute to this and future issues, feel free to contribute on GitHub or suggest content for next week on GitHub discussions.
To discuss this week's issue,
feel free to join us on the Unofficial Dart Community Discord
in the #this-week-in-dart
channel.
These last two weeks saw the release of Dart 2.18.5, a patch release with the following fixes and improvements:
To learn how to update your Dart version, check out Get the Dart SDK or download the update from the Dart SDK archive.
A breaking change request has also been made this week and is open for review and feedback:
Head to the linked issue to learn more about the potential breaking change, the reasoning behind it, its impact, and potential mitigations. Feel free to leave comments or concerns.
Generally the Dart team strives to not make breaking changes, and to preserve compatibility of all Dart programs across stable Dart SDK releases, but sometimes breaking changes are needed or justified. To learn more about this process, see Dart SDK breaking change process.
This is your reminder to migrate your packages and apps to sound null safety which is supported with a language version of 2.12 or later.
Sound null safety can bring many benefits to your projects and is required to maintain future compatibility with Dart and packages as they continue to evolve. To learn more about migrating, see Migrating to null safety.
Dart 3, planned for a mid-2023 release, will require sound null safety. To learn more, see the Dart 3 null safety tracking SDK issue.
53 unique authors have contributed 242 commits to the Dart SDK over the past two weeks.
The following are some handpicked, interesting changes:
dart bug
commandKeep in mind, none of these changes are guaranteed to eventually land in a stable release.
Specification, implementation, and tooling work has been continuing for records and patterns.
In terms of the specifications, the 2.18 and 2.19 releases of the patterns specification were released over these pasts two weeks with the following additions and changes:
=>
in switch expression guardsExtracted from a larger type modifier proposal,
a proposal for base
, interface
, and final
type modifiers
was also introduced.
These can be placed on classes and mixins to allow an author
to control whether the type allows being
implemented, extended, both, or neither.
Read the feature specification
for more information on their functionality and motivation.
To learn more about and contribute to discussion of these and other potential changes to the Dart language, visit the Dart language repository.
The package of the week is package:puppeteer!
package:puppeteer
is a port of the Puppeteer Node.js library
to Dart which enables you to automate a Chrome or Chromium browser
over the DevTools Protocol.
Many of things you can do in the browser manually can be done using Puppeteer through Dart code. Some common tasks that Puppeteer enables are:
Puppeteer enables extensive control and makes it easy,
even automatically installing the Chromium binaries for you.
It also allows you to run the browser in headless or "headful" mode,
depending on your use case.
If you need anything from the browser,
look no further than package:puppeteer
.
To learn more about Puppeteer for Dart, visit its pub page where it has examples or its generated API docs.
Dart's package ecosystem is growing fast, and we want to help foster that growth. If you know of any great open source projects, let us know by suggesting a package on GitHub discussions.
Check the Flutter Meetup Network and the Dart Language tag on Meetup to find an event near you or online and connect with other Dart developers!
Let us know about future events on the events discussion board to include here!
Share quotes and comments you see or hear about Dart on our quotes discussion board for future inclusion!
If you know of any jobs which use or are related to Dart, let us know in the Job postings for Dart discussion board, and we will be happy to include them here!
]]>To contribute to this and future issues, feel free to contribute on GitHub or suggest content for next week on GitHub discussions.
To discuss this week's issue,
feel free to join us on the Unofficial Dart Community Discord
in the #this-week-in-dart
channel.
If you haven't already and your package is open source,
consider specifying the repository
field in your pubspec.yaml
file.
The package analysis tools and the pub.dev site
use the specified link to populate links on the package site
and in the future may use it for git repository verification.
In Dart 2.19, using a colon (:
) to separate a named parameter
from its default value will result in a warning by the analyzer.
While most code should already use an equal sign (=
) already,
make sure your code is migrated.
You can enable the prefer_equal_for_default_values
lint
then use the dart fix
tool
to automatically transition all current usages and avoid future ones.
??
and throw
work together39 unique authors have contributed 125 commits to the Dart SDK in the past week.
The following are some handpicked, interesting changes:
Dart_IsNull
in dart_api_dl.h
Keep in mind, none of these changes are guaranteed to eventually land in a stable release.
Specification and implementation work continues for records and patterns.
In terms of the specifications, the 2.17 release of the patterns specification was released this week with the following changes:
||
and &&
instead of just |
and &
to avoid ambiguity around as
expressionsrelationalExpression
to bitwiseOrExpression
While not new this week, unnamed libraries have been implemented in the SDK and are set to be supported in Dart 2.19. Unnamed libraries allow users to document a library and associate metadata with a library without needing to decide on a library name.
To learn more about and contribute to discussion of these and other potential changes to the Dart language, visit the Dart language repository.
The package of the week is package:meta!
package:meta
is a package built by the Dart team
providing a set of annotations to better express developer intentions
that can't otherwise be deduced by statically analyzing source code.
Tools such as Dart's analyzer can use the information provided by the tools to provide feedback if your code violates intentions signaled by these intentions.
One popular example is the @required
annotation
used to signal a named parameter was required
before the introduction of the required
keyword.
Another is @immutable
, which lets the analyzer warn
you if a class with this annotation is not immutable.
To learn more about many of the useful annotations provided,
visit the API documentation of package:meta
on pub.dev.
These annotations can be used to improve code quality and avoid potential bugs, helping not only you as a developer but also the users of your libraries.
Dart's package ecosystem is growing fast, and we want to help foster that growth. If you know of any great open source projects, let us know by suggesting a package on GitHub discussions.
Check the Flutter Meetup Network and the Dart Language tag on Meetup to find an event near you or online and connect with other Dart developers!
Let us know about future events on the events discussion board to include here!
Share quotes and comments you see and hear about Dart on our quotes discussion board for future inclusion!
If you know of any jobs which use or are related to Dart, let us know in the Job postings for Dart discussion board, and we will be happy to include them here!
]]>