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

Typescript error when importing SimpleSchema #742

Open
bruceborrett opened this issue Feb 1, 2024 · 6 comments
Open

Typescript error when importing SimpleSchema #742

bruceborrett opened this issue Feb 1, 2024 · 6 comments

Comments

@bruceborrett
Copy link

I just installed this package and when I try to import SimpleSchema I get the following Typescript error:

image

  • Meteor version: 2.14
Copy link

github-actions bot commented Feb 1, 2024

Thank you for submitting this issue!

We, the Members of Meteor Community Packages take every issue seriously.
Our goal is to provide long-term lifecycles for packages and keep up
with the newest changes in Meteor and the overall NodeJs/JavaScript ecosystem.

However, we contribute to these packages mostly in our free time.
Therefore, we can't guarantee your issues to be solved within certain time.

If you think this issue is trivial to solve, don't hesitate to submit
a pull request, too! We will accompany you in the process with reviews and hints
on how to get development set up.

Please also consider sponsoring the maintainers of the package.
If you don't know who is currently maintaining this package, just leave a comment
and we'll let you know

@jankapunkt
Copy link
Member

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

@bruceborrett
Copy link
Author

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.

@jankapunkt
Copy link
Member

jankapunkt commented Feb 1, 2024

@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.

@bruceborrett
Copy link
Author

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.

@bruceborrett
Copy link
Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants