requirejs - Dart2js : Is it possible to start Root Isolate from Javascript? -
i have application compiled in dart2js (dart sdk version 0.6.13.0_r25630) , i'd load requirejs everytime need.
first of all, thanks god wrapper function in compiled javascript, in case not enough :(
i use requirejs load dart2js application
require(["application.dart"], function () {});
but handle when start application. example on click event.
require(["jquery","application.dart"], function (jquery,$) { jquery(element).click(function(){ $.startrootisolate($.main$closure); }) });
i hacked compiled javascript, i'd know if it's possible in native way.
in application.dart.js wrapped function in amd module
(function (factory) { if (typeof define === 'function' && define.amd) { // amd. register anonymous module. define([],function(){ return factory(); } ); } else { // browser globals. factory(); } })(function($) {...})
then return $ object
return $;
and commented line of code found
$.startrootisolate($.main$closure);
thanks everyone
marco
i doubt possible without hacking @ code have. however, dart 1.6 added support deferred loading might give alternative way of doing need?
http://news.dartlang.org/2014/08/dart-16-adds-support-for-deferred.html
Comments
Post a Comment