Comments (10)
Working on this is on our roadmap, but progress is blocked on a solution to bufbuild/protobuf-es#397 (which is also on our roadmap). We will share any updates when we have them.
from protovalidate.
Rough guess is that we will be unblocked sometime in Q1. Appreciate the offer to help and will post to the issue if we could use help when the time comes.
from protovalidate.
Yes, supporting Protovalidate in TypeScript entails having a high quality open source CEL interpreter that works in all the environments we want (aka doesn't require Node.js APIs and doesn't require WASM). We are also unaware of any existing open source project that meets these requirements and so have already invested some time building our own implementation. We would open source this CEL implementation at the same time that we would open source support for Protovalidate TypeScript (which currently doesn't have a concrete timeline associated with it).
from protovalidate.
Would you folks be open to adding library functions that don't depend on protobuf-es while that blocker exists?
No, we are focusing our attention on improving protobuf-es and are actively working on a solution to the blocking issue.
from protovalidate.
Good to hear that, maybe i can also contribute. It seems like zod is popular these days, you would instantly also have validation up to the frontend: https://zod.dev/
from protovalidate.
@elliotmjackson Hi there! Is there already something available to try out?
from protovalidate.
Hi there! Having typescript support for protovalidate would be fantastic.
I noticed in the linked blocker above that @protobuf-ts
correctly includes options
in the generated typescript. I was able to successfully test this out locally, such that my generated Typescript code contained custom proto options I defined using protovalidate syntax.
Would you folks be open to adding library functions that don't depend on protobuf-es
while that blocker exists? For example, instead of providing a function public ValidationResult validate(Message msg)
within the library, you could instead expect that:
- Users of your library would define their validation in their
.proto
files (no change here). - Users of your library would be responsible for generating
FieldConstraints
andMessageConstraints
and such. (As a user, I would rely onprotobuf-ts
to help me do this with its helper functions likereadFieldOption
.) - Your Typescript protovalidate library would provide methods like
public ValidationResult validate(fieldValue Value, fieldConstraints FieldConstraints)
.
I believe with this structure, your library wouldn't have any need to inspect what options were defined on a given proto message. Instead, clients would be responsible for doing this themselves, and your protovalidate Typescript library would simply provide the validation component. Long-term it would obviously be wonderful to address bufbuild/protobuf-es#397 and have a simple validate
method available that could parse custom proto options, similar to what's present in the Python and Golang and Java libraries you folks have developed. But it would definitely be helpful to have a stop-gap solution here that at least provided partial support for users of your protovalidate ecosystem!
from protovalidate.
Would you folks be open to adding library functions that don't depend on protobuf-es while that blocker exists?
No, we are focusing our attention on improving protobuf-es and are actively working on a solution to the blocking issue.
Thanks Nick, that's great to hear! Do you folks have any ETA on when you might have the blocking issue resolved, and when it might be possible to start developing the protovalidate-typescript library? (I'd be happy to help out with the latter if you're looking for contributors!)
from protovalidate.
Awesome, thanks, I'll check back in on this ticket in Q1!
from protovalidate.
Since protovalidate relies heavily on CEL does this mean that a CEL typescript evaluator is being developed as well?
And will there be a standalone version of the evaluator?
We have the need for a javascript/typescript CEL evaluator in our project but we can't seem to find a robust implementation at the moment.
from protovalidate.
Related Issues (20)
- [BUG] Conformance test suite has test cases that are unspecified by the proto3 spec HOT 2
- Add package documentation for Protobuf packages
- [Feature Request] PHP Support
- [Feature Request] Ruby Support
- [Question] Deprecated field validation HOT 1
- [Question] I can't generate a validator with buf, is the plugin used by the buf.gen.yaml file incorrect? HOT 1
- Protoc does not generate validation code [BUG] HOT 1
- [Feature Request] Have URI validations for string but also allow empty HOT 1
- [Feature Request]: Add wellknown regex for URL encoded parameters HOT 1
- Cannot resolve import HOT 1
- [Question] Migration from protoc-gen-validate to protovalidate HOT 2
- [Feature Request] Add to scalapb common protos HOT 3
- [Question] Carrying Patches from protoc-gen-validate HOT 1
- How do you use protovalidate on grpc-gateway? HOT 2
- [Feature Request] How to replace error messages in standard constraints? HOT 1
- [BUG] Regex in CEL with non-capturing group issue HOT 1
- [BUG] migrate: tmp on different partition than target [invalid cross-device link] HOT 1
- [BUG] migration tool: repeated strings with ignore_empty doesn't work HOT 2
- Add access to custom options (of host messages).
- [BUG] Migrator uses wrong field path for string ignore HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from protovalidate.