New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deploy Polymer App generates code with errors #13849
Comments
Here's the original code, before the build step: library models; import 'package:polymer/polymer.dart' /// The Item class represents an item in the Todo list. Item({this.text: '', this.done: false}) { // Check if item text is empty. // Apply a done class for completed items. I think the issue is: the code has an import with a show. But the build step is introducing a new name that isn't included in the original show, and the build step isn't adding the new name (ChangeNotifierMixin) to the show. Yup, if I remove the show statements from my original code, the generated code in out/ works. Added Library-PolymerBuild label. |
Bumping to high. Removed Priority-Unassigned label. |
Sadness. We used to add our own import with prefix, to be safe from this kind of issue. Not sure what happened. Added Accepted label. |
Removed Library-PolymerBuild label. |
Thanks for verifying! |
Added this to the M8 milestone. |
Issue #14509 has been merged into this issue. |
Ugh. No idea how to fix this yet. The @observable transformation is local right now. It doesn't need to affect the rest of your file. It doesn't mess up line numbers and it doesn't care if your code is in a library or part. If we need to add an import, then suddenly we've got to know if we're in a library/part, and if it's a part, we need add the import to the main file. Which is not easy with barback transformers (would've been relatively easy in our old compiler. Doh!) One idea is to change the transform ... instead of replacing the base class with ChangeNotifier, just override some methods to turn the dirty-checking impl into a no-op. But, I'm not sure how smart dart2js is in this case, in other words: can it kill the dirty-check code? |
Set owner to @jmesserly. |
Issue #15095 has been merged into this issue. |
Issue #16555 has been merged into this issue. |
Ah, I knew this sounded familiar. Thanks for de-duping. I have this starred. |
Removed Library-Observe label. |
unfortunately, no progress here. Maybe the answer is to ditch the @observable transform for now & stick with dirty-checking similar to Angular. Added Accepted label. |
Alternatively, we could use the resolver for this. Now that we are using the analyzer in transformers for polymer, I think we can start using it here too. We would apply this on libraries rather than files, though. We can also resolve @observable and remove the special handling we have for @published. |
This issue has been moved to dart-archive/observe#44. |
Using:
polymer:
description: polymer
source: hosted
version: "0.7.6+4"
polymer_expressions:
description: polymer_expressions
source: hosted
version: "0.7.6+4"
Dart Editor version 0.7.6_r28108
Just ran "deploy polymer app", and it generated code that doesn't compile.
This is from the todo_element sample here: https://github.com/sethladd/dart-polymer-dart-examples/tree/master/web/todo_element
Build looks like this:
!/usr/bin/env dart
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:polymer/builder.dart';
void main() {
build(entryPoints: ['web/simple_custom_element/index.html', 'web/todo_element/index.html']);
}
Attachment:
[Screen Shot 2013-10-05 at 10.02.45 AM.png](https://storage.googleapis.com/google-code-attachments/dart/issue-13849/comment-0/Screen Shot 2013-10-05 at 10.02.45 AM.png) (205.33 KB)
The text was updated successfully, but these errors were encountered: