Monday, January 14, 2013

BIG BREAKING CHANGE: dart.js Bootstrap File is Moving to Pub



dart.js file is moving to Pub and can be found in the new browser package. The familiar link to dart.js from your html files,
should be replaced by declaring a dependency to this package, or by hosting a local fileThis is a far reaching change that will impact all browser based Dart applications; Dartisans are urged to follow the advice provided by Vijay Menon

FYI: We are moving the bootstrap file dart.js to pub.  Please update any links to dart.js from your html files accordingly.  

We will delete the old copy of dart.js in our repository in a couple weeks.

The dart.js file is used in Dart browser apps to check for native Dart support and either (a) bootstrap Dartium or (b) load compiled JS instead.  Previously, we've recommended that you add a script tag pointing the version of dart.js in our repository.  This doesn't work offline and also results in slower startup (see dartbug.com/6723).

Instead, we now recommend that you install dart.js via the following steps:

1. Add the following to your pubspec.yaml:
  dependencies:
    browser: any

2. Run pub install.

3. Use a relative script tag in your html to the installed version:
<script src="packages/browser/dart.js"></script>
If you do not wish to use pub, you may host a copy of this file locally instead.  In this case, you will need to update it yourself as necessary.  We reserve the right to move this file in the repository, so we no longer recommend linking to it directly.
As always, we invite you to join our Dart mailing list, ask questions on Stack Overflow, or file feature requests on dartbug.com.