Jayprecode / country-state-dropdown

This Component is built with Nextjs, Tailwindcss, Shadcn-ui & Zustand for state management
https://country-state-dropdown.vercel.app
89 stars 9 forks source link

Performance Concerns #5

Open enesbala5 opened 2 weeks ago

enesbala5 commented 2 weeks ago

This looks amazing however I am concerned on how reading 80000 lines worth of JSON to find a state impacts performance on web apps. Can you let me know how that experience has been for you?

StellarLogic commented 2 weeks ago

Talking about the performance it's feels smooth when you are scrolling and selecting from any dropdown down but it feels sluggish when you to type inside search bar

enesbala5 commented 2 weeks ago

I'n sure a proper implementation would require a separate API being built / implemented. This is not fitting for browser environments. Great for a quick and easy fix though.

StellarLogic commented 2 weeks ago

I was thinking about splitting the states json in smaller jsons so we can load one according to selected county.

If you can check here also there are no api calls and still ui is smooth as butter

https://dr5hn.github.io/countries-states-cities-database/

enesbala5 commented 1 week ago

That would be great. My main gripe was with the State JSON which was very large, and this would fix that