dart-archive / polymer-dart

Polymer support for Dart
https://pub.dartlang.org/packages/polymer
BSD 3-Clause "New" or "Revised" License
180 stars 33 forks source link

Add a way of publishing specified fields from behaviors/elements to the js prototype #597

Open jakemac53 opened 9 years ago

jakemac53 commented 9 years ago

You can do this for methods today with @eventHandler, but the only way to do it for fields is with @property, which makes it a full on polymer property. See https://github.com/dart-lang/polymer_elements/issues/70 for example, the IronA11yKeysBehavior class expects behaviors and elements to set a keyBindings object directly on their prototypes, for the most optimal behavior. To support this we would also need proper support for statics.

jakemac53 commented 9 years ago

I think what probably makes the most sense here is to rename and generalize the @eventHandlerannotation.

Naming suggestions? Ideally something short and meaningful, @exposeToJs is all I can really think of off the top of my head right now but I am not a huge fan of it.

Could also just be like @jsPrototype? That is very explicit about what is going on at least.

zoechi commented 9 years ago

@expose, @export, @reflect, @polymerJs

jakemac53 commented 9 years ago

I do like @export, but I am not sure if it is descriptive enough. Maybe that is fine though.

jakemac53 commented 8 years ago

@reflectable does allow this now, I am going to open a separate issue about static properties

jakemac53 commented 8 years ago

whoops this is not actually resolved