Upcoming breaking change to dart:html and dart:htmlimpl

10 views
Skip to first unread message

Jacob Richman

unread,
Feb 16, 2012, 9:02:37 PM2/16/12
to General Dart Discussion
We are changing the implementation of dart:html from a wrapper based solution to a wrapper-free solution.  The dart:html API will not change as part of this transition but it will no longer be possible to use dart:html and dart:dom from within the same isolate and the dart:htmlimpl library will go away.

Why are we doing this?
* Smaller compiler output because dead code elimination is more effective with the new solution.
* Faster compile times as dart:html is expressed directly rather than being expressed as a wrapper layer on top of dart:dom.
* Faster runtime execution and lower runtime memory usage as the overhead of wrapping and unwrapping is avoided.

When will the change occur?
As soon as early next week.

Tradeoffs:
* It will no longer be possible to import dart:html and dart:dom within the same isolate.  At some point we expect to remove dart:dom completely so it doesn’t make sense to try to support this use case.  Supporting it would be extremely difficult and fragile given wrapper free implementations of both libraries.
*dart:htmlimpl is going away as it doesn’t make sense to expose publicly given that the implementation of dart:html on Dartium will continue to use wrappers for some time.  dart:htmlimpl was only needed before to work around known broken or missing functionality in dart:html.  This escape hatch will not be needed with the updated library as dart:html and dart:dom are generated by the same script so the dart:html versions of rapidly evolving APIs such as web audio will always function just as well as the dart:dom versions.

Once the new version lands if there is functionality in dart:dom that you need not in dart:html please file bugs.

-Jacob
Reply all
Reply to author
Forward
0 new messages