#2903799aa20 Thanks @rocwang! - # Make baseUrl() more defensive in @effect/platform
Sometimes, third party code may patch a missing global location to accommodate for non-browser JavaScript
runtimes, e.g. Cloudflare Workers,
Deno. Such patch
might not yield a fully valid location. This could
break baseUrl(), which is called by makeUrl().
For example, the following code would log Invalid URL: '/api/v1/users' with base 'NaN'.
import { makeUrl } from "@effect/platform/Http/UrlParams";
globalThis.location = { href: "" };
const url = makeUrl("/api/v1/users", []);
// This would log "Invalid URL: '/api/v1/users' with base 'NaN'",
// because location.origin + location.pathname return NaN in baseUrl()
console.log(url.left.message);
Arguably, this is not an issue of Effect per se, but it's better to be defensive and handle such cases gracefully.
So this change does that by checking if location.orign and location.pathname are available before accessing them.
#2903799aa20 Thanks @rocwang! - # Make baseUrl() more defensive in @effect/platform
Sometimes, third party code may patch a missing global location to accommodate for non-browser JavaScript
runtimes, e.g. Cloudflare Workers,
Deno. Such patch
might not yield a fully valid location. This could
break baseUrl(), which is called by makeUrl().
For example, the following code would log Invalid URL: '/api/v1/users' with base 'NaN'.
import { makeUrl } from "@effect/platform/Http/UrlParams";
globalThis.location = { href: "" };
const url = makeUrl("/api/v1/users", []);
// This would log "Invalid URL: '/api/v1/users' with base 'NaN'",
// because location.origin + location.pathname return NaN in baseUrl()
console.log(url.left.message);
Arguably, this is not an issue of Effect per se, but it's better to be defensive and handle such cases gracefully.
#29264c6bc7f Thanks @gcanti! - Add propertyOrder option to ParseOptions to control the order of keys in the output, closes #2925.
The propertyOrder option provides control over the order of object fields in the output. This feature is particularly useful when the sequence of keys is important for the consuming processes or when maintaining the input order enhances readability and usability.
By default, the propertyOrder option is set to "none". This means that the internal system decides the order of keys to optimize parsing speed. The order of keys in this mode should not be considered stable, and it's recommended not to rely on key ordering as it may change in future updates without notice.
Setting propertyOrder to "input" ensures that the keys are ordered as they appear in the input during the decoding/encoding process.
#29264c6bc7f Thanks @gcanti! - Add propertyOrder option to ParseOptions to control the order of keys in the output, closes #2925.
The propertyOrder option provides control over the order of object fields in the output. This feature is particularly useful when the sequence of keys is important for the consuming processes or when maintaining the input order enhances readability and usability.
By default, the propertyOrder option is set to "none". This means that the internal system decides the order of keys to optimize parsing speed. The order of keys in this mode should not be considered stable, and it's recommended not to rely on key ordering as it may change in future updates without notice.
Setting propertyOrder to "input" ensures that the keys are ordered as they appear in the input during the decoding/encoding process.
The timeToLiveStrategy determines how items are invalidated. If set to
"creation", then items are invalidated based on their creation time. If set
to "usage", then items are invalidated based on pool usage.
By default, the timeToLiveStrategy is set to "usage".
This option allows you to specify the level of concurrent access per pool item.
I.e. setting concurrency: 2 will allow each pool item to be in use by 2 concurrent tasks.
targetUtilization determines when to create new pool items. It is a value
between 0 and 1, where 1 means only create new pool items when all the existing
items are fully utilized.
A targetUtilization of 0.5 will create new pool items when the existing items are
50% utilized.
#283767f160a Thanks @KhraksMamtsov! - Introduced Redacted<out T = string> module - Secret generalization
Secret extends Redacted
The use of the Redacted has been replaced by the use of the Redacted in packages with version 0.*.*
The timeToLiveStrategy determines how items are invalidated. If set to
"creation", then items are invalidated based on their creation time. If set
to "usage", then items are invalidated based on pool usage.
By default, the timeToLiveStrategy is set to "usage".
This option allows you to specify the level of concurrent access per pool item.
I.e. setting concurrency: 2 will allow each pool item to be in use by 2 concurrent tasks.
targetUtilization determines when to create new pool items. It is a value
between 0 and 1, where 1 means only create new pool items when all the existing
items are fully utilized.
A targetUtilization of 0.5 will create new pool items when the existing items are
50% utilized.
Bumps the production-dependencies group with 7 updates in the / directory:
0.36.40
0.36.43
0.55.5
0.56.0
0.51.5
0.51.8
0.33.24
0.33.26
0.33.24
0.33.26
0.67.18
0.67.21
3.2.8
3.3.0
Updates
@effect/cli
from 0.36.40 to 0.36.43Release notes
Sourced from
@effect/cli
's releases.Changelog
Sourced from
@effect/cli
's changelog.Commits
856024c
Version Packages (#2936)67f160a
IntroduceRedacted\<T>
module (#2856)8bc3822
Version Packages (#2928)61e8edb
fix print to stdout of cli (#1812) (#2920)ae55d07
Version Packages (#2911)Updates
@effect/platform
from 0.55.5 to 0.56.0Release notes
Sourced from
@effect/platform
's releases.... (truncated)
Changelog
Sourced from
@effect/platform
's changelog.... (truncated)
Commits
856024c
Version Packages (#2936)188f0a5
parse URL instances when creating client requests (#2924)2b9ddfc
support new Pool options in /platform WorkerPool (#2876)67f160a
IntroduceRedacted\<T>
module (#2856)8bc3822
Version Packages (#2928)a67d602
ensure pre-response handler is checked after running the user-provided http a...ae55d07
Version Packages (#2911)799aa20
Make baseUrl() more defensive in@effect/platform
(#2903)Updates
@effect/platform-node
from 0.51.5 to 0.51.8Release notes
Sourced from
@effect/platform-node
's releases.Changelog
Sourced from
@effect/platform-node
's changelog.Commits
856024c
Version Packages (#2936)188f0a5
parse URL instances when creating client requests (#2924)8bc3822
Version Packages (#2928)ae55d07
Version Packages (#2911)Updates
@effect/printer
from 0.33.24 to 0.33.26Release notes
Sourced from
@effect/printer
's releases.Changelog
Sourced from
@effect/printer
's changelog.Commits
856024c
Version Packages (#2936)ae55d07
Version Packages (#2911)Updates
@effect/printer-ansi
from 0.33.24 to 0.33.26Release notes
Sourced from
@effect/printer-ansi
's releases.Changelog
Sourced from
@effect/printer-ansi
's changelog.Commits
856024c
Version Packages (#2936)ae55d07
Version Packages (#2911)Updates
@effect/schema
from 0.67.18 to 0.67.21Release notes
Sourced from
@effect/schema
's releases.... (truncated)
Changelog
Sourced from
@effect/schema
's changelog.... (truncated)
Commits
856024c
Version Packages (#2936)67f160a
IntroduceRedacted\<T>
module (#2856)8bc3822
Version Packages (#2928)7fcdb92
propertyOrder: do not add missing optional values (#2930)4c6bc7f
AddpropertyOrder
option toParseOptions
to control the order of … (#2926)ae55d07
Version Packages (#2911)cd7496b
Add support forAST.Literal
inSchema.TemplateLiteral
, closes #2913 (#2916)349a036
Schema: align constructors arguments (#2915)Updates
effect
from 3.2.8 to 3.3.0Release notes
Sourced from effect's releases.
... (truncated)
Changelog
Sourced from effect's changelog.
... (truncated)
Commits
856024c
Version Packages (#2936)0f40d98
add concurrency control to Pool options (Superseded by #361.