dart2ts 0.9.15

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 0

TLDR

Dart2TS is a dart1.x to typescript compiler.

Usage

Install the tool :

pub global activate dart2ts

Launch it:

dart2ts build <path_to_your_dart_package>

Package Requirements

The package to translate should be in strong mode with all the dependencies resolved.

The stronger it is the better dart2ts can understand it and translate it.

Details

Dart2TS is a new approach of developing with Dart. You can write actual dart code and have it translated to effective typescript code. From there you can continue writing in dart or switch to typescript.

The main advantages of using dart2ts instead of the traditional dart2js or dartdevc compilers is a better integration with the javascript / typescript / nodejs ecosystem.

You can end up writing nodejs packages or webpack application using dart.

What is working

Pretty much every constructs from dart1.x:

  • named constructors
  • factory constructors
  • async await
  • generators
  • named parameters

Help

If you want to help you're welcome. These are some of the things that needs some helps:

  • improve code coverage
  • test
  • improve incremental building
  • port to dart2.0

Dart core libraries

Dart core libraries (dart:core, dart:async) are been ported to typescript and are available here.

In order to access dart2ts node packages you'll have add the following registers to your configuration:

npm config set @dart2ts.packages:registry=https://npm.dart-polymer.com
npm config set @dart2ts:registry=https://npm.dart-polymer.com

v0.9.15

  • Fixed wrong prefix op overrides (some are user definable ...)
  • Introduction to class interfaces ( == class interface with no constructors)

v0.9.14

  • fixed issue with multiple fields init
  • better handling of static methods on native types
  • better ordering of emitted declaration
  • missing not operator
  • better handling of constructors for native types (string)
  • prefix and postfix operator not user definable

v0.9.13

  • fixed string escape nasty bug

v0.9.12

  • better support for try catch with type clause
  • completed dart type name mapping
  • added option to specify an overrides yaml file

v0.9.11

  • fixed little bug when translating async closures.

v0.9.10

  • null aware operator support

Use this package as an executable

1. Install it

You can install the package from the command line:


$ pub global activate dart2ts

2. Use it

The package has the following executables:


$ dart2ts

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  dart2ts: ^0.9.15

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:dart2ts/dart2ts.dart';
  
Version Uploaded Documentation Archive
0.9.15 Oct 28, 2018 Go to the documentation of dart2ts 0.9.15 Download dart2ts 0.9.15 archive
0.9.14 Oct 26, 2018 Go to the documentation of dart2ts 0.9.14 Download dart2ts 0.9.14 archive
0.9.13 Oct 21, 2018 Go to the documentation of dart2ts 0.9.13 Download dart2ts 0.9.13 archive
0.9.12 Oct 21, 2018 Go to the documentation of dart2ts 0.9.12 Download dart2ts 0.9.12 archive
0.9.11 Oct 14, 2018 Go to the documentation of dart2ts 0.9.11 Download dart2ts 0.9.11 archive
0.9.10 Oct 13, 2018 Go to the documentation of dart2ts 0.9.10 Download dart2ts 0.9.10 archive
0.9.9 Oct 5, 2018 Go to the documentation of dart2ts 0.9.9 Download dart2ts 0.9.9 archive
0.9.0 Oct 2, 2018 Go to the documentation of dart2ts 0.9.0 Download dart2ts 0.9.0 archive
0.0.1 Oct 31, 2017 Go to the documentation of dart2ts 0.0.1 Download dart2ts 0.0.1 archive
1.0.0-rc.1 Oct 5, 2018 Go to the documentation of dart2ts 1.0.0-rc.1 Download dart2ts 1.0.0-rc.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
0
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
0
Overall:
Weighted score of the above. [more]
0
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Analysis issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see https://www.dartlang.org/dart-2#migration.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.8.0 <2.0.0