-
Notifications
You must be signed in to change notification settings - Fork 17
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
add typescript #32
Comments
These kind of issues are not because of missing type checking but because of missing tests |
I basically share the opinion of https://medium.com/javascript-scene/the-typescript-tax-132ff4cb175b |
@pozylon this article makes the typical false assumption, that you spend more time writing code then reading code, which is wrong. In particular in frameworks and libraries. Having types at least at the surface of unchained would help to extend and refactor it, in particular, because you uses classes to extend to implement new functionality.
true, but you have neither in this case. Its also not (only) about preventing errors, but also about modeling with more thought. That's why i love graphql, you start with the model. In unchained, you pass around orders, deliveries, etc. having types would help to have a clear shape for these objects, while currently, these objects are not always well-defined. |
I can't see that assumption in the text. I'm also a big fan of typed languages which heavily use type inference like Swift and know their advantages, maybe Typescript will be there someday and will become the most popular language in the Node.js cosmos. Until then, I would like to wait. After all, typescript compiles to js and introduces an indirection. Maybe it's easier to model when you have types, but it's also harder to find people at the moment that can write Typescript compared to plain old JS. And also, even if we introduced a typed programming language for unchained, why not https://reasonml.github.io which seems much more elegant and has all the cool things like pattern matching (https://reasonml.github.io/docs/en/pattern-matching#docsNav). Maybe we can have Swift with WebAssembly running in Node side-by-side with our JS dependencies in 2-3 months.
Yeah, having type definition files for the surface like it has been done for Zeit's next.js seems like a good thing helping the Typescript developers use unchained in their projects: We are going to shift our work at unchained massively to tests and documentation during this year, it's extremely important that Unchained get's some tests. Going to close this for the moment. Let's reconsider this at the end of year. |
Just found out about Deno in Hacker news and tried it out. If we can migrate from meteor to https://deno.land I'm also all in on Typescript. But there is no ecosystem atm., let's see what momentum does. At least there is a chance to convince the js community thanks to Ryan Dahl. |
I follow the Deno project since more than a year and I'm not sure if it picks up steam. But if we fully migrate to TypeScript we would be ready for deno ;) |
i would not wait for deno. It does not really solve any problem. I would introduce typescript asap at places where it makes sense, e.g. business logic. concerning the future of unchained: i would rebuild around node and prisma2/nexus. Then you could give developers the power to extend the whole application schema easily, with typesafety, relations, etc. |
Issues like #31 show that some type checking is necessary for a project like that.
maybe we can start with porting some packages like order and delivery to typescript
The text was updated successfully, but these errors were encountered: