├── .github └── CODEOWNERS ├── .gitignore ├── .npmignore ├── .travis.yml ├── CONTRIBUTING.md ├── LICENSE.md ├── README.md ├── gulpfile.js ├── package-lock.json ├── package.json ├── tests ├── basic.html └── runner.html ├── wct.conf.json └── webcomponents-platform.js /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @azakus 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | webcomponents-platform.min.js* 3 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .github/ 2 | tests/ 3 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | sudo: required 3 | dist: trusty 4 | node_js: '9' 5 | addons: 6 | firefox: latest 7 | apt: 8 | sources: 9 | - google-chrome 10 | packages: 11 | - google-chrome-stable 12 | script: 13 | - xvfb-run wct 14 | - if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then wct -s 'windows 10/microsoftedge@14' 15 | -s 'windows 8.1/internet explorer@11' -s 'os x 10.11/safari@10' -s 'os x 10.11/safari@9'; 16 | fi 17 | env: 18 | global: 19 | - secure: HJqGZudd8jAegvRbU8MYMtGiLbfu8C1hbz+occ0ML5vfKgggsv2JrHSgdo1cF9gRkZu5zp389v00za+P0Fm6dFs+VA4Xp0/kC/gDUloRfp01Mnkdz171GoO0NpZo6iQWgN98ih72DrVUyhGi3Enj0y8JVPmIwMkosW/EGEJURIegl9EKW8VE3Hvo79zwXi3FN2JzNja20MmQUWH8LXypfNJfx9LKlwzXnvD+tYGZHV80lM7qadTwfw9uJIucd5cSevuZeuA0vZIVv0eLy09Hk/pQedZo8KOTrbjXezlJGHUDvkcYpUjUtQu7so71aVkdEoMUlV0CGBavreS17GTWn5KP2IV9Pu4QmnxMmjkIhBnuF/LftRDTAE/JqzenTi2ep0MsPlFiK963uuT/A/y4hD3JDaFTFUtY7XCScgEnyTMPpLJKDBgnUejLJOIiC6ETgRkCXM/kTq3tbWbNYMbcuMN6jcRvIQ0OezoAsYElDDqBzpa0Ou9vul/k5+gTz0A2bvALKfOQuacGXchUU2U9gFqvz6MJx+lSZK7SPZgQS+k51WEHJjCHCfHMOZ0R21DtAMigijou8PL8Mqkw/blczoSY/21qjNYxlLpIblRIWTVWdsHzJbmTHuDDwuoYQdre62uRW3GhO6gINYAQy5ymE8GF8eUyTQLxvnL/H7Uo1EU= 20 | - secure: pF2Y4srYs2GBrNj0ZoTcI+BKtIePMCU6BLP9QcVSJRWN/B2Lo4f41awsMpIV2c5QtFy4wMJyaAXEhgqHDCxedWYsICS4+/gS6fgZaCndF5xNTrVFy/nQmSaqZxJf/MppbDDZKbzX0fofQPxZ+IKP4LMzNvN8xoIkxXiqbVk0/qbKqkJqs7NkB5n7pexIXMYNH9xX4jK6p8aHWHAAYGqz2X8sQ24TyS9EOQh+gjABPnzjGEi1MhpY5faz1xrjcs6Vjv60Xt/6aXOTJGLvn0Ojbu5gHh/w6XsX2RQYPS0ZIOiraxosgPFejhrzLoaRZW/1+Fb9YGiEkXgjRPFv1/V/6p+GjZLH9bEZdYxGNGjAPNQa80EsMOoztMlk2JNbfTK0PF+GfjHi/XQvR0xc/z1Cpjw2j01iFVF8TXsaxY3Ag2DcFPJpD1NNUtwD/moa+1XSgY+lgw1LQbFhuSuZWFsXBbkjW55VYOiP6zGMzHvEgmvnBuqJxjFocwFfKU3RPemek7wqxloTX+lJMOBmOh5zjhMzTpHpbW7CeAfOzmvv0Od1OfN+icPOyJbtMoPNkbAIEAOCXVgbFYPxkwjYgkbaWRnGy3QHyoiQETv9VFMbRm+JudKlcXj7AJblE6zwk/xx6bhpBeWJFRpNG07JjHN8uDg7QLRF2T/qlLou6K2FNt0= 21 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Want to contribute to webcomponents.js? Great! 4 | 5 | We are more than happy to accept external contributions to the project in the form of [bug reports](../../issues) and pull requests. 6 | 7 | ## Contributor License Agreement 8 | 9 | Before we can accept patches, there's a quick web form you need to fill out. 10 | 11 | - If you're contributing as an individual (e.g. you own the intellectual property), fill out [this form](http://code.google.com/legal/individual-cla-v1.0.html). 12 | - If you're contributing under a company, fill out [this form](http://code.google.com/legal/corporate-cla-v1.0.html) instead. 13 | 14 | This CLA asserts that contributions are owned by you and that we can license all work under our [license](LICENSE). 15 | 16 | Other projects require a similar agreement: jQuery, Firefox, Apache, Node, and many more. 17 | 18 | [More about CLAs](https://www.google.com/search?q=Contributor%20License%20Agreement) 19 | 20 | ## Initial setup 21 | 22 | 1. Setup Gulp: `sudo npm install -g gulp` 23 | 1. Fork the project on github and pull down your copy. 24 | > replace the {{ username }} with your username and {{ repository }} with the repository name 25 | 26 | git clone git@github.com:{{ username }}/{{ repository }}.git 27 | 28 | 1. Test your change results in a working build. 29 | > in the repo you've made changes to, try generating a build: 30 | 31 | cd $REPO 32 | npm install 33 | gulp build 34 | 35 | The builds will be placed into the `dist/` directory if all goes well. 36 | 37 | 1. Commit your code and make a pull request. 38 | 39 | That's it for the one time setup. Now you're ready to make a change. 40 | 41 | ## Submitting a pull request 42 | 43 | We iterate fast! To avoid potential merge conflicts, it's a good idea to pull from the main project before making a change and submitting a pull request. The easiest way to do this is setup a remote called `upstream` and do a pull before working on a change: 44 | 45 | git remote add upstream git://github.com/polymer/webcomponentsjs.git 46 | 47 | Then before making a change, do a pull from the upstream `master` branch: 48 | 49 | git pull upstream master 50 | 51 | To make life easier, add a "pull upstream" alias in your `.gitconfig`: 52 | 53 | [alias] 54 | pu = !"git fetch origin -v; git fetch upstream -v; git merge upstream/master" 55 | 56 | That will pull in changes from your forked repo, the main (upstream) repo, and merge the two. Then it's just a matter of running `git pu` before a change and pushing to your repo: 57 | 58 | git checkout master 59 | git pu 60 | # make change 61 | git commit -a -m 'Awesome things.' 62 | git push 63 | 64 | Lastly, don't forget to submit the pull request. -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # License 2 | 3 | Everything in this repo is BSD style license unless otherwise specified. 4 | 5 | Copyright (c) 2016 The Polymer Authors. All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above 12 | copyright notice, this list of conditions and the following disclaimer 13 | in the documentation and/or other materials provided with the 14 | distribution. 15 | * Neither the name of Google Inc. nor the names of its 16 | contributors may be used to endorse or promote products derived from 17 | this software without specific prior written permission. 18 | 19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # webcomponents-platform 2 | A set of basic platform polyfills needed by webcomponents.js, such as a 3 | constructable `CustomEvent` and basic ES6 shims (`Object.assign` and `Array.from`) 4 | 5 | ## Browser Support 6 | 7 | The polyfills are intended to work in the latest versions of evergreen browsers. See below 8 | for our complete browser support matrix: 9 | 10 | | Polyfill | IE11+ | Chrome* | Firefox* | Safari 9+* | Chrome Android* | Mobile Safari* | 11 | | ---------- |:-----:|:-------:|:--------:|:----------:|:---------------:|:--------------:| 12 | | Custom Elements | ✓ | ✓ | ✓ | ✓ | ✓| ✓ | 13 | | HTML Imports | ✓ | ✓ | ✓ | ✓| ✓| ✓ | 14 | | Shadow DOM | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | 15 | | Templates | ✓ | ✓ | ✓| ✓ | ✓ | ✓ | 16 | 17 | ## Contribute 18 | 19 | See the [contributing guide](CONTRIBUTING.md) 20 | 21 | ## License 22 | 23 | Everything in this repository is BSD style license unless otherwise specified. 24 | 25 | Copyright (c) 2016 The Polymer Authors. All rights reserved. 26 | -------------------------------------------------------------------------------- /gulpfile.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright (c) 2016 The Polymer Project Authors. All rights reserved. 4 | * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt 5 | * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt 6 | * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt 7 | * Code distributed by Google as part of the polymer project is also 8 | * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt 9 | */ 10 | 'use strict'; 11 | 12 | const compilerPackage = require('google-closure-compiler'); 13 | const gulp = require('gulp'); 14 | const sourcemaps = require('gulp-sourcemaps'); 15 | const closureCompiler = compilerPackage.gulp(); 16 | 17 | gulp.task('default', () => { 18 | return gulp.src('./webcomponents-platform.js', {base: './'}) 19 | .pipe(sourcemaps.init()) 20 | .pipe(closureCompiler({ 21 | compilation_level: 'ADVANCED', 22 | warning_level: 'VERBOSE', 23 | language_in: 'ECMASCRIPT6_STRICT', 24 | language_out: 'ECMASCRIPT5_STRICT', 25 | dependency_mode: 'STRICT', 26 | entry_point: ['/webcomponents-platform'], 27 | js_output_file: 'webcomponents-platform.min.js', 28 | output_wrapper: '(function(){\n%output%\n}).call(self);', 29 | assume_function_wrapper: true, 30 | new_type_inf: true, 31 | rewrite_polyfills: false 32 | })) 33 | .pipe(sourcemaps.write('/')) 34 | .pipe(gulp.dest('./')); 35 | }); 36 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@webcomponents/webcomponents-platform", 3 | "version": "1.0.1", 4 | "description": "Basic platform polyfills needed by webcomponents.js", 5 | "main": "webcomponents-platform.js", 6 | "directories": { 7 | "test": "tests" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/webcomponents/webcomponents-platform.git" 12 | }, 13 | "author": "The Polymer Authors", 14 | "license": "BSD-3-Clause", 15 | "bugs": { 16 | "url": "https://github.com/webcomponents/webcomponents-platform/issues" 17 | }, 18 | "scripts": { 19 | "build": "gulp", 20 | "test": "wct", 21 | "prepack": "npm run build" 22 | }, 23 | "homepage": "http://webcomponents.org", 24 | "devDependencies": { 25 | "google-closure-compiler": "^20180910.0.0", 26 | "gulp": "^4.0.0", 27 | "gulp-sourcemaps": "^2.6.4", 28 | "wct-browser-legacy": "^1.0.0", 29 | "web-component-tester": "^6.8.0" 30 | }, 31 | "publishConfig": { 32 | "access": "public" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /tests/basic.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 12 |
13 | 14 |