Skip to content

Commit

Permalink
Add @webcomponents/template
Browse files Browse the repository at this point in the history
  • Loading branch information
TimvdLippe committed Apr 18, 2019
1 parent 394e559 commit d145e38
Show file tree
Hide file tree
Showing 18 changed files with 13,088 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
packages/custom-elements/ @azakus @bicknellr
packages/shadycss/ @azakus
packages/shadydom/ @azakus @sorvell
packages/shadycss/ @azakus
packages/template/ @azakus
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
packages/*/node_modules/
node_modules/
lerna-debug.log
lerna-debug.log
*.min.js*
1 change: 0 additions & 1 deletion packages/custom-elements/.gitignore

This file was deleted.

1 change: 0 additions & 1 deletion packages/shadydom/.gitattributes

This file was deleted.

1 change: 0 additions & 1 deletion packages/shadydom/.gitignore

This file was deleted.

16 changes: 16 additions & 0 deletions packages/template/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": "eslint:recommended",
"env": {
"browser": true
},
"plugins": [
"html"
],
"rules": {
"semi": "error",
"strict": "error"
},
"parserOptions": {
"ecmaVersion": 5
}
}
18 changes: 18 additions & 0 deletions packages/template/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
language: node_js
sudo: false
dist: trusty
node_js: '9'
addons:
firefox: latest
chrome: stable
before_script:
- npm run lint
script:
- xvfb-run wct --npm
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then wct --npm -s 'windows 10/microsoftedge@13' -s 'windows 10/microsoftedge@14' -s 'windows 10/microsoftedge@15' -s 'windows 10/microsoftedge@16'
-s 'windows 8.1/internet explorer@11' -s 'macos 10.13/safari@11' -s 'os x 10.12/safari@10' -s 'os x 10.11/safari@9' -s 'Linux/chrome@41';
fi
env:
global:
- secure: oucYIKHVGwlwga761L4VtSlIDA1rFOnglofd8A3DwbDG7yAJG8/5knkzB/1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m2JCS4kx3V+TCczeKtKtX2MnPulGUFfqzvQKs7MQQ8hSZ7z/5YCO/UYntuQXxyQpqtyKpRWGAxBSqfT3IFXyt2cKsGbCG+07hxDtaWNmIfUkhYGBqfgQGuEXqYb8VeA7icHyCJhpfMuiJpmsOtNLsi1QSGrl/+9ShUXXLaP/vTgoxiWc3VyQ5k65/zIYJPjT8tpX8zWGeLX4KQNf0GYILNqgsWA8bjh4ws=
19 changes: 19 additions & 0 deletions packages/template/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# License

Everything in this repo is BSD style license unless otherwise specified.

Copyright (c) 2016 The Polymer Authors. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

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.
17 changes: 17 additions & 0 deletions packages/template/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# template
A minimal polyfill for `<template>`.

## Known limitations

### Template nodes in main document are upgraded after `DOMContentLoaded`

The first timepoint in which the polyfill can be certain the main document is loaded is `DOMContentLoaded`.
As such, we use this timepoint to bootstrap any `<template>` as defined in the main document.
This means that any scripts in the main document that run before this event (e.g. inline scripts) will not have the properly upgraded templates.
Instead, listen for `DOMContentLoaded` yourself and only after that interact with any `<template>` in the main document.

## License

Everything in this repository is BSD style license unless otherwise specified.

Copyright (c) 2016 The Polymer Authors. All rights reserved.
37 changes: 37 additions & 0 deletions packages/template/gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/**
* @license
* Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/

'use strict';

const compilerPackage = require('google-closure-compiler');
const gulp = require('gulp');
const sourcemaps = require('gulp-sourcemaps');

const closureCompiler = compilerPackage.gulp();

gulp.task('default', () => {
return gulp.src('./template.js', {base: './'})
.pipe(sourcemaps.init())
.pipe(closureCompiler({
compilation_level: 'ADVANCED',
warning_level: 'VERBOSE',
language_in: 'ECMASCRIPT6_STRICT',
language_out: 'ECMASCRIPT5_STRICT',
dependency_mode: 'STRICT',
entry_point: ['/template'],
js_output_file: 'template.min.js',
output_wrapper: '(function(){\n%output%\n}).call(self);',
assume_function_wrapper: true,
new_type_inf: true,
rewrite_polyfills: false
}))
.pipe(sourcemaps.write('/'))
.pipe(gulp.dest('./'));
});
Loading

0 comments on commit d145e38

Please sign in to comment.