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

add typescript #32

Closed
macrozone opened this issue Mar 4, 2019 · 7 comments
Closed

add typescript #32

macrozone opened this issue Mar 4, 2019 · 7 comments
Labels
wontfix This will not be worked on

Comments

@macrozone
Copy link
Contributor

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

@pozylon
Copy link
Member

pozylon commented Mar 4, 2019

These kind of issues are not because of missing type checking but because of missing tests

@pozylon
Copy link
Member

pozylon commented Mar 4, 2019

I basically share the opinion of https://medium.com/javascript-scene/the-typescript-tax-132ff4cb175b

@pozylon pozylon added the wontfix This will not be worked on label Mar 4, 2019
@macrozone
Copy link
Contributor Author

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

These kind of issues are not because of missing type checking but because of missing tests

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.

@pozylon
Copy link
Member

pozylon commented Mar 5, 2019

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.

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.

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.

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:
https://github.com/jupl/DefinitelyTyped/tree/add-next/types/next

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.

@pozylon pozylon closed this as completed Mar 5, 2019
@pozylon pozylon mentioned this issue Mar 5, 2019
@pozylon
Copy link
Member

pozylon commented Jul 7, 2019

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.

@schmidsi
Copy link
Member

schmidsi commented Jul 9, 2019

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 ;)

@macrozone
Copy link
Contributor Author

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.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants