Questions tagged [dart2js]

The Dart to JavaScript compiler that reads a Dart file and translates it to JavaScript.

The Dart to JavaScript compiler that reads a Draft file and translates it to JavaScript. It generates JavaScript source code from the Draft files. The name of the tool used to compile the code is draft2js. Dart Editor uses dart2js behind the scenes whenever Dart Editor compiles to JavaScript. It produces a file that contains the JavaScript equivalent of the Dart code. It also produces a source map, which can help to debug the JavaScript version of the app more easily.

196 questions
1
vote
0 answers

Two Level class and interface extension throwing dart2js error because of different interfaces

I am having the following situation which is a bit hard to explain, but I will try anyway to make it as clear as I can. I am working on a package for WebRTC that should be building dart applications. It was already done but I decided to rewrite the…
Robert
  • 5,484
  • 1
  • 22
  • 35
1
vote
0 answers

main.dart.js not produced on build

I haven't build in a long time so I dont know if this is new or not, but recently I decided to use async and await to make code look nicer. However, I tried to build just to verity it worked on JS but I am getting two cases depending on what I…
Cristian Garcia
  • 9,630
  • 6
  • 54
  • 75
1
vote
1 answer

Why copy & paste dart2js' output to console doesn't work?

compile the following code with dart2js -o test.js test.dart open test.js, copy its content open browser, go to stackoverflow.com open dev tools, go to console tab paste test.js's content into console, hit Enter I expect it to click the "Ask…
Not an ID
  • 2,579
  • 2
  • 21
  • 28
1
vote
2 answers

How to control the string encoding UTF

When compiling to javaScript the dart2js compiler converts the string to an escaped utf format \u043d\u041d... I am not sure why his is done (the original file contains text strings that are in cyrillic, but the system (and hopefully DartEditor)…
Peter StJ
  • 2,297
  • 3
  • 21
  • 29
1
vote
1 answer

Why is Module.DEFAULT_REFLECTOR not initialized?

This is an Angular 1.0 application. The error in Chrome's console is: Uncaught Module.DEFAULT_REFLECTOR not initialized for dependency injection.http://goo.gl/XFXx9G I've read the other posts, and I do have the Angular transformer in my…
Isvara
  • 3,403
  • 1
  • 28
  • 42
1
vote
1 answer

Modify dart2js output about deferred library

I'm using Dart for a chrome extension. I inject code via content_scripts option in the manifest.json My injected code contains a deferred library. So, when the code is injected, it trys to get deferred at the wrong url. Example Dart file library…
Druxtan
  • 1,311
  • 2
  • 15
  • 21
1
vote
1 answer

Deploy Polymer Dart application

Is there any way how to build pure JavaScript (or production ready) Polymer application? I've just built polymer application, but I have some issues: in build directory are buildLogs files, dart files + whole packages files are not minified, dart…
Zdeněk Mlčoch
  • 722
  • 6
  • 17
1
vote
0 answers

Dart2JS extended td not working in Firefox/IE

I'm trying to build a simple CRUD-table by using polymer with dart. The application consists of: -"crud-th" = TableRowElement which extends th -"crud-tr" = TableRowElement which extends tr -"crud-td" = TableCellElement which extends td I'm…
kevj
  • 55
  • 1
  • 8
1
vote
2 answers

Pyramid, Dart, setuptools

I'm starting to develop a web application in python 3 in the Pyramid framework and I would really like to use Dart instead of js. However, dart must be compiled to js in order to run in all browsers. My question: what is a good workflow for…
zegkljan
  • 8,051
  • 5
  • 34
  • 49
1
vote
2 answers

What is the /packages/$sdk/ folder inside a Google Dart build for?

After building a Google Dart web app in Dart Editor (the Pub Build (Generates JS) option) the folder layout is like this. My app imports both dart:html and dart:async but It seems I can upload everything but the $sdk folder to my server and the app…
Chris
  • 68
  • 8
1
vote
1 answer

Does dart2js optimize const objects better?

Are class instances created with a const constructor more optimized than the normal instances (created with a new constructor) when compiled to JavaScript with dart2js?
JAre
  • 4,666
  • 3
  • 27
  • 45
1
vote
1 answer

Package dart lib into single javascript file to make lib available in websites

I wrote my first library in dart. Now I want to make use of it in a website. My idea was to compile all necessary dart code of my lib and its dependencies into one javascript file that has a useful "global" API. As I understand this I would also…
user1889543
  • 111
  • 1
  • 3
1
vote
1 answer

Dart2js brackets Symbol in metadata annotation

I can run this code on Dart VM: @MirrorsUsed(metaTargets: Tag) import 'dart:mirrors'; class Tag { final Symbol name; const Tag(this.name); } @proxy @Tag(#[]) class Tagged { noSuchMethod(Invocation invocation) { InstanceMirror…
JAre
  • 4,666
  • 3
  • 27
  • 45
1
vote
1 answer

Dart "NoSuchMethodError: Cannot call "get$data" (config.get$data is not a function)

I'm building an app with Angular Dart. When I'm trying to run it as a javascript it throws an error in the console (Firefox): "NoSuchMethodError: Cannot call "get$data" (config.get$data is not a function) or for the same issue in…
Pawel Uchida-Psztyc
  • 3,735
  • 2
  • 20
  • 41
1
vote
1 answer

unwanted rewriting of the icon attribute in polymer-ui-icon during pub transform (probably polymer)

ui-scafold from polymer-ui-elements. One of the elements I use is the polymer-ui-icon-button. I can set which icon to use from a selection of options, like 'refresh', which uses the icon from a large image at a particular position in that image. …
James Hurford
  • 2,018
  • 19
  • 40