Skip to content

Commit

Permalink
docs: fix polyfill mdx
Browse files Browse the repository at this point in the history
  • Loading branch information
daybrush committed May 8, 2024
1 parent cf1636e commit bc47101
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/docs/tutorials/installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ yarn add @egjs/svelte-flicking
</Tabs>

## CDN Links
Unlike individual or internal cases, CDN has unpredictable problems with services, so it is better to use your own files.

### packaged(with dependencies)
```html
<!-- unpkg -->
Expand Down
25 changes: 25 additions & 0 deletions docs/docs/tutorials/polyfills.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ custom_edit_url: null
sidebar_position: 6
---

### Before
Flicking is based on es5 and additionally needs es6 Promise to work properly.
es5 is basically supported on IE9+ ([Source](http://kangax.github.io/compat-table/es5/))
So, only es6 Promise is needed to run Flicking on the older browsers.
Expand All @@ -14,4 +15,28 @@ So, only es6 Promise is needed to run Flicking on the older browsers.
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/es6-promise/dist/es6-promise.auto.js"></script>
```

Adding the above script will make Flicking run on the older browsers.

### After


Flicking is based on es5 and additionally needs es6 Promise to work properly.
es5 is basically supported on IE9+ ([Source](http://kangax.github.io/compat-table/es5/))
So, only es6 Promise is needed to run Flicking on the older browsers.

* How to use it via CDN
```html
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/es6-promise/dist/es6-promise.auto.js"></script>
```
* How to use it yourself (Unlike individual or internal cases, CDN has unpredictable problems with services, so it is better to use your own files.)
```
# Download
https://cdn.jsdelivr.net/npm/es6-promise/dist/es6-promise.auto.js
```
* How to use it via module (The pollution of the global scope)
```js
require('es6-promise').polyfill();
```


Adding the above script will make Flicking run on the older browsers.
2 changes: 1 addition & 1 deletion docs/docs/tutorials/quick-start.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import TabItem from '@theme/TabItem';
]}>
<TabItem value="js">

Add the script/CSS to the page.
Add the script/CSS to the page. (Unlike individual or internal cases, CDN has unpredictable problems with services, so it is better to use your own files.)
```html
<script src="https://unpkg.com/@egjs/flicking/dist/flicking.pkgd.min.js" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://unpkg.com/@egjs/flicking/dist/flicking.css" crossorigin="anonymous" />
Expand Down

0 comments on commit bc47101

Please sign in to comment.