Unified · Split
| @@ -21,7 +21,7 @@ it also fits t3's existing effect runtime. adding cordis did not remove the need · 20 unmodified lines | |||
| 21 | 21 | ||
| 22 | | variant | source lines | new runtime dependency | result | | 22 | | variant | source lines | new runtime dependency | result | |
| 23 | | ----------------------- | -----------: | --------------------------------------------------- | ------------------------------------------------------------------ | | 23 | | ----------------------- | -----------: | --------------------------------------------------- | ------------------------------------------------------------------ | |
| 24 | | `effectScopeRuntime.ts` | 682 | none, effect is already used by t3 | best base for production | | 24 | | `effectScopeRuntime.ts` | 680 | none, effect is already used by t3 | best base for production | |
| 25 | | `cordisRuntime.ts` | 557 | cordis rc.8 and about 300 kib of installed packages | works, but adds a second lifecycle runtime and the largest adapter | | 25 | | `cordisRuntime.ts` | 557 | cordis rc.8 and about 300 kib of installed packages | works, but adds a second lifecycle runtime and the largest adapter | |
| 26 | | `pureRuntime.ts` | 425 | none | simplest planner, but manual finalizers are too easy to misuse | | 26 | | `pureRuntime.ts` | 425 | none | simplest planner, but manual finalizers are too easy to misuse | |
| 27 | 27 | ||
| @@ -158,16 +158,14 @@ class PluginRuntimeCleanupError extends Schema.TaggedErrorClass<PluginRuntimeCle · 157 unmodified lines | |||
| 158 | } | 158 | } |
| 159 | } | 159 | } |
| 160 | 160 | ||
| 161 | type PluginPlanningError = DuplicatePluginIdError | DuplicateCapabilityError | DependencyCycleError; | 161 | const PluginPlanningError = Schema.Union([ |
| 162 | 162 | DuplicatePluginIdError, | |
| 163 | const isDuplicatePluginIdError = Schema.is(DuplicatePluginIdError); | 163 | DuplicateCapabilityError, |
| 164 | const isDuplicateCapabilityError = Schema.is(DuplicateCapabilityError); | 164 | DependencyCycleError, |
| 165 | const isDependencyCycleError = Schema.is(DependencyCycleError); | 165 | ]); |
| 166 | 166 | type PluginPlanningError = typeof PluginPlanningError.Type; | |
| 167 | const isPluginPlanningError = (error: unknown): error is PluginPlanningError => | 167 | |
| 168 | isDuplicatePluginIdError(error) || | 168 | const isPluginPlanningError = Schema.is(PluginPlanningError); |
| 169 | isDuplicateCapabilityError(error) || | ||
| 170 | isDependencyCycleError(error); | ||
| 171 | 169 | ||
| 172 | type PluginReconcileError = | 170 | type PluginReconcileError = |
| 173 | | PluginPlanningError | 171 | | PluginPlanningError |