-
Notifications
You must be signed in to change notification settings - Fork 7
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
Best Practices for Using Generated gRPC Dart Code as a Dependency #58
Comments
Current version is v1.6.4: https://github.com/pactus-project/pactus/tree/v1.6.4/www/grpc/gen/dart |
Javad, we will make sure to implement these tasks in separate issues. 1-Review Existing gRPC Documentation While we are able to search and find the documentation link ourselves, we kindly request that you provide us with the link. |
I think don't need to generate gRPC proto again via pipeline, you can use this practice. |
@Ja7ad , we talk about it in the GUI team to make it easier and better. |
We have generated gRPC Dart code in the repository under the following path:
https://github.com/pactus-project/pactus/tree/main/www/grpc/gen/dart
To ensure proper usage and integration of this generated code in other projects, here are the recommended best practices:
1. Referencing the Generated Code
To use the generated code in your Dart/Flutter project, add it to the
pubspec.yaml
file as a Git dependency:<version-tag>
with the specific tag or branch name you want to use (e.g.,v1.0.0
).2. Keep the Generated Code Updated
Ensure the generated gRPC Dart code is always updated in the repository whenever
.proto
files are modified. This ensures compatibility and consistency across projects using this package.3. Versioning Recommendations
vX.Y.Z
) to reference the gRPC code.main
branch unless explicitly required, as it might include unstable changes.4. Importing the Package
After adding the dependency, import the generated files into your Dart/Flutter project:
Replace
<generated_file>
with the appropriate file name based on your usage.5. Managing Updates
If there are updates to the tag or generated code:
ref
in yourpubspec.yaml
.6. Testing Integration
After integrating the package into your Flutter project:
The text was updated successfully, but these errors were encountered: