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

feature request: javascript/typescript support #71

Closed
glerchundi opened this issue Apr 13, 2018 · 19 comments
Closed

feature request: javascript/typescript support #71

glerchundi opened this issue Apr 13, 2018 · 19 comments
Labels
Enhancement Extend or improve functionality JS JavaScript language support

Comments

@glerchundi
Copy link
Contributor

Are you open for a PR supporting javascript/typescript?

@rodaine
Copy link
Member

rodaine commented Nov 1, 2018

Totally!

@rodaine rodaine added the Enhancement Extend or improve functionality label Nov 1, 2018
@4nte
Copy link

4nte commented Nov 2, 2018

@glerchundi Are you planning to work on this?

@glerchundi
Copy link
Contributor Author

@AnteGulin probably in January but we need to first discuss the approach of course:

And probably much more question, any thoughts?

@glerchundi
Copy link
Contributor Author

/cc @aberasarte

@NeoCN
Copy link

NeoCN commented Mar 21, 2019

any update on this ?

@rodaine
Copy link
Member

rodaine commented Mar 22, 2019

Only pure javascript?

I think pure JS with TS stubs is the way to go, if that makes sense.

Typescript is typically used in an Angular application which usually per-property validations were better than a one and only Validate method. Maybe include this per-property in pure javascript and then type definitions on those?

For consistency with the rest of the languages, a single validate is preferred. While some of these implementations fail fast, if desired the function can gather all violations into a single error for per-property introspection. That said, if you want to go beyond that and provide per-property, I think that's fine too.

What to do with RE2 validations? protocolbuffers/protobuf#53

This isn't implemented yet, and is meant for validating that the value of a field is a valid regex, not that the value matches a regex. I'd not worry about this at the moment.

@rodaine rodaine added the JS JavaScript language support label Mar 22, 2019
@Shivam010
Copy link

@glerchundi @rodaine
Any update on this?
If any help is needed I am open for this...

@glerchundi
Copy link
Contributor Author

As we want to have a full closed loop for the js code generation as well as the validation part of it, we're blocked on this: protocolbuffers/protobuf-javascript#65.

I think this can workaround by doing some seding after protoc, although it is a really awful solution :)

@Shivam010
Copy link

Ok then...

@smorel-plenty
Copy link
Contributor

Gently pining this ticket. Is it truly blocked on protocolbuffers/protobuf-javascript#65 it's hard to tell if that one is ever going to get fixed. Would it be possible to make some progress on this feature with the assumption that there are caveats (e.g. non-separability of the generated code modules)? Maybe even support by targeting another proto JS or TS generator?

@buzzdan
Copy link

buzzdan commented Dec 2, 2020

Watching..

@buzzdan
Copy link

buzzdan commented Jan 13, 2021

@glerchundi do you think theres any way around protocolbuffers/protobuf-javascript#65 ?

@thesayyn
Copy link

Gently pining this ticket. Is it truly blocked on protocolbuffers/protobuf-javascript#65 it's hard to tell if that one is ever going to get fixed. Would it be possible to make some progress on this feature with the assumption that there are caveats (e.g. non-separability of the generated code modules)? Maybe even support by targeting another proto JS or TS generator?

We can target the one that we created. We have the ability to iterate quicker than any other plugin out there. I am ready to implement the validation runtime here and get it working with https://github.com/thesayyn/protoc-gen-ts

The only thing that I need right now, a runtime implemented here.

thesayyn/protoc-gen-ts#65

@loeffel-io
Copy link

Would love to see a js/ts implementation

@buzzdan
Copy link

buzzdan commented Jul 13, 2022

@thesayyn any updates on this one ?

@derekperkins
Copy link

For anyone interested, this project (not mine), maps protoc-gen-validate grammar to an Open API spec, which then generates validation code. It's not perfect, but at least an option for anyone waiting on this to be resolved.
https://github.com/kollalabs/protoc-gen-openapi

@nickwinger
Copy link

actually i thought that buf (and connect-web) is primarly here to make the perfect support for web/java/typescriprt and grpc. Now i wonder why we don't have validation and a language such as go ?!? is preferred ?

@SpareShade
Copy link

just for reference connectrpc/connect-es#270

@elliotmjackson
Copy link
Contributor

Thanks for your feature request for TypeScript support. We appreciate your interest in enhancing the usability of pgv.

I wanted to let you know that we're actively working on adding TypeScript support in the protovalidate project. While this won't be implemented in protoc-gen-validate, we're excited about the possibilities it will bring to the Protobuf ecosystem.

With that said, I'll be closing this issue as we're addressing it in the protovalidate repository. If you have any more suggestions or questions, feel free to drop them our way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Extend or improve functionality JS JavaScript language support
Projects
None yet
Development

No branches or pull requests