Blogpost : https://blog.annamalai.me/posts/replicating-polyfill.io-using-cloudflare-workers/
Polyfill worker - https://polyfill.asvny.workers.dev
Polyfill worker + Node.js - https://polyfill-with-node.asvny.workers.dev
An experimental project on how to implement the same functionality of Polyfill.io using Cloudflare Worker and Cloudflare KV Storage.
Please don't use this in production .. it is not as fast as original polyfill.io
In this folder, the index.ts
file contains the worker code which generates the polyfill string by itself and index-node-server.ts
contains the worker code which fetches from upstream origin Node.js server when there is no cached response.
It contains a Node.js script which helps to populate the TOML
and script
to the store by calling the Cloudflare Bulk API endpoint.
It is a fork of polyfill-library , I have made some changes so that it can adapt and worker in Cloudflare worker environment. This needs to be optimised further because it quite slow as of now and sometimes it takes a couple of seconds to generate the polyfill sourcee.
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Annamalai - @asvny_
Project Link: https://github.com/asvny/polyfill-cloudflare-worker
Annamalai Saravanan