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

Document Constraint Types in Code #444

Merged
merged 4 commits into from
Sep 5, 2023
Merged

Conversation

georg-schwarz
Copy link
Member

This mechanism is similar to the current jv code generation to self-document blocktypes.

Exerpt:
image

I noticed some issue with Jayvee having no concept for INFINITY. Still, I'd vote to integrate this feature nevertheless.
image

Copy link
Contributor

@rhazn rhazn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand this right this introduces builtin constraintypes without added logic and parses the ones from our Typescript code into a simulated stdlib jayvee code, right? If so, sounds like a good first step, mediumterm I think it would be good to go from actual jv code to our metainf.

I disagree on the Infinity being okay though, I think we should never generate invalid jayvee code. I left a comment on how I think we can avoid that. Otherwise I am happy with this.

@georg-schwarz
Copy link
Member Author

If I understand this right this introduces builtin constraintypes without added logic and parses the ones from our Typescript code into a simulated stdlib jayvee code, right? If so, sounds like a good first step, mediumterm I think it would be good to go from actual jv code to our metainf.

Correct. It is the first step towards turning the mechanism around. The idea is to have this syntax as comparison now to the meta-inf in order to see what else we need to go this step. I think the only thing we need is to express validations that concern multiple properties of the constraints (e.g., minLength <= maxLength).

I disagree on the Infinity being okay though, I think we should never generate invalid jayvee code. I left a comment on how I think we can avoid that. Otherwise I am happy with this.

Done!

@georg-schwarz georg-schwarz merged commit 76a4430 into main Sep 5, 2023
2 checks passed
@georg-schwarz georg-schwarz deleted the constraint-code-docs branch September 5, 2023 13:04
@github-actions github-actions bot locked and limited conversation to collaborators Sep 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants