Комментарии:
This took just about as long as building an entire app so…
ОтветитьYou can't call it a fix when there's no problem to begin with.
Ответить"env vars are hard" well u just made them 10 times harder
ОтветитьLollll
ОтветитьHow’s it work with eas and react native?
ОтветитьzodSchema.parse(process.env)
Ответитьsomething on javascriptian
ОтветитьWhy would I use that if I can just add 4 more lines of code instead of importing an external framework to do something easy af? Please guys, just write "You're typing process.env wrong" by Matt.
ОтветитьOver-engineering 💯
ОтветитьTheo, any way to use enums (strings) instead of just string?
ОтветитьLove it. SvelteKit also has something similar.
ОтветитьWrapper around zod parse(prosess.env) 🤷♂️ treeshake issue = next only
ОтветитьI've been using this for years 😂
Does your package support merging of .env, .env.local, .env.<environnement> and .env.<environnement>.local ?
That red swiggly line is one of the best creative thing, give a pat yourself on the back
ОтветитьEnv vars are a mess in React. This just makes me really appreciate the SvelteKit way (fully typed, checked at build because they're just direct imports, server/public separation). I like how this library has validation tho.
ОтветитьI frequently use env variables to tree shake in different envs at compile time. For example, any place you have process.env.NODE_ENV compiles to the actual value like "development", which tree shaking will interpret as a literal, which means "if ("development" === "production")" will tree shake out any code in this conditional. The approach in this package requires a runtime check which does not allow for tree shaking. Any thoughts on this tradeoff for this approach?
A common example is for things like integrated devtools that I don't want shipped to production
Oh my god. Please, don't you ever get bothered by the boilerplate? Like micro-optimizing everything makes everything esoteric and that's just terrible.
ОтветитьGuys is this not over engineering
ОтветитьI wonder if dotenv cannot be simirarly augmented. They already have checks and a loading mechanism, and it looks like zod could be used to check either the result or the initial environment variables.
ОтветитьThis is like the Pokémon evolution of dotenv
ОтветитьWhat the difference between znv and t3-env? Libraries almost identical
ОтветитьI'm a systems guy, not a web dev, so maybe I'm out of touch, but were people not doing this kind of validation anyway? I've done several projects that have been configurable with environment variables, and I always did validation checks when starting the program. It seems strange to me that you would need a library to do this. I mean, maybe it could cut down on a bit of boilerplate, but don't you still have to specify the validation logic somehow? Also, I thought environment variables were conventionally optional. If you absolutely must provide them because they don't have default variables, they're usually better off as either program arguments or in a config file.
ОтветитьMan, more crap to do basic stuff. Just stop. Less is more!
ОтветитьWhat is the difference to just plain Zod?
ОтветитьWhat is hard about env variables? I don't get it
ОтветитьI've been trying to figure out why my .env.local file isn't working for days and you made me realize its because of not using 'export default' in next config. thank god you were lazy!
ОтветитьSo you've reinvented config files again? Good job, it only took you 40 years 🥳
Ответитьbloatware...
ОтветитьThanks for giving a shout out to the engineer that actually built it
ОтветитьI used to have to `export FOO=bar`
But now I can add a new library, boilerplates, types, and build steps!
Job security achieved.
And of course nexxel is already there with the Nuxt adapter/integration PR! 🥵
ОтветитьHow is everyone OK with this... .env could be troublesome sometimes, but importing two new libs to just type check and pre-build validation???
ОтветитьOne thing i’ve been looking for is how to detect changes on the settings and have the system reactively adopt the new setting.
For ex - new timeout setting just applies it the api client. But a database url change re-establishes a db connection pool to a new server.
I wish JS devs could stop fixing things
ОтветитьTheo talk about Pulumi! I just went to a GDG meet where the spokesperson talked about it and how versatile it is with many different languages!
ОтветитьAudio is out of sync for me
ОтветитьI believe the issue with environment variables is generally that you don't know you need them until something breaks, then you need to find out what the values should be.
It is simply pain, and if not documented properly you'll just cry yourself to sleep at night.
It doesn't make sense to me, environment variables are controlled values set by the system owner, why should add complexity by validating them!
ОтветитьCool package. Embarrassing demo.
ОтветитьThat's super exciting Mr. Pedophile hanging around the soda machine at the arcade in 1985.
ОтветитьThis is a really awesome solution, my company uses infisical which is another really cool env variable solution. Would recommend!
ОтветитьThis package seems promising enough. I had similar issues with env files. I just used the cleanEnv function from the envalid package to fix them.
Ответитьi use env-var but i will try this
ОтветитьWhat's the extension at the bottom of the terminal?
ОтветитьOr just use a toml file ??
ОтветитьThey suck ass in NextJs for sure, but work great in SvelteKit.
Ответить