fridays / next-routes

Universal dynamic routes for Next.js
MIT License
2.47k stars 230 forks source link

Remove `array-includes` dep to shave 5kb off payload #48

Closed ajoslin closed 7 years ago

ajoslin commented 7 years ago

Thanks for the library.

I'm evaluating using this, and I saw the array-includes dep wasn't really needed, so here you go.

HaNdTriX commented 7 years ago

Thanks!

fridays commented 7 years ago

Should we remove array-find too?

find(this.routes, route => route.name === name)

could be

this.routes.filter(route => route.name === name)[0]
ajoslin commented 7 years ago

array-find is only 407B gzipped, so it's less of a big deal.

But yes, that would probably be better. May as well save half a KB where you can.