| layout | default |
|---|---|
| title | Getting the Code |
| load_polymer | true |
You can grab {{site.project_title}} a few different ways:
{% include downloadbutton.html %}
The latest version of {{site.project_title}} can be downloaded as .zip bundle or installed via Bower.
The .zip contains everything you need, including the repositories, demos, and
samples described in this document. It contains the built files for polymer.min.js
and platform.min.js.
The Bower component just includes the build files.
If you want to checkout code or contribute to the project, you can recursively clone and initialize all of {{site.project_title}}'s submodules with a single git command.
To get the code, run:
git clone git://github.com/Polymer/polymer-all.git --recursive
If you want the bleeding edge development version, you'll want the master branch:
git clone -b master git://github.com/Polymer/polymer-all.git --recursive
Remember: If you don't specify master, you'll get the stable branch by default. See branching workflow for more info. {: .alert }
This creates a polymer-all/ folder with the following top-level files and folders:
- platform/ — The platform shims and polyfills.
- polymer/polymer.js — The {{site.project_title}} kernel
- polymer-elements/ — A collection of core utility elements.
- polymer-ui-elements/ — A collection of UI elements.
- projects/ — Larger examples, demos, and tools that use {{site.project_title}}.
- toolkit-ui/ — older widget examples.
- more-elements/ — additional elements
- Each platform polyfill also has a sibling repo.
A description of each repository is below.
Periodically, we will update the project's submodules on GitHub. To
update your local copy's submodules, run the following command
from the polymer-all/ folder:
git submodule update --init --recursive
To check that your development environment is ready, start a local web server and run one of the included sample projects:
- Start a local web server in the folder where you have
polymer-all/. - In your browser, navigate to http://localhost/toolkit-ui/workbench/menu.html, or whichever port you started the server on. You should see a menu of items, as shown below.
The entirety of the {{site.project_title}} is composed of a number of Git
repositories. All are included as submodules in the main polymer-all repository.
However, understanding the various pieces will help you navigate the codebase.
We have factored our repositories into separate chunks for each specification API. For example, the following repositories are useful individually:
CustomElementsHTMLImportsPointerEventsPointerGesturesShadowDOMmdvweb-animations-js
Some repositories depend on others in {{site.project_title}} and must be siblings of the same parent directory to function completely:
polymerplatformtoolkit-ui
The polymer repository contains the
{{site.project_title}} kernel and its tools and tests. It expects
the platform polyfill repo to be a sibling directory.
Each new web platform feature has a corresponding polyfill repository. The reasoning for this is two-fold:
- make the polyfills work across all modern browsers
- each polyfill can stand on its own and be used à la carte in projects.
The platform repository references each of the polyfills as a sibling directory, and contains integration tests, loader, and build tools for
the amalgamated polyfills.
See Tooling & Testing for information.
github.com/polymer/polymer-elements
The polymer-elements repository
contains utility elements that do not render UI.
github.com/polymer/polymer-ui-elements
The polymer-ui-elements
repository contains a growing set of basic UI components. Most are a work in progress.
github.com/polymer/more-elements
The more-elements repository contains
extra components and wrappers for third-party code. Examples include Bootstrap,
topcoat, Chart.js, pdf.js, x-tags, and AceEditor.
The toolkit-ui repository contains examples of
the types of things you can do when writing a {{site.project_title}} element.
- elements/ —
g-*custom element definitions. - workbench/ — demos of the {{site.project_title}}-style elements found in
elements/.
The projects repository contains
substantial larger apps/demos that we're tinkering with This includes apps like
pica and tools like Sandbox.