Skip to content

v0.51.0

Choose a tag to compare

@github-actions github-actions released this 29 Oct 18:07
· 277 commits to main since this release
53695cc

Minor Changes

  • #452 fb0ae8b Thanks @mattiamanzati! - Add strictEffectProvide diagnostic to warn when using Effect.provide with Layer outside of application entry points

    This new diagnostic helps developers identify potential scope lifetime issues by detecting when Effect.provide is called with a Layer argument in locations that are not application entry points.

    Example:

    // Will trigger diagnostic
    export const program = Effect.void.pipe(Effect.provide(MyService.Default));

    Message:

    Effect.provide with a Layer should only be used at application entry points. If this is an entry point, you can safely disable this diagnostic. Otherwise, using Effect.provide may break scope lifetimes. Compose all layers at your entry point and provide them at once.

    Configuration:

    • Default severity: "off" (opt-in)
    • Diagnostic name: strictEffectProvide

    This diagnostic is disabled by default and can be enabled via tsconfig.json:

    {
      "compilerOptions": {
        "plugins": [
          {
            "name": "@effect/language-service",
            "diagnosticSeverity": {
              "strictEffectProvide": "warning"
            }
          }
        ]
      }
    }

Patch Changes