
Security News
Deno 2.6 + Socket: Supply Chain Defense In Your CLI
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.
@refinitiv-ui/polyfills
Advanced tools
Element Framework (EF) is built on top of Lit framework and published as ES2020. The features are supported by latest versions of all modern browsers and build tools.
For legacy browsers, such as IE11 or old Chrome, it is required to compile code to ES5 and include polyfills. Lit has provided documentation for better understanding of the topic.
This guideline does not provide definite instructions to make your application working in old browsers, but rather focuses on essential information related to EF.
Legacy browsers require the following features:
EF is built using Web Components standards. Old browsers may not support Web Components natively, therefore polyfills are required. EF curates necessary polyfills as @refinitiv-ui/polyfills.
npm install @refinitiv-ui/polyfills
You must import this module in your app before any EF components.
import '@refinitiv-ui/polyfills';
EF components are published using ES2020 syntax and many old browsers do not support it. Babel is popular tools to convert modern JavaScript to ES5.
npm install @babel/core --save-dev
Create or edit .browserslistrc at your application root directory to include environments that you need to support. See more about browserslist. For instance, if your application need to support IE11 add this line:
IE >= 11
Configure your build tool, to include these modules into Babel compilation list:
The new versions of other dependencies might be published as modules in the future. Includes them if that is the case.
Old browsers do not support many features of ES2020. core-js is a standard library that includes polyfills for ES2020+:
While you can manually include core-js polyfills, we recommend to use @babel/preset-env to automatically inject required polyfills based on your code and supported environments.
npm install core-js
npm install @babel/preset-env --save-dev
This is the minimum configuration for @babel/preset-env:
{
"corejs": {
"version": 3,
"proposals": true
},
"useBuiltIns": "usage"
}
Some EF components use Intl features, which may not be available in old browsers so the polyfills are required.
These polyfills significantly increase the size of the bundle. We recommend to only include the supported languages.
npm install @formatjs/intl-getcanonicallocales @formatjs/intl-locale @formatjs/intl-numberformat @formatjs/intl-pluralrules @formatjs/intl-datetimeformat
Import polyfills into your app:
// Import polyfills required by specific element
import '@formatjs/intl-datetimeformat/locale-data/en';
import '@formatjs/intl-datetimeformat/polyfill.iife';
import '@formatjs/intl-getcanonicallocales/polyfill.iife';
import '@formatjs/intl-locale/polyfill.iife';
import '@formatjs/intl-numberformat/locale-data/en';
import '@formatjs/intl-numberformat/polyfill.iife';
// Import supported locales, for instance `en`
import '@formatjs/intl-pluralrules/locale-data/en';
import '@formatjs/intl-pluralrules/polyfill.iife';
There are additional polyfills available for more advanced translation messages. You can get additional information on formatjs.io.
Webpack uses babel-loader to transpile JavaScript.
Install babel-loader and other necessary dependencies.
npm install core-js
npm install babel-loader @babel/core @babel/preset-env --save-dev
Create or edit .browserslistrc at your app root directory as per instructions in the previous section.
Merge this configuration with your WebPack configuration:
module.exports = {
// Ensure that the output is targeted ES5 format
target: ['web', 'es5'],
module: {
rules: [
{
test: /\.m?js$/,
include: [
// Do not forget to include own project if modern JavaScript us used
path.resolve(__dirname, 'src'),
// Include packages that must be transpiled
path.resolve(__dirname, 'node_modules/@refinitiv-ui'),
path.resolve(__dirname, 'node_modules/@webcomponents'),
path.resolve(__dirname, 'node_modules/@lit'),
path.resolve(__dirname, 'node_modules/lit'),
path.resolve(__dirname, 'node_modules/lit-element'),
path.resolve(__dirname, 'node_modules/lit-html'),
path.resolve(__dirname, 'node_modules/d3-color'),
path.resolve(__dirname, 'node_modules/lightweight-charts')
],
use: {
loader: 'babel-loader',
options: {
presets: [
[
'@babel/preset-env',
{
corejs: {
version: 3,
proposals: true
},
useBuiltIns: 'usage'
}
]
]
}
}
}
]
}
};
FAQs
Verified polyfills for the Element Framework
The npm package @refinitiv-ui/polyfills receives a total of 3 weekly downloads. As such, @refinitiv-ui/polyfills popularity was classified as not popular.
We found that @refinitiv-ui/polyfills demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.