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

Expressions used in [[ ]] are being tree shaken by dart2js #6

Open
adarshaj opened this issue Jul 20, 2014 · 8 comments
Open

Expressions used in [[ ]] are being tree shaken by dart2js #6

adarshaj opened this issue Jul 20, 2014 · 8 comments

Comments

@adarshaj
Copy link

Currently the binding works only in Dartium, and because of tree shaking the expression used only within [[ ]] in html fails to be preserved in generated js after pub build.

@sethladd
Copy link
Contributor

Thanks for the report!

@justinfagnani
Copy link
Contributor

@blois How hard would it be to add [[ ]] expressions to the Angular transformer?

@zoechi
Copy link

zoechi commented Aug 28, 2014

I read some issue comments/commit messages during the recent weeks that indicate the Angular team is working on direct support of binding to polymer elements but I could have misinterpreted these comments.

@blois
Copy link
Member

blois commented Aug 28, 2014

Adding support for expressions in Angular should be as easy as adding them to: https://github.com/angular/angular.dart/blob/master/lib/tools/html_extractor.dart

Should be able to add tests for it at:
https://github.com/angular/angular.dart/blob/master/test/tools/transformer/expression_generator_spec.dart

@justinfagnani
Copy link
Contributor

Is there a way to plug into the the extractor? This same work got rejected from Angular core, so I would expect changes to the extractor to be too. The point of this separate package it to be independent of Angular core.

@justinfagnani
Copy link
Contributor

@zoechi Angular's web component support design will not currently work with many of the custom elements in core-* and paper-* because they don't fire 'change' events when properties change. I think this is a major flaw in Angular's web component support, and angular_node_bind sidesteps all those issues by calling Node.bind() directly.

@zoechi
Copy link

zoechi commented Aug 29, 2014

@justinfagnani Thanks for the feedback!

@justinfagnani
Copy link
Contributor

Ouch, Angualr's expression extraction support is very limited, making this issue impossible to fix right now. Basically Angular's extractor supports {{ }} expressions, or directives can declare in their annotation which expressions they use, or which attributes contain expressions. Since we don't know ahead of time which expressions are used, or which attributes they're used in, we can't possibly specify that. Not only that but the attribute containing expressions are only support if the entire attribute is an expression.

This is tracked in angular.dart issue 1050: dart-archive/angular.dart#1050

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

No branches or pull requests

5 participants