js_wrapping_generator 0.4.7

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 63

Dart Js Wrapping generator

A generator of Js wrappers. See js_wrapping package for details.

See CHANGELOG of the js_wrapping package for details.

example/example.dart

// Copyright (c) 2015, Alexandre Ardhuin. All rights reserved. Use of this
// source code is governed by a BSD-style license that can be found in the
// LICENSE file.

@JsName('z.y.x')
library js_wrapping_generator.example.js_proxy;

import 'package:js_wrapping/js_wrapping.dart';
import 'package:js_wrapping/util/state.dart';

part 'example.g.dart';

abstract class _JsFoo implements JsInterface {
  static int get static1 => $js;
  static int static2;
  static int staticMethod(JsFoo foo) => $js;

  factory _JsFoo() => null;

  List l1;
  List<num> l2;
  List<JsFoo> l3;

  @JsName('_i')
  int i;

  @JsName('k')
  num k1, k2;
  int j = null;
  bool get l;

  String get a;
  void set a(String a);

  String get b => '';
  void set b(String b) {}

  m1();
  void m2();
  String m3();
  String m4(int a);
  int m5(int a, b);
  @JsName('_m6')
  int _m6(int a, b);
}

callM6(JsFoo foo) => foo._m6(1, 2);

@JsName('a.b.JsBar')
abstract class _JsBar extends JsInterface {
  _JsBar.created(JsObject o) : super.created(o) {
    getState(this).putIfAbsent(#a, () => 0);
  }

  factory _JsBar() = dynamic;
  factory _JsBar.named(int x, int y) = dynamic;

  JsBar m1();

  void set a(int a) {
    getState(this)[#a] = a;
  }

  int get a => getState(this)[#a] as int;
}

abstract class _JsBaz extends JsBar {
  factory _JsBaz() = dynamic;
}

abstract class __Context implements JsInterface {
  int find(String a);

  String a;

  String get b;

  set b(String b1);
}

final _context = new _Context.created(context);

final find = _context.find;
String get a => _context.a;
void set a(String _a) {
  _context.a = _a;
}

String get b => _context.b;
void set b(String _b) {
  _context.b = _b;
}

Use this package as a library

1. Depend on it

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


dependencies:
  js_wrapping_generator: "^0.4.7"

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:js_wrapping_generator/js_wrapping_generator.dart';
  
Version Uploaded Documentation Archive
0.4.7 Apr 13, 2018 Go to the documentation of js_wrapping_generator 0.4.7 Download js_wrapping_generator 0.4.7 archive
0.4.6 Apr 13, 2018 Go to the documentation of js_wrapping_generator 0.4.6 Download js_wrapping_generator 0.4.6 archive
0.4.5 Apr 7, 2018 Go to the documentation of js_wrapping_generator 0.4.5 Download js_wrapping_generator 0.4.5 archive
0.4.4 Apr 6, 2018 Go to the documentation of js_wrapping_generator 0.4.4 Download js_wrapping_generator 0.4.4 archive
0.4.2 Aug 30, 2017 Go to the documentation of js_wrapping_generator 0.4.2 Download js_wrapping_generator 0.4.2 archive
0.4.1 Aug 28, 2017 Go to the documentation of js_wrapping_generator 0.4.1 Download js_wrapping_generator 0.4.1 archive
0.4.0 Jun 20, 2017 Go to the documentation of js_wrapping_generator 0.4.0 Download js_wrapping_generator 0.4.0 archive
0.3.0+1 Feb 20, 2017 Go to the documentation of js_wrapping_generator 0.3.0+1 Download js_wrapping_generator 0.3.0+1 archive
0.3.0 Nov 15, 2016 Go to the documentation of js_wrapping_generator 0.3.0 Download js_wrapping_generator 0.3.0 archive
0.0.3 Feb 4, 2014 Go to the documentation of js_wrapping_generator 0.0.3 Download js_wrapping_generator 0.0.3 archive

All 12 versions...

Analysis

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

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

Scores

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

Platforms

Detected platforms: other

Primary library: package:js_wrapping_generator/js_wrapping_generator.dart with components: io, build, mirrors.

Suggestions

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

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.44.0 <2.0.0
analyzer ^0.31.1 0.31.1 0.32.1
build ^0.12.0 0.12.6
js_wrapping 0.4.7 0.4.7
path ^1.5.1 1.6.0
source_gen ^0.8.0 0.8.1+3
Transitive dependencies
args 1.4.3
async 2.0.7
charcode 1.1.1
cli_util 0.1.3
collection 1.14.10
convert 2.0.1
crypto 2.0.3
csslib 0.14.4
dart_style 1.0.9+1 1.0.14
front_end 0.1.0-alpha.9 0.1.1
glob 1.1.5
html 0.13.3+1
isolate 1.1.0 2.0.1
kernel 0.3.0-alpha.9 0.3.1
logging 0.11.3+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
yaml 2.1.14
Dev dependencies
browser ^0.10.0
build_runner ^0.8.1
build_test ^0.10.0
test ^0.12.0