Closed kevinCubas closed 8 months ago
This PR https://github.com/forjadev/mjo-forja-webpage/pull/22 may fix the problem, but also keep the barrel file convention.
Another approach would be to just delete the barrel file and import the components using the full path
Description:
The current state of our application is experiencing decreased performance and a tree shaking problem, primarily stemming from the use of barrel files. This not only impacts the speed and efficiency of our application but also results in errors with both server and client components.
Steps to Reproduce:
Ensure you are working in a project branch that contains multiple components, for example, branch with multiple components.
Import a single file from the "@/components" directory.
Run the following command:
Observed Behavior:
Importing using a barrel file
(@/components)
, we notice a significant increase in the number of modules being imported. This, in turn, leads to extended compilation times even for a single import.Expected Behavior:
Without the use of a barrel file
(@/components/navbar/Navbar)
should result in a more efficient and performant outcome.NOTE: The specified examples were reproduced using the first compilation without caching.