-
-
Notifications
You must be signed in to change notification settings - Fork 110
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
Support TypeScript #28
Comments
What type of support would you want exactly? This will run perfectly fine inside TypeScript, at least in theory. |
He probably meant to provide typings (@types/v8n) |
Azael05x is write. Needs @types/v8n for compile time type checking. |
I've submitted declarations for publishing. I will update with the status here! |
Thank you so much @sebastianbarfurth. Very great job! |
If the types are official, there's no reason to use @types. Just inclide the .d.ts files in the repo itself. Then there will be no compatibility issues and we'll know it's always up to date. You only install one package - if you're using TS it just works and if you're using JS it's ignored. Better yet, rewrite the whole thing in TypeScript ;) |
@lazarljubenovic According to the docs the @types approach is favored for non TypeScript applications, so I'm trying to go with standards here. I do see your point, I believe rewriting to TypeScript for the core is useful anyway. When that happens the types can move into the project. For switching to TypeScript @imbrn would need to agree. It's a fairly simple switch, if we wanna do it I can probably do it today or tomorrow. It's especially nice because it introduces no changes to the resulting code, it's merely a help in development and makes everything work a bit smoother. |
I actually feel like converting to TypeScript sooner rather than later would be a good thing. Just as an aside. |
Go ahead and do that! This is the last thing we need to do before releasing version 1.1. 🎉🎉 |
I'm nearly done, but I can't find a way to make type definitions for a Proxy based approach, since the names of functions aren't known. |
Maybe we should keep this feature out of the next version, and then we can think about it better. |
@imbrn Yeah, I wanna do docs first and I will go ahead with this for 1.2.0. |
@sebastianbarfurth This library has a lot of dynamic behavior, and I think this is great. So, we really need to talk about how we can make this work for TypeScript. Maybe it needs some code refactoring to make it a little less dynamic, but this is something we quite need to discuss before though. |
I agree. I have done a lot of work on this with TypeScript and it adds a lot of consistency and insight into code quality, but the dynamic parts are hard to represent. Will revisit for a later version. |
Ok |
Removing this from 1.2.0 since this requires some additional refactoring before-hand. |
Awesome library! Everything else is perfectly typable. |
Is there any update on this? I'd love to use it, but lack of typings is a bit of a deal breaker for work related projects |
@BottlecapDave I felt the same way regarding this being the best library I could find for fluent validation, but I didn't see a way to easily address this Typescript issue and (perhaps more importantly) the lack of human-readable error messages. Therefore, I created a new one: https://github.com/trevorr/tsfv. Maybe it will meet your needs. |
Awesome lib, but not been able to use it with Angular 8. Looking forward to the typescript version. Thank you! |
You can use it with any framework, you just won't get types. |
Using v8n with Angular |
Has there been any progress on this lately? If Typescript support isn't coming soon for v8n, I'm afraid that we'll have no choice but to switch to a different validation toolkit. |
@GustavTaxen and the rest: Just created #178. |
Hi, just so you all are aware. I've forked the repository and published a version of it (with very basic typings) to npm under the name v8n.ts My intentions are for this to be a temporary package that should be deprecated once this issue is resolved. |
Thank you!
The text was updated successfully, but these errors were encountered: