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

觀看次數:357 次
跳至第一則未讀訊息

Vijay Menon

未讀,
2013年6月10日 下午12:12:3210/6/2013
收件者︰ 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

未讀,
2013年6月11日 上午1:35:5511/6/2013
收件者︰ 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/
 
 
訊息已刪除

Vijay Menon

未讀,
2013年6月11日 上午11:42:0811/6/2013
收件者︰ 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
 
 

回覆所有人
回覆作者
轉寄
0 則新訊息