Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version Packages #55

Merged
merged 1 commit into from
Mar 1, 2025
Merged

Version Packages #55

merged 1 commit into from
Mar 1, 2025

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Jan 21, 2025

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

@effect/[email protected]

Minor Changes

  • #54 19e5a77 Thanks @mattiamanzati! - - Update internal version of effect from 2.x beta to 3.12.5

    • Remove adapter from gen refactors
  • #56 5b2b27c Thanks @mattiamanzati! - Add support for Effect diagnostics

    With this release of the language service plugin, we aim to improve the overall Effect experience by providing additional diagnostics that tries to fix misleading or hard to read TypeScript errors.

    All of the diagnostics provided by the language service are available only in editor-mode, that means that they won't show up when using tsc.

    Diagnostics are enabled by default, but you can opt-out of them by changing the language service configuration and provide diagnostics: false.

    {
      "plugins": [
        {
          "name": "@effect/language-service",
          "diagnostics": false
        }
      ]
    }

    Please report any false positive or missing diagnostic you encounter over the Github repository.

    Missing Errors and Services in Effects

    Additionally to the standard TypeScript error that may be cryptic at first:

    Argument of type 'Effect<number, never, ServiceB | ServiceA | ServiceC>' is not assignable to parameter of type 'Effect<number, never, ServiceB | ServiceA>' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
      Type 'ServiceB | ServiceA | ServiceC' is not assignable to type 'ServiceB | ServiceA'.
        Type 'ServiceC' is not assignable to type 'ServiceB | ServiceA'.
          Type 'ServiceC' is not assignable to type 'ServiceA'.
            Types of property 'a' are incompatible.
              Type '3' is not assignable to type '1'.ts(2379)
    

    you'll now receive an additional error:

    Missing 'ServiceC' in the expected Effect context.
    

    Floating Effect

    In some situation you may not receive any compile error at all, but that's because you may have forgot to yield your effects inside gen!

    Floating Effects that are not assigned to a variable will be reported into the Effect diagnostics.

    Effect.runPromise(
      Effect.gen(function* () {
        Effect.sync(() => console.log("Hello!"));
        // ^- Effect must be yielded or assigned to a variable.
      }),
    );

    Used yield instead of yield*

    Similarly, yield instead of yield* won't result in a type error by itself, but is not the intended usage.

    This yield will be reported in the effect diagnostics.

    Effect.runPromise(
      Effect.gen(function* () {
        yield Effect.sync(() => console.log("Hello!"));
        // ^- When yielding Effects inside Effect.gen, you should use yield* instead of yield.
      }),
    );

@github-actions github-actions bot force-pushed the changeset-release/main branch from 5908cfc to 20b05a3 Compare March 1, 2025 13:42
@github-actions github-actions bot force-pushed the changeset-release/main branch from 20b05a3 to 089e164 Compare March 1, 2025 15:02
@mattiamanzati mattiamanzati merged commit 0877de4 into main Mar 1, 2025
@mattiamanzati mattiamanzati deleted the changeset-release/main branch March 1, 2025 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant