Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Side by Side Diff: pkg/web_components/README.md

Issue 723393003: update to polymer js 0.5.1 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: final tweaks Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/webcomponents.min.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 unminified 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/webcomponents.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, webcomponents.js
31 be included **before** other script tags. Be sure to include dart_support.js 31 should be included **before** other script tags. Be sure to include
32 too, it is required for the Shadow DOM polyfill to work with 32 dart_support.js 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).
34 34
35 ## Custom Elements 35 ## Custom Elements
36 36
37 Custom Elements let authors define their own elements. Authors associate 37 Custom Elements let authors define their own elements. Authors associate
38 JavaScript or Dart code with custom tag names, and then use those custom tag 38 JavaScript or Dart code with custom tag names, and then use those custom tag
39 names as they would any standard tag. 39 names as they would any standard tag.
40 40
41 For example, after registering a special kind of button called `super-button`, 41 For example, after registering a special kind of button called `super-button`,
42 use the super button just like this: 42 use the super button just like this:
(...skipping 14 matching lines...) Expand all
57 shadow roots. It provides a method of establishing and maintaining functional 57 shadow roots. It provides a method of establishing and maintaining functional
58 boundaries between DOM trees and how these trees interact with each other within 58 boundaries between DOM trees and how these trees interact with each other within
59 a document, thus enabling better functional encapsulation within the DOM. 59 a document, thus enabling better functional encapsulation within the DOM.
60 60
61 See the Polymer [Shadow DOM page](http://www.polymer-project.org/platform/shadow -dom.html) 61 See the Polymer [Shadow DOM page](http://www.polymer-project.org/platform/shadow -dom.html)
62 for more information. 62 for more information.
63 63
64 64
65 ## Hacking on this package 65 ## Hacking on this package
66 66
67 To rebuild platform.js: 67 The `webcomponents.*` files in this package are developed
68 68 [here](https://github.com/Polymer/webcomponentsjs). Follow the instructions
69 ```bash 69 there for how to build a new release and then copy the files into this package.
70 # Make a directory like ~/src/polymer
71 mkdir ~/src/polymer
72 cd ~/src/polymer
73 git clone https://github.com/polymer/tools
74
75 # Sync polymer repositories
76 ./tools/bin/pull-all-polymer.sh
77
78 # If you don't have "npm", get it here: http://nodejs.org
79 cd platform-dev
80 npm install
81 grunt minify audit
82 cd build
83
84 # Copy the build output to your Dart source tree
85 cp build.log platform* ~/dart/dart/pkg/web_components/lib
86 ```
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698