Go all in on TypeScript #200
Replies: 11 comments 17 replies
-
Same here! |
Beta Was this translation helpful? Give feedback.
-
Thank you @phifa and @arnaudbzn for the suggestion! Hydrogen's core components are all written in TypeScript, and those types are exposed. The output of That said, I think it would be a great future enhancement to add an option for |
Beta Was this translation helpful? Give feedback.
-
Same here! |
Beta Was this translation helpful? Give feedback.
-
Exactly as phifa said, I don't know why you wouldn't want to use Typescript these days by default. I went to https://hydrogen.shopify.dev/ hoping to see a TS boilerplate, only to find a bootstrapped site full of JSX files. I am trying to start a new project and I currently don't know if I should use Shopify Hydrogen or NextJS with typescript! Fallen at the first hurdle :o/ |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
I have tried to change the hydrogen demo app to full TypeScript, but failed. |
Beta Was this translation helpful? Give feedback.
-
I'm hitting some interesting issues when trying to convert the default project to typescript: It seems to use a "not exposed index.html" when running dev, which means I can't change it from |
Beta Was this translation helpful? Give feedback.
-
How do we proceed? It looks like this request has more upvotes than any other. @blittle Any thoughts, plans how to move this forward? You said it is already written in TypeScript, so it should not be too wild, to make this work. I am certain, this will be a good investment and pull more devs to use and extend hydrogen. You can also write the documentation code examples in JS and TS, if you don't want to scare the JS devs. |
Beta Was this translation helpful? Give feedback.
-
@jplhomer Any updates on this? I assume the recent burst in general usage around TS would make this a VERY sought after feature including for myself... Side point it would be lovely to have on the docs site one of those tabs that lets you change code fragments between .js and .ts do you think that would be something the team would be able to develop? |
Beta Was this translation helpful? Give feedback.
-
We did it, folks: Hydrogen now ships with Hello World and Demo Store templates in TypeScript! |
Beta Was this translation helpful? Give feedback.
-
Just tried Hello World. I think there's a bug. The |
Beta Was this translation helpful? Give feedback.
-
I just saw the hydrogen demo from Tobi and got super excited! This looks like a fun stack to use! While looking through the docs one thing irritated me. All the examples I saw, were written in JavaScript, not TypeScript.
Is this intentionally to lower the barrier of entry? Is it possible to easily set up the custom storefront hydrogen project with TypeScript? And lastly, why not go all in on TypeScript, in the examples, in the docs and screencasts?
I just did a quick local setup of a hydrogen project. Since it is packaged with vite, you can rename the files to tsx files and make it work, sort of. Of course now all types are missing and have to be added. It would be awesome to make this more configurable, like you know it from next.js:
yarn create next-app --typescript
.Anyways, would love to hear some core devs talk about the choices they made with TypeScript.
Beta Was this translation helpful? Give feedback.
All reactions