I am working on a web application by react and php (for api services). after users login, my application will give users access to different parts of react application. for example, an admin will see the features of management, sellers will see a seller panel of uploading products, buyers can browse the products.
I understand there are different ways to achieve this, but I am hoping to find the most popular or the best way considering performance, bundle size, safety, etc
currently, I am thinking about for different type of users, create different bundles by webpack which only includes the code needed for that user. after logs in, give the user the right bundle.
Not sure if this is a good way to go. I am hoping to get some more inputs from others, and it will be better if you can also show me an example on how to implement. thanks!