calzone 0.4.0

  • Installing
  • Versions
  • 40


Use your Dart library from JavaScript!

A compiler/patcher for a JS bridge to your Dart library, using dart2js and analyzer.

Even though calzone.dart is reaching maturity, if you're interested in using it and are having problems using it, please contact mbullington on the Dart Slack.


A large part of calzone works by transformers. A transformer is an addon to the compiler that will bridge together a Dart type (or types) with their JavaScript equivalents. An example of this is the PromiseTransformer, where it will take Promises and convert them to Futures, and vice versa. This API is frozen and is available for projects using calzone to build their own.

The best example of this is in the calzone.transformers library, which is our standard library for transformers. Most of these transformers are suggested for use, such as Promises <-> Future, Closure, and Collections.

Using calzone

Please refer to the Wiki on how to use calzone, starting with Creating a Stub, then Internal Workings. For most usecases, you'll want to use the high-level Builder abstraction.

For an example of using Builder, please refer to test/, or to sdk-dslink-javascript.

Use this package as a library

1. Depend on it

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

  calzone: "^0.4.0"

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:

      import 'package:calzone/analysis.dart';

      import 'package:calzone/builder.dart';

      import 'package:calzone/compiler.dart';

      import 'package:calzone/patcher.dart';

      import 'package:calzone/transformers.dart';

      import 'package:calzone/util.dart';

      import 'package:calzone/visitor_typescript.dart';
Version Uploaded Documentation Archive
0.4.0 Dec 11, 2017 Go to the documentation of calzone 0.4.0 Download calzone 0.4.0 archive
0.3.0 Apr 6, 2017 Go to the documentation of calzone 0.3.0 Download calzone 0.3.0 archive
0.2.1 Aug 27, 2016 Go to the documentation of calzone 0.2.1 Download calzone 0.2.1 archive
0.2.0 Aug 27, 2016 Go to the documentation of calzone 0.2.0 Download calzone 0.2.0 archive
0.1.8 Jul 6, 2016 Go to the documentation of calzone 0.1.8 Download calzone 0.1.8 archive
0.1.7 Feb 19, 2016 Go to the documentation of calzone 0.1.7 Download calzone 0.1.7 archive
0.1.6 Feb 4, 2016 Go to the documentation of calzone 0.1.6 Download calzone 0.1.6 archive
0.1.5 Dec 24, 2015 Go to the documentation of calzone 0.1.5 Download calzone 0.1.5 archive
0.1.4 Dec 24, 2015 Go to the documentation of calzone 0.1.4 Download calzone 0.1.4 archive
0.1.3 Dec 23, 2015 Go to the documentation of calzone 0.1.3 Download calzone 0.1.3 archive

All 13 versions...


We analyzed this package on Jun 19, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.63.0
  • pana: 0.11.3


Describes how popular the package is relative to other packages. [more]
0 / 100
Code health derived from static analysis. [more]
85 / 100
Reflects how tidy and up-to-date the package is. [more]
71 / 100
Overall score:
Weighted score of the above. [more]
Learn more about scoring.


Detected platforms: Flutter, other

Platform components identified in package: io.


  • Maintain

    Changelog entries help clients to follow the progress in your code.

  • Use constrained dependencies.

    The pubspec.yaml contains 1 dependency without version constraints. Specify version ranges for the following dependencies: calzone_source_crawler.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 9 errors 22 hints.

    Strong-mode analysis of lib/src/analysis/analyzer.dart failed with the following error:

    line: 16 col: 80
    The getter 'name' isn't defined for the class 'Directive'.

    Strong-mode analysis of lib/src/analysis/visitor.dart failed with the following error:

    line: 45 col: 19
    The getter 'fields' isn't defined for the class 'ClassMember'.

    Similar analysis of the following files failed:

    • lib/src/compiler/base_transformer.dart (error)
    • lib/analysis.dart (hint)
    • lib/builder.dart (hint)
    • lib/compiler.dart (hint)
    • lib/patcher.dart (hint)
    • lib/src/compiler/compiler.dart (hint)
    • lib/src/compiler/nodes/class.dart (hint)
    • lib/src/transformers/buffer.dart (hint)
    • lib/src/transformers/closure.dart (hint)
    • lib/src/transformers/promise.dart (hint)
    • lib/visitor_typescript.dart (hint)
  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use calzone.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.10.0 <2.0.0
analyzer 0.29.10 0.29.10 0.32.1
calzone_source_crawler 0.0.1-alpha.1
logging ^0.11.3 0.11.3+1
node_preamble ^1.0.0 1.4.2
path ^1.3.5 1.6.1
Transitive dependencies
args 0.13.7 1.4.3
async 2.0.7
charcode 1.1.1
cli_util 0.0.1+2 0.1.3
collection 1.14.10
convert 2.0.1
crypto 2.0.5
csslib 0.14.4
glob 1.1.5
html 0.13.3+1
isolate 1.1.0 2.0.1
meta 1.1.5
package_config 1.0.3
plugin 0.2.0+2
source_span 1.4.0
string_scanner 1.0.2
typed_data 1.1.5
utf 0.9.0+4
watcher 0.9.7+8
when 0.2.0
which 0.1.3
yaml 2.1.14
Dev dependencies
test >=0.12.3+4 <0.13.0