Skip to content

Commit 8b34bf2

Browse files
jacobmllr95tmorehouse
authored andcommitted
perf: remove default array/object polyfills (#3641)
1 parent d3641ba commit 8b34bf2

File tree

8 files changed

+962
-491
lines changed

8 files changed

+962
-491
lines changed

docs/markdown/intro/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -667,10 +667,9 @@ sizes when using the `ESM` module _vs._ the `ESM` bundle.
667667
### Dependencies
668668

669669
BootstrapVue relies on `Popper.js` (for Tooltip, Popover, and Dropdown positioning), `PortalVue`
670-
(for toasts), and
670+
(for toasts) and
671671
[`vue-functional-data-merge`](https://github.com/alexsasharegan/vue-functional-data-merge) (used by
672-
our functional components) and parts of `core-js`. These four dependencies are included in the `UMD`
673-
bundle.
672+
our functional components). These three dependencies are included in the `UMD` bundle.
674673

675674
## Migrating a project already using Bootstrap
676675

docs/markdown/reference/starter-templates/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ created when you run `yarn build`.
131131

132132
### Importing individual components and directives
133133

134-
As an example, you can import `<b-card>` (plus some of it's sub components) and `<b-table>` as follows:
134+
As an example, you can import `<b-card>` (plus some of it's sub components) and `<b-table>` as
135+
follows:
135136

136137
```js
137138
// Import the individual components

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@
7373
"dependencies": {
7474
"@nuxt/opencollective": "^0.2.2",
7575
"bootstrap": "^4.3.1",
76-
"core-js": ">=2.6.5 <3.0.0",
7776
"popper.js": "^1.15.0",
7877
"portal-vue": "^2.1.5",
7978
"vue-functional-data-merge": "^3.1.0"
@@ -97,6 +96,7 @@
9796
"codecov": "^3.5.0",
9897
"codemirror": "^5.48.0",
9998
"codesandbox": "^2.1.6",
99+
"core-js": ">=2.6.5 <3.0.0",
100100
"cross-env": "^5.2.0",
101101
"eslint": "^6.0.1",
102102
"eslint-config-prettier": "^6.0.0",

scripts/rollup.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const externals = ['vue', ...Object.keys(dependencies)]
1818
// are expected to be provided later.
1919
// In some cases (i.e. browser UMD build), we want to include some of
2020
// them in the build, so we exclude the external here.
21-
const externalExcludes = ['core-js', 'popper.js', 'portal-vue', 'vue-functional-data-merge']
21+
const externalExcludes = ['popper.js', 'portal-vue', 'vue-functional-data-merge']
2222

2323
// The base rollup configuration
2424
const baseConfig = {
@@ -36,7 +36,7 @@ export default [
3636
// UMD Browser Build
3737
{
3838
...baseConfig,
39-
// We use a specific input entrypoint for the browser build
39+
// We use a specific input for the browser build
4040
input: path.resolve(src, 'browser.js'),
4141
external: externals.filter(dep => !externalExcludes.includes(dep)),
4242
output: {

src/components/nav/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,8 @@ The dropdown default slot is optionally scoped with the following scope availabl
220220

221221
By default, `<b-nav-item-dropdown>` renders the menu contents in the DOM even when the menu is not
222222
shown. When there are a large number of dropdowns rendered on the same page, performance could be
223-
impacted due to larger overall memory utilization. You can instruct `<b-nav-item-dropdown>` to render
224-
the menu contents only when it is shown by setting the `lazy` prop to true.
223+
impacted due to larger overall memory utilization. You can instruct `<b-nav-item-dropdown>` to
224+
render the menu contents only when it is shown by setting the `lazy` prop to true.
225225

226226
## Using in navbar
227227

src/utils/array.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
import fromPolyfill from 'core-js/library/fn/array/from'
2-
import isArrayPolyfill from 'core-js/library/fn/array/is-array'
3-
41
// --- Static ---
52

6-
export const from = Array.from || fromPolyfill
7-
export const isArray = Array.isArray || isArrayPolyfill
3+
export const from = Array.from
4+
export const isArray = Array.isArray
85

96
// --- Instance ---
107

src/utils/object.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
import assignPolyfill from 'core-js/library/fn/object/assign'
2-
import isPolyfill from 'core-js/library/fn/object/is'
31
import { isArray } from './array'
42

53
// --- Static ---
64

7-
export const assign = Object.assign || assignPolyfill
5+
export const assign = Object.assign
86
export const getOwnPropertyNames = Object.getOwnPropertyNames
97
export const keys = Object.keys
108
export const defineProperties = Object.defineProperties
@@ -15,7 +13,7 @@ export const getOwnPropertySymbols = Object.getOwnPropertySymbols
1513
export const getPrototypeOf = Object.getPrototypeOf
1614
export const create = Object.create
1715
export const isFrozen = Object.isFrozen
18-
export const is = Object.is || isPolyfill
16+
export const is = Object.is
1917

2018
// --- "Instance" ---
2119

0 commit comments

Comments
 (0)