Satyam/react-simple-idle-monitor

Changes in v1.0.0

Closed this issue · 2 comments

Due to the possibilities offered by React Hooks and the deprecation of others used in versions so far, it seemed necessary to develop a new version. It has several changes, some of them incompatible. Please check the README and CHANGELOG files on the master branch of this project that documents this changes.

The major changes in this version were the change to React Hooks, both in using them and providing one, useIdleMonitor, and a complete re-write in TypeScript.

The features related to Redux and Event firing have been removed from the core IdleMonitor into their own IdleMonitorRedux and IdleMonitorEvents components. I actually don't know if anybody used these features but instead of dropping them I decided to offer them separate. Should I keep supporting them or drop them?

I corrected a bad design feature that had haunted me all along, the enabled property which I finally dropped in favour of the more standard disabled. Does anybody use it? I hope the change is not terrible on its users, or is it?

The onActive event received the UI event that triggered the activation and a function that, when called, would ignore the event. I dropped it, partly because the IdleMonitorEvents component which now has it, has no event information and little control over the core to stop it. Would anybody miss that feature?

The element property was dropped. Initially, the component listens to events on the document DOM element. It could be changed by providing a separate element. Now, the component listens to events on a <div> element it creates itself. This is also justified because, being a Context Provider, the component is controlled from anywhere down in the tree via the useIdleMonitor hook while in the previous version it was controlled from above through its properties. Any issue about this?

Likewise, instead of relying on actual DOM events to detect activity, it now uses React Synthetic Events. Thus, the strings listed for the events property change as they should now be React event names, not DOM events. I don't believe many people did change the default events the component listened to so this change should not be significant, or is it?

Please comment.

A new version of react-simple-idle-monitor is available for evaluation and comment. Perhaps you want to comment on it in this open running issue. My apologies if you are no longer interested.

The nicknames below are taken from the list of people who have starred or forked the repository or have it as a dependency in some of their projects. so they are listed in the open as such, so there is no breach of privacy.

@AhmedAbdulrahman, @abdullahceylan, @herbertpimentel, @memezilla, @evandromacedo, @zakangelle, @jeremyraffin, @scottc-netflix,@ymali,@deltaidea,@facto, @nualamo, @hsz, @vied12, @thachp, @pppemo, @galina-osenina, @ITADMINPTYLTD, @jmpressman, @vijayasankar, @donovantc

This new React Hooks version has been released.