Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
@aofl/polyfill-service
Advanced tools
Implements a customized version of @webcomponents/webcomponentsjs/webcomponents-loader.js
that uses dynamic imports to load polyfills. It also allows for lazy loading other polyfills based on a config file.
npm i -S @aofl/polyfill-service
// sample-config.js
export default {
'Object.assign': () => import('@aofl/polyfill-service/src/object-assign-polyfill'),
'fetch': () => import('isomorphic-fetch'),
'Reflect': () => import('harmony-reflect'),
'Array.prototype.find': () => import('array.prototype.find'),
'html-imports': {
test() {
return !('import' in document.createElement('link'));
},
load: () => import('@webcomponents/webcomponentsjs/webcomponents-bundle')
}
};
// init-polyfill-service.js
import {Polyfill} from '@aofl/polyfill-service';
import polyfills from './sample-config';
const ready = Polyfill.loadAll(polyfills); // promise
export default ready;
polyfill.loadAll()
returns a promise. In addition to this WebComponentsReady
is fired once all promises are loaded.
If using webpack you will have to use imports-loader
to fix the global variable in webcomponents polyfills.
// webpack.config.js
...
module: {
rules: [
{
test: /@webcomponents/,
loader: 'imports-loader?this=>window'
},
]
}
...
v3.5.0 - 2020-02-25
FAQs
Uses dynamic imports to load polyfills
The npm package @aofl/polyfill-service receives a total of 65 weekly downloads. As such, @aofl/polyfill-service popularity was classified as not popular.
We found that @aofl/polyfill-service demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.