EasyWebApp / Web-polyfill

An automatic CDN service for Web polyfills, which is based on TypeScript, Node.js & JSDelivr.

Home Page:https://polyfill.web-cell.dev/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Web polyfill

An automatic CDN service for Web polyfills, which is based on TypeScript, Node.js & JSDelivr.

CI & CD

Usage example

  1. Find a Web feature in the Polyfill directory
  2. Copy the class name of the selected polyfill, then write it into a specific Script URL (shown below)
  3. the above script will detect whether current environment needs to be patched, then load the polyfill script original from JSDelivr

Web pages

<head>
    <script src="https://polyfill.web-cell.dev/feature/ResizeObserver.js"></script>
</head>

Web workers

self.importScripts('https://polyfill.web-cell.dev/feature/Regenerator.js');

Add more polyfills

  1. For junior engineers, you can submit an issue and wait for the maintainer reaction
  2. For senior engineers, just edit the Polyfill files, and make a pull request
  3. After your pull request reviewd & merged, the polyfills will be updated by GitHub actions automatically

Host your own mirror

  1. Fork this repository
  2. Replace original HTTP domain with yours in GitHub action configuration
  3. You can replace GitHub pages with an Object Storage service (AWS S3, etc.)

China mainland

Thanks for KaiYuanShe's donation, we get a fast local mirror for China mainland:

https://polyfill.kaiyuanshe.cn/

Custom examples

Edit .env content to fit your situation:

WAN_ICON=πŸ‡ΊπŸ‡¦
WAN_HOST=https://polyfill.example.ua
LAN_ICON=πŸ‡·πŸ‡Ί
LAN_HOST=https://polyfill.example.ru

or

WAN_ICON=πŸ‡°πŸ‡·
WAN_HOST=https://polyfill.example.kr
LAN_ICON=πŸ‡°πŸ‡΅
LAN_HOST=https://polyfill.example.kp

Inspired by

  1. https://polyfill.io/
  2. https://polyfiller.kaiyuanshe.cn/

About

An automatic CDN service for Web polyfills, which is based on TypeScript, Node.js & JSDelivr.

https://polyfill.web-cell.dev/


Languages

Language:TypeScript 100.0%