• This repository has been archived on 30/Dec/2022
  • Stars
    star
    2,457
  • Rank 18,712 (Top 0.4 %)
  • Language
    JavaScript
  • Created over 9 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A starting point for Polymer apps

Polymer App Toolbox - Starter Kit

Build Status

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 using npm (we assume you have pre-installed node.js).

npm install -g polymer-cli
Initialize project from template
mkdir my-app
cd my-app
polymer init polymer-3-starter-kit

Start the development server

This command serves the app at http://127.0.0.1:8081 and provides basic URL routing for the app:

npm start

Build

The npm run build command builds your Polymer application for production, using build configuration options provided by the command line or in your project's polymer.json file.

You can configure your polymer.json file to create multiple builds. This is necessary if you will be serving different builds optimized for different browsers. You can define your own named builds, or use presets. See the documentation on building your project for production for more information.

The Polymer Starter Kit is configured to create three builds. These builds will be output to a subdirectory under the build/ directory as follows:

build/
  es5-bundled/
  es6-bundled/
  esm-bundled/
  • es5-bundled is a bundled, minified build with a service worker. ES6 code is compiled to ES5 for compatibility with older browsers.
  • es6-bundled is a bundled, minified build with a service worker. ES6 code is served as-is. This build is for browsers that can handle ES6 code - see building your project for production for a list.
  • esm-bundled is a bundled, minified build with a service worker. It uses standard ES module import/export statements for browsers that support them.

Run polymer help build for the full list of available options and optimizations. Also, see the documentation on the polymer.json specification and building your Polymer application for production.

Preview the build

This command serves your app. Replace build-folder-name with the folder name of the build you want to serve.

npm start build/build-folder-name/

Run tests

This command will run Web Component Tester against the browsers currently installed on your machine:

npm test

If running Windows you will need to set the following environment variables:

  • LAUNCHPAD_BROWSERS
  • LAUNCHPAD_CHROME

Read More here daffl/launchpad


Looking for our older PSK2 Polycast or migration blog post? See the previous README.

More Repositories

1

polymer

Our original Web Component library.
HTML
22,033
star
2

pwa-starter-kit

Starter templates for building full-featured Progressive Web Apps from web components.
JavaScript
2,367
star
3

polymer-bundler

Moved to Polymer/tools monorepo
TypeScript
1,196
star
4

old-docs-site

Old Polymer site. Replaced by these repos: polymer-project.org, polymer-library-docs
HTML
1,022
star
5

shop

The Shop app
JavaScript
990
star
6

designer

Polymer Designer Tool
JavaScript
839
star
7

web-component-tester

Moved to Polymer/tools monorepo
TypeScript
566
star
8

polymer-cli

Moved to Polymer/tools monorepo
JavaScript
498
star
9

pwa-helpers

Small helper methods or mixins to help you build web apps.
TypeScript
440
star
10

tools

Polymer Tools Monorepo
TypeScript
430
star
11

prpl-server

⚠️Maintenance mode⚠️ An HTTP server for Node designed to serve PRPL apps in production.
TypeScript
425
star
12

news

Polymer News (Progress Web App Template)
HTML
263
star
13

polycasts

HTML
220
star
14

polyserve

Moved to Polymer/tools monorepo
TypeScript
192
star
15

polymer-analyzer

Moved to Polymer/tools monorepo
TypeScript
159
star
16

hn-polymer-2

Polymer Hacker News clone
HTML
158
star
17

polymer-modulizer

Moved to https://github.com/Polymer/tools/tree/master/packages/modulizer
HTML
143
star
18

polymer-build

Moved to Polymer/tools monorepo
TypeScript
103
star
19

polymer-decorators

TypeScript decorators for Polymer.
TypeScript
93
star
20

polymer-editor-service

Moved to Polymer/tools monorepo
TypeScript
76
star
21

vscode-plugin

Provides autocompletion, linting, and more for web components.
TypeScript
74
star
22

pwa-starter-kit-hn

TypeScript
70
star
23

lazy-imports

Declarative lazy HTML imports as a behavior.
HTML
63
star
24

polymer-css-build

JavaScript
40
star
25

polymer-linter

Moved to Polymer/tools monorepo
TypeScript
34
star
26

atom-plugin

Provides autocompletion, linting, and more for web components.
JavaScript
32
star
27

polymer-library-docs

Polymer library documentation site.
HTML
23
star
28

gen-typescript-declarations

Moved to Polymer/tools monorepo
TypeScript
21
star
29

wct-local

Moved to Polymer/tools monorepo
TypeScript
21
star
30

dom5

TypeScript
19
star
31

polymer-resin

XSS mitigation for Polymer webcomponents that uses safe html type contracts
JavaScript
18
star
32

wct-sauce

Moved to Polymer/tools monorepo
JavaScript
17
star
33

polymer-project.org

Polymer Project site & blog.
HTML
15
star
34

koa-node-resolve

Koa middleware that transforms Node package specifiers to relative paths
TypeScript
15
star
35

browser-capabilities

Moved to Polymer/tools monorepo
TypeScript
14
star
36

tattoo

Test All The Things Over and Over
TypeScript
12
star
37

koa-esm-transform

Middleware for Koa servers that transforms standard JavaScript modules to AMD modules for use with older browsers that don't support modules natively.
TypeScript
10
star
38

polymer-project-config

Moved to Polymer/tools monorepo
JavaScript
8
star
39

css-select-parse5-adapter

An adapter for the css-select package to allow querying of parse5 generated trees.
TypeScript
8
star
40

polymer-workspaces

Moved to https://github.com/Polymer/tools/tree/master/packages/workspaces
TypeScript
8
star
41

polymer.github.io

HTML
7
star
42

tools-sample-projects

Sample projects that Polymer tools should handle.
HTML
7
star
43

ar-logo

JavaScript
7
star
44

tools-common

Moved to Polymer/tools monorepo
JavaScript
6
star
45

benchmarks

Benchmarks for Polymer project libraries
JavaScript
6
star
46

plylog

A logger for the Polymer CLI toolchain
TypeScript
4
star
47

elements

A collection of elements made by the Polymer team
4
star
48

koa-karma-proxy

Simplified coordination of karma and upstream proxy server using the koa web framework.
TypeScript
4
star
49

mocha-suite-child

Runs mocha test suites defined in HTML documents and include the results as if they are part of the main context.
3
star
50

.allstar

2
star
51

tools-team

Issues for tools in general
2
star
52

polygit

Polygit
TypeScript
1
star
53

.github

1
star