![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
github.com/cristalhq/aconfig
Simple, useful and opinionated config loader.
There are many solutions regarding configuration loading in Go. I was looking for a simple loader that is as easy to use and understand as possible. The goal was to load config from 4 places: defaults (in the code), files, environment variables, command-line flags. This library works with all of these sources.
Go version 1.14+
go get github.com/cristalhq/aconfig
type MyConfig struct {
Port int `default:"1111" usage:"just give a number"`
Auth struct {
User string `required:"true"`
Pass string `required:"true"`
}
Pass string `default:"" env:"SECRET" flag:"sec_ret"`
}
var cfg MyConfig
loader := aconfig.LoaderFor(&cfg, aconfig.Config{
// feel free to skip some steps :)
// SkipDefaults: true,
// SkipFiles: true,
// SkipEnv: true,
// SkipFlags: true,
EnvPrefix: "APP",
FlagPrefix: "app",
Files: []string{"/var/opt/myapp/config.json", "ouch.yaml"},
FileDecoders: map[string]aconfig.FileDecoder{
// from `aconfigyaml` submodule
// see submodules in repo for more formats
".yaml": aconfigyaml.New(),
},
})
// IMPORTANT: define your own flags with `flagSet`
flagSet := loader.Flags()
if err := loader.Load(); err != nil {
panic(err)
}
// configuration fields will be loaded from (in order):
//
// 1. defaults set in structure tags (see MyConfig defenition)
// 2. loaded from files `file.json` if not `ouch.yaml` will be used
// 3. from corresponding environment variables with the prefix `APP_`
// 4. command-line flags with the prefix `app.` if they are
Also see examples: examples_test.go.
Integration with spf13/cobra
playground.
See these docs.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.