OLD | NEW |
1 # Web Components | 1 # Web Components |
2 | 2 |
3 This package has the polyfills for | 3 This package has the polyfills for |
4 [Shadow DOM](http://www.polymer-project.org/platform/shadow-dom.html), | 4 [Shadow DOM](http://www.polymer-project.org/platform/shadow-dom.html), |
5 [Custom Elements](http://www.polymer-project.org/platform/custom-elements.html), | 5 [Custom Elements](http://www.polymer-project.org/platform/custom-elements.html), |
6 and [HTML Imports](http://www.polymer-project.org/platform/html-imports.html). | 6 and [HTML Imports](http://www.polymer-project.org/platform/html-imports.html). |
7 | 7 |
8 These features exist in dart:html, for example | 8 These features exist in dart:html, for example |
9 [Element.reateShadowRoot](https://api.dartlang.org/apidocs/channels/stable/#dart
-dom-html.Element@id_createShadowRoot) | 9 [Element.reateShadowRoot](https://api.dartlang.org/apidocs/channels/stable/#dart
-dom-html.Element@id_createShadowRoot) |
10 and [Document.register](https://api.dartlang.org/apidocs/channels/stable/#dart-d
om-html.HtmlDocument@id_register). | 10 and [Document.register](https://api.dartlang.org/apidocs/channels/stable/#dart-d
om-html.HtmlDocument@id_register). |
11 However those APIs are not supported on all browsers yet unless you | 11 However those APIs are not supported on all browsers yet unless you |
12 load the polyfills, as indicated below. | 12 load the polyfills, as indicated below. |
13 | 13 |
14 ## Getting started | 14 ## Getting started |
15 | 15 |
16 Include the polyfills in your HTML `<head>` to enable Shadow DOM: | 16 Include the polyfills in your HTML `<head>` to enable Shadow DOM: |
17 | 17 |
18 ```html | 18 ```html |
19 <script src="packages/web_components/platform.js"></script> | 19 <script src="packages/web_components/platform.js"></script> |
20 <script src="packages/web_components/dart_support.js"></script> | 20 <script src="packages/web_components/dart_support.js"></script> |
21 ``` | 21 ``` |
22 | 22 |
23 You can also use an unminfied version for development: | 23 You can also use an unminified version for development: |
24 | 24 |
25 ```html | 25 ```html |
26 <script src="packages/web_components/platform.concat.js"></script> | 26 <script src="packages/web_components/platform.concat.js"></script> |
27 <script src="packages/web_components/dart_support.js"></script> | 27 <script src="packages/web_components/dart_support.js"></script> |
28 ``` | 28 ``` |
29 | 29 |
30 Because the Shadow DOM polyfill does extensive DOM patching, platform.js should | 30 Because the Shadow DOM polyfill does extensive DOM patching, platform.js should |
31 be included **before** other script tags. Be sure to include dart_support.js | 31 be included **before** other script tags. Be sure to include dart_support.js |
32 too, it is required for the Shadow DOM polyfill to work with | 32 too, it is required for the Shadow DOM polyfill to work with |
33 [dart2js](https://www.dartlang.org/docs/dart-up-and-running/contents/ch04-tools-
dart2js.html). | 33 [dart2js](https://www.dartlang.org/docs/dart-up-and-running/contents/ch04-tools-
dart2js.html). |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 | 77 |
78 # If you don't have "npm", get it here: http://nodejs.org | 78 # If you don't have "npm", get it here: http://nodejs.org |
79 cd platform-dev | 79 cd platform-dev |
80 npm install | 80 npm install |
81 grunt minify audit | 81 grunt minify audit |
82 cd build | 82 cd build |
83 | 83 |
84 # Copy the build output to your Dart source tree | 84 # Copy the build output to your Dart source tree |
85 cp build.log platform* ~/dart/dart/pkg/web_components/lib | 85 cp build.log platform* ~/dart/dart/pkg/web_components/lib |
86 ``` | 86 ``` |
OLD | NEW |