Logo

dev-resources.site

for different kinds of informations.

Effect 3.11 (Release)

Published at
12/2/2024
Categories
releases
effect
typescript
Author
mirelaprifti
Categories
3 categories in total
releases
open
effect
open
typescript
open
Author
12 person written this
mirelaprifti
open
Effect 3.11 (Release)

Authored by Tim Smart

Effect 3.11 has been released! This release includes a number of new features and improvements. Here’s a summary of what’s new:

Effect.fn

The Effect.fn api allows you to create a function that is automatically traced, and also attaches the location where the function was called to any error traces.

It also doubles as a pipe function, allowing you to create a pipeline after the function definition.


1 import { Effect } from "effect"

2

3 const logExample = Effect.fn("example")(function* <N extends number>(n: N) {

4 yield* Effect.annotateCurrentSpan("n", n)

5 yield* Effect.logInfo(`got: ${n}`)

6 yield* Effect.fail(new Error())

7 }, Effect.delay("1 second"))

8

9 Effect.runFork(logExample(100).pipe(Effect.catchAllCause(Effect.logError)))

Enter fullscreen mode Exit fullscreen mode

 

Time zone support in Cron

Cron expressions using the Cron module now support time zones. You can specify a time zone when creating a cron instance when using Cron.make or Cron.parse.

 

Context.Reference

You can now create a Context.Tag that also has a default value.


1 import { Context } from "effect"

2

3 export class SpecialNumber extends Context.Reference<SpecialNumber>()(

4 "SpecialNumber",

5 { defaultValue: () => 2048 }

6 ) {}

Enter fullscreen mode Exit fullscreen mode

 

Micro runtime changes

Micro execution is now using a fiber-runtime based model. This results in the following benefits:

  • Improved performance
  • Improved interruption model
  • Consistency with the Effect data type

Env & EnvRef have been removed in favour of Context.Reference.

 

Effect.scopedWith

Effect.scopedWith allows you to create & use a Scope without adding it to the Effect’s requirements.


1 import { Effect, Scope } from "effect"

2

3 Effect.scopedWith((scope) => Scope.addFinalizer(scope, Effect.log("finalized")))

Enter fullscreen mode Exit fullscreen mode

 

BigDecimal updates

  • BigDecimal.toExponential added - format a BigDecimal as a string in exponential notation.
  • BigDecimal.fromNumber has been deprecated in favour of BigDecimal.unsafeFromNumber.

 

Other changes

There were several other smaller changes made. Take a look through the CHANGELOG to see them all: CHANGELOG.

Don’t forget to join our Discord Community to follow the latest updates and discuss every tiny detail!

releases Article's
30 articles in total
Favicon
GrowthBook Version 3.4
Favicon
Laravel 11.30: A Leap Forward in Testing, Model IDs, and Authorization
Favicon
Documentation Release Notes - December 2024
Favicon
Effect 3.12 (Release)
Favicon
Documentation Release Notes - November 2024
Favicon
Changelog 2024/48 aka We 🖤 Svelte 5
Favicon
Documentation Release Notes - October 2024
Favicon
Documentation Release Notes - September 2024
Favicon
Documentation Release Notes - August 2024
Favicon
GrowthBook Version 3.3
Favicon
Effect Website 2.0 (Release)
Favicon
Effect 3.11 (Release)
Favicon
Create Effect App (Release)
Favicon
GrowthBook Version 3.2
Favicon
Workday Releases: A Strategic Approach for Continuous Improvement
Favicon
Unveiling the Benefits of Testing Platform in New Oracle Releases
Favicon
문서 릴리즈 노트 - 2024년 6월
Favicon
Dokumentation Versionshinweise - Juni 2024
Favicon
Notes de mise à jour de la documentation - juin 2024
Favicon
Documentation Release Notes - June 2024
Favicon
Informacje o wersji dokumentacji - czerwiec 2024 r.
Favicon
Notes de mise à jour de la documentation - mai 2024
Favicon
문서 릴리즈 노트 - 2024년 5월
Favicon
Dokumentation Versionshinweise - Mai 2024
Favicon
ドキュメント・リリースノート - 2024年5月
Favicon
Informacje o wersji dokumentacji - maj 2024 r.
Favicon
Documentation Release Notes - May 2024
Favicon
ドキュメント・リリースノート - 2024年6月
Favicon
Making Releases Routine
Favicon
Introducing AG Charts Enterprise

Featured ones: