[PoC] use official @linqapp/sdk for types and additional features#278
Open
jflayhart wants to merge 4 commits intovercel:linqfrom
Open
[PoC] use official @linqapp/sdk for types and additional features#278jflayhart wants to merge 4 commits intovercel:linqfrom
jflayhart wants to merge 4 commits intovercel:linqfrom
Conversation
Contributor
|
@jflayhart is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
5 tasks
- Replace openapi-fetch HTTP client with the official @linqapp/sdk
- Import types directly from SDK instead of generating from OpenAPI spec
- Remove generated schema.ts (~6100 lines) and OpenAPI YAML (~5800 lines)
- Remove openapi-fetch and openapi-typescript dependencies
- Error handling now catches SDK exceptions instead of checking { data, error }
- Disable SDK retries (maxRetries: 0) since adapter handles its own retry logic
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
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
Replaces the
openapi-fetchHTTP client and OpenAPI-generated types with the official@linqapp/sdk, removing ~12,000 lines of generated code that can become stale.What changed
openapi-fetch→@linqapp/sdk(typed SDK methods likeclient.chats.messages.send())import typefrom@linqapp/sdkinstead ofcomponents["schemas"]["X"]from generatedschema.tsAPIErrorsubclasses) instead of checking{ data, error, response }@linqapp/sdkas a regular dependency, matching how other adapters handle platform SDKs (Slack →@slack/web-api, Discord →discord.js, Teams →botbuilder, etc.)schema.ts(~6,100 lines),lib/linq/linq-api-v3.yaml(~5,800 lines),openapi-fetchandopenapi-typescriptdeps,generate-typesscript(url, init)to fetch, not aRequestobject) and empty-string cursor handlingBundle size
The adapter bundle is smaller because all SDK type imports are erased at compile time. Only 6 runtime values are imported from the SDK: the client class and 5 error classes. The SDK has zero transitive dependencies.
The node_modules footprint increases ~2.5 MB, comparable to other platform SDKs in this repo (
discord.js,botbuilder,@googleapis/chat, etc.). This is a server-side adapter — presuming none of this ships to the browser.Why replace
openapi-fetchwith the official SDK?@linqapp/sdk