@loaders.gl/polyfills provides optional support for Node.js and older browsers.
Older browsers (mainly Edge and IE11) as well as versions of Node.js prior to v11 do not provide certain classes that loaders.gl depends on.
While there are many good polyfill modules available on
npm, to make the search for a version that works perfectly with loaders.gl a little easier, a polyfill module is included.
npm install @loaders.gl/polyfills
@loaders.gl/polyfills before you start using other loaders.gl modules.
import '@loaders.gl/polyfills'; import '@loaders.gl/core';
|Node.js < 11||Yes (Older browsers)||Only UTF8 is guaranteed to be supported|
|All versions||No||Note: these functions are not unicode safe, but OK to use for test cases.|
|All versions||No||A subset of the fetch API is supported, see below.|
fetch polyfill supports a subset of the browser fetch API, including:
TextDecoder polyfills are provided to ensure these APIs are always available. In modern browsers these will evaluate to the built-in objects of the same name, however under Node.js polyfills are transparently installed.
Note: The provided polyfills only guarantee UTF8 support.
Header polyfill (for Node.js
fetch) is a fork of the implementation in https://github.com/github/fetch (MIT license).