hydrogen
hydrogen copied to clipboard
create-app bugs and improvements
It works! But let's clean up a few of these "broken windows" which otherwise make the experience seem sub-par.
- [x] Show a progress bar while deps are being installed (probably comes for free in CLIKit new version once it's compat?)
- [x] ESLint shows errors due to spacing of imports, and usage of
"
instead of'
. This is due to the ESLint rules we have connected, which arehydrogen/recommended
. We should format this code as part of the init process. - [ ] The JS conversion for e.g. hello-world displays an invalid
HydrogenSession
inserver.js
. The instance properties are still in the class definition, which isn't valid JS. We should find a way to fix this. - [x] Update README in templates - use the v1 repo for reference
- [x] try/catch errors for
fetch
when Node version < v18. I'm OK with requiring v18 since it's been out a while, but we absolutely need to make it more clear in the error message since that'll be the first interaction for a lot of people.
- [ ] Allow any repo url (including third party) as the
template
flag. Example--template https://github.com/{user}/{repo>}
and even--template {user}/{repo}
Show a progress bar while deps are being installed (probably comes for free in CLIKit new version once it's compat?)
Yeah, we'll get that once we upgrade to the latest CLI-kit.
ESLint shows errors due to spacing of imports, and usage of " instead of '. This is due to the ESLint rules we have connected, which are hydrogen/recommended. We should format this code as part of the init process.
We are indeed formatting the files but using the local config. I suspect this works in the monorepo because it can find a local config, but it doesn't in standalone apps. I will add a default config.
The JS conversion for e.g. hello-world displays an invalid HydrogenSession in server.js. The instance properties are still in the class definition, which isn't valid JS. We should find a way to fix this.
I'm not sure what you mean. Public class fields seem to be supported, so the only "issue" is that they go from private to public. Or are you talking about something else? 🤔
try/catch errors for fetch when Node version < v18. I'm OK with requiring v18 since it's been out a while, but we absolutely need to make it more clear in the error message since that'll be the first interaction for a lot of people.
I've found that node-fetch
is already included in CLI-kit so we can just use that instead, which means we support Node 16. That will probably prevent a lot of problems.
--
Some of this is addressed in https://github.com/Shopify/h2/pull/435
@frandiox not sure tbh. Looks like eslint is tripping up? Maybe it's targeting a version of JS that doesn't support public class fields?
Hmm... I don't get those errors in my local projects 🤔 Maybe we need to update the ESLint dep or ES target?