From bd6266ce97b43d5b4c46939b7baf4f3dd2540f0a Mon Sep 17 00:00:00 2001 From: Basix Date: Sat, 10 Oct 2020 02:01:21 +0900 Subject: [PATCH] Remove instance methods from `usage.md` core-js@3 can polyfill the instance methods without touching global scope. the documentation of babel-plugin-transform-runtime also mentions this: https://babeljs.io/docs/en/next/babel-plugin-transform-runtime#corejs --- docs/usage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage.md b/docs/usage.md index ecaa555c2f..af93ccb164 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -162,7 +162,7 @@ The [@babel/polyfill](polyfill.md) module includes [core-js](https://github.com/ This means you can use new built-ins like `Promise` or `WeakMap`, static methods like `Array.from` or `Object.assign`, instance methods like `Array.prototype.includes`, and generator functions (when used alongside the regenerator plugin). The polyfill adds to the global scope as well as native prototypes like `String` in order to do this. -For library/tool authors this may be too much. If you don't need the instance methods like `Array.prototype.includes` you can do without polluting the global scope altogether by using the [transform runtime](plugin-transform-runtime.md) plugin instead of `@babel/polyfill`. +For library/tool authors this may be too much. If you don't want to pollute the global scope you can do without polluting the global scope altogether by using the [transform runtime](plugin-transform-runtime.md) plugin instead of `@babel/polyfill`. To go one step further, if you know exactly what features you need polyfills for, you can require them directly from [core-js](https://github.com/zloirock/core-js#commonjs).