Repository navigation
v0.55.0
Minor Changes
-
#478
9a9d5f9Thanks @mattiamanzati! - AddrunEffectInsideEffectdiagnostic to warn when usingEffect.runSync,Effect.runPromise,Effect.runFork, orEffect.runCallbackinside an Effect context (such asEffect.gen,Effect.fn, orEffect.fnUntraced).Running effects inside effects is generally not recommended as it breaks the composability of the Effect system. Instead, developers should extract the Runtime and use
Runtime.runSync,Runtime.runPromise, etc., or restructure their code to avoid running effects inside effects.Example:
// ❌ Will trigger diagnostic export const program = Effect.gen(function* () { const data = yield* Effect.succeed(42); const result = Effect.runSync(Effect.sync(() => data * 2)); // Not recommended return result; }); // ✅ Proper approach - extract runtime export const program = Effect.gen(function* () { const data = yield* Effect.succeed(42); const runtime = yield* Effect.runtime(); const result = Runtime.runSync(runtime)(Effect.sync(() => data * 2)); return result; }); // ✅ Better approach - compose effects export const program = Effect.gen(function* () { const data = yield* Effect.succeed(42); const result = yield* Effect.sync(() => data * 2); return result; });
-
#480
f1a0eceThanks @mattiamanzati! - AddschemaUnionOfLiteralsdiagnostic to warn when usingSchema.Unionwith multipleSchema.Literalcalls that can be simplified to a singleSchema.Literalcall.This diagnostic helps improve code readability and maintainability by suggesting a more concise syntax for union of literals.
Example:
// ❌ Will trigger diagnostic export const Status = Schema.Union(Schema.Literal("A"), Schema.Literal("B")); // ✅ Simplified approach export const Status = Schema.Literal("A", "B");
Patch Changes
-
#481
160e018Thanks @mattiamanzati! - Update Effect ecosystem dependencies to latest versions:@effect/cli: 0.71.0 → 0.72.0@effect/platform: 0.92.1 → 0.93.0@effect/platform-node: 0.98.3 → 0.99.0@effect/printer-ansi: 0.46.0 → 0.47.0@effect/rpc: 0.71.0 → 0.72.0effect: Updated to stable version 3.19.0
Also updated development tooling dependencies:
vitest: 3.2.4 → 4.0.6@vitest/coverage-v8: 3.2.4 → 4.0.6- TypeScript ESLint packages: 8.46.1 → 8.46.3
- Various other minor dependency updates