dai-shi / waku

⛩️ The minimal React framework
https://waku.gg
MIT License
4.52k stars 121 forks source link

unresolved environment variable `import.meta.env.WAKU_HYDRATE` #380

Closed himself65 closed 6 months ago

himself65 commented 8 months ago
image
himself65 commented 8 months ago

https://github.com/dai-shi/waku/blob/66339e5937e418ceec77c5b944bc28704f2ee7d9/packages/waku/src/client.ts#L21-L25

Should we add some waku env vars into this?

dai-shi commented 8 months ago

Is it TypeScript only issue? Why does it complain with Record<string, string>??

himself65 commented 8 months ago

I'm using WebStorm, let me see what happened on VSCode

himself65 commented 8 months ago

Ok, looks good on vscode

image
himself65 commented 8 months ago

OK,

  1. env is unresolved is IDE only issue: https://youtrack.jetbrains.com/issue/WEB-62135/Vite-import.env-is-unresolved
  2. I think we should declare WAKU_HYDRATE on top?
dai-shi commented 8 months ago

We could declare it if it helps. It feels somewhat internal and not super necessary. But, it doesn't hurt, so I'm fine.

(btw, I think there's room for improvement for better TypeScript support in general. Not only our internal implementations are 100% typed, but also public API isn't 100% typed.)

himself65 commented 8 months ago

I will keep this issue until we have enough users to question about such things

dai-shi commented 6 months ago

We no longer use import.meta.env.WAKU_HYDRATE. We don't know the future though.