next-router-events icon indicating copy to clipboard operation
next-router-events copied to clipboard

Add new router events

Open BernabeFelix opened this issue 6 years ago • 4 comments

  • [x] Update next to @6.1.
  • [x] Add hash events

BernabeFelix avatar Dec 04 '18 22:12 BernabeFelix

Thanks for thinking to pitch in with a PR 👏

This package is redundant now, since Next.js ended up improving their API to have have Router.events.on and Router.events.off: https://github.com/zeit/next.js#router-events

I tried to work out exactly which Next.js version has the new router API (starting at https://github.com/zeit/next.js/issues/4679#issuecomment-418338148), but struggle to find a changelog entry about it. It seems to be since v6.1?

https://github.com/DefinitelyTyped/DefinitelyTyped/pull/27143/files#diff-ca4e115dff389253004e9db34db00b59R1

Perhaps it was in one of the v6.1 alphas.

Once we know for sure, I might deprecate this package on npm.

jaydenseric avatar Dec 05 '18 00:12 jaydenseric

hey @jaydenseric, they introduce it on https://github.com/zeit/next.js/releases/tag/6.0.4-canary.1

BernabeFelix avatar Dec 05 '18 01:12 BernabeFelix

@BernabeFelix Thanks! But how can you tell? I can't see anything in the changelog entry about it... was it just not documented properly?

jaydenseric avatar Dec 05 '18 01:12 jaydenseric

Oh, I thought you were talking about the new events. Router events were introduced in https://github.com/zeit/next.js/releases/tag/6.1.1-canary.0 Support events emitter for router

BernabeFelix avatar Dec 05 '18 15:12 BernabeFelix