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
0
votes
1 answer

Handling bootstrap4 modals in Dart

I need to call bootstrap modals from Dart code and this is what I've tried (using the js library): @JS('jQuery') class jQuery { @JS() jQuery(obj); @JS('modal') external dynamic modal(func); } class Modal extends jQuery { Modal(obj) :…
Mattia
  • 5,909
  • 3
  • 26
  • 41
0
votes
1 answer

stack overflow error in native method without apparent reason

I receive a stack overflow error without any repeating pattern when calling a wrapper for a native method here's my adapter import 'dart:js'; import 'package:share_place/users/user.dart'; import 'package:logging/logging.dart'; class MixPanel { …
Zied Hamdi
  • 2,400
  • 1
  • 25
  • 40
0
votes
1 answer

Getting the typed syntax tree from dart2js or dart-analyzer

I'd like to derive exactly that subset of the sources of a dart comiler (dart2js or dartdevc or other) or of a dart analyser that can 1. transform a string of dart code (or better a list of strings each representing a compilation unit) into a typed…
Malelago
  • 31
  • 3
0
votes
1 answer

Dart - The setter 'someVar' is not defined for the class 'Map'

I'm trying to 'port' some script to the Dart. To learn how everything work etc. But there is a problem - in JavaScript we can set and get any variable in the object. In Dart we have a Map class. And I have no idea how to use it (there is not so many…
user64675
  • 482
  • 7
  • 25
0
votes
0 answers

Parsing URL Params into dart does type overrides if the type is unexpected

I am creating a web application which parses URLS for route parameters for client look ups. Example: www.example.com#userId=5 Ignore security loop holes on that. I noticed that when navigating to the page, it would call: onRouteParams(Map params)…
Fallenreaper
  • 10,222
  • 12
  • 66
  • 129
0
votes
0 answers

Pub Build by Command Line

How to use pub build by command line directly from terminal? Using dart2js is easy, it works like this: /Applications/dart-sdk/bin/dart2js --minify --out=file:/Users/muggins/my_project/web/my_project.dart.js…
0
votes
1 answer

Compile HttpServer from Dart to JS for NodeJS

Is there some way to create http server on Dart that will be compiled to JS for Node JS? If I try to use default server HttpServer.bind(new InternetAddress("127.0.0.1"), 8081); and then compile this code via dart2js I'll get error when node…
user5384930
0
votes
0 answers

Can't read 'package:intl/intl.dart' only when performing debug build

If I 'Pub Build - Minified' my application compiles and runs correctly. If I instead I do 'Pub Build - Debug' I get the following errors: [Error from Dart2JS on App|web/view_assignment.dart]: web\code_admin.dart:6:8: Can't read…
Dejas
  • 3,511
  • 4
  • 24
  • 36
0
votes
1 answer

how to deployment dart app to javascript in the server?

to do with the files in the build/web folder in my dart app to deployed a in the server as Javascript? I want to deployd my app but as javascript. But i don't know the correct procedure. I have configured my project and I called in my…
0
votes
0 answers

dart2js Polymer Dart Sample ClickCounter App is OK in Firefox, fails in Chrome

I am trying out a Polymer Dart App under Cordova. So I started with the Dart Editor Sample App. I use a recent version of Polymer so I had to edit the sample code. Here is my pubspec.yaml name: cortst description: Cordova Test…
timecc
  • 161
  • 1
  • 11
0
votes
1 answer

AngularDart 1.0.0 has issues in IE 11 and Safari 7 and below

I had AngularDart 1.0.0 throw errors in Safari 7.0 and below and IE 11 when rendering my page component. It seems to die inside the ng-repeat loop when trying to access one of the widgets (the variable it is looping over). Another one of my…
Scotty Waggoner
  • 3,083
  • 2
  • 26
  • 40
0
votes
2 answers

Test Dart and dart2js code in same page

I trying my luck on Dart. I've got an application that loads the Dart file and the generated Javascript:
Hendrik Jan
  • 4,396
  • 8
  • 39
  • 75
0
votes
1 answer

How I can extend max time given to perform dart2js in WebStorm

I have a big Dart project with a compilation time longer than the 30s allowed by WebStorm. Is there any way to extend allowed calculation time?
Zdeněk Mlčoch
  • 722
  • 6
  • 17
0
votes
1 answer

Error invoking clientX with Dart2JS

When compiling code with dart dart2js, and run in chrome or firefox void main() { window.onMouseDown.listen((e) => print(e.clientX)); } Result: Uncaught TypeError: undefined is not a function In Dartium there is no error.
Tiago Pertile
  • 1,045
  • 2
  • 7
  • 9
0
votes
1 answer

Dart polymer Paper_elements don't play nicely with sample webapp when compiled to JavaScript

I have problem using paper_element in dart polymer app. Dart Editor version 1.5.8.release (STABLE) Dart SDK version 1.5.8 I create sample web application with polymer. I add following dependencies to pubspec.yaml polymer: ">=0.12.0…
Juri Krainjukov
  • 732
  • 8
  • 27