Skip to content

JS-interop example produces > 670kb .js file #11218

Closed
@sethladd

Description

@sethladd

This example:

import 'dart:html';
import 'package:js/js.dart' as js;

void main() {
  var context = js.context;
  js.scoped(() {
    var hug = new js.Proxy(context.Hug);
    var result = hug.embrace(10);
    query('#output').text = result;
  });
}

Calling this JS file:

function Hug(strength) {
  this.strength = strength;
}

Hug.prototype.embrace = function(length) {
  return 'thanks, that was a good hug for ' + length + ' minutes!';
}

Hug.prototype.patBack = function(onDone) {
  onDone('all done');
}

produces a 676kb .js file.

I am using Dart Editor version 0.5.16_r23799

Note: minifying the output code breaks Dart-JS interop.

Metadata

Metadata

Labels

P1A high priority bug; for example, a single project is unusable or has many test failuresweb-dart2js

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions