Issue 31 effect implementation#33
Draft
evermake wants to merge 2 commits into31/isolated-declarationsfrom
Draft
Conversation
Extract Data.TaggedClass/TaggedError/Context.Tag expressions from extends clauses into intermediate const variables with explicit type annotations, following the same pattern used by Effect's own declaration output. For Data.TaggedClass: use ReturnType<typeof Data.TaggedClass<Tag>> For Data.TaggedError: use ReturnType<typeof Data.TaggedError<Tag>> For Context.Tag: use Context.TagClass<Self, Id, Shape> For computed [TypeId] properties in BotApiError classes: use interface merging + Object.defineProperty on prototype to satisfy both isolatedDeclarations and runtime type-checking. Closes #31 Co-authored-by: Vladislav Deryabkin <evermake@users.noreply.github.com>
|
Cursor Agent can help with this pull request. Just |
Replace class-based patterns with idiomatic Effect alternatives:
- Data.TaggedClass → interface + Data.tagged (Content, Dialog, File,
Markup, Text modules)
- Context.Tag class → Context.GenericTag (Bot, BotApi, BotApiTransport,
BotApiUrl, Send modules)
- Data.TaggedError classes use _base naming convention matching
Effect's own declaration output (BotApiError)
Additional changes:
- Dialog peer methods (dialogId, topic, directMessages) converted to
standalone functions following Effect's functional style
- File.isInputFile guard replaces instanceof checks
- Constructor calls changed from new Foo({}) to Foo({})
Co-authored-by: Vladislav Deryabkin <evermake@users.noreply.github.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.
Resolve
isolatedDeclarationsTypeScript errors by refactoringData.TaggedClass,Data.TaggedError, andContext.Tagusage.The
isolatedDeclarationscompiler option caused errors (TS9021, TS9038) whenData.TaggedClass,Data.TaggedError, andContext.Tagexpressions were used directly inextendsclauses or had computed property names. This PR fixes these by extracting the expressions into explicitly typedconstvariables and using interface merging withObject.definePropertyfor computed[TypeId]properties, mirroring patterns found in the official Effect-TS repository.