Friday, November 16, 2012

Breaking Change: Deprecated Language Features Will No Longer be Supported by Dart2js

Peter von der Ahé writes:
dart2js will soon start rejecting code that uses certain deprecated language features.  Right now, the compiler is warning  about these language features, but it will soon reject code that uses 

The compiler, dart2js, will soon start rejecting the following deprecated language features: 

* Interface declarations.  Use abstract classes instead. 

* Getters with explicit parameter lists "()".  Just remove the parentheses. 

* Old-style #library, #import, and #source syntax.  Convert to new-style syntax: 



    library foo; 



    part 'foo.dart'; 

    #import('foolib.dart', prefix: 'foo'); 


    import 'foolib.dart' as foo; 

* triple-equal operators, === and !===.  Use the function "identical" instead. 

* The keyword "Dynamic".  Use dynamic instead (all lowercase). 

You can check that your code is up to spec with the dart2js options --analyze-all and --reject-deprecated-language-features. 


PS: If you're working on the platform libraries, you can use --report-sdk-use-of-deprecated language-features to see what deprecated language features the platform libraries are using. 
As always, we invite you to join our Dart mailing list, ask questions on Stack Overflow, or file feature requests on