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

No warning when element HTML file is missing import #560

Closed sigmundch closed 8 years ago

sigmundch commented 9 years ago

From @theqwertman on August 21, 2015 16:9

For example,

<polymer-element name="address-entry">
  <template>
    <style>
      :host {
        display: block;
      }
    </style>
<paper-dialog><h2>Something</h2></paper-dialog>

should report an error since there is no import link whatsoever, but the build succeeds without complaint, and the developer must investigate to find out why their element is not appearing.

Copied from original issue: dart-lang/sdk#24167

sigmundch commented 9 years ago

Is the problem in your example that you don't have the import to paper-dialog or the script tag that defines address-entry?

We used to have a linter that would give you warnings if you are missing the script tag or an import to find the definition of an element. However, since we added support for @HtmlImport in Dart files, I am not sure if we can continue producing these warnings accurately (a missing import in the HTML is not always a problem).

M-Pixel commented 9 years ago

I was unaware of @HtmlImport. I suppose the solution is to use that exclusively, then.

jakemac53 commented 8 years ago

Yes, using dart imports exclusively and relying on @HtmlImport is the easiest way to deal with this