'Leaf Petersen' via Dart Misc
2018-03-08 01:16:18 UTC
*What's being deprecated?*
Top level constants in the Dart 1 core libraries were named using an all
caps naming convention:
const JsonCodec JSON = const JsonCodec();
This is inconsistent with standard Dart style. In Dart 2, we have
(already) added camel case versions of constants to the library, and we are
now deprecating the old constants.
const JsonCodec json = const JsonCodec();@Deprecated("Use json instead")const JsonCodec JSON = json;
*What will break?*
Nothing, but you may get new deprecation warnings from the analyzer if you
use the old constant names.
info: 'JSON' is deprecated and shouldn't be used. (deprecated_member_use at
scratch.dart:12)
*How do I get rid of the deprecation warnings?*
Use the new constant names (generally just the camel case version of the
old name).
The library documentation
<https://api.dartlang.org/dev/2.0.0-dev.33.0/dart-convert/JSON-constant.html> for
the old name shows the new name to use.
You can also use "go to definition" in the IDE to go to the definition of
the old constant, which references the new name.
*Why is this change being made?*
SCREAMING CAPS ARE INCONSISTENT WITH STANDARD DART STYLE, AND DON'T LOOK
VERY GOOD EITHER.
*When will the old constants go away?*
We hope to remove the old constants in a future release, but because of the
very breaking nature of this change we do not anticipate doing this for the
Dart 2 release. We plan to continue to work towards removal of the old
constants in a future release, possibly with automated tooling to help with
the migration.
This has landed in bleeding edge, and will be released in the next Dart SDK
version (probably 2.0.0-dev.34.0) and rolled into Flutter bleeding edge
shortly thereafter.
As usual, please reach out to me here or offline with any concerns, and/or
with help resolving any issues after this change has landed.
thanks,
-leaf
Top level constants in the Dart 1 core libraries were named using an all
caps naming convention:
const JsonCodec JSON = const JsonCodec();
This is inconsistent with standard Dart style. In Dart 2, we have
(already) added camel case versions of constants to the library, and we are
now deprecating the old constants.
const JsonCodec json = const JsonCodec();@Deprecated("Use json instead")const JsonCodec JSON = json;
*What will break?*
Nothing, but you may get new deprecation warnings from the analyzer if you
use the old constant names.
info: 'JSON' is deprecated and shouldn't be used. (deprecated_member_use at
scratch.dart:12)
*How do I get rid of the deprecation warnings?*
Use the new constant names (generally just the camel case version of the
old name).
The library documentation
<https://api.dartlang.org/dev/2.0.0-dev.33.0/dart-convert/JSON-constant.html> for
the old name shows the new name to use.
You can also use "go to definition" in the IDE to go to the definition of
the old constant, which references the new name.
*Why is this change being made?*
SCREAMING CAPS ARE INCONSISTENT WITH STANDARD DART STYLE, AND DON'T LOOK
VERY GOOD EITHER.
*When will the old constants go away?*
We hope to remove the old constants in a future release, but because of the
very breaking nature of this change we do not anticipate doing this for the
Dart 2 release. We plan to continue to work towards removal of the old
constants in a future release, possibly with automated tooling to help with
the migration.
This has landed in bleeding edge, and will be released in the next Dart SDK
version (probably 2.0.0-dev.34.0) and rolled into Flutter bleeding edge
shortly thereafter.
As usual, please reach out to me here or offline with any concerns, and/or
with help resolving any issues after this change has landed.
thanks,
-leaf
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.