Skip to content
This repository has been archived by the owner on Dec 19, 2017. It is now read-only.

interop with template_binding.js instead of porting #3

Open
jmesserly opened this issue Feb 4, 2015 · 0 comments
Open

interop with template_binding.js instead of porting #3

jmesserly opened this issue Feb 4, 2015 · 0 comments

Comments

@jmesserly
Copy link
Contributor

I think this should be pretty easy nowadays with Bindable ("Observable" in JS) and BindingDelegate interfaces that abstract a lot of the observe-js/polymer-expressions dependencies

this is moved from https://code.google.com/p/dart/issues/detail?id=18893, original report below:

https://github.com/Polymer/TemplateBinding/blob/master/src/TemplateBinding.js
https://github.com/Polymer/NodeBind/blob/master/src/NodeBind.js

... are by-hand ports, because we didn't have JS interop when they were written.

It would be better to interop. They are already included in the pub.dartlang.org/packages/web_components package platform.js. Most of TemplateBinding code is dealing with the semantics of and its repeat/if/bind attributes. The code isn't really Dart specific. We'd have to measure performance tradeoffs, but it might not make much difference in the context of stamping a template.

One other challenge is TemplateBinding depends on observe-js, which itself depends on reflective operations on JS objects. So it won't work without addressing that layer. We might be able to get pretty far just by patching "Path" in observe-js, but needs more investigation to be sure.

(addendum)
hmmmm. it seems if you have a bindingDelegate, paths aren't used. So maybe ArrayObserver is the only one to deal with

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant