ForgeRock Developer Experience

Use polyfills

Transpiling your code is not quite enough to ensure legacy compatibility. Polyfills are the second step to ensuring legacy support.

Here are the recommended polyfills:

  1. core-js to polyfill core/common native features: Promise, URL, Object.assign, array methods, and others.

  2. regenerator-runtime to polyfill native generator functions.

  3. whatwg-fetch to polyfill native fetch.

  4. fast-text-encoding to polyfill native TextEncoder.

NPM install example:

npm install core-js regenerator-runtime whatwg-fetch fast-text-encoding
Copyright © 2010-2024 ForgeRock, all rights reserved.