OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // BSD-style license that can be found in the LICENSE file. | |
4 | |
5 /// Contains all error and warning messages produced by polymer. | |
6 library polymer.src.build.messages; | |
7 | |
8 import 'package:code_transformers/messages/messages.dart'; | |
9 import 'constants.dart'; | |
10 | |
11 const importNotFound = const MessageTemplate( | |
12 const MessageId('polymer', 1), | |
13 'couldn\'t find imported asset "%-path-%" in package "%-package-%".', | |
14 'Import not found', | |
15 ''' | |
16 An HTML import seems to be broken. This could be because the file doesn't exist | |
17 or because the link URL is incorrect. | |
18 '''); | |
19 | |
20 const duplicateDefinition = const MessageTemplate( | |
21 const MessageId('polymer', 2), | |
22 'duplicate definition for custom tag "%-name-%".%-second-%', | |
23 'Duplicate definition', | |
24 ''' | |
25 Custom element names are global and can only be defined once. Some common | |
26 reasons why you might get two definitions: | |
27 | |
28 * There are two different elements defined with the same name. | |
Kathy Walrath
2014/09/03 21:26:55
There are two -> Two
defined with -> have [or "are
Siggi Cherem (dart-lang)
2014/09/04 02:32:16
went with option 4: `are declared with` :)
| |
29 * A single HTML file defining an element, is imported from two different | |
Kathy Walrath
2014/09/03 21:26:55
, is imported from -> has been imported using
Siggi Cherem (dart-lang)
2014/09/04 02:32:17
Done.
| |
30 URLs. | |
31 '''); | |
32 | |
33 const usePolymerHtmlMessage = const MessageTemplate( | |
34 const MessageId('polymer', 3), | |
35 'Missing definition for <polymer-element>, please add the following ' | |
36 'HTML import at the top of this file: <link rel="import" ' | |
37 'href="%-reachOutPrefix-%packages/polymer/polymer.html">.', | |
38 'Missing import to polymer.html', | |
39 ''' | |
40 Starting with polymer 0.11.0 we require that each file that uses the definition | |
Kathy Walrath
2014/09/03 21:26:54
0.11.0 we require that each -> 0.11.0, each
Siggi Cherem (dart-lang)
2014/09/04 02:32:18
Done.
| |
41 of polymer-element has to import it either directly or transitively. | |
Kathy Walrath
2014/09/03 21:26:54
has to import -> must import
Siggi Cherem (dart-lang)
2014/09/04 02:32:15
Done.
| |
42 '''); | |
43 | |
44 const noImportWithinElement = const MessageTemplate( | |
45 const MessageId('polymer', 4), | |
46 'Polymer.dart\'s implementation of ' | |
47 'HTML imports are not supported within polymer element definitions, yet. ' | |
48 'Please move the import out of this <polymer-element>.', | |
Kathy Walrath
2014/09/03 21:26:53
Please move -> Move
Siggi Cherem (dart-lang)
2014/09/04 02:32:17
Pretty please? :)
I'm actually curious: since thi
Kathy Walrath
2014/09/04 17:07:28
I suppose "Please" isn't bad here. We don't usuall
| |
49 'Can\'t use imports inside <polymer-element>', | |
50 ''' | |
51 HTML imports are expected on the top of each document, outside of any | |
Kathy Walrath
2014/09/03 21:26:53
on the -> at the
Siggi Cherem (dart-lang)
2014/09/04 02:32:15
Done.
| |
52 polymer-element definitions. The polymer build process combines all your HTML | |
53 files together so you can deploy a single HTML file with your application. This | |
54 build process will ignore imports that appear to be in the wrong location. | |
Kathy Walrath
2014/09/03 21:26:54
will ignore -> ignores
Siggi Cherem (dart-lang)
2014/09/04 02:32:15
Done.
| |
55 '''); | |
56 | |
57 const useInitDart = const MessageTemplate( | |
58 const MessageId('polymer', 5), | |
59 'To run a polymer application, you need to call "initPolymer". You can ' | |
Kathy Walrath
2014/09/03 21:26:55
"initPolymer" -> initPolymer()
Siggi Cherem (dart-lang)
2014/09/04 02:32:17
Done.
| |
60 'either include a generic script tag that does this for you:' | |
61 '\'<script type="application/dart">export "package:polymer/init.dart";' | |
62 '</script>\' or add your own script tag and call that function. ' | |
63 'Make sure the script tag is placed after all HTML imports.', | |
64 'Missing init.dart', | |
65 ''' | |
66 We determined that your application entry point didn't have any Dart script | |
Kathy Walrath
2014/09/03 21:26:55
->
Your application entrypoint doesn't have...
Siggi Cherem (dart-lang)
2014/09/04 02:32:15
Done.
| |
67 tags, and hence, it's missing some initialization needed for polymer.dart. | |
Kathy Walrath
2014/09/03 21:26:54
->tags, so it's...
Siggi Cherem (dart-lang)
2014/09/04 02:32:16
Done.
| |
68 '''); | |
69 | |
70 const noDartScriptAndExperimental = const MessageTemplate( | |
71 const MessageId('polymer', 6), | |
72 'The experimental bootstrap feature doesn\'t support script tags on ' | |
73 'the main document (for now).', | |
74 'No script tags with experimental bootstrap.', | |
Kathy Walrath
2014/09/03 21:26:55
Remove the "."
Siggi Cherem (dart-lang)
2014/09/04 02:32:16
Done.
| |
75 'This experimental feature is no longer supported.'); | |
76 | |
77 const onlyOneTag = const MessageTemplate( | |
78 const MessageId('polymer', 7), | |
79 'Only one "application/dart" script tag per document is allowed.', | |
80 'Single tag per document', | |
Kathy Walrath
2014/09/03 21:26:55
Most of these are phrased to describe the problem,
Siggi Cherem (dart-lang)
2014/09/04 02:32:17
Done.
| |
81 ''' | |
82 Dartium currently limits to have a single script tag per document. Any | |
Kathy Walrath
2014/09/03 21:26:55
limits to have a single
->
allows only one
Siggi Cherem (dart-lang)
2014/09/04 02:32:16
Done.
| |
83 additional script tags might be ignored or result in an error. This will | |
84 likely change in the future, but for now, we recommend that you combine the | |
85 script tags together into a single Dart library. | |
86 '''); | |
87 | |
88 const moveHtmlImportsUp = const MessageTemplate( | |
89 const MessageId('polymer', 8), | |
90 'Move HTML imports above your Dart script tag.', | |
91 'Imports before script tags', | |
92 ''' | |
93 It is good practice to put all your HTML imports at the beginning of the | |
94 document, above any Dart script tags. Today, the execution of Dart script tags | |
95 is not synchronous in Dartium, so the difference is not noticeable. However, we | |
96 are planning changes in Dartium that will eventually make the timing of script | |
97 tags execution match how they are in Javascript. At that point the order of your | |
98 imports with respect to script tags will be important. Following the practice of | |
99 putting imports first protects your app from a future breaking change in this | |
100 respect. | |
101 '''); | |
102 | |
103 const missingHref = const MessageTemplate( | |
104 const MessageId('polymer', 9), | |
105 'link rel="%-rel-%" missing href.', | |
106 'Missing href on a `<link>` tag', | |
107 'All `<link>` tags should have a valid URL to a resource.'); | |
108 | |
109 const elementWasDeprecatedEonsAgo = const MessageTemplate( | |
110 const MessageId('polymer', 10), | |
111 '<element> elements are not supported, use <polymer-element> instead', | |
112 '`<element>` is deprecated', | |
113 ''' | |
114 Long ago `<polymer-element>` used to be called `<element>`. You probably ran | |
115 into this error if you were migrating code that was written on a very early | |
116 version of polymer. | |
117 '''); | |
118 | |
119 // TODO(jmesserly): this warning is wrong if someone is using raw custom | |
120 // elements. Is there another way we can handle this warning that won't | |
121 // generate false positives? | |
122 const customElementNotFound = const MessageTemplate( | |
123 const MessageId('polymer', 11), | |
124 'custom element with name "%-tag-%" not found.', | |
125 'Definition of a custom element not found', | |
126 ''' | |
127 The polymer build was not able to find the definition of a custom element. This | |
128 can happen if an element is defined with a `<polymer-element>` tag, but you are | |
129 missing an HTML import or the import link is incorrect. | |
130 | |
131 This warning can also be a false alarm. For instance, when an element is defined | |
132 programatically using `document.registerElement`. In that case the polymer build | |
133 will not be able to see the definition and will produce this warning. | |
134 '''); | |
135 | |
136 const scriptTagSeemsEmpty = const MessageTemplate( | |
137 const MessageId('polymer', 12), | |
138 'script tag seems empty.', | |
139 'Empty script tag', | |
140 'Script tags should either have a `src` attribute or a non-empty body.'); | |
141 | |
142 const wrongScriptTypeExpectedDart = const MessageTemplate( | |
143 const MessageId('polymer', 13), | |
144 'Wrong script type, expected type="application/dart".', | |
145 'Expected Dart mime-type', | |
146 ''' | |
147 You seem to have a `.dart` extension on a script tag, but the mime-type | |
148 doesn't match `application/dart`. | |
149 '''); | |
150 | |
151 const wrongFileTypeExpectedDart = const MessageTemplate( | |
152 const MessageId('polymer', 14), | |
153 '"application/dart" scripts should use the .dart file extension.', | |
154 'Expected Dart file extension', | |
155 ''' | |
156 You are using the `application/dart` mime-type on a script tag, so we expected | |
157 the URL to the script source URL to have a `.dart` extension, but it doesn't. | |
158 '''); | |
159 | |
160 const foundBothScriptSrcAndBody = const MessageTemplate( | |
161 const MessageId('polymer', 15), | |
162 'script tag has "src" attribute and also has script text.', | |
163 'Script tags should have either a URL or an inlined body.', | |
Kathy Walrath
2014/09/03 21:26:54
->
Script with both src and inline text
(be sure
Siggi Cherem (dart-lang)
2014/09/04 02:32:16
Done.
| |
164 ''' | |
165 You have a script tag that includes both a `src` attribute, and script text | |
Kathy Walrath
2014/09/03 21:26:54
attribute,...
->
attribute and inline script text.
Siggi Cherem (dart-lang)
2014/09/04 02:32:17
Done.
| |
166 inlined. You must choose one or the other. | |
167 '''); | |
168 | |
169 const incorrectInstantiationMissingBaseTag = const MessageTemplate( | |
170 const MessageId('polymer', 16), | |
171 'custom element "%-tag-%" extends from "%-base-%", but ' | |
172 'this tag will not include the default properties of "%-base-%". ' | |
173 'To fix this, either write this tag as <%-base-% ' | |
174 'is="%-tag-%"> or remove the "extends" attribute from ' | |
175 'the custom element declaration.', | |
176 'Incorrect instantiation: missing base tag in instantiation.', | |
Kathy Walrath
2014/09/03 21:26:54
remove the "."
Siggi Cherem (dart-lang)
2014/09/04 02:32:16
Done.
| |
177 ''' | |
178 When you declare that a custom element extends from a base tag, for example: | |
179 | |
180 <polymer-element name="my-example" extends="ul"> | |
181 | |
182 or: | |
183 | |
184 <polymer-element name="my-example2" extends="ul"> | |
185 <polymer-element name="my-example" extends="my-example2"> | |
186 | |
187 You should instantiate `my-example` by using this syntax: | |
188 | |
189 <ul is="my-example"> | |
190 | |
191 And not: | |
192 | |
193 <my-example> | |
194 | |
195 Only elements that don't extend from existing HTML elements are created using | |
196 the latter form. | |
197 | |
198 This is because browsers first create the base element, and then upgrade them to | |
Kathy Walrath
2014/09/03 21:26:55
them -> it
Siggi Cherem (dart-lang)
2014/09/04 02:32:15
Done.
| |
199 have the extra functionality of your custom element. In the example above, using | |
200 `<ul>` tells the browser what is the base type that they need to create before | |
201 doing the upgrade. | |
Kathy Walrath
2014/09/03 21:26:53
what is the base type that they need to create
->
Siggi Cherem (dart-lang)
2014/09/04 02:32:16
Done.
| |
202 '''); | |
203 | |
204 const incorrectInstantiationBogusBaseTag = const MessageTemplate( | |
205 const MessageId('polymer', 17), | |
206 'custom element "%-tag-%" doesn\'t declare any type ' | |
207 'extensions. To fix this, either rewrite this tag as ' | |
208 '<%-tag-%> or add \'extends="%-base-%"\' to ' | |
209 'the custom element declaration.', | |
210 | |
211 'Incorrect instantiation: extra `is` attribute or missing `extends` ' | |
212 'in declaration.', | |
Kathy Walrath
2014/09/03 21:26:55
remove the "."
Siggi Cherem (dart-lang)
2014/09/04 02:32:16
Done.
| |
213 ''' | |
214 Creating a custom element using the syntax: | |
215 | |
216 <ul is="my-example"> | |
217 | |
218 means that the declaration of `my-example` extends transitively from `ul`. This | |
219 error message is shown if the definition of `my-example` doesn't declare this | |
220 extension. It might be that you no longer extend from the base element, in which | |
221 case the fix is to change the instantiation to: | |
222 | |
223 <my-example> | |
224 | |
225 or that the declaration needs to be fixed and include the `extends` attribute, | |
Kathy Walrath
2014/09/03 21:26:54
or that ->
Another possibility is that
and includ
Siggi Cherem (dart-lang)
2014/09/04 02:32:17
Done.
| |
226 for example: | |
227 | |
228 <polymer-element name="my-example" extends="ul"> | |
229 '''); | |
230 | |
231 const incorrectInstantiationWrongBaseTag = const MessageTemplate( | |
232 const MessageId('polymer', 18), | |
233 'custom element "%-tag-%" extends from "%-base-%". ' | |
234 'Did you mean to write <%-base-% is="%-tag-%">?', | |
235 'Incorrect instantiation: base tag seems wrong', | |
236 ''' | |
237 It seems you have a declaration like: | |
238 | |
239 <polymer-element name="my-example" extends="div"> | |
240 | |
241 but an instantiation like: | |
242 | |
243 <span is="my-example"> | |
244 | |
245 Both the declaration and the instantiation need to match on the base type. So | |
246 either the instantiation needs to be fixed to be more like: | |
247 | |
248 <span is="my-example"> | |
249 | |
250 or the declaration should be fixed to be like: | |
251 | |
252 <polymer-element name="my-example" extends="span"> | |
253 '''); | |
254 | |
255 const noDashesInCustomAttributes = const MessageTemplate( | |
256 const MessageId('polymer', 19), | |
257 'PolymerElement no longer recognizes attribute names with ' | |
258 'dashes such as "%-name-%". Use %-alternative-% ' | |
259 'instead (both forms are equivalent in HTML).', | |
260 'No dashes allowed in custom attributes', | |
261 ''' | |
262 Polymer used to recognize attributes with dashes like `my-name` and convert them | |
263 to match properties where dashes were removed, and words follow the camelCase | |
264 style (for example `myName`). This feature is no longer available. Now simply | |
265 use the same name as the property. | |
266 | |
267 Because HTML attributes are case-insensitive, you can also write the name of | |
268 your property entirely in lowercase. Just be sure that your custom-elements | |
269 don't declare two properties with the same name but different capitalization. | |
270 '''); | |
271 | |
272 | |
273 const eventHandlersOnlyWithinPolymerElements = const MessageTemplate( | |
274 const MessageId('polymer', 20), | |
275 'Inline event handlers are only supported inside ' | |
276 'declarations of <polymer-element>.', | |
277 'Event handlers not supported here', | |
278 ''' | |
279 Bindings of the form `{{ }}` are supported inside `<template>` nodes, even outsi de | |
280 of `<polymer-element>` declarations. However, those bindings only support bindin g | |
281 values into the content of a node or an attribute. | |
282 | |
283 Inline event handlers of the form `on-click="{{method}}"` are a special feature | |
284 of polymer elements, so they are only supported inside `<polymer-element>` | |
285 definitions. | |
286 '''); | |
287 | |
288 const invalidEventHandlerBody = const MessageTemplate( | |
289 const MessageId('polymer', 21), | |
290 'Invalid event handler body "%-value-%". Declare a method ' | |
291 'in your custom element "void handlerName(event, detail, target)" ' | |
292 'and use the form %-name-%="{{handlerName}}".', | |
293 'Event handler bindings are method names, not expressions.', | |
Kathy Walrath
2014/09/03 21:26:53
remove the "." and make it not a sentence. Maybe:
Siggi Cherem (dart-lang)
2014/09/04 02:32:15
Done.
| |
294 ''' | |
295 Unlike data bindings, event handler bindings of the form `on-click="{{method}}"` | |
296 are not evaluated as expressions. They are meant to just contain a simple name | |
297 that resolves to a method in your polymer element's class definition. | |
298 '''); | |
299 | |
300 const nestedPolymerElementDefinitionsNotAllowed = const MessageTemplate( | |
301 const MessageId('polymer', 22), | |
302 'Nested polymer element definitions are not allowed.', | |
303 'Nested polymer element definitions are not allowed.', | |
Kathy Walrath
2014/09/03 21:26:55
Nested polymer element definitions not allowed
(r
Siggi Cherem (dart-lang)
2014/09/04 02:32:17
Done.
| |
304 ''' | |
305 Because custom element names are global, there is no need to have a | |
306 `<polymer-element>` defined nested within a `<polymer-element>`. If you have a | |
Kathy Walrath
2014/09/03 21:26:53
defined -> definition?
Siggi Cherem (dart-lang)
2014/09/04 02:32:17
Done.
| |
307 definition inside another, please move the sencond definition out. | |
Kathy Walrath
2014/09/03 21:26:53
please move -> move
sencond -> second
Siggi Cherem (dart-lang)
2014/09/04 02:32:15
Done.
| |
308 | |
309 It's possible that you see this error if you have an HTML import within a | |
Kathy Walrath
2014/09/03 21:26:55
It's possible that you -> You might
Siggi Cherem (dart-lang)
2014/09/04 02:32:16
Done.
| |
310 polymer element. You should be able to also move the import out of the element | |
Kathy Walrath
2014/09/03 21:26:54
to also -> to
Siggi Cherem (dart-lang)
2014/09/04 02:32:17
Done.
| |
311 definition. | |
312 '''); | |
313 | |
314 const missingTagName = const MessageTemplate( | |
315 const MessageId('polymer', 23), | |
316 'Missing tag name of the custom element. Please include an ' | |
Kathy Walrath
2014/09/03 21:26:55
Please include -> Include
Siggi Cherem (dart-lang)
2014/09/04 02:32:17
Done.
| |
317 'attribute like \'name="your-tag-name"\'.', | |
318 'Polymer element definitions must have a name.', | |
Kathy Walrath
2014/09/03 21:26:55
->
Polymer element definition without a name
Siggi Cherem (dart-lang)
2014/09/04 02:32:17
Done.
| |
319 ''' | |
320 Polymer element definitions must have a name. You can include a name by using | |
321 the `name` attribute in `<polymer-element>` for example: | |
322 | |
323 <polymer-element name="my-example"> | |
324 '''); | |
325 | |
326 final invalidTagName = new MessageTemplate( | |
327 const MessageId('polymer', 24), | |
328 'Invalid name "%-name-%". Custom element names must have ' | |
329 'at least one dash and can\'t be any of the following names: ' | |
Kathy Walrath
2014/09/03 21:26:54
dash -> dash (-)
Siggi Cherem (dart-lang)
2014/09/04 02:32:15
Done.
| |
330 '${invalidTagNames.keys.join(", ")}.', | |
331 'Custom element names must have a dash.', | |
Kathy Walrath
2014/09/03 21:26:53
->
Custom element name missing a dash
Siggi Cherem (dart-lang)
2014/09/04 02:32:15
Done.
| |
332 ''' | |
333 Custom element names must have a dash and can\'t be any of the following | |
Kathy Walrath
2014/09/03 21:26:55
dash -> dash (`-`)
Siggi Cherem (dart-lang)
2014/09/04 02:32:17
Done.
| |
334 reserved names: | |
335 | |
336 ${invalidTagNames.keys.map((e) => ' * `$e`\n').join('')} | |
337 | |
338 '''); | |
339 | |
340 final inlineImportFail = const MessageTemplate( | |
341 const MessageId('polymer', 25), | |
342 'Failed to inline html import: %-error-%', | |
Kathy Walrath
2014/09/03 21:26:54
html -> HTML
Siggi Cherem (dart-lang)
2014/09/04 02:32:17
Done.
| |
343 'An error occurred while iniling an import', | |
Kathy Walrath
2014/09/03 21:26:54
iniling -> inlining
Siggi Cherem (dart-lang)
2014/09/04 02:32:16
wow - this typo has been there for months!
| |
344 ''' | |
345 An error occurred while iniling an import in the polymer build. This is often | |
346 the result of a broken HTML import. | |
347 '''); | |
348 | |
349 final inlineStyleFail = const MessageTemplate( | |
350 const MessageId('polymer', 26), | |
351 'Failed to inline stylesheet: %-error-%', | |
352 'An error occurred while iniling a stylesheet.', | |
Kathy Walrath
2014/09/03 21:26:55
->
Error while inlining a stylesheet
(remove the
Siggi Cherem (dart-lang)
2014/09/04 02:32:17
Done.
| |
353 ''' | |
354 An error occurred while iniling a stylesheet in the polymer build. This is often | |
Kathy Walrath
2014/09/03 21:26:53
GLOBAL:
iniling -> inlining
Siggi Cherem (dart-lang)
2014/09/04 02:32:15
Done.
| |
355 the result of a broken URL in a `<link rel="stylesheet" href="...">`. | |
356 '''); | |
357 | |
358 final scriptFileNotFound = const MessageTemplate( | |
359 const MessageId('polymer', 27), | |
360 'Script file at "%-url-%" not found.', | |
361 'URL to a script file might be incorrect', | |
362 ''' | |
363 An error occurred trying to read a script tag on a given URL. This is often the | |
364 result of a broken URL in a `<script src="...">`. | |
365 '''); | |
366 | |
367 final useUnderscorePrefix = const MessageTemplate( | |
368 const MessageId('polymer', 28), | |
369 'When using bindings with the "%-name-%" attribute you may ' | |
370 'experience errors in certain browsers. Please use the ' | |
371 '"_%-name-%" attribute instead.', | |
372 'Not all browsers support bindings to URL attributes', | |
Kathy Walrath
2014/09/03 21:26:53
This message seems more specific than the previous
Siggi Cherem (dart-lang)
2014/09/04 02:32:16
Done
| |
373 ''' | |
374 Not all browsers support bindings to URL attributes. Some browsers might | |
Kathy Walrath
2014/09/03 21:26:55
Delete the first sentence if it just repeats the m
Siggi Cherem (dart-lang)
2014/09/04 02:32:15
Well well well - you just found a bug in the linte
| |
375 sanitize the attributes and result in an incorrect link. For this reason polymer | |
376 provides a special set of attributes that let you bypass any browser internal | |
377 attribute validation. The name of the attribute is the same as the original | |
378 attribute, but with a leading underscore. For example, instead of writing: | |
379 | |
380 <img src="{{binding}}"> | |
381 | |
382 you can write: | |
383 | |
384 <img _src="{{binding}}"> | |
385 | |
386 For more information, see <http://goo.gl/5av8cU>. | |
387 '''); | |
388 | |
389 final dontUseUndercorePrefix = const MessageTemplate( | |
390 const MessageId('polymer', 29), | |
391 'The "_%-name-%" attribute is only supported when using bindings. ' | |
392 'Please change to the "%-name-%" attribute.', | |
393 'The special underscore attribute is only for bindings.', | |
Kathy Walrath
2014/09/03 21:26:54
->
Attribute has "_" prefix'
Siggi Cherem (dart-lang)
2014/09/04 02:32:15
Done.
| |
394 ''' | |
395 A special attribute exists to support bindings on URL attributes. For example, | |
396 this correctly binds the `src` attribute in an image: | |
397 | |
398 <img _src="{{binding}}"> | |
399 | |
400 However, this special `_src` attribute is only available for bindings. If you | |
401 just have a URL, use the normal `src` attribute instead. | |
402 '''); | |
403 | |
404 final internalErrorDontKnowHowToImport = const MessageTemplate( | |
405 const MessageId('polymer', 30), | |
406 "internal error: don't know how to include %-target-% from" | |
407 " %-source-%.%-extra-%", | |
408 "Internal error: don't know how to include a URL", | |
409 ''' | |
410 Sorry, you just run into a bug in the polymer transformer code. Please file a | |
Kathy Walrath
2014/09/03 21:26:54
you just run -> you just ran
[GLOBAL]
Siggi Cherem (dart-lang)
2014/09/04 02:32:16
Done.
| |
411 bug at <http://dartbug.com/new> including if possible some example code that can | |
Kathy Walrath
2014/09/03 21:26:55
including if possible some
->
including, if possib
Siggi Cherem (dart-lang)
2014/09/04 02:32:17
Done.
| |
412 help us reproduce the issue so we can investigate. | |
Kathy Walrath
2014/09/03 21:26:54
delete " so we can investigate"
Siggi Cherem (dart-lang)
2014/09/04 02:32:16
Done.
| |
413 '''); | |
414 | |
415 final internalErrorUnexpectedScript = const MessageTemplate( | |
416 const MessageId('polymer', 31), | |
417 'unexpected script. The ScriptCompactor transformer should run after ' | |
418 'running the ImportInliner', | |
419 'Internal error: phases run out of order', | |
420 ''' | |
421 Sorry, you just run into a bug in the polymer transformer code. Please file a | |
422 bug at <http://dartbug.com/new> including if possible some example code that can | |
423 help us reproduce the issue so we can investigate. | |
424 '''); | |
425 | |
426 final noPrivateCustomTag = const MessageTemplate( | |
427 const MessageId('polymer', 32), | |
428 '@CustomTag is not currently supported on private classes:' | |
429 ' %-name-%. Consider making this class public, or create a ' | |
430 'public initialization method marked with `@initMethod` that calls ' | |
431 '`Polymer.register(%-name-%, %-className-%)`.', | |
432 '`@CustomTag` is only supported on public classes.', | |
Kathy Walrath
2014/09/03 21:26:54
->
`@CustomTag` used on a private class
Siggi Cherem (dart-lang)
2014/09/04 02:32:16
Done.
| |
433 ''' | |
434 The `@CustomTag` annotation is currently only supported on public classes. If | |
435 you need to register a custom element whose implementation is a private class, | |
Kathy Walrath
2014/09/03 21:26:53
Maybe clarify that it's private because its name s
Siggi Cherem (dart-lang)
2014/09/04 02:32:16
added, but I'm not convinced this is the right pla
| |
436 you can still do so by invoking `Polymer.register` within a public method marked | |
437 with `@initMethod`. | |
438 '''); | |
439 | |
440 final noPrivateInitMethod = const MessageTemplate( | |
441 const MessageId('polymer', 33), | |
442 '@initMethod is no longer supported on private functions: %-name-%', | |
443 '`@initMethod` is only supported on public functions.', | |
Kathy Walrath
2014/09/03 21:26:55
->
`@initMethod` used on a private function
Siggi Cherem (dart-lang)
2014/09/04 02:32:16
Done.
| |
444 ''' | |
445 The `@initMethod` annotation is currently only supported on public top-level | |
446 functions. | |
447 '''); | |
448 | |
449 final missingArgumentInAnnotation = const MessageTemplate( | |
450 const MessageId('polymer', 34), | |
451 'Missing argument in @%-name-% annotation', | |
452 'Missing argument in annotation', | |
453 'The annotation expects one argument, but the argument was not provided.'); | |
454 | |
455 final invalidArgumentInAnnotation = const MessageTemplate( | |
456 const MessageId('polymer', 35), | |
457 'The parameter to @%-name-% seems to be invalid.', | |
458 'Invalid argument in annotation', | |
Kathy Walrath
2014/09/03 21:26:54
->
Non-constant argument in annotation
Siggi Cherem (dart-lang)
2014/09/04 02:32:15
Kept as "invalid" because we don't know that the p
| |
459 ''' | |
460 We expected a constant argument in an annotation, but the polymer build was not | |
Kathy Walrath
2014/09/03 21:26:55
->
The polymer transformer was not able to extract
Siggi Cherem (dart-lang)
2014/09/04 02:32:17
Done.
| |
461 able to extract the value of this argument. This can happen if your code is | |
462 currently in a state that can't be analyzed (for example, it has parse | |
463 errors) or if the expression passed as an argument is invalid (for example, it | |
464 is not a compile-time constant). | |
465 '''); | |
466 | |
467 | |
468 final noInitializersError = const MessageTemplate( | |
469 const MessageId('polymer', 36), | |
470 'No polymer initializers were found. Make sure to either ' | |
471 'annotate your polymer elements with @CustomTag or include a ' | |
472 'top level method annotated with @initMethod that registers your ' | |
473 'elements. Both annotations are defined in the polymer library (' | |
474 'package:polymer/polymer.dart).', | |
475 'No polymer initializers found', | |
476 ''' | |
477 No polymer initializers were found. Make sure to either | |
478 annotate your polymer elements with @CustomTag or include a | |
479 top level method annotated with @initMethod that registers your | |
480 elements. Both annotations are defined in the polymer library ( | |
481 package:polymer/polymer.dart). | |
482 '''); | |
483 | |
484 final noEventBindingsWithAtExpression = const MessageTemplate( | |
485 const MessageId('polymer', 37), | |
486 'event bindings with @ are no longer supported', | |
487 'Event bindings with @ are no longer supported', | |
488 ''' | |
489 For a while there was an undocumented feature that allowed users to include | |
490 expressions in event bindings using the `@` prefix, for example: | |
491 | |
492 <div on-click="{{@a.b.c}}"> | |
493 | |
494 This feature is no longer supported. | |
495 '''); | |
496 | |
497 final noPrivateEventHandlers = const MessageTemplate( | |
498 const MessageId('polymer', 38), | |
499 'private symbols cannot be used in event handlers', | |
500 'Private symbols cannot be used in event handlers', | |
Kathy Walrath
2014/09/03 21:26:53
->
Private symbol in event handler
Siggi Cherem (dart-lang)
2014/09/04 02:32:15
Done.
| |
501 ''' | |
502 Currently private members can't be used on event handlers. So you can't write: | |
Kathy Walrath
2014/09/03 21:26:53
on -> as? with? for?
Siggi Cherem (dart-lang)
2014/09/04 02:32:16
in? :)
| |
503 | |
504 <div on-click="{{_method}}"> | |
505 | |
506 This restriction might be removed in the future, but for now, you need to make | |
507 your event handlers public. | |
508 '''); | |
509 | |
510 final noPrivateSymbolsInBinding = const MessageTemplate( | |
511 const MessageId('polymer', 39), | |
512 'private symbols are not supported', | |
513 'Private symbols are not supported', | |
Kathy Walrath
2014/09/03 21:26:53
->
Private symbol in a binding expression
Siggi Cherem (dart-lang)
2014/09/04 02:32:17
Done.
| |
514 ''' | |
515 Private members can't be used on binding expressions. For example, you can't | |
516 write: | |
517 | |
518 <div>{{a.b._c}}</div> | |
519 '''); | |
520 | |
521 final html5Warning = const MessageTemplate( | |
522 const MessageId('polymer', 40), | |
523 '(from html5lib) %-message-%', | |
524 'A warning was found while parsing the html document', | |
Kathy Walrath
2014/09/03 21:26:54
html -> HTML
[global within text]
Siggi Cherem (dart-lang)
2014/09/04 02:32:15
Done.
| |
525 ''' | |
526 We use a parser that implements the HTML5 spec (`html5lib`). We report any | |
Kathy Walrath
2014/09/03 21:26:53
We use a
->
The polymer transformer uses a
We rep
Siggi Cherem (dart-lang)
2014/09/04 02:32:15
Done.
| |
527 warnings that were detected by our parser during the polymer build process. | |
528 '''); | |
OLD | NEW |