BREAKING CHANGE: js-interop will require extra script in html

357 views
Skip to first unread message

Vijay Menon

unread,
Jun 10, 2013, 12:12:32 PM6/10/13
to General Dart Discussion

If you don't use Dart-JS interop or any packages that rely on it, you can stop reading.

tl;dr: We are splitting up the current dart.js bootstrap script to move js-interop specific code to a separate file.  If you use JS interop, you will also need to include interop.js alongside dart.js in your html file.

E.g., You will need to change your html from:

  <script src="packages/browser/dart.js"></script>

to

  <script src="packages/browser/dart.js"></script>
  <script src="packages/browser/interop.js"></script>

Currently, dart.js includes a fair bit of code that's there only to support Dart-JS interop, and every Dart web app pays for this additional code regardless of whether they use JS interop or not.

I expect to land this change in the next 24 hours.

Cheers,

Vijay




Seth Ladd

unread,
Jun 11, 2013, 1:35:55 AM6/11/13
to anno...@dartlang.org
--
For more news and information, visit http://news.dartlang.org/
 
To join the conversation, visit https://groups.google.com/a/dartlang.org/
 
 
Message has been deleted

Vijay Menon

unread,
Jun 11, 2013, 11:42:08 AM6/11/13
to General Dart Discussion
Note this is landed now in bleeding edge.  Most of you will see it as part of the next editor integration release.

On Mon, Jun 10, 2013 at 11:05 PM, mezoni <andrew...@gmail.com> wrote:
>> If you don't use Dart-JS interop or any packages that rely on it, you can stop reading.

I think this is better than "If you don't use ... you can stop reading"

What changed?

Dart-JS interop code for JavaScript has moved from dart.js to interop.js (still part of the browser package).
 
Who is affected?

Anyone using Dart-JS interop, either directly or indirectly.
 
How do I update my code?

In your HTML, change:

  <script src="packages/browser/dart.js"></script>

to

  <script src="packages/browser/dart.js"></script>
  <script src="packages/browser/interop.js"></script>
 
Why did this change happen?

This makes apps that do not use Dart-JS interop smaller.  It also makes it easier for the Dart team to iterate on interop code by factoring it out.
 
When will the change take effect?

It just did.
 

Although, in principle, it all depends on the established order and those who control it...
Or this is not from "anno...@dartlang.org"?

--
For other discussions, see https://groups.google.com/a/dartlang.org/
 
For HOWTO questions, visit http://stackoverflow.com/tags/dart
 
To file a bug report or feature request, go to http://www.dartbug.com/new
 
 

Reply all
Reply to author
Forward
0 new messages