-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
23 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,40 @@ | ||
# lazyfill | ||
# lazyfill (beta) | ||
|
||
Polyfill Service - the lazy way | ||
|
||
Polyfills are only loaded when they are needed. | ||
Initial 2Kb to polyfill a lot of Stuff. | ||
|
||
Let's assume that your browser does not support the function "Element.prototype.toggleAttribute". | ||
```js | ||
> ['a','b','c'].at(-1); // accessing [].at immediatel loads the polyfill | ||
> 'c' | ||
``` | ||
|
||
|
||
# Ussage | ||
|
||
Add this script on the top of your page: | ||
|
||
```html | ||
<script src="https://cdn.jsdelivr.net/gh/nuxodin/lazyfill@xxxxx/mod.min.js"></script> | ||
``` | ||
done! | ||
|
||
# How it works | ||
|
||
To every polyfillable property, the scripts adds a getter which synchronously loads the corresponding polyfill. | ||
Of course, we all know that blocking xhr-requests is not nice. | ||
Therefore, the url to the script that should be added to the page is given in the console. | ||
|
||
# Help | ||
Any help is greatly appreciated. | ||
|
||
## Resources | ||
# Thanks / Resources | ||
|
||
https://github.com/behnammodi/polyfill | ||
|
||
https://polyfill.io/v3/ | ||
|
||
https://ungap.github.io/ | ||
|
||
https://github.com/Sylvain59650/all-polyfills | ||
https://github.com/Sylvain59650/all-polyfills |