Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit ce76f80

Browse files
committed
Merge branch '3.0-preview'
2 parents d2c9e9c + d33a7ca commit ce76f80

29 files changed

+13673
-584
lines changed

.eslintrc.json

Lines changed: 0 additions & 21 deletions
This file was deleted.

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* text=auto
1+
* text=auto

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
bower_components/
21
build/
32
node_modules/

.travis.yml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,17 @@
11
language: node_js
2+
node_js:
3+
- "9"
4+
- "8"
25
dist: trusty
36
sudo: required
47
addons:
5-
firefox: "latest"
6-
apt:
7-
sources:
8-
- google-chrome
9-
packages:
10-
- google-chrome-stable
11-
node_js:
12-
- "node"
13-
- "6"
8+
firefox: latest
9+
chrome: stable
1410
cache:
1511
directories:
1612
- node_modules
1713
install:
18-
- npm install -g polymer-cli
1914
- npm install
20-
- polymer install
2115
before_script:
2216
- npm run lint
2317
script:

README.md

Lines changed: 15 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -18,95 +18,61 @@ The PRPL pattern, in a nutshell:
1818
* **Pre-cache** components for remaining routes
1919
* **Lazy-load** and progressively upgrade next routes on-demand
2020

21-
### Migrating from Polymer Starter Kit v1?
22-
23-
[Check out our blog post that covers what's changed in PSK2 and how to migrate!](https://www.polymer-project.org/1.0/blog/2016-08-18-polymer-starter-kit-or-polymer-cli.html)
24-
25-
### Quickstart
26-
27-
We've recorded a Polycast to get you up and running with PSK2 fast!
28-
29-
<p align="center">
30-
<a href="https://www.youtube.com/watch?v=HgJ0XCyBwzY&list=PLNYkxOF6rcIDdS7HWIC_BYRunV6MHs5xo&index=10">
31-
<img src="https://img.youtube.com/vi/HgJ0XCyBwzY/0.jpg" alt="Polymer Starter Kit 2 video">
32-
</a>
33-
</p>
34-
3521
### Setup
3622

3723
##### Prerequisites
3824

39-
First, install [Polymer CLI](https://github.com/Polymer/polymer-cli) using
25+
Install [Polymer CLI](https://github.com/Polymer/polymer-cli) using
4026
[npm](https://www.npmjs.com) (we assume you have pre-installed [node.js](https://nodejs.org)).
4127

42-
npm install -g polymer-cli
43-
44-
Second, install [Bower](https://bower.io/) using [npm](https://www.npmjs.com)
45-
46-
npm install -g bower
28+
npm install -g polymer-cli@next
4729

4830
##### Initialize project from template
4931

5032
mkdir my-app
5133
cd my-app
52-
polymer init polymer-2-starter-kit
34+
polymer init polymer-3-starter-kit
5335

5436
### Start the development server
5537

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

59-
polymer serve
41+
npm start
6042

6143
### Build
6244

63-
The `polymer 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.
64-
65-
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](https://www.polymer-project.org/2.0/toolbox/build-for-production) for more information.
66-
67-
The Polymer Starter Kit is configured to create three builds using [the three supported presets](https://www.polymer-project.org/2.0/toolbox/build-for-production#build-presets):
45+
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.
6846

69-
```
70-
"builds": [
71-
{
72-
"preset": "es5-bundled"
73-
},
74-
{
75-
"preset": "es6-bundled"
76-
},
77-
{
78-
"preset": "es6-unbundled"
79-
}
80-
]
81-
```
47+
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](https://www.polymer-project.org/3.0/toolbox/build-for-production) for more information.
8248

83-
Builds will be output to a subdirectory under the `build/` directory as follows:
49+
The Polymer Starter Kit is configured to create three builds. These builds will be output to a subdirectory under the `build/` directory as follows:
8450

8551
```
8652
build/
8753
es5-bundled/
8854
es6-bundled/
89-
es6-unbundled/
55+
esm-bundled/
9056
```
9157

9258
* `es5-bundled` is a bundled, minified build with a service worker. ES6 code is compiled to ES5 for compatibility with older browsers.
93-
* `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](https://www.polymer-project.org/2.0/toolbox/build-for-production#compiling) for a list.
94-
* `es6-unbundled` is an unbundled, minified build with a service worker. ES6 code is served as-is. This build is for browsers that support HTTP/2 push.
59+
* `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](https://www.polymer-project.org/3.0/toolbox/build-for-production#compiling) for a list.
60+
* `esm-bundled` is a bundled, minified build with a service worker. It uses standard ES module import/export statements for browsers that support them.
9561

96-
Run `polymer help build` for the full list of available options and optimizations. Also, see the documentation on the [polymer.json specification](https://www.polymer-project.org/2.0/docs/tools/polymer-json) and [building your Polymer application for production](https://www.polymer-project.org/2.0/toolbox/build-for-production).
62+
Run `polymer help build` for the full list of available options and optimizations. Also, see the documentation on the [polymer.json specification](https://www.polymer-project.org/3.0/docs/tools/polymer-json) and [building your Polymer application for production](https://www.polymer-project.org/3.0/toolbox/build-for-production).
9763

9864
### Preview the build
9965

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

102-
polymer serve build/build-folder-name/
68+
npm start build/build-folder-name/
10369

10470
### Run tests
10571

10672
This command will run [Web Component Tester](https://github.com/Polymer/web-component-tester)
10773
against the browsers currently installed on your machine:
10874

109-
polymer test
75+
npm test
11076

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

@@ -115,11 +81,6 @@ If running Windows you will need to set the following environment variables:
11581

11682
Read More here [daffl/launchpad](https://github.com/daffl/launchpad#environment-variables-impacting-local-browsers-detection)
11783

118-
### Adding a new view
84+
---
11985

120-
You can extend the app by adding more views that will be demand-loaded
121-
e.g. based on the route, or to progressively render non-critical sections of the
122-
application. Each new demand-loaded fragment should be added to the list of
123-
`fragments` in the included `polymer.json` file. This will ensure those
124-
components and their dependencies are added to the list of pre-cached components
125-
and will be included in the build.
86+
Looking for our older PSK2 Polycast or migration blog post? See [the previous README](https://github.com/Polymer/polymer-starter-kit/blob/v3.2.1/README.md).

bower.json

Lines changed: 0 additions & 26 deletions
This file was deleted.

index.html

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
/**
6464
* [polymer-root-path]
6565
*
66-
* By default, we set `Polymer.rootPath` to the server root path (`/`).
6766
* Leave this line unchanged if you intend to serve your app from the root
6867
* path (e.g., with URLs like `my.domain/` and `my.domain/view1`).
6968
*
@@ -72,29 +71,29 @@
7271
* to indicate the path from which you'll be serving, including leading
7372
* and trailing slashes (e.g., `/my-app/`).
7473
*/
75-
window.Polymer = {rootPath: '/'};
74+
window.MyAppGlobals = { rootPath: '/' };
7675

7776
// Load and register pre-caching Service Worker
7877
if ('serviceWorker' in navigator) {
7978
window.addEventListener('load', function() {
8079
navigator.serviceWorker.register('service-worker.js', {
81-
scope: Polymer.rootPath,
80+
scope: MyAppGlobals.rootPath
8281
});
8382
});
8483
}
8584
</script>
8685

8786
<!-- Load webcomponents-loader.js to check and load any polyfills your browser needs -->
88-
<script src="bower_components/webcomponentsjs/webcomponents-loader.js"></script>
87+
<script src="node_modules/@webcomponents/webcomponentsjs/webcomponents-loader.js"></script>
8988

9089
<!-- Load your application shell -->
91-
<link rel="import" href="src/my-app.html">
90+
<script type="module" src="src/my-app.js"></script>
9291

9392
<!-- Add any global styles for body, document, etc. -->
9493
<style>
9594
body {
9695
margin: 0;
97-
font-family: 'Roboto', 'Noto', sans-serif;
96+
font-family: "Roboto", "Noto", sans-serif;
9897
line-height: 1.5;
9998
min-height: 100vh;
10099
background-color: #eeeeee;

0 commit comments

Comments
 (0)