Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Riverpod annotation in large scale applications #3418

Closed
AlexMichels opened this issue Mar 12, 2024 Discussed in #3417 · 2 comments
Closed

Riverpod annotation in large scale applications #3418

AlexMichels opened this issue Mar 12, 2024 Discussed in #3417 · 2 comments

Comments

@AlexMichels
Copy link

Discussed in #3417

Originally posted by AlexMichels March 12, 2024
Hello @rrousselGit ,
I really enjoy using Riverpod. Currently, I am using Riverpod in projects with over 100k lines of code and for hundreds of thousands of users. We are using Riverpod annotation, Feature First, and each feature consists of UI -> controller (Notifier) -> service. The Riverpod providers are the glue between our layers. The problem we have on a large scale is that the build runner takes 3-5 minutes to run. That means if I change the branch or work on a provider, it takes 4 minutes until it is done. This costs each engineer about 30 minutes per day.

What is your recommendation? I was thinking maybe to push the generated files so at least we do not need to wait so long each time we change the branch.

Are there better solutions to improve the use of annotation for large projects?

Thanks in advance.

@Cierra-Runis
Copy link

Cierra-Runis commented Mar 12, 2024

flutter pub run build_runner watch --delete-conflicting-outputs

Did you try the command as above?
Once static metaprogramming implement, it will be much faster than build_runner.

@rrousselGit
Copy link
Owner

The problem we have on a large scale is that the build runner takes 3-5 minutes to run. That means if I change the branch or work on a provider, it takes 4 minutes until it is done. This costs each engineer about 30 minutes per day.

That's the fault of your app. This is typically a sign that the files of your providers are importing too many things, which essentially re-generate the whole app on change.
The fewer and more specifics the imports are, the faster code-generation will be.

And yes, the best solution is static metaprogramming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants