Releases: WJSoftware/wj-config
v3.0.0-beta.1
What's Changed
Full Changelog: v2.0.2...v3.0.0-beta.1
TypeScript Explained
The new TypeScript support is super accurate. Learn about it in the wiki page about this.
v2.0.2
What's Changed
- build(deps-dev): bump typescript from 4.7.4 to 5.2.2 by @dependabot in #27
- fix(build): Test for out folder before attempting to remove it by @webJose in #31
- fix: Correct includeEnvironment() to specify IEnvironment instead of Environment by @webJose in #32
- fix: Enclose call to fetch() in try..catch for better unit testing experience by @webJose in #33
- chore(tests): Comment incomplete Dictionary tests to allow UT runs by @webJose in #34
New Contributors
- @dependabot made their first contribution in #27
Full Changelog: v2.0.0...v2.0.2
v2.0.0
v2.0.0-rc3
- Minor performance improvement on how URL-building functions work
- fix: Prefixed all instances of
window
withglobalThis
so NodeJS won't complain.
v2.0.0-rc2
v2.0.0-rc2
Create URL's using window.location
It was not previously possible in browser scenarios to create a relative URL with a different protocol (for example, to initiate web sockets with the current host). Now this is possible. The created URL will of course be an absolute URL, but it will use the value of window.location.hostname
, making it unnecessary to configure host names or do concatenation outside the URL-building functions.
Example
{
"ws": {
"api": {
"rootPath": "/api",
...
},
"sockets": {
"scheme": "wss",
"rootUrl": "/sockets",
"chat": "/livechat"
}
}
}
With a configuration JSON similar to the one shown, the URL-building function config.ws.sockets.chat()
would return an absolute URL using the wss
scheme and whatever host is in window.location.hostname
.
FetchedConfig Renamed
The data source FetchedConfigDataSource
has been renamed to FetchedDataSource
, and its corresponding builder function has been renamed from addFetchedConfig()
to addFetched()
.
Intellisense Corrections
Some Intellisense metadata was outdated. It should be up to date now.
IBuilder.addSingleValue()'s Intellisense Spit into Two Overloads
The functionality of the function was not changed, nor did the data source changed. The interpretation of the parameters, however, changed to accomodate two overloads. Intellisense should show you the new correct way of calling this data source function.
Dictionary Validation
Validation of the provided dictionary (flat) object has been improved to detect non-flat objects early, specifically during construction of the data source.
Delayed Functions Can Now Be Asynchronous
In the past release, all data sources gained the ability to accept as main data argument a function that returned the data instead of directly providing the data. This enhancement responded to the need to avoid wasted CPU cycles loading data sources that are conditioned and therefore may end up not being needed. The problem: The functions had to be synchronous. This update allows the functions to be asynchronous.
v2.0.0-rc.1
- Minor fixes for bugs found while adding unit tests.
- Deleted ComputedDataSource. Use
addObject()
instead ofaddComputed()
.
v2.0.0-rc.0
Conditional Data Source Addition
- Adds the
when()
builder function to condition the addition of a data source. - Defines the current environment as an object with a
name
andtraits
property. - Adds the
whenAllTraits()
andwhenAnyTrait()
builder functions to condition data sources based on the traits of the current environment. - Adds the
forEnvironment()
andaddPerEnvironment()
as a new way to add per-environment configuration based on conditionals.
v1.1.0
v1.0.2
Initial Release
First Release