Giter Club home page Giter Club logo

polymer-skeleton's Introduction

GitHub release Build Status GitHub issues XO code style Polymer Skeleton Greenkeeper badge

A mininum boilerplate to deliver a Polymer 3.x with Webpack, PostCSS and Service Workers ready.

Features

Loaders

Supported Browsers

All modern browsers. ๐Ÿ•ถ

But as the features said, we are also transpiling the bundle for "oldie" browsers. Of course we are not covering things like IE11.

Usage

Clone this repository:

git clone --depth 1 https://github.com/PolymerX/polymer-skeleton [your-app-name]

Remove the .git folder and change details within:

  • package.json
  • src/manifest.json

Then start building your application!

yarn

Developing

Start the webpack-dev-server on localhost http://localhost:3000 with hot-reload and watch on .pcss files.

yarn dev

Test

XO for code style, Stylelint for PostCSS linting, and WCT for components tests:

yarn test

Run Lighthouse for testing the PWA capabilities:

yarn test:lighthouse

Build

(Almost) production-ready (webpack --optimize-minimze and copy statics) to dist folder. Also generating Service Workers. The command will also create the module version of the bundle ready to be loaded as type=module.

yarn build

Styling components with PostCSS

During development .pcss files will be watched, compiled and injected to the relative <style> tag within the component template. The CSS is scoped to the component so don't worry about CSS specificity, you can also use :host, :host-context and :root selectors. Read more about styling web components and custom CSS properties.

We also include Autoprefixer plugin, if you don't know how it works (...and you should), it allows you to write CSS without worrying about vendor prefixes. Just write your css properties prefix-free and let autoprefixer do the work for you when compiling.

How about commons styles? You can simply import any other .pcss file within your main component .js file and print it inside the template().

We are getting the webpcomponents-loader.js polyfill from GitHub using NPM/Yarn and copying it into a vendor folder with a Node script.

Contributors

Name Website
Alessio Occhipinti https://godev.space
Mattia Astorino http://equinsuocha.io/

License

PolymerX ยฉ MIT

polymer-skeleton's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

polymer-skeleton's Issues

Add Router

I'm thinking if we should bundle a router with the Skeleton. And this should be related to #13 since the routing should be handle by Redux.

Question

@LasaleFamine can u say me, why i dont see my changes in Develop if i pull?

Sorry for the issue, but i dont know how i can contact you :D

image

Base template and base components

Need to work on a base template like the Polymer Starter Kit (but better ๐Ÿ˜„ ).

We can also check:

Of course I'm talkin about some basic configuration of the index.html and few more files, but of course we have a different structure and designers ๐Ÿ’ฏ

Fix reload options for webpack-dev-server

Reminder example:

...
     contentBase: path.resolve('src'),
     publicPath: '/assets/js',
     compress: true,
     port: 3100
     watchContentBase: true,
     watchOptions: {
		ignored: 'assets/**/**/*.js',
  		poll: true
	},
	hot: true,
	inline: true
...

Also set reload to false for BrowserSync.

Make a beautiful logo

This space is dedicated to discussions about the logo. This weekend i will work on this.

Fix build step running "module" before "no-module" for Service Workers

Currently we are running the first webpack.config.js and then the webpack-module-build.config.js. This is actually wrong because the main Webpack configuration file generates Service Workers with Workbox and the module.bundle.js should be already generated before running Workbox. The command should be fixed within the package.json:

From

"build": "NODE_ENV=production webpack --optimize-minimize",
"postbuild": "NODE_ENV=production webpack --config webpack-module-build.config.js",

To

"prebuild": "NODE_ENV=production webpack --config webpack-module-build.config.js",
"build": "NODE_ENV=production webpack --optimize-minimize",

IMPORTANT: The CopyWebpackPlugin should be also moved from the webpack.config.js to the webpack-module-build.config.js.

Add badges

XO:
XO code style

PolymerX Skeleton (you can change the color and also the text):
Polymer Skeleton

Github Release (or Tag?):
GitHub release

Others? What do you think? @equinusocio

Polymer 3

Merge polymer-3 branch to master.

Service worker registration error & insecure origins are not loaded

I'm using Mac OS El Capitan, latest Chrome, yarn goes without any issues in terminal and no errors so far.
In Chrome console I got next errors:

(index):70 Error during service worker registration: DOMException: Only secure origins are allowed (see: https://goo.gl/Y0ZkNV).
(anonymous) @ (index):70
Promise rejected (async)
(anonymous) @ (index):69
(index):86 GET http://0.0.0.0:3000/module.bundle.js net::ERR_ABORTED

I'd changed localhost address and set enable to allow-insecure-localhost flag.
What is wrong with my installation?
Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.