Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 /// Contains all error and warning messages produced by polymer. | 5 /// Contains all error and warning messages produced by polymer. |
| 6 library polymer.src.build.messages; | 6 library polymer.src.build.messages; |
| 7 | 7 |
| 8 import 'package:code_transformers/messages/messages.dart'; | 8 import 'package:code_transformers/messages/messages.dart'; |
| 9 import 'constants.dart'; | 9 import 'constants.dart'; |
| 10 | 10 |
| (...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 573 * to support registering Dart APIs for JavaScript custom elements. | 573 * to support registering Dart APIs for JavaScript custom elements. |
| 574 | 574 |
| 575 Now, the code from `dart_support.js` is split in two halves. The half for | 575 Now, the code from `dart_support.js` is split in two halves. The half for |
| 576 dart2js is now injected by the polymer transformers automatically during `pub | 576 dart2js is now injected by the polymer transformers automatically during `pub |
| 577 build`. The `web_components` package provides an HTML file containing the other | 577 build`. The `web_components` package provides an HTML file containing the other |
| 578 half. Developers of packages that wrap JavaScript custom elements (like | 578 half. Developers of packages that wrap JavaScript custom elements (like |
| 579 `core_elements` and `paper_elements`) will import that file directly, so | 579 `core_elements` and `paper_elements`) will import that file directly, so |
| 580 application developers don't have to worry about it anymore. | 580 application developers don't have to worry about it anymore. |
| 581 ''' | 581 ''' |
| 582 ); | 582 ); |
| 583 | |
| 584 const SCRIPT_INCLUDED_MORE_THAN_ONCE = const MessageTemplate( | |
| 585 const MessageId('polymer', 44), | |
| 586 'The `%-url-%` script was included more than once.', | |
| 587 'A dart script file was included more than once.', | |
|
Siggi Cherem (dart-lang)
2014/10/21 17:06:03
to be consistent with the titles we use above - Ka
jakemac
2014/10/21 18:14:01
Done.
| |
| 588 ''' | |
| 589 Duplicate dart scripts often happen if you have multiple html imports that | |
| 590 include the same script. The simplest workaround for this is to move your dart | |
| 591 script to its own html file, and import that instead of the script (html imports | |
| 592 are automatically deduped). | |
| 593 | |
| 594 For example: | |
| 595 | |
| 596 <script type="application/dart" src="foo.dart"></script> | |
| 597 | |
| 598 Should turn into: | |
| 599 | |
| 600 <link rel="import" href="foo.html"> | |
| 601 | |
| 602 And `foo.html` should look like: | |
| 603 | |
| 604 <!DOCTYPE html> | |
|
Siggi Cherem (dart-lang)
2014/10/21 17:06:03
we can omit the doctype actually
jakemac
2014/10/21 18:14:01
Done.
| |
| 605 <script type="application/dart" src="foo.dart"></script> | |
| 606 '''); | |
| OLD | NEW |