babel / babel/babel-polyfills

[@babel/babel-polyfill] allow use of Financial-Times/polyfill-library as polyfills-source

Open
#19 7 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
357
Forks
62
PR merge metrics
No merged PRs in 30d

Description

## Feature Request

**Is your feature request related to a problem? Please describe.**
core-js is missing the important things. `ChildNode.remove()`, `fetch()`, `XMLHttpRequest()` ...

**Describe the solution you'd like**
possibility to use [Financial-Times/polyfill-library](https://github.com/Financial-Times/polyfill-library/) or any other source of polyfills while keeping the possibility of `useBuiltIns: 'usage'`, so babel-loader still only includes whats necessary.

**Describe alternatives you've considered**
Including a huge bundle of polyfills and/or gather the ones i need and/or have a mess of a setup of polyfilled and not polyfilled things while having half of the features polyfilled fully automatic by babel/polyfill.

**Teachability, Documentation, Adoption, Migration Strategy**
```js
{
test: /\.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: [
[
'@babel/preset-env',
{
targets: {
browsers: [
'last 2 versions',
'ie >= 11'
]
},
useBuiltIns: 'usage',
polyfillSource: 'Financial-Times/polyfill-library' // or somthing like this
}
]
]
}
}
}
```

Contributor guide

Open the contributing guide

Research direction

The issue names @babel/preset-env's useBuiltIns: 'usage' and a babel-loader configuration, but no repository files or tests. Start by tracing that option and the proposed polyfillSource behavior; done would mean selecting Financial-Times/polyfill-library or another source while retaining usage-based inclusion.

Written by the indexing model from the issue text.

Assessment

Tech stack
babel, javascript, webpack
Domain
build-system, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.