{"id":17965349,"url":"https://github.com/t2ym/wc-putty","last_synced_at":"2026-05-03T02:37:28.371Z","repository":{"id":143927636,"uuid":"173286778","full_name":"t2ym/wc-putty","owner":"t2ym","description":"Complementary polyfills for @webcomponents/webcomponentsjs","archived":false,"fork":false,"pushed_at":"2019-03-01T10:57:39.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-09T15:48:44.008Z","etag":null,"topics":["es-modules","polyfill","web-components"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/t2ym.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-01T10:56:44.000Z","updated_at":"2019-03-01T11:02:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"651e725a-67ed-4b54-98a2-e7b47c5227dc","html_url":"https://github.com/t2ym/wc-putty","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t2ym%2Fwc-putty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t2ym%2Fwc-putty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t2ym%2Fwc-putty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/t2ym%2Fwc-putty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/t2ym","download_url":"https://codeload.github.com/t2ym/wc-putty/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247070927,"owners_count":20878586,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["es-modules","polyfill","web-components"],"created_at":"2024-10-29T12:41:53.135Z","updated_at":"2026-05-03T02:37:23.346Z","avatar_url":"https://github.com/t2ym.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm version](https://badge.fury.io/js/wc-putty.svg)](https://badge.fury.io/js/wc-putty)\n\n# wc-putty\n\nComplementary polyfills for [@webcomponents/webcomponentsjs](https://github.com/webcomponents/webcomponentsjs)\n\n## List of Polyfills\n\n| Property/Method | Target Class | Target Browsers | Features |\n|:----------------|:-------------|:----------------|:------|\n| `attributeChangedCallback()` | Custom element base class | IE 11, Edge, Safari 9 | Attribute changes via properties |\n| `children`      | `DocumentFragment` | IE 11     | |\n| `children`      | `SVGElement` | IE 11           | |\n| `from()`        | `Array`      | IE 11           | `Iterable` protocol |\n| `constructor()` | `Set`        | IE 11           | `Iterable` initializer |\n| `Symbol.species`| `Set`        | IE 11           | |\n| `Symbol.iterator` | `Set`      | IE 11           | |\n| `values()`      | `Set`        | IE 11           | |\n| `add()`         | `Set`        | IE 11           | Key equality for `-0` and `0` |\n| `has()`         | `Set`        | IE 11           | Key equality for `-0` and `0` |\n| `constructor()` | `Map`        | IE 11           | `Iterable` initializer |\n| `Symbol.species`| `Map`        | IE 11           | |\n| `Symbol.iterator` | `Map`      | IE 11           | |\n| `keys()`        | `Map`        | IE 11           | |\n| `values()`      | `Map`        | IE 11           | |\n| `entries()`     | `Map`        | IE 11           | |\n| `set()`         | `Map`        | IE 11           | Key equality for `-0` and `0` |\n| `has()`         | `Map`        | IE 11           | Key equality for `-0` and `0` |\n\n## Install\n\n```\n    npm install wc-putty\n```\n\n## Import\n\n```js\n    import { polyfill } from 'wc-putty/polyfill.js';\n```\n\n## Usage\n\n```js\n    // Polyfilled only on IE11, Edge, and Safari 9\n    class MyElement extends polyfill(HTMLElement) {\n      static get observedAttributes() { return [ 'lang' ] }\n      attributeChangedCallback(name, oldValue, newValue) {\n        // Attribute changes via built-in properties such as lang are detected properly\n        // Attribute changes via setAttribute() are detected and the method is called only once per change\n      }\n    }\n    customElements.define('my-element', MyElement);\n    // Triggers attributeChangedCallback('lang', null, 'en-US')\n    document.createElement('my-element').lang = 'en-US';\n\n    // Polyfilled only on IE 11\n    // Set\n    let set = new Set([0, -0, 1]);\n    set.size === 2; // key equality for -0 and 0\n    set.has(-0) \u0026\u0026 set.has(0) \u0026\u0026 set.has(1);\n    [...set]; // spread iterable\n    for (let item of set) {} // iterate over a Set object\n    // Map\n    let map = new Map((function * () { yield * [0, -0, 1]; })());\n    map.size === 2; // key equality for -0 and 0\n    map.has(-0) \u0026\u0026 map.has(0) \u0026\u0026 map.has(1);\n```\n\n## Notes\n\n- The polyfills are complementary to [@webcomponents/webcomponentsjs](https://github.com/webcomponents/webcomponentsjs)\n  - `@webcomponents/webcomponentsjs/webcomponents-{bundle|loader}.js` have to be loaded beforehand\n- The polyfills are adaptive\n  - They do not touch the target classes if the features are supported natively or currently polyfilled and functional\n- Global objects are polyfilled except for `attributeChangedCallback()`\n- The main module `polyfill.js` is provided as an ES module and evaluated only once to polyfill the target global objects\n- Transpilation for the target browsers is required\n  - Basic polyfills such as babel runtime have to be loaded beforehand\n- Bundling is required if the target browser does not support ES modules natively\n- Attribute changes via `setAttributeNS()` can trigger 2 calls of `attributeChangedCallback()` if polyfilled by `polyfill()` mixin\n\n## License\n\n[BSD-2-Clause](https://github.com/t2ym/wc-putty/blob/master/LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft2ym%2Fwc-putty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ft2ym%2Fwc-putty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ft2ym%2Fwc-putty/lists"}