feat(sdk): add vue, svelte, angular implementation of useStream hook#2001
Open
Christian Bromann (christian-bromann) wants to merge 7 commits intomainfrom
Open
feat(sdk): add vue, svelte, angular implementation of useStream hook#2001Christian Bromann (christian-bromann) wants to merge 7 commits intomainfrom
Christian Bromann (christian-bromann) wants to merge 7 commits intomainfrom
Conversation
|
@langchain/langgraph-checkpoint
@langchain/langgraph-checkpoint-mongodb
@langchain/langgraph-checkpoint-postgres
@langchain/langgraph-checkpoint-redis
@langchain/langgraph-checkpoint-sqlite
@langchain/langgraph-checkpoint-validation
create-langgraph
@langchain/langgraph-api
@langchain/langgraph-cli
@langchain/langgraph
@langchain/langgraph-cua
@langchain/langgraph-supervisor
@langchain/langgraph-swarm
@langchain/langgraph-ui
@langchain/langgraph-sdk
@langchain/angular
@langchain/react
@langchain/svelte
@langchain/vue
commit: |
There was a problem hiding this comment.
shouldn't be return this.queue = this.queue.then(() => this.enqueue(action, options));?
return is missing
970a9e8 to
74d188a
Compare
This was referenced Mar 3, 2026
Update vitest Add missing eslint Remove tsc build for svelte and vue Clean up possible changes use pnpm split off custom react package add vue tests add tests for svelte adding angular tests land remaining tests and remove validation package add readme port missing features migrate to message instances proper type tests more tests test fixes in angular format fix lint and build support for switchThread feat: support for submit queue format tool calls as class instances type fixes lint fixes cr cr format add missing export revert fix fix document queuing in readme Update libs/sdk/src/ui/transport.ts Co-authored-by: pawel-twardziak <pawel.twardziak.dev@gmail.com> proper server side queuing add queuing docs linting and formatting format cr actually transform into message instances feat: onError per submit call format format lint
eba0e56 to
2be25ca
Compare
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.
This PR introduces first-class Vue, Svelte, and Angular integrations for the LangGraph
useStreamhook — bringing the same streaming chat experience previously available only in React to three additional frontend frameworks. It also restructures the SDK internals to extract a framework-agnostic UI core, splits the React integration into its own dedicated package, and adds a client-side submission queue system.New Packages
@langchain/reactuseState,useSyncExternalStore)react,react-dom@langchain/vueref,computed,watch)vue@langchain/sveltewritable,derived) / Runessvelte@langchain/angularsignal,computed,effect)@angular/coreAll four packages expose a unified
useStreamAPI adapted to each framework's idiomatic reactivity system, providing:FetchStreamTransportor user-defined implementationsSDK Core Refactoring (
@langchain/langgraph-sdk)The React-specific streaming implementation has been extracted from the core SDK into the new
@langchain/reactpackage. In its place, the core SDK now exports a framework-agnostic UI module (@langchain/langgraph-sdk/ui) containing shared primitives:StreamManager— Core stream lifecycle and event processingMessageTupleManager— Message state normalization between dict and class formatsSubmitQueue— Client-side queue that drains submissions sequentially when the agent is idle, with configurable error handling ("continue"/"stop")FetchStreamTransport— Pluggable SSE transport abstraction using the Fetch APIextractInterrupts— Unified interrupt extraction from stream state and thread stategetBranchContext/getMessagesMetadataMap— Thread history branching utilitiesSubagentManager— Tracking and management of nested agent runsThe existing
@langchain/langgraph-sdk/reactentrypoint remains backward-compatible — it re-exports from@langchain/reactwith a thin wrapper that preserves the existing message dictionary format.Removed
@langchain/langgraph-sdk-validation— The standalone validation package has been removed. Its test coverage has been absorbed into each framework package's own test suite, providing more targeted and framework-specific validation.Example Applications
Three new example apps demonstrate the integration for each framework:
examples/ui-angular/— Angular standalone component with signals-based chatexamples/ui-svelte/— Svelte 5 app with runes-based chatexamples/ui-vue/— Vue 3 Composition API chatAll examples follow the same pattern: a simple chat UI backed by a single-node StateGraph agent, showcasing message streaming with optimistic updates.
Testing
Each framework package includes comprehensive browser-based integration tests using Vitest Browser Mode with WebDriverIO:
*.test-d.ts) — Extensive type-level tests foruseStream,createAgent,createDeepAgent, and LangGraph schema inference, ensuring correct generic type resolution across all framework adaptersThe core SDK also adds unit tests for the new
SubmitQueue(libs/sdk/src/ui/queue.test.ts).