Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(docs): correct polyfilling suggestions #3605

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions docs/markdown/intro/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ JavaScript files.
<link type="text/css" rel="stylesheet" href="//unpkg.com/bootstrap-vue@latest/dist/bootstrap-vue.min.css" />

<!-- Load polyfills to support older browsers -->
<script src="//polyfill.io/v3/polyfill.min.js?features=es2015%2CMutationObserver" crossorigin="anonymous"></script>
<script src="//polyfill.io/v3/polyfill.min.js?features=es2015%2CIntersectionObserver" crossorigin="anonymous"></script>

<!-- Load Vue followed by BootstrapVue -->
<script src="//unpkg.com/vue@latest/dist/vue.min.js"></script>
Expand Down Expand Up @@ -551,34 +551,35 @@ Following features and APIs are used by BootstrapVue:
- ES6 (e.g. `Array.from()`, `Array.isArray()`, `Object.assign()`, `Object.is()`, etc.)
- `Promise`
- `MutationObserver`
- `IntersectionObserver` (optional)

If you want to support older IE, Android and iOS devices, you may want to use
[core-js](https://github.com/zloirock/core-js) and
[mutationobserver-shim](https://www.npmjs.com/package/mutationobserver-shim):
[intersection-observer](https://www.npmjs.com/package/intersection-observer):

- `npm install core-js regenerator-runtime mutationobserver-shim`
- `npm install core-js regenerator-runtime intersection-observer`
- Import the polyfills in your app main entry point:

<!-- eslint-disable no-unused-vars -->

```js
import 'core-js/stable"'
import 'core-js/stable'
import 'regenerator-runtime/runtime'
import 'mutationobserver-shim'
import 'intersection-observer' // Optional
import Vue from 'vue'
import BootstrapVue from 'bootstrap-vue'
```

If using deprecated [@babel/polyfill](https://babeljs.io/docs/en/babel-polyfill/):

- `npm install @babel/polyfill mutationobserver-shim`
- `npm install @babel/polyfill intersection-observer`
- Import the polyfills in your app main entry point:

<!-- eslint-disable no-unused-vars -->

```js
import '@babel/polyfill'
import 'mutationobserver-shim'
import 'intersection-observer' // Optional
import Vue from 'vue'
import BootstrapVue from 'bootstrap-vue'
```
Expand Down
5 changes: 4 additions & 1 deletion docs/markdown/reference/router-links/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,10 @@ do not support IntersectionObserver, you can use the following conditional polyf
export default {
head: {
script: [
{ src: 'https://polyfill.io/v2/polyfill.min.js?features=IntersectionObserver', body: true }
{
src: 'https://polyfill.io/v3/polyfill.min.js?features=es2015%2CIntersectionObserver',
body: true
}
]
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ module.exports = {
meta: [{ 'http-equiv': 'X-UA-Compatible', content: 'IE=edge' }],
script: [
{
src: '//polyfill.io/v3/polyfill.min.js?features=es2015%2CMutationObserver',
src: '//polyfill.io/v3/polyfill.min.js?features=es2015%2CIntersectionObserver',
crossorigin: 'anonymous'
}
]
Expand Down