feat(ecs): merge imports plugins at runtime (types still exclude them)#119
Merged
Conversation
Previously `imports` was type-only: the imported plugins' members were visible to local declarations but contributed nothing at runtime, so a consumer that forgot to re-list them in the top-level combine got `undefined` transactions/ resources at runtime despite a clean compile. Now `imports` merges into the assembled plugin at runtime exactly like `extends` (order: imports, then extends, then local — preserving service init order). This is a pure runtime change: the result TYPE is unchanged and still excludes the imported members, so the quadratic-killing property is preserved (imports do not propagate through downstream result types). No type-signature changes. Adds "imports runtime behavior" tests proving imported members exist on the assembled plugin and on a database built from it alone (no separate combine). Updates docs that incorrectly stated the consumer must re-list imports. Bump to 0.9.65. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #118.
importswas previously type-only — the imported plugins' members were visible to local declarations but contributed nothing at runtime. That meant a consumer who forgot to re-list an imported plugin in the top-levelcombine(...)gotundefinedtransactions/resources at runtime despite a clean compile.This makes
importsmerge into the assembled plugin at runtime exactly likeextends(order: imports → extends → local declarations, preserving service initialization order).This is a pure runtime change — no type changes
The result type is unchanged and still excludes the imported members. That's the whole point: it preserves the property that kills the quadratic
extendsblowup (imported members do not propagate through downstream result types). The public function signature is identical; only the function body changed.So:
extendsimports(before)imports(now)Verification
tsc -bgreen; 62 plugin tests pass (added an "imports runtime behavior" suite proving imported members exist on the assembled plugin and on a database built from it alone, with no separatecombine); lint clean.imports-chain.type-test.tsstill passes unchanged — imported members remain absent from the result type.Bump to 0.9.65.
🤖 Generated with Claude Code