Skip to content

Commit

Permalink
📦 4.6.3
Browse files Browse the repository at this point in the history
  • Loading branch information
SupremeTechnopriest committed May 26, 2021
1 parent e28919a commit d78d971
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### 4.6.3
- Add missing `ref` to TypeScript definitions.
- Fixed a bug where reset would not propagate cross tab.
- Exported a bundle for modern browsers. This will become the default in version 5. If you require dead browser support, you will need to import from legacy. `import IdleTimer from 'react-idle-timer/legacy' for Webpack 5 and `import IdleTimer from 'react-idle-timer/dist/legacy' for webpack 4 and below.

### 4.6.2
- Allow for dynamically setting `onActive` and `onIdle` event handlers in conjunction with cross tab event reconciliation.

Expand Down
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,34 @@
🚀 **Support for Isomorphic React**<br/>
🎣 **Hook Implementation**

## Upcoming breaking changes in v5

In the next major version, IdleTimer will be dropping default support for dead browsers. The main exports will be for modern browsers and ES Modules only. Version `4.6.3` added a new export for modern browsers to allow Content Security Policies to be added without regenerator-runtime violations:

```javascript
import IdleTimer, { useIdleTimer } from 'react-idle-timer/modern'
```

If your build chain does not support node sub-modules (Webpack <= v4), you will need to import directly from dist.

```javascript
import IdleTimer, { useIdleTimer } from 'react-idle-timer/dist/modern'
```

In version 5 this will be inverted. The default export will be for modern browsers. If you need support for CommonJS/ Babel compiled source, you will need to import the legacy package:

```javascript
import IdleTimer, { useIdleTimer } from 'react-idle-timer/legacy'
```

Again, if your build chain does not support node sub-modules (Webpack <= v4), you will need to import directly from dist.

```javascript
import IdleTimer, { useIdleTimer } from 'react-idle-timer/dist/legacy'
```

If you have any questions or concerns feel free to open an issue on [github](https://github.com/SupremeTechnopriest/react-idle-timer/issues). The version 5 release is planned for late Q3 - early Q4 2021.

## Latest News

#### Version `4.6.0` adds cross tab support:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-idle-timer",
"version": "4.6.3-rc.4",
"version": "4.6.3",
"description": "Activity detection for React.js",
"main": "./dist/index.min.js",
"module": "./dist/index.es.js",
Expand Down

0 comments on commit d78d971

Please sign in to comment.