calzone 0.4.0

  • README.md
  • Installing
  • Versions
  • 47

calzone

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.

Transformers

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.

1. Depend on it

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


dependencies:
  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 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...

Analysis

This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • tool failures on Feb 16, 2018
  • Dart: 2.0.0-dev.20.0
  • pana: 0.10.1

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
16 / 100
Health:
Code health derived from static analysis. [more]
86 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
64 / 100
Overall score:
Weighted score of the above. [more]
47

Platforms

Detected platforms: Flutter, other

Platform components identified in package: io.

Suggestions

  • Fix lib/src/compiler/base_transformer.dart.

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

    line: 31 col: 55
    The getter 'types' isn't defined for the class 'TypeTransformer'.

  • Fix lib/src/analysis/visitor.dart.

    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'.

  • Fix further 1 Dart files.

    Similar analysis of the following files failed:

    • lib/src/analysis/analyzer.dart
  • Maintain CHANGELOG.md.

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

  • Fix issues reported by dartanalyzer.

    dartanalyzer reported 3 error(s) and 0 warning(s).

  • Use constrained dependencies.

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

  • 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.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.10.0 <2.0.0
analyzer 0.29.10 0.29.10 0.31.1
calzone_source_crawler 0.0.1-alpha.1
logging ^0.11.3 0.11.3+1
node_preamble ^1.0.0 1.4.0
path ^1.3.5 1.5.1
Transitive dependencies
args 0.13.7 1.3.0
async 2.0.3 2.0.4
charcode 1.1.1
cli_util 0.0.1+2 0.1.2+1
collection 1.14.5
convert 2.0.1
crypto 2.0.2+1
csslib 0.14.1
glob 1.1.5
html 0.13.2+2
isolate 1.1.0
meta 1.1.2
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+7
when 0.2.0
which 0.1.3
yaml 2.1.13
Dev dependencies
test >=0.12.3+4 <0.13.0