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

v0 Dart client generation #3

Merged
merged 37 commits into from
Apr 25, 2024
Merged

v0 Dart client generation #3

merged 37 commits into from
Apr 25, 2024

Conversation

austinmilt
Copy link
Collaborator

@austinmilt austinmilt commented Apr 22, 2024

This PR adds Dart client code generation. It requires a single import into the client's codebase (documented in the README)

This version includes

  • client code generation (see base directory starting in main.go.tmpl)
  • services interface generation for mocking in tests (types.go.tmpl)
  • test validation against the test webrpc schema (tests/scripts/test.sh and tests/test/reference_test.dart)
  • test validation against an additional webrpc schema (tests/test/custom_test.dart)
  • CI test automation (.github/workflows/ci.yml)
  • an example Flutter client app with a Go backend (_examples/flutter-go/)

Note this version ignores wide/large number truncation that occurs in web environments (i.e. Flutter web) (see webrpc/webrpc#283)

@austinmilt austinmilt mentioned this pull request Apr 22, 2024
6 tasks
@austinmilt
Copy link
Collaborator Author

@VojtechVitek looking for reviews at your leisure

Copy link
Contributor

@VojtechVitek VojtechVitek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I think this is excellent!

@austinmilt What a great contribution to the webrpc project. Thank you! 🎉

If you agree, I can get this into webrpc binary as an officially supported client.

I've never worked with Dart, so I won't be able to run/test this myself today.. but the tests suite looks very robust 👍

Screen Shot 2024-04-25 at 5 51 18 PM

@VojtechVitek VojtechVitek merged commit 556dabc into master Apr 25, 2024
2 checks passed
@VojtechVitek VojtechVitek deleted the feature/v0-ignore-bignum branch April 25, 2024 16:11
@austinmilt
Copy link
Collaborator Author

LGTM. I think this is excellent!

@austinmilt What a great contribution to the webrpc project. Thank you! 🎉

If you agree, I can get this into webrpc binary as an officially supported client.

I've never worked with Dart, so I won't be able to run/test this myself today.. but the tests suite looks very robust 👍

Screen Shot 2024-04-25 at 5 51 18 PM

I would love to see this officially supported. Just FYI this version is what I'd consider a minimal implementation

  • doesnt support metadata generally
  • types cant be compared for deep equality
  • doesnt attempt to define or return default values

@VojtechVitek
Copy link
Contributor

@austinmilt it's a very great start :) Feel free to create issues for what you think is missing 👍

@austinmilt
Copy link
Collaborator Author

I made some issues but will likely wait to implement anything until/unless folks end up using the library (including myself :D) .

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

Successfully merging this pull request may close these issues.

2 participants