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

feat: implement type safety #7

Merged
merged 12 commits into from
May 13, 2024
Merged

feat: implement type safety #7

merged 12 commits into from
May 13, 2024

Conversation

TomerAberbach
Copy link
Owner

@TomerAberbach TomerAberbach commented May 12, 2024

  • Implement type-level checking of graph constraints
  • The above requires an API change, to separate the keys representing a task from the task function
  • Delete debug runtime validation entrypoint since the type-level validation takes care of it
  • Reduce bundle size
  • Increase test coverage
  • Deprecate grfnviz since it's a pain to maintain and no one seems to be using it
  • Require node 18

@TomerAberbach TomerAberbach marked this pull request as draft May 12, 2024 01:32
@TomerAberbach TomerAberbach marked this pull request as ready for review May 12, 2024 22:14
@TomerAberbach
Copy link
Owner Author

@maraisr since you're one of the people I know uses this, do you have any feedback? Does this look good to you at a high-level?

@maraisr
Copy link
Contributor

maraisr commented May 13, 2024

This is such an wonderful pull request! 🎉 Thank you so much!!

Was messing around with it, and stumbled upon this nugget. Being able to detect a single output vertex is such a major win for stability and assurance.

image

I'd say ship it! :shipit: 🚀

My only critique (though pales in comparison to the wins) is that I was unable to get autocomplete for dependencies, but its no biggy.

Example
let get = grfn({
	get_post,
	get_comments: [get_comments, ['get_post']],
	get_author: [get_author, ['get_post']],
	format: [
		(comments: string, post: string, author: string) => {
			return {
				comments,
				post,
				author
			};
		},
		['get_comments', 'get_post', 'get_au ▌']
//                                                   ^ expected intellisense to provide me with "get_author"
	]
});

let result = await get('my-post');
console.log(`result: %o`, result);

readme.md Show resolved Hide resolved
@TomerAberbach
Copy link
Owner Author

This is such an wonderful pull request! 🎉 Thank you so much!!

Was messing around with it, and stumbled upon this nugget. Being able to detect a single output vertex is such a major win for stability and assurance.

image

I'd say ship it! :shipit: 🚀

My only critique (though pales in comparison to the wins) is that I was unable to get autocomplete for dependencies, but its no biggy.

Example

Glad it's working well for you! Agreed that autocomplete for dependencies would be nice. Might very well be possible to support...

Co-authored-by: Marais Rossouw <[email protected]>
@TomerAberbach TomerAberbach changed the title Implement type safety feat: implement type safety May 13, 2024
@TomerAberbach TomerAberbach merged commit 372df02 into main May 13, 2024
8 checks passed
@TomerAberbach TomerAberbach deleted the feat/type-safe branch May 13, 2024 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants