| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 /// Common methods used by transfomers. | 5 /// Common methods used by transfomers. |
| 6 library polymer.src.build.common; | 6 library polymer.src.build.common; |
| 7 | 7 |
| 8 import 'dart:async'; | 8 import 'dart:async'; |
| 9 | 9 |
| 10 import 'package:analyzer/src/generated/ast.dart'; | 10 import 'package:analyzer/src/generated/ast.dart'; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 final List<String> entryPoints; | 60 final List<String> entryPoints; |
| 61 | 61 |
| 62 /// Map of stylesheet paths that should or should not be inlined. The paths | 62 /// Map of stylesheet paths that should or should not be inlined. The paths |
| 63 /// are relative to the package root and are represented using posix style, | 63 /// are relative to the package root and are represented using posix style, |
| 64 /// which matches the representation used in asset ids in barback. | 64 /// which matches the representation used in asset ids in barback. |
| 65 /// | 65 /// |
| 66 /// There is an additional special key 'default' for the global default. | 66 /// There is an additional special key 'default' for the global default. |
| 67 final Map<String, bool> inlineStylesheets; | 67 final Map<String, bool> inlineStylesheets; |
| 68 | 68 |
| 69 /// True to enable Content Security Policy. | 69 /// True to enable Content Security Policy. |
| 70 /// This means the HTML page will include *.dart.precompiled.js | 70 /// This means the HTML page will not have inlined .js code. |
| 71 /// | |
| 72 /// This flag has no effect unless [directlyIncludeJS] is enabled. | |
| 73 final bool contentSecurityPolicy; | 71 final bool contentSecurityPolicy; |
| 74 | 72 |
| 75 /// True to include the compiled JavaScript directly from the HTML page. | 73 /// True to include the compiled JavaScript directly from the HTML page. |
| 76 /// If enabled this will remove "packages/browser/dart.js" and replace | 74 /// If enabled this will remove "packages/browser/dart.js" and replace |
| 77 /// `type="application/dart"` scripts with equivalent *.dart.js files. | 75 /// `type="application/dart"` scripts with equivalent *.dart.js files. |
| 78 /// | |
| 79 /// If [contentSecurityPolicy] enabled, this will reference files | |
| 80 /// named *.dart.precompiled.js. | |
| 81 final bool directlyIncludeJS; | 76 final bool directlyIncludeJS; |
| 82 | 77 |
| 83 /// Run transformers to create a releasable app. For example, include the | 78 /// Run transformers to create a releasable app. For example, include the |
| 84 /// minified versions of the polyfills rather than the debug versions. | 79 /// minified versions of the polyfills rather than the debug versions. |
| 85 final bool releaseMode; | 80 final bool releaseMode; |
| 86 | 81 |
| 87 /// This will make a physical element appear on the page showing build logs. | 82 /// This will make a physical element appear on the page showing build logs. |
| 88 /// It will only appear when ![releaseMode] even if this is true. | 83 /// It will only appear when ![releaseMode] even if this is true. |
| 89 final bool injectBuildLogsInOutput; | 84 final bool injectBuildLogsInOutput; |
| 90 | 85 |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 /// Returns true if this is a valid custom element name. See: | 264 /// Returns true if this is a valid custom element name. See: |
| 270 /// <http://w3c.github.io/webcomponents/spec/custom/#dfn-custom-element-type> | 265 /// <http://w3c.github.io/webcomponents/spec/custom/#dfn-custom-element-type> |
| 271 bool isCustomTagName(String name) { | 266 bool isCustomTagName(String name) { |
| 272 if (name == null || !name.contains('-')) return false; | 267 if (name == null || !name.contains('-')) return false; |
| 273 return !invalidTagNames.containsKey(name); | 268 return !invalidTagNames.containsKey(name); |
| 274 } | 269 } |
| 275 | 270 |
| 276 /// Regex to split names in the 'attributes' attribute, which supports 'a b c', | 271 /// Regex to split names in the 'attributes' attribute, which supports 'a b c', |
| 277 /// 'a,b,c', or even 'a b,c'. This is the same as in `lib/src/declaration.dart`. | 272 /// 'a,b,c', or even 'a b,c'. This is the same as in `lib/src/declaration.dart`. |
| 278 final ATTRIBUTES_REGEX = new RegExp(r'\s|,'); | 273 final ATTRIBUTES_REGEX = new RegExp(r'\s|,'); |
| OLD | NEW |