Skip to content

Commit

Permalink
Fixed #4 - Removed polyfills from the package. Polyfills should now b…
Browse files Browse the repository at this point in the history
…e installed manually if needed.
  • Loading branch information
dgpedro committed Apr 1, 2021
1 parent 3541fe3 commit e7fbc15
Show file tree
Hide file tree
Showing 13 changed files with 7 additions and 70 deletions.
20 changes: 4 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,11 @@ With a couple of code lines, it's possible to make any react page much more inte

## Polyfills

- **[Web Animations API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Animations_API)**
- **[Intersection Observer API](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API)** (only if `lazy` prop set to `true`)
- **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)**
Depending on the browser to support, some polyfills might be needed:

If needed, polyfills can be imported individually:

```javascript
import "react-component-transition/build/polyfill/web-animations-api";
import "react-component-transition/build/polyfill/intersection-observer";
import "react-component-transition/build/polyfill/promise";
```

or all at once:

```javascript
import "react-component-transition/build/polyfill";
```
- **[Web Animations API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Animations_API/Using_the_Web_Animations_API#browser_support)**
- **[Intersection Observer API](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API#browser_compatibility)** (only if `lazy` prop set to `true`)
- **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise#browser_compatibility)**

## Usage

Expand Down
15 changes: 0 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 3 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
{
"name": "react-component-transition",
"version": "1.1.6",
"version": "2.0.0",
"description": "Easy animations between react component transitions.",
"main": "./build/cjs/index.js",
"module": "./build/esm/index.js",
"sideEffects": false,
"scripts": {
"build": "rimraf docs && webpack --color --mode production",
"build-dev": "rimraf docs && webpack --color --mode development",
"prepare": "rimraf build && npm run tsc && npm run polyfill",
"prepare": "rimraf build && npm run tsc",
"tsc": "tsc -p tsconfig.json && tsc -p tsconfig-cjs.json",
"polyfill": "tsc -p tsconfig-polyfill.json",
"prestart": "rimraf docs",
"start": "webpack-dev-server --mode development"
},
Expand All @@ -37,11 +36,8 @@
"@types/classnames": "^2.2.10",
"@types/uniqid": "^5.2.0",
"classnames": "^2.2.6",
"core-js": "^3.6.5",
"intersection-observer": "^0.11.0",
"react-intersection-observer": "^8.26.2",
"uniqid": "^5.2.0",
"web-animations-js": "^2.3.2"
"uniqid": "^5.2.0"
},
"devDependencies": {
"@babel/cli": "^7.12.8",
Expand Down
5 changes: 0 additions & 5 deletions presets-esm.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion presets-esm.js

This file was deleted.

5 changes: 0 additions & 5 deletions presets.d.ts

This file was deleted.

1 change: 0 additions & 1 deletion presets.js

This file was deleted.

3 changes: 0 additions & 3 deletions src/polyfill/index.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/polyfill/intersection-observer.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/polyfill/promise.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/polyfill/web-animations-api.ts

This file was deleted.

11 changes: 0 additions & 11 deletions tsconfig-polyfill.json

This file was deleted.

3 changes: 0 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,5 @@
},
"include": [
"./src"
],
"exclude": [
"./src/polyfill"
]
}

0 comments on commit e7fbc15

Please sign in to comment.