DEV Community

Lam
Lam

Posted on

Polyfill.Io Cheat Sheet

[Optimized] Extra features

<script>if(!(window.fetch&&window.Promise&&[].includes&&Object.assign&&window.Map)){document.write('<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=default,fetch"></scr'+'ipt>')}</script>
Enter fullscreen mode Exit fullscreen mode

This is the same as the previous, but also adds a polyfill for window.fetch(). We add a window.fetch check and loads the additional fetch feature.

[Optimized] For modern browsers

<script>if(!(window.Promise&&[].includes&&Object.assign&&window.Map)){document.write('<script src="https://cdn.polyfill.io/v2/polyfill.min.js"></scr'+'ipt>')}</script>
Enter fullscreen mode Exit fullscreen mode

This only includes polyfill.io when necessary, skipping it for modern browsers for faster load times.

[Usage] References

[Usage] Default usage

<script src="https://cdn.polyfill.io/v2/polyfill.min.js"></script>
Enter fullscreen mode Exit fullscreen mode

This is the default script for Polyfill.io.

Reference

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more