From 468ceead73739c09178dd28ba53d27be0046fad4 Mon Sep 17 00:00:00 2001 From: Sebastian Lorenz Date: Mon, 27 Jul 2026 15:13:32 +0200 Subject: [PATCH] Remove version.ts --- packages/effect/src/Fiber.ts | 3 +-- packages/effect/src/TxPubSub.ts | 4 ++-- packages/effect/src/internal/effect.ts | 14 +++++++------- packages/effect/src/internal/version.ts | 2 -- packages/effect/src/unstable/cluster/Sharding.ts | 2 +- scripts/version.mjs | 9 --------- scripts/version.template.txt | 2 -- 7 files changed, 11 insertions(+), 25 deletions(-) delete mode 100644 packages/effect/src/internal/version.ts delete mode 100644 scripts/version.mjs delete mode 100644 scripts/version.template.txt diff --git a/packages/effect/src/Fiber.ts b/packages/effect/src/Fiber.ts index ed60b91e9f2..480e2ed1299 100644 --- a/packages/effect/src/Fiber.ts +++ b/packages/effect/src/Fiber.ts @@ -12,7 +12,6 @@ import type * as Context from "./Context.ts" import type { Effect } from "./Effect.ts" import type { Exit } from "./Exit.ts" import * as effect from "./internal/effect.ts" -import { version } from "./internal/version.ts" import type { LogLevel } from "./LogLevel.ts" import type { Pipeable } from "./Pipeable.ts" import { hasProperty } from "./Predicate.ts" @@ -22,7 +21,7 @@ import type { Scope } from "./Scope.ts" import type { AnySpan } from "./Tracer.ts" import type { Covariant } from "./Types.ts" -const TypeId = `~effect/Fiber/${version}` +const TypeId = "~effect/Fiber" /** * A runtime fiber is a lightweight thread that executes Effects. Fibers are diff --git a/packages/effect/src/TxPubSub.ts b/packages/effect/src/TxPubSub.ts index e1ecbc9ea35..6e5943d6cad 100644 --- a/packages/effect/src/TxPubSub.ts +++ b/packages/effect/src/TxPubSub.ts @@ -638,14 +638,14 @@ export const shutdown = (self: TxPubSub): Effect.Effect => * **Example** (Waiting for shutdown) * * ```ts - * import { Effect, TxPubSub } from "effect" + * import { Effect, Fiber, TxPubSub } from "effect" * * const program = Effect.gen(function*() { * const hub = yield* TxPubSub.unbounded() * * const fiber = yield* Effect.forkChild(TxPubSub.awaitShutdown(hub)) * yield* TxPubSub.shutdown(hub) - * yield* fiber.await + * yield* Fiber.await(fiber) * }) * ``` * diff --git a/packages/effect/src/internal/effect.ts b/packages/effect/src/internal/effect.ts index 58b6bd318d6..aa4616707a0 100644 --- a/packages/effect/src/internal/effect.ts +++ b/packages/effect/src/internal/effect.ts @@ -98,7 +98,6 @@ import { } from "./references.ts" import { getStackTraceLimit, setStackTraceLimit } from "./stackTraceLimit.ts" import { addSpanStackTrace, makeStackCleaner } from "./tracer.ts" -import { version } from "./version.ts" // ---------------------------------------------------------------------------- // Cause @@ -490,7 +489,7 @@ const renderErrorCause = (cause: Error, prefix: string) => { // ---------------------------------------------------------------------------- /** @internal */ -export const FiberTypeId = `~effect/Fiber/${version}` as const +export const FiberTypeId = "~effect/Fiber" as const const fiberVariance = { _A: identity, @@ -5204,16 +5203,17 @@ export const forkUnsafe = ( daemon = false, uninterruptible: boolean | "inherit" = false ): FiberImpl => { - const interruptible = uninterruptible === "inherit" ? parent.interruptible : !uninterruptible - const child = new FiberImpl(parent.context, interruptible) + const parentRuntime = parent as FiberImpl + const interruptible = uninterruptible === "inherit" ? parentRuntime.interruptible : !uninterruptible + const child = new FiberImpl(parentRuntime.context, interruptible) if (immediate) { child.evaluate(effect as any) } else { - parent.currentDispatcher.scheduleTask(() => child.evaluate(effect as any), 0) + parentRuntime.currentDispatcher.scheduleTask(() => child.evaluate(effect as any), 0) } if (!daemon && !child._exit) { - parent.children().add(child) - child.addObserver(() => parent._children!.delete(child)) + parentRuntime.children().add(child) + child.addObserver(() => parentRuntime._children!.delete(child)) } return child } diff --git a/packages/effect/src/internal/version.ts b/packages/effect/src/internal/version.ts deleted file mode 100644 index 31a362ac681..00000000000 --- a/packages/effect/src/internal/version.ts +++ /dev/null @@ -1,2 +0,0 @@ -export const version: version = "dev" -export type version = "dev" diff --git a/packages/effect/src/unstable/cluster/Sharding.ts b/packages/effect/src/unstable/cluster/Sharding.ts index 6a2338afdbf..289319ca435 100644 --- a/packages/effect/src/unstable/cluster/Sharding.ts +++ b/packages/effect/src/unstable/cluster/Sharding.ts @@ -1202,7 +1202,7 @@ const make = Effect.gen(function*() { if (!options.discard) { const entry: ClientRequestEntry = { rpc: rpc as any, - context: fiber.currentContext, + context: fiber.context, message } clientRequests.set(id, entry) diff --git a/scripts/version.mjs b/scripts/version.mjs deleted file mode 100644 index 6b95f8d88b2..00000000000 --- a/scripts/version.mjs +++ /dev/null @@ -1,9 +0,0 @@ -import * as Fs from "node:fs" -import Package from "../packages/effect/package.json" with { type: "json" } - -const tpl = Fs.readFileSync("./scripts/version.template.txt").toString("utf8") - -Fs.writeFileSync( - "packages/effect/src/internal/version.ts", - tpl.replace(/VERSION/g, Package.version) -) diff --git a/scripts/version.template.txt b/scripts/version.template.txt deleted file mode 100644 index 7e41a1e925b..00000000000 --- a/scripts/version.template.txt +++ /dev/null @@ -1,2 +0,0 @@ -export const version: version = "VERSION" -export type version = "VERSION"