-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
850 additions
and
758 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,38 @@ | ||
# Polymer App Toolbox - Drawer Template | ||
# \<polymerday\> | ||
|
||
This template is a starting point for building apps using a drawer-based | ||
layout. The layout is provided by `app-layout` elements. | ||
PolymerDay Madrid | ||
|
||
This template, along with the `polymer-cli` toolchain, also demonstrates use | ||
of the "PRPL pattern" This pattern allows fast first delivery and interaction with | ||
the content at the initial route requested by the user, along with fast subsequent | ||
navigation by pre-caching the remaining components required by the app and | ||
progressively loading them on-demand as the user navigates through the app. | ||
## Install the Polymer-CLI | ||
|
||
The PRPL pattern, in a nutshell: | ||
First, make sure you have the [Polymer CLI](https://www.npmjs.com/package/polymer-cli) installed. Then run `polymer serve` to serve your application locally. | ||
|
||
* **Push** components required for the initial route | ||
* **Render** initial route ASAP | ||
* **Pre-cache** components for remaining routes | ||
* **Lazy-load** and progressively upgrade next routes on-demand | ||
## Viewing Your Application | ||
|
||
### Setup | ||
``` | ||
$ polymer serve | ||
``` | ||
|
||
##### Prerequisites | ||
## Building Your Application | ||
|
||
Install [polymer-cli](https://github.com/Polymer/polymer-cli): | ||
``` | ||
$ polymer build | ||
``` | ||
|
||
npm install -g polymer-cli | ||
This will create a `build/` folder with `bundled/` and `unbundled/` sub-folders | ||
containing a bundled (Vulcanized) and unbundled builds, both run through HTML, | ||
CSS, and JS optimizers. | ||
|
||
##### Initialize project from template | ||
You can serve the built versions by giving `polymer serve` a folder to serve | ||
from: | ||
|
||
mkdir my-app | ||
cd my-app | ||
polymer init app-drawer-template | ||
``` | ||
$ polymer serve build/bundled | ||
``` | ||
|
||
### Start the development server | ||
|
||
This command serves the app at `http://localhost:8080` and provides basic URL | ||
routing for the app: | ||
|
||
polymer serve | ||
|
||
|
||
### Build | ||
|
||
This command performs HTML, CSS, and JS minification on the application | ||
dependencies, and generates a service-worker.js file with code to pre-cache the | ||
dependencies based on the entrypoint and fragments specified in `polymer.json`. | ||
The minified files are output to the `build/unbundled` folder, and are suitable | ||
for serving from a HTTP/2+Push compatible server. | ||
|
||
In addition the command also creates a fallback `build/bundled` folder, | ||
generated using fragment bundling, suitable for serving from non | ||
H2/push-compatible servers or to clients that do not support H2/Push. | ||
|
||
polymer build | ||
|
||
### Test the build | ||
|
||
This command serves the minified version of the app in an unbundled state, as it would | ||
be served by a push-compatible server: | ||
|
||
polymer serve build/unbundled | ||
|
||
This command serves the minified version of the app generated using fragment bundling: | ||
|
||
polymer serve build/bundled | ||
|
||
### Extend | ||
|
||
You can extend the app by adding more elements that will be demand-loaded | ||
e.g. based on the route, or to progressively render non-critical sections | ||
of the application. Each new demand-loaded fragment should be added to the | ||
list of `fragments` in the included `polymer.json` file. This will ensure | ||
those components and their dependencies are added to the list of pre-cached | ||
components (and will have bundles created in the fallback `bundled` build). | ||
## Running Tests | ||
|
||
``` | ||
$ polymer test | ||
``` | ||
|
||
Your application is already set up to be tested via [web-component-tester](https://github.com/Polymer/web-component-tester). Run `polymer test` to run your application's test suite locally. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,32 @@ | ||
{ | ||
"name": "app-drawer-template", | ||
"name": "polymerday", | ||
"description": "PolymerDay Madrid", | ||
"main": "index.html", | ||
"keywords": [ | ||
"polymer", | ||
"polymerday", | ||
"madrid" | ||
], | ||
"authors": [ | ||
"The Polymer Authors" | ||
"Carlos Cañado <[email protected]>", | ||
"Manu Fosela <[email protected]>", | ||
"Jorge del Casar <[email protected]>", | ||
"Alvaro Isorna <[email protected]>" | ||
], | ||
"license": "MIT", | ||
"ignore": [ | ||
"**/.*", | ||
"node_modules", | ||
"bower_components", | ||
"test", | ||
"tests" | ||
], | ||
"private": true, | ||
"dependencies": { | ||
"app-layout": "polymerelements/app-layout#^0.9.0", | ||
"app-route": "polymerelements/app-route#^0.9.1", | ||
"iron-flex-layout": "polymerelements/iron-flex-layout#^1.3.0", | ||
"iron-icon": "polymerelements/iron-icon#^1.0.0", | ||
"iron-iconset-svg": "polymerelements/iron-iconset-svg#^1.0.0", | ||
"iron-localstorage": "polymerelements/iron-localstorage#^1.0.0", | ||
"iron-media-query": "polymerelements/iron-media-query#^1.0.0", | ||
"iron-pages": "polymerelements/iron-pages#^1.0.0", | ||
"iron-selector": "polymerelements/iron-selector#^1.0.0", | ||
"paper-tabs": "PolymerElements/paper-tabs#~1.6.2", | ||
"paper-icon-button": "PolymerElements/paper-icon-button#~1.1.1", | ||
"polymer": "polymer/polymer#^1.4.0" | ||
"polymer": "polymer/polymer#^1.4.0", | ||
"platinum-sw": "polymerelements/platinum-sw#^1.3.0", | ||
"iron-flex-layout": "polymerelements/iron-flex-layout#^1.3.1", | ||
"paper-styles": "PolymerElements/paper-styles#^1.1.4" | ||
}, | ||
"devDependencies": { | ||
"web-component-tester": "^4.0.0" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,30 @@ | ||
{ | ||
"name": "My App", | ||
"short_name": "My App", | ||
"icons": [{ | ||
"src": "images/app-icon-32.png", | ||
"type": "image/png", | ||
"sizes": "32x32" | ||
}, { | ||
"src": "images/app-icon.svg", | ||
"sizes": "128x128", | ||
"type": "image/svg" | ||
}, { | ||
"src": "images/app-icon-144.png", | ||
"sizes": "144x144", | ||
"type": "image/png" | ||
}, { | ||
"src": "images/app-icon.svg", | ||
"sizes": "192x192", | ||
"type": "image/svg" | ||
},{ | ||
"src": "images/app-icon.svg", | ||
"sizes": "384x384", | ||
"type": "image/svg" | ||
}], | ||
"name": "polymerday", | ||
"short_name": "polymerday", | ||
"description": "PolymerDay Madrid", | ||
"icons": [{ | ||
"src": "images/app-icon-32.png", | ||
"type": "image/png", | ||
"sizes": "32x32" | ||
}, { | ||
"src": "images/app-icon.svg", | ||
"sizes": "128x128", | ||
"type": "image/svg" | ||
}, { | ||
"src": "images/app-icon-144.png", | ||
"sizes": "144x144", | ||
"type": "image/png" | ||
}, { | ||
"src": "images/app-icon.svg", | ||
"sizes": "192x192", | ||
"type": "image/svg" | ||
},{ | ||
"src": "images/app-icon.svg", | ||
"sizes": "384x384", | ||
"type": "image/svg" | ||
}], | ||
"start_url": "/", | ||
"display": "standalone", | ||
"background_color": "#3f51b5", | ||
"theme_color": "#3f51b5" | ||
"background_color": "#FFF", | ||
"theme_color": "#295DA4" | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1 @@ | ||
/** | ||
* @license | ||
* Copyright (c) 2016 The Polymer Project Authors. All rights reserved. | ||
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt | ||
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | ||
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt | ||
* Code distributed by Google as part of the polymer project is also | ||
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt | ||
*/ | ||
console.info('Service worker disabled for development, will be generated at build time.'); |
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.