SupremeTechnopriest / react-idle-timer

User activity timer component
https://idletimer.dev
MIT License
1.15k stars 143 forks source link

move `types` condition to the front #343

Closed Andarist closed 1 year ago

Andarist commented 1 year ago

I moved types condition to the front. package.json#exports are order-sensitive - they are always matched from the top to the bottom. When a match is found then it should be used and no further matching should occur.

Right now, the current setup works in TypeScript but it's considered a bug and it should not be relied upon, see the thread and the comment here. For that reason, I would like to fix all popular packages that misconfigured their exports this way so the bug can be fixed in TypeScript.

⚠️ this PR focuses solely on fixing "🐛 Used fallback condition" problem but the "🚭 Unexpected ESM syntax" remains here. You can check the reported errors here

vercel[bot] commented 1 year ago

Someone is attempting to deploy a commit to a Personal Account owned by @SupremeTechnopriest on Vercel.

@SupremeTechnopriest first needs to authorize it.

SupremeTechnopriest commented 1 year ago

Awesome! Thanks for the PR. I will get this merged up and published this weekend.

Andarist commented 1 year ago

@SupremeTechnopriest friendly 🏓

Andarist commented 1 year ago

@SupremeTechnopriest friendly 🏓

SupremeTechnopriest commented 1 year ago

Hey @Andarist. This is resolved in the latest 5.7.2 release. I didn't merge this because it didn't follow the contribution guide, but I was doing some work on the exports anyway. I added a legacy bundle for older browsers as well. Thanks for reporting this! Let me know if you have any issues with the types. In the future just quickly gloss over the contribution guide and Ill be happy to merge your changes in!