GithubHelp home page GithubHelp logo

wessberg / polyfiller Goto Github PK

View Code? Open in Web Editor NEW
124.0 5.0 5.0 14.84 MB

Never worry about polyfills again.

Home Page: https://polyfill.app

License: MIT License

JavaScript 68.00% TypeScript 31.82% Shell 0.01% HTML 0.17%
polyfills shim javascript web webservice typescript polyfill-app polyfills-as-a-service

polyfiller's Introduction

Logo

Never worry about polyfills again.

Downloads per month NPM version Dependencies Contributors code style: prettier License: MIT Support on Patreon

Description

This is a web service that returns a minified and encoded bundle of only the polyfills your users need. It's like polyfill.io, but it has additional polyfills such as Web Components, Pointer Events, and much more. It is also potentially faster since all unique polyfill combinations are cached in memory and returned immediately as requested. And, it supports different kinds of encodings for the smallest possible network bandwidth overhead, including Brotli and Gzip. The web service is hosted and live at https://polyfill.app/api. It is free to use, and there are no quota limits. See the Hosting section for details on how to host it yourself, if you want to.

Features

  • Sends only the polyfills your users actually need
  • Wide range of polyfills for modern technologies such as Web Components, Pointer Events, Intl (including RelativeTimeFormat and ListFormat), and much more.
  • Automatic deduplication and insertion of missing dependencies of requested polyfills
  • Supports multiple environments, including Browsers, Workers, and even Node.
  • Brotli and Gzip compression
  • Intelligent disk- and memory caching for maximum speed and availability
  • Completely free

Supporters

Polyfiller is kindly supported by and relies heavily on BrowserStack for cross-browser testing to ensure maximum cross-browser compatibility.

BrowserStack

Polyfiller is kindly supported by JetBrains for software development tools:

Supported by JetBrains

Backers

Become a sponsor/backer and get your logo listed here.

Bubbles Xerox Trent Raymond scrubtheweb Joel
Bubbles
Twitter: @usebubbles
Xerox Trent Raymond scrubtheweb Joel

Patreon

Patrons on Patreon

Table of Contents

Install

npm

$ npm install @wessberg/polyfiller

Yarn

$ yarn add @wessberg/polyfiller

pnpm

$ pnpm add @wessberg/polyfiller

Polyfiller is already hosted at https://polyfill.app/api as a free web service, but you can install it, for example if you want to host it yourself. See the Hosting section for more details on that.

Usage

Polyfiller can be used both in a Browser, Worker, and Node environment. By default, the assumed environment is Browser.

Usage in a Browser

Place a <script> tag inside your index.html file with a src pointing at https://polyfill.app/api/polyfill. In the following example, polyfills for ES2015 and Shadow DOM are requested:

<!-- An example of requesting polyfills for an ES2015 environment as well as Web Component support
-->
<script crossorigin src="https://polyfill.app/api/polyfill?features=es,web-components"></script>

A targeted bundle will be returned that only contains the specific polyfills the browser needs! When a browser (or robot) visits your site, Polyfiller evaluates the user agent against Caniuse and decides what is supported and what isn't. It is up to you to decide which polyfills you need, but the web service will automatically make sure to include every dependency of those polyfills, but only if the browser doesn't already support them. See this or this section for details on how to use Polyfiller from Web Workers/ServiceWorkers and Node.

You can provide options to Polyfiller via query parameters such as minify and sourcemap to adjust the received payload to your liking.

Examples

Example 1:

In this example:

  • es polyfills those EcmaScript features that the browser doesn't support.
  • intersection-observer is polyfilled, even if the browser supports it, because it has the force option.
  • intl is polyfilled, with the inclusion of Intl.ListFormat and Intl.RelativeTimeFormat, if the browser doesn't support it, and the en locale data is included.
  • Sourcemaps are generated, and the bundle is minified
<script crossorigin src="https://polyfill.app/api/polyfill?minify&sourcemap&features=es,intersection-observer|force,intl|locale=en"></script>

Example 2:

This example shows how you can add support for Web Components:

  • template polyfills the HTMLTemplateElement if the browser doesn't support it.
  • shadow-dom polyfills the Shadow DOM v1 specification if the browser doesn't support it.
  • custom-elements polyfills the Custom Elements v1 specification if the browser doesn't support it.
<script crossorigin src="https://polyfill.app/api/polyfill?features=template,shadow-dom,custom-elements"></script>

For your convenience, the web-components alias requests those three features.

<script crossorigin src="https://polyfill.app/api/polyfill?features=web-components"></script>

Example 3:

For your convenience, a few libraries are included that isn't strictly polyfills but are closely related to compatibility: In this example:

  • systemjs Adds the SystemJS ES module loader. Useful if you target a browser that doesn't support ES-modules and want to use something like dynamic imports and code-splitting.
  • regenerator-runtime is added, which is what babel transpiles async functions and generator functions into if you don't target browsers that supports it.
<script crossorigin src="https://polyfill.app/api/polyfill?features=systemjs,regenerator-runtime"></script>

Web Service API Reference

GET /api/polyfill?features=[...features]

Retrieves a bundle of polyfills. Polyfiller will use the incoming Accept-Encoding headers of the request to decide if the response should be Brotli encoded, Gzip encoded or not encoded at all.

Parameter overview

Parameter Description
features A comma-separated string of all the features you want to include in your bundle (if required by the browser). Each feature may receive zero or more options. Some options are supported for all features while others only support specific features.
context Can be either window, worker, or node. Use this to instruct Polyfiller to optimize polyfills for the given environment, as well as to exclude polyfills that doesn't support the given context.
sourcemap If given, or if it has a value of true, Polyfiller will be instructed to generate SourceMaps. Use this in development for better stack traces.
minify If given, Polyfiller will send back a minified Polyfill bundle.

feature

A feature has a name and may receive zero or more options. For example, intl is a feature name, and so is custom-elements. See the Feature name section for the full list of possible feature names.

Option

An option is some data associated with a feature. It is associated with a feature using the | (pipe) operator. For example, here's how to associate the force option with a feature: animation|force.

Some options apply to all features while others only apply to specific features. For example: intl|locale=en

The force option

By default, features that are already supported by the browser sending the request to the web service won't be polyfilled. That would be a waste of network bandwidth and parsing cost for your users. However, sometimes you may want to force a polyfill, even for browsers that support a feature. In order to do so, associate the force option with a feature. For example: animation|force This will force-apply a polyfill for Web Animations.

The locale option for Intl

This option only works with intl, intl.core, intl.list-format, or intl.relative-time-format. The Intl family of polyfills rely on locale data for them to work. There are over 600 different locale files shipped. Sending all of them back over the network would take way too much bandwidth. Instead, if you just ask for the intl, intl.core, intl.list-format, or intl.relative-time-format features, they will be returned without any locale data.

To add one or more locales, use the locale option. For example: intl|locale=en

This will return a bundle of Intl-related polyfills along with locale data for the en (English) language code. You can ask for as many you want by separating the locales with the ~ operator. For example: intl|locale=en~da~fr This will return a bundle of Intl-related polyfills along with locale data for en (English), da (Danish), and fr (French).

The variant option for SystemJS

SystemJS comes in two base versions, a minimal version called s, and a more feature-complete version called system. By default, the system variant will be used. You can decide which one to use with the variant option.

For example: systemjs|variant=s selects the s variant, while systemjs|variant=system selects the system variant.

Extra options for Zone

Zone.js, which is supported by Polyfiller, can be configured with some extra options to enhance its operation or support interoperability with more APIs:

Option Description
error Generates more readable Stack traces when using Zone
shadydom Makes Zone compatible with the ShadyDOM polyfill.
mediaquery Patches the Media Query API
fetch Patches the Fetch API.
resizeobserver Patches the ResizeObserver API.

Extra options for shadow-dom

Option Description
experimental You can pass the experimental option to shadow-dom (or any of its aliases such as web-components) to base it on some experimental features that may reduce bugs in older browsers such as IE and Edge <= 15.
lit If you're going to be using Lit, you can also pass the lit option to shadow-dom (or any of its aliases such as web-components) to include its polyfill support layer.

Usage in a Web Worker/Service Worker

You can also request polyfills from a Worker. It is highly recommended that you pass in the context query parameter with a value of worker to instruct Polyfiller to optimize polyfills for a Worker environment, as well as to not include any polyfills that won't work in a Worker environment.

// Provide a context query parameter with a value of 'worker' to avoid polyfills that doesn't support that environment
importScripts("https://polyfill.app/api/polyfill?features=es,intl,web-animations&context=worker");

Usage in Node

You can also request polyfills from Node, if that's a thing you want to do. It is highly recommended that you pass in the context query parameter with a value of node to instruct Polyfiller to optimize polyfills for a Node environment, as well as to not include any polyfills that won't work in a Node environment.

(async () => {
	// Remember to provide a user agent header if you want anything meaningful back
	const response = await fetch("https://polyfill.app/api/polyfill?features=intl&context=node");
	const text = await response.text();
	// Apply the polyfills
	new Function(text)();
})();

Contributing

Do you want to contribute? Awesome! Please follow these recommendations.

Maintainers

Frederik Wessberg
Frederik Wessberg
Twitter: @FredWessberg
Github: @wessberg
Lead Developer

FAQ

What's the difference from polyfill.io

These two services are very much alike. In fact, Polyfiller depends on the library behind polyfill.io for some of the polyfills! Polyfiller exists for two reasons:

  • A wider range of available polyfills such as Web Components, PointerEvents and Proxies
  • Deep integration with Caniuse. If you use something like babel-preset-env with a browserslist and you generate this automatically based on the features you want to support with a tool such as browserslist-generator, both syntax detection for transpiling, and feature detection for polyfilling will be seamlessly based on your browserslist.

Hosting

Polyfiller is already hosted at https://polyfill.app/api as a free web service, but feel free to host it yourself. The server is built with support for both HTTP2 and HTTP. The environment variable HTTP2=[true|false] decides whether a HTTP2 server will be hosted or not. If you use a load balancer and something like nginx in a reverse proxy setup, please know that nginx doesn't support HTTP2 via its proxy module, so you have to use HTTP1.1 there. Thankfully, it is as easy as setting HTTP2=false before launching the server and setting HTTPS=false.

Logo

All credits go to Andreas Mehlsen (@andreasbm) for the awesome logo design.

License

MIT © Frederik Wessberg (@FredWessberg) (Website)

Feature names

Here's a full list of all possible feature names. Note that these will be deduplicated. For example, if you request es.object, but also request es, es.object will only be included once as part of es. And, if you request performance.now, date.now will also be included since the polyfill depends on it. You don't have to worry about dependencies.

Bold-formatted polyfills are aliases for one or several other related features.

  • formdata
    • form-data
  • requestidlecallback
    • request-idle-callback
  • requestanimationframe
    • request-animation-frame
  • es
    • es.promise
    • es.object
    • es.function
    • es.array
    • es.array-buffer
    • es.string
    • es.data-view
    • es.regexp
    • es.number
    • es.math
    • es.date
    • es.symbol
    • es.collections
    • es.typed-array
    • es.reflect
    • es.global-this
  • es2015
    • es
  • es.promise
    • es.promise.constructor
    • es.promise.any
    • es.promise.all-settled
    • es.promise.finally
  • es.object
    • es.object.assign
    • es.object.create
    • es.object.define-getter
    • es.object.define-setter
    • es.object.entries
    • es.object.from-entries
    • es.object.get-own-property-descriptors
    • es.object.lookup-getter
    • es.object.lookup-setter
    • es.object.values
    • es.object.define-properties
    • es.object.define-property
    • es.object.freeze
    • es.object.get-own-property-descriptor
    • es.object.get-own-property-names
    • es.object.get-prototype-of
    • es.object.is-extensible
    • es.object.is-frozen
    • es.object.is-sealed
    • es.object.is
    • es.object.keys
    • es.object.prevent-extensions
    • es.object.seal
    • es.object.set-prototype-of
    • es.object.to-string
  • es.function
    • es.function.bind
    • es.function.name
  • es.array
    • es.array.concat
    • es.array.copy-within
    • es.array.every
    • es.array.flat
    • es.array.flat-map
    • es.array.fill
    • es.array.filter
    • es.array.find
    • es.array.find-index
    • es.array.for-each
    • es.array.from
    • es.array.includes
    • es.array.index-of
    • es.array.is-array
    • es.array.iterator
    • es.array.join
    • es.array.last-index-of
    • es.array.map
    • es.array.of
    • es.array.reduce
    • es.array.reduce-right
    • es.array.slice
    • es.array.some
    • es.array.sort
    • es.array.species
    • es.array.splice
    • es.array.at
    • es.array.find-last
    • es.array.find-last-index
  • es.array-buffer
    • es.array-buffer.constructor
    • es.array-buffer.is-view
    • es.array-buffer.slice
  • es.string
    • es.string.anchor
    • es.string.big
    • es.string.blink
    • es.string.bold
    • es.string.code-point-at
    • es.string.ends-with
    • es.string.fixed
    • es.string.fontcolor
    • es.string.fontsize
    • es.string.from-code-point
    • es.string.includes
    • es.string.italics
    • es.string.iterator
    • es.string.link
    • es.string.match
    • es.string.pad-end
    • es.string.pad-start
    • es.string.raw
    • es.string.repeat
    • es.string.search
    • es.string.small
    • es.string.split
    • es.string.starts-with
    • es.string.strike
    • es.string.sub
    • es.string.sup
    • es.string.trim
    • es.string.trim-start
    • es.string.trim-end
    • es.string.replace-all
    • es.string.match-all
    • es.string.at
  • es.regexp
    • es.regexp.constructor
    • es.regexp.flags
    • es.regexp.to-string
  • es.number
    • es.number.constructor
    • es.number.epsilon
    • es.number.is-finite
    • es.number.is-integer
    • es.number.is-nan
    • es.number.is-safe-integer
    • es.number.max-safe-integer
    • es.number.min-safe-integer
    • es.number.parse-float
    • es.number.parse-int
    • es.number.to-fixed
    • es.number.to-precision
  • es.math
    • es.math.acosh
    • es.math.asinh
    • es.math.atanh
    • es.math.cbrt
    • es.math.clz32
    • es.math.cosh
    • es.math.expm1
    • es.math.fround
    • es.math.hypot
    • es.math.imul
    • es.math.log1p
    • es.math.log2
    • es.math.log10
    • es.math.sign
    • es.math.sinh
    • es.math.tanh
    • es.math.trunc
  • es.date
    • es.date.now
    • es.date.to-iso-string
    • es.date.to-json
    • es.date.to-primitive
    • es.date.to-string
  • es.symbol
    • es.symbol.async-iterator
    • es.symbol.has-instance
    • es.symbol.is-concat-spreadable
    • es.symbol.iterator
    • es.symbol.constructor
    • es.symbol.match
    • es.symbol.match-all
    • es.symbol.replace
    • es.symbol.search
    • es.symbol.species
    • es.symbol.split
    • es.symbol.to-primitive
    • es.symbol.to-string-tag
    • es.symbol.unscopables
    • es.symbol.description
  • es.collections
    • es.map
    • es.weak-map
    • es.set
    • es.weak-set
  • es.typed-array
    • es.typed-array.copy-within
    • es.typed-array.every
    • es.typed-array.fill
    • es.typed-array.filter
    • es.typed-array.find
    • es.typed-array.find-index
    • es.typed-array.float32-array
    • es.typed-array.float64-array
    • es.typed-array.for-each
    • es.typed-array.from
    • es.typed-array.includes
    • es.typed-array.index-of
    • es.typed-array.int8-array
    • es.typed-array.int16-array
    • es.typed-array.int32-array
    • es.typed-array.iterator
    • es.typed-array.join
    • es.typed-array.last-index-of
    • es.typed-array.map
    • es.typed-array.of
    • es.typed-array.reduce
    • es.typed-array.reduce-right
    • es.typed-array.reverse
    • es.typed-array.set
    • es.typed-array.slice
    • es.typed-array.some
    • es.typed-array.sort
    • es.typed-array.subarray
    • es.typed-array.to-locale-string
    • es.typed-array.to-string
    • es.typed-array.uint8-array
    • es.typed-array.uint8-clamped-array
    • es.typed-array.uint16-array
    • es.typed-array.uint32-array
    • es.typed-array.at
    • es.typed-array.find-last
    • es.typed-array.find-last-index
  • es.reflect
    • es.reflect.apply
    • es.reflect.construct
    • es.reflect.define-property
    • es.reflect.delete-property
    • es.reflect.get
    • es.reflect.get-own-property-descriptor
    • es.reflect.get-prototype-of
    • es.reflect.has
    • es.reflect.is-extensible
    • es.reflect.own-keys
    • es.reflect.prevent-extensions
    • es.reflect.set
    • es.reflect.set-prototype-of
  • dom.collections.iterable
    • dom.collections.iterator
    • dom.collections.for-each
  • intl
    • intl.date-time-format
    • intl.display-names
    • intl.get-canonical-locales
    • intl.list-format
    • intl.locale
    • intl.number-format
    • intl.plural-rules
    • intl.relative-time-format
  • animation
    • web-animations
  • web-components
    • custom-elements
    • shadow-dom
    • template
  • event
    • event.constructor
    • event.focusin
    • event.hashchange
  • setimmediate
    • set-immediate
  • globalthis
    • es.global-this
  • global-this
    • es.global-this
  • adopted-style-sheets
    • constructable-style-sheets
  • structuredclone
    • structured-clone
  • base64
    • atob
    • btoa
  • systemjs
  • zone
  • performance.now
  • url
  • object-fit
  • console
  • blob
  • proxy
  • es.string.replace
  • pointer-event
  • xhr
  • fetch
  • regenerator-runtime
  • queryselector
  • document-fragment
  • node.parentelement
  • scroll-behavior
  • focus-visible
  • node.contains
  • window
  • document
  • class-list
  • dom-token-list
  • element
  • custom-event
  • event-source
  • get-computed-style
  • intersection-observer
  • mutation-observer
  • resize-observer
  • broadcast-channel
  • proto

polyfiller's People

Contributors

tommedema avatar wessberg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

polyfiller's Issues

Firefox 68 for Android does not polyfill pointer event

The "never worry about polyfills again" tagline is not true in this case, because a polyfill is clearly not being loaded.

I'm referring to the pointer-event feature.

It is not supported on Firefox for Android 68.

Yet when use Polyfiller like so:

<script crossorigin src="https://polyfill.app/api/polyfill?features=url,fetch,pointer-event,scroll-behavior"></script>

The polyfill is not loaded. When I change it to:

<script crossorigin src="https://polyfill.app/api/polyfill?features=url,fetch,pointer-event|force,scroll-behavior"></script>

It suddenly starts polyfilling and pointer events are detected.

Browser: https://whatsmybrowser.org/b/BY983

Error in Web Service API Reference

An Error occurred.
Code: 500
ENOSPC: no space left on device, open '/tmp/@wessberg/polyfiller/production/85d70e21d508715396c51d67992a98f7ced0eac7'

Default locale not set in Safari/Firefox for Intl polyfill

I was experimenting with the Intl polyfill API, and noticed a problem when running a RelativeTimeFormat command from MDN.

Loading "https://polyfill.app/api/polyfill?features=intl.relative-time-format|force,locales=en" into my page and then running var rtf1 = new Intl.RelativeTimeFormat('en', { style: 'narrow' });, I receive the error "ReferenceError: Could not determine locale: No default locale has been configured". This happens in both Safari and Firefox, but not Chrome.

Am I missing a step somewhere, or is the default locale not being added?

Invalid certificate error shown on Safari iOS 9 and under devices

image

Failed to load resource: The certificate for this server is invalid. You might be connecting to a server that is pretending to be “polyfill.app” which could put your confidential information at risk.
Error is shown and request is blocked.

Seems to work in major and current browsers. Not sure how long this has been an issue.

Getting 500 status error

https://polyfill.app/api/polyfill?features=scroll-behavior

An Error occurred.
Code: 500

Value undefined out of range for undefined options property undefined

Intl.ListFormat not being returned for Chrome 71 in Xiaomi phone

The error can be reproduced as the following:

const request = require("request");

function withUserAgent(userAgent) {
    return {
        url: "https://polyfill.app/api/polyfill?features=intl.list-format",
        headers: {
            "User-Agent": userAgent
        }
    };
}

// this is a real user agent from mi browser in a Xiaomi phone
const chrome71xiaomi = "Mozilla/5.0 (Linux; U; Android 10; en-us; SM-G975F Build/QP1A.190711.020) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/71.0.3578.141 Mobile Safari/537.36 XiaoMi/MiuiBrowser/12.1.3-g";

// this is a real user agent from a Pixel 2 XL
const chrome71      = "Mozilla/5.0 (Linux; Android 8.0.0; Pixel 2 XL Build/OPD1.170816.004) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.141 Mobile Safari/537.36";

// This one is just like the above one, but with "XiaoMi/MiuiBrowser/12.1.3-g" added at the end
const chrome71fake  = "Mozilla/5.0 (Linux; Android 8.0.0; Pixel 2 XL Build/OPD1.170816.004) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.141 Mobile Safari/537.36 XiaoMi/MiuiBrowser/12.1.3-g";

request(
    withUserAgent(chrome71xiaomi),
    (error, response, body) => console.log("chrome71xiaomi: ", body.length)
);

request(
    withUserAgent(chrome71),
    (error, response, body) => console.log("chrome71: ", body.length)
);

request(
    withUserAgent(chrome71fake),
    (error, response, body) => console.log("chrome71fake: ", body.length)
);

The resulting log is:

chrome71xiaomi:  0
chrome71fake:  0
chrome71:  15477

Which is obviously an error.

Add "context:[worker|window|node]"

If the context flag is given, we can filter out polyfills that isn't supported in that realm (unless the force modifier is given also)

scroll-behavior not working on IOS' Safari

I'm using polyfiller to allow the use of scroll-behaviour and it work great on MacOS safari but on IOS it not doing anything not even scrolling

<script crossorigin src="https://polyfill.app/api/polyfill?minify&sourcemap&features=scroll-behavior"></script>

....

target.scrollIntoView({
  behavior: 'smooth'
})

/api/polyfill doesn't work with Chrome Canary

When I open https://app.usebubbles.com the request to polyfill.app/api/polyfill does not return response, which makes the whole app stuck and waiting it. Can be reproduced in Chrome Canary 92.0.4473.0 canary (x86_64). Is not reproduced in stable version 89.0.4389.114 (x86_64)

curl 'https://polyfill.app/api/polyfill?features=fetch,pointer-event,scroll-behavior,es' \
  -H 'Connection: keep-alive' \
  -H 'Pragma: no-cache' \
  -H 'Cache-Control: no-cache' \
  -H 'sec-ch-ua: "Chromium";v="92", " Not A;Brand";v="99", "Google Chrome";v="92"' \
  -H 'Origin: https://app.usebubbles.com' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4473.0 Safari/537.36' \
  -H 'Accept: */*' \
  -H 'Sec-Fetch-Site: cross-site' \
  -H 'Sec-Fetch-Mode: cors' \
  -H 'Sec-Fetch-Dest: script' \
  -H 'Referer: https://app.usebubbles.com/' \
  -H 'Accept-Language: en-US,en;q=0.9,ru;q=0.8,uk;q=0.7' \
  --compressed

After timeout I see the following error in console:

Access to script at 'https://polyfill.app/api/polyfill?features=fetch,pointer-event,scroll-behavior,es' from origin 'https://app.usebubbles.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
app.usebubbles.com/:1 
GET https://polyfill.app/api/polyfill?features=fetch,pointer-event,scroll-behavior,es net::ERR_FAILED

ResizeObserver is not polyfilled even though `|force` is used

This is my current script tag:

<script crossorigin src="https://polyfill.app/api/polyfill?features=es,fetch,pointer-event,scroll-behavior,resize-observer|force"></script>

An hour ago I got this error on Sentry:

Screen Shot 2020-03-05 at 9 27 53 AM

For some reason ResizeObserver is not being polyfilled.

This is the user agent:

Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.5 Mobile/15E148 Safari/604.1

Screen Shot 2020-03-05 at 9 28 24 AM

Do you want the domain pollyfiller.io ?

@wessberg - I have the domain polyfiller.io going if you want if its on Hover.com currently and is $49.74 annually. I don't want any money for it just want to see it go to an appropriate home rather than being picked off and sat on by someone trying tomake money from it.

ES.string not polyfilled on QQ browser

Browser:

Screen Shot 2020-04-06 at 12 21 43 PM

User agent:


Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36 QBCore/4.0.1301.400 QQBrowser/9.0.2524.400 Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2875.116 Safari/537.36 NetType/WIFI MicroMessenger/7.0.5 WindowsWechat

Error:

Screen Shot 2020-04-06 at 12 21 52 PM

Code:

<script crossorigin src="https://polyfill.app/api/polyfill?features=url,fetch,pointer-event,scroll-behavior,es"></script>

It should polyfill es --> es.string --> padStart but it doesn't.

Chrome 86 error

Hey there,

Thanks for making Polyfiller!

I'm using the following URL to polyfill es, intl (Dutch) and fetch: https://polyfill.app/api/polyfill?features=es,intl|locale=nl,fetch
However, this returns an error when using Chrome 86:

An Error occurred.
Code: 500
BrowserslistError

BrowserslistError: Unknown version 86 of chrome at Function.select (/app/node_modules/browserslist/index.js:1086:17) at /app/node_modules/browserslist/index.js:336:33 at Array.reduce () at resolve (/app/node_modules/browserslist/index.js:318:18) at browserslist (/app/node_modules/browserslist/index.js:443:21) at normalizeBrowserslist (/app/node_modules/@wessberg/browserslist-generator/dist/cjs/index.js:741:12) at generateBrowserslistFromUseragent (/app/node_modules/@wessberg/browserslist-generator/dist/cjs/index.js:1461:36) at Object.userAgentSupportsFeatures (/app/node_modules/@wessberg/browserslist-generator/dist/cjs/index.js:1501:35) at shouldIncludePolyfill (/app/dist/index.js:3456:102) at polyfillSet.forEach.polyfill (/app/dist/index.js:3491:13)

BrowserslistError: Unknown version 86 of chrome

Any idea what might be going on?

Uint32Array Safari 9 El Capitain webpack console error

Using:

  • <script crossorigin="anonymous" src="https://polyfill.app/api/polyfill?features=es"></script>
  • Browserstack: OSX El Capitan, Safari 9.1

I get the following error:
image

Involved 🤷‍♂:

  • es.typed-array.uint32-array
  • es.typed-array.from

TypeError: Invalid character in header field name

I cannot reproduce this but I got this error from one of my users in Sentry

Does this make sense to you?

Screen Shot 2020-04-02 at 12 24 49 PM

TypeError: Invalid character in header field name
--
arguments | [{"message":"Invalid character in header field name","name":"TypeError","stack":"TypeError: Invalid character in header field name\n    at normalizeName (https://polyfill.app/api/polyfill?features=url,fetch,pointer-event,scroll-behavior:1:75432)\n    at Headers.append (https://polyfill.app/api/polyfill?features=url,fetch,pointer-event,scroll-behavior:1:76247)\n    at Headers.<anonymous> (https://polyfill.app/api/polyfill?features=url,fetch,pointer-event,scroll-behavior:1:76159)\n    at Array.forEach (<anonymous>)\n    at new Headers (https://polyfill.app/api/polyfill?features=url,fetch,pointer-event,scroll-behavior:1:76131)\n    at new Request (https://polyfill.app/api/polyfill?features=url,fetch,pointer-event,scroll-behavior:1:81348)\n    at https://polyfill.app/api/polyfill?features=url,fetch,pointer-event,scroll-behavior:1:83734\n    at new Promise (<anonymous>)\n    at fetch (https://polyfill.app/api/polyfill?features=url,fetch,pointer-event,scroll-behavior:1:83685)\n    at https://app.usebubbles.com/static/js/2.fafbee11.chunk.js:1:914256\n    at https://app.usebubbles.com/static/js/main.79af2afc.chunk.js:1:175882\n    at u (https://app.usebubbles.com/static/js/2.fafbee11.chunk.js:1:471028)\n    at Generator._invoke (https://app.usebubbles.com/static/js/2.fafbee11.chunk.js:1:470781)\n    at Generator.forEach.e.<computed> [as next] (https://app.usebubbles.com/static/js/2.fafbee11.chunk.js:1:471385)\n    at r (https://app.usebubbles.com/static/js/2.fafbee11.chunk.js:1:34154)\n    at s (https://app.usebubbles.com/static/js/2.fafbee11.chunk.js:1:34357)\n    at https://app.usebubbles.com/static/js/2.fafbee11.chunk.js:1:34416\n    at new Promise (<anonymous>)\n    at https://app.usebubbles.com/static/js/2.fafbee11.chunk.js:1:34297\n    at https://app.usebubbles.com/static/js/main.79af2afc.chunk.js:1:176085\n    at https://app.usebubbles.com/static/js/main.79af2afc.chunk.js:1:172971\n    at u (https://app.usebubbles.com/static/js/2.fafbee11.chunk.js:1:471028)\n    at Generator._invoke (https://app.usebubbles.com/static/js/2.fafbee11.chunk.js:1:470781)\n    at Gene..."}]

Resize observer is not polyfilled in FBAN (Facebook) browser

User agent:

Mozilla/5.0 (iPhone; CPU iPhone OS 13_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 LightSpeed [FBAN/MessengerLiteForiOS;FBAV/253.1.0.43.116;FBBV/200174216;FBDV/iPhone11,6;FBMD/iPhone;FBSN/iOS;FBSV/13.3.1;FBSS/3;FBCR/;FBID/phone;FBLC/en_US;FBOP/0]

This is a version of the Safari browser on iOS. For some reason the resize observer is not polyfilled even with this script tag:

<script crossorigin src="https://polyfill.app/api/polyfill?features=es,fetch,pointer-event,scroll-behavior,resize-observer"></script>

Screen Shot 2020-02-27 at 4 17 34 PM

Screen Shot 2020-02-27 at 4 18 47 PM

Intl polyfill overrides Intl.Collator

I'm using Intl.Collator to compare some strings and also the Intl.ListFormat polyfill on the same app. My app fails while trying to create a instance of the Intl.Collator class.

Importing with the url: https://polyfill.app/api/polyfill?features=intl.list-format

Pen to reproduce: https://jsbin.com/peyulegiba/edit?html,js,output
(Opening in a browser that loads and applies the polyfill, yields undefined instead of function Collator())

When debugging on mobile Safari 12, i found the overriding line:

window.Intl = Intl$1;

Probably just coping over the Intl.Collator to the polyfilled Intl will solve the issue.

window.Intl = Object.assign(window.Intl, Intl$1);

Thanks for the awesome service, looking forward to use the custom-elements polyfill next. =D

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.