effect 2.3.6 → 2.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ModuleVersion/package.json +6 -0
- package/dist/cjs/GlobalValue.js +27 -2
- package/dist/cjs/GlobalValue.js.map +1 -1
- package/dist/cjs/ModuleVersion.js +49 -0
- package/dist/cjs/ModuleVersion.js.map +1 -0
- package/dist/cjs/index.js +4 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/internal/cache.js +1 -1
- package/dist/cjs/internal/cache.js.map +1 -1
- package/dist/cjs/internal/effectable.js +2 -2
- package/dist/cjs/internal/effectable.js.map +1 -1
- package/dist/cjs/internal/fiberRuntime.js +3 -3
- package/dist/cjs/internal/fiberRuntime.js.map +1 -1
- package/dist/cjs/internal/option.js +2 -1
- package/dist/cjs/internal/option.js.map +1 -1
- package/dist/cjs/internal/version.js +8 -2
- package/dist/cjs/internal/version.js.map +1 -1
- package/dist/dts/ModuleVersion.d.ts +11 -0
- package/dist/dts/ModuleVersion.d.ts.map +1 -0
- package/dist/dts/index.d.ts +6 -0
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/dts/internal/version.d.ts +2 -1
- package/dist/dts/internal/version.d.ts.map +1 -1
- package/dist/esm/GlobalValue.js +2 -2
- package/dist/esm/GlobalValue.js.map +1 -1
- package/dist/esm/ModuleVersion.js +17 -0
- package/dist/esm/ModuleVersion.js.map +1 -0
- package/dist/esm/index.js +6 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/internal/cache.js +1 -1
- package/dist/esm/internal/cache.js.map +1 -1
- package/dist/esm/internal/effectable.js +2 -2
- package/dist/esm/internal/effectable.js.map +1 -1
- package/dist/esm/internal/fiberRuntime.js +3 -3
- package/dist/esm/internal/fiberRuntime.js.map +1 -1
- package/dist/esm/internal/option.js +2 -1
- package/dist/esm/internal/option.js.map +1 -1
- package/dist/esm/internal/version.js +5 -1
- package/dist/esm/internal/version.js.map +1 -1
- package/package.json +9 -1
- package/src/GlobalValue.ts +2 -2
- package/src/ModuleVersion.ts +18 -0
- package/src/index.ts +7 -0
- package/src/internal/cache.ts +1 -1
- package/src/internal/effectable.ts +2 -2
- package/src/internal/fiberRuntime.ts +3 -3
- package/src/internal/option.ts +2 -1
- package/src/internal/version.ts +7 -1
|
@@ -7,7 +7,7 @@ import { pipeArguments } from "../Pipeable.js"
|
|
|
7
7
|
import type * as Sink from "../Sink.js"
|
|
8
8
|
import type * as Stream from "../Stream.js"
|
|
9
9
|
import * as OpCodes from "./opCodes/effect.js"
|
|
10
|
-
import
|
|
10
|
+
import * as version from "./version.js"
|
|
11
11
|
|
|
12
12
|
/** @internal */
|
|
13
13
|
export const EffectTypeId: Effect.EffectTypeId = Symbol.for("effect/Effect") as Effect.EffectTypeId
|
|
@@ -30,7 +30,7 @@ export const effectVariance = {
|
|
|
30
30
|
/* c8 ignore next */
|
|
31
31
|
_A: (_: never) => _,
|
|
32
32
|
|
|
33
|
-
_V:
|
|
33
|
+
_V: version.getCurrentVersion()
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
const sinkVariance = {
|
|
@@ -67,7 +67,7 @@ import { OpSupervision } from "./runtimeFlags.js"
|
|
|
67
67
|
import * as supervisor from "./supervisor.js"
|
|
68
68
|
import * as SupervisorPatch from "./supervisor/patch.js"
|
|
69
69
|
import * as tracer from "./tracer.js"
|
|
70
|
-
import
|
|
70
|
+
import * as version from "./version.js"
|
|
71
71
|
|
|
72
72
|
/** @internal */
|
|
73
73
|
export const fiberStarted = metric.counter("effect_fiber_started")
|
|
@@ -1287,11 +1287,11 @@ export class FiberRuntime<in out A, in out E = never> implements Fiber.RuntimeFi
|
|
|
1287
1287
|
// @ts-expect-error
|
|
1288
1288
|
cur = this._tracer.context(
|
|
1289
1289
|
() => {
|
|
1290
|
-
if (
|
|
1290
|
+
if (version.getCurrentVersion() !== (cur as core.Primitive)[EffectTypeId]._V) {
|
|
1291
1291
|
return core.dieMessage(
|
|
1292
1292
|
`Cannot execute an Effect versioned ${
|
|
1293
1293
|
(cur as core.Primitive)[EffectTypeId]._V
|
|
1294
|
-
} with a Runtime of version ${
|
|
1294
|
+
} with a Runtime of version ${version.getCurrentVersion()}`
|
|
1295
1295
|
)
|
|
1296
1296
|
}
|
|
1297
1297
|
// @ts-expect-error
|
package/src/internal/option.ts
CHANGED
|
@@ -42,6 +42,7 @@ const SomeProto = Object.assign(Object.create(CommonProto), {
|
|
|
42
42
|
}
|
|
43
43
|
})
|
|
44
44
|
|
|
45
|
+
const NoneHash = Hash.hash("None")
|
|
45
46
|
const NoneProto = Object.assign(Object.create(CommonProto), {
|
|
46
47
|
_tag: "None",
|
|
47
48
|
_op: "None",
|
|
@@ -49,7 +50,7 @@ const NoneProto = Object.assign(Object.create(CommonProto), {
|
|
|
49
50
|
return isOption(that) && isNone(that)
|
|
50
51
|
},
|
|
51
52
|
[Hash.symbol]<A>(this: Option.None<A>) {
|
|
52
|
-
return
|
|
53
|
+
return NoneHash
|
|
53
54
|
},
|
|
54
55
|
toJSON<A>(this: Option.None<A>) {
|
|
55
56
|
return {
|