-
Notifications
You must be signed in to change notification settings - Fork 2
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
44 changed files
with
1,076 additions
and
147 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
akirodic.com |
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,29 @@ | ||
# Polymer App Toolbox - Drawer Template | ||
|
||
This template is a starting point for building apps using a drawer-based | ||
layout. The layout is provided by `app-layout` elements. | ||
|
||
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. | ||
|
||
The PRPL pattern, in a nutshell: | ||
|
||
* **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 | ||
|
||
### Setup | ||
|
||
##### Prerequisites | ||
|
||
Install [polymer-cli](https://github.com/Polymer/polymer-cli): | ||
|
||
npm install -g polymer-cli | ||
|
||
##### Initialize project from template | ||
|
||
mkdir my-app | ||
cd my-app | ||
polymer init app-drawer-template | ||
|
||
### Start the development server | ||
|
||
This command serves the app at `http://localhost:8080` and provides basic URL | ||
routing for the app: | ||
|
||
polymer serve | ||
|
||
[Personal website](http://akirodic.com) based on [Polymer App Toolbox](https://www.polymer-project.org/1.0/toolbox/). | ||
|
||
### 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. | ||
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. | ||
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 | ||
``` | ||
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: | ||
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 | ||
``` | ||
polymer serve build/unbundled | ||
``` | ||
|
||
This command serves the minified version of the app generated using fragment bundling: | ||
|
||
polymer serve build/bundled | ||
``` | ||
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). | ||
|
||
|
||
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). |
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
language: node_js | ||
sudo: required | ||
dist: trusty | ||
addons: | ||
firefox: latest | ||
apt: | ||
sources: | ||
- google-chrome | ||
packages: | ||
- google-chrome-stable | ||
node_js: | ||
- '0.12' | ||
- '4.2' | ||
- '5.1' | ||
cache: | ||
directories: | ||
- node_modules | ||
before_script: | ||
- 'export DISPLAY=:99.0' | ||
- sh -e /etc/init.d/xvfb start | ||
- sleep 3 | ||
- npm i -g [email protected] [email protected] [email protected] | ||
- bower i | ||
script: | ||
- ./travis-runner.sh | ||
env: | ||
- secure: XwpzUCepQserNClpI5XnMFFxfPd69m1zJvB+D+AUXbdGUki2VEJcN5p4Lu/7sr5beoo19bh6dMRjMXVRmMnaphLa+PfSm6CM/j3iCrOdmehsgmQMrhNmflqW4a3QfcJ4QFNcg+v7Q0O+GsBKim3WVX1lRaGFU/OHKjsSomTqdWOeIzsfqlpt21FV6F84HwsUjLrA1iGndioXQ+HsjD1+RxO6QF5remQuTUGVbNZhgxiv+qbB27izH3TTItuU6etU0lUqsVinSL9Tdibqm3OkgV0sbulTfufIq+7y8Oug8QahZQDVTKENB5MAJW2JbMJ1+RAWwKEA2Dl7JntmI7vMRL74UOLXVVlWeATHzaBJaivR6d+MDZIkMvFmn+kQPWPo7k/5oQUfQ2MketR/tAMFWmpRMoDfR00Ib2P0pqdg57CDoGrz7Pn27iDZWivtYRiri+uOjPNSqxrjwBJuXR8/E5voCSb9h353PSHvu2k23vhtNCT+H0qXUUBTBzz73PJtoqjV4+4vTWqTE86NPvaiyLEA+mRHofKhOYFprS4xwaL8G7DnqMef+sqdtGMSRttRV2CQYKZXvMg5vVvaBlbquV64nOO1wagakjbm+3dIE4V6iABwulFsMWCgsNc1TTcDVR4niOVcMQ9l1s0cukZ4bsj2edDgp0/t+oQd5acA55Q= |
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/bin/bash -e | ||
set -o pipefail | ||
|
||
if [ "$TRAVIS_BRANCH" = "dev" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_NODE_VERSION" = "5.1" ] | ||
then | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "auto deployer" | ||
|
||
# Stamp index.html with the date and time of PSK's deploying | ||
date_value=`date` | ||
sed -i.tmp1 "s/This is another card./This is another card. PSK Deployed on: $date_value/" app/index.html | ||
|
||
deploy_ghpages () { | ||
# Deploying to GitHub Pages! (http://polymerelements.github.io/polymer-starter-kit) | ||
echo Deploying to GitHub Pages | ||
sed -i.tmp "s/\/\/ app.baseUrl = '\/polymer-starter-kit/app.baseUrl = '\/polymer-starter-kit/" app/scripts/app.js | ||
sed -i.tmp2 "s/<\/head>/\ \<script>'https:'!==window.location.protocol\&\&(window.location.protocol='https')<\/script>&/g" app/index.html | ||
gulp build-deploy-gh-pages | ||
# Undoing Changes to PSK for GitHub Pages | ||
cp app/scripts/app.js.tmp app/scripts/app.js | ||
rm app/scripts/app.js.tmp | ||
cp app/index.html.tmp2 app/index.html | ||
rm app/index.html.tmp2 | ||
} | ||
|
||
deploy_firebase () { | ||
# Deploying to Firebase! (https://polymer-starter-kit.firebaseapp.com) | ||
echo Deploying to Firebase | ||
# Making Changes to PSK for Firebase | ||
sed -i.tmp 's/<!-- Chrome for Android theme color -->/<base href="\/">\'$'\n<!-- Chrome for Android theme color -->/g' app/index.html | ||
sed -i.tmp "s/hashbang: true/hashbang: false/" app/elements/routing.html | ||
cp docs/firebase.json firebase.json | ||
# Starting Build Process for Firebase Changes | ||
gulp | ||
# Starting Deploy Process to Firebaseapp.com Server -- polymer-starter-kit.firebaseapp.com | ||
firebase deploy --token "$FIREBASE_TOKEN" -m "Auto Deployed by Travis CI" | ||
# Undoing Changes to PSK for Firebase | ||
cp app/index.html.tmp app/index.html | ||
cp app/elements/routing.html.tmp app/elements/routing.html | ||
rm app/elements/routing.html.tmp | ||
rm app/index.html.tmp | ||
rm firebase.json | ||
} | ||
|
||
deploy_ghpages | ||
deploy_firebase | ||
|
||
# Revert to orginal index.html and delete temp file | ||
cp app/index.html.tmp1 app/index.html | ||
rm app/index.html.tmp1 | ||
elif [ "$TRAVIS_BRANCH" = "master" ] && [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_NODE_VERSION" != "5.1" ] | ||
then | ||
echo "Do Nothing, only deploy with Node 5.1" |
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
Binary file not shown.
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.
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.
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.
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.
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.
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
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# akirodic.com | ||
|
||
User-agent: * | ||
Disallow: |
Oops, something went wrong.