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 | 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 | 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 | 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; | |
| 162 | − | |
| 163 | −const isDuplicatePluginIdError = Schema.is(DuplicatePluginIdError); | |
| 164 | −const isDuplicateCapabilityError = Schema.is(DuplicateCapabilityError); | |
| 165 | −const isDependencyCycleError = Schema.is(DependencyCycleError); | |
| 166 | − | |
| 167 | −const isPluginPlanningError = (error: unknown): error is PluginPlanningError => | |
| 168 | − isDuplicatePluginIdError(error) || | |
| 169 | − isDuplicateCapabilityError(error) || | |
| 170 | − isDependencyCycleError(error); | |
| 161 | +const PluginPlanningError = Schema.Union([ | |
| 162 | + DuplicatePluginIdError, | |
| 163 | + DuplicateCapabilityError, | |
| 164 | + DependencyCycleError, | |
| 165 | +]); | |
| 166 | +type PluginPlanningError = typeof PluginPlanningError.Type; | |
| 167 | + | |
| 168 | +const isPluginPlanningError = Schema.is(PluginPlanningError); | |
| 171 | 169 | |
| 172 | 170 | type PluginReconcileError = |
| 173 | 171 | | PluginPlanningError |