-
-
Notifications
You must be signed in to change notification settings - Fork 161
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
Typescript error when importing SimpleSchema #742
Comments
Thank you for submitting this issue! We, the Members of Meteor Community Packages take every issue seriously. However, we contribute to these packages mostly in our free time. If you think this issue is trivial to solve, don't hesitate to submit Please also consider sponsoring the maintainers of the package. |
Hi @bruceborrett there is not types definition yet. Are you experienced with TypeScript? I am not yet so I need help to provide one. If you would consider adding one then feel free to open a PR |
Well, the simpl-schema NPM package is written completely in Typescript, so the definitions are already there, for some reason they just not being made available when installed as part of this Meteor package. |
@bruceborrett ah I see now. The Simple Schema NPM package dropped Meteor support in their 3.x major release, which is why this package is a hard-fork of the latest Meteor compatible version 1.13.1 which at that time did not contain any typescript code. This also why we just can't copy the type definitions from the NPM repo as they are not reflecting the code in this Meteor package. Edit_ Note, that with the dropped Meteor support there will also be trouble with async in Meteor 3.0 if you continue to use the npm package as we need basically all computable fields to be async-compatible in order to support any validations or computed properties that involve Mongo Collection calls. |
I see, so then, in my opinion, this package should never have been forked, the latest simpl-schema is still perfectly compatible with Meteor (its framework agnostic now) and is being well maintained. It is in fact the Collection2 package which is no longer compatible with simpl-schema, and Collection2 acts as the glue between simpl-schema and Meteor. In my opinion Collection2 should rather be updated to work with the latest simpl-schema, perhaps it can even be extended to support other validation libraries such as Zod and Yup etc. |
I want to close this ticket and rather look at updating the collection2 package to support the latest simpl-schema, unless anyone can tell me why thats the wrong approach? |
I just installed this package and when I try to import SimpleSchema I get the following Typescript error:
The text was updated successfully, but these errors were encountered: