router icon indicating copy to clipboard operation
router copied to clipboard

Examples: add Tanstack Start SSE

Open MrNiceRicee opened this issue 1 year ago • 4 comments

Hello there!

This PR adds an example for SSE to Tanstack Start. Used EventEmitter on the server side and added @microsoft/fetch-event-source to help with making event listening on the client side easier.

The PR in essence is an extended version of the counter-example w/ react query and sse

side note: unsure if my approach of combining the event listener with useQuery good strategy, but it worked well enough. It's inspired by Tkdodo's websocket article

Would love to get some feedback if ya'll have capacity/time!

MrNiceRicee avatar Sep 17 '24 05:09 MrNiceRicee

☁️ Nx Cloud Report

CI is running/has finished running commands for commit cdad5465261b1ede8e7a662729468331e3ebcf3b. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 2 targets

Sent with 💌 from NxCloud.

nx-cloud[bot] avatar Sep 19 '24 01:09 nx-cloud[bot]

Open in Stackblitz

More templates

@tanstack/eslint-plugin-router

pnpm add https://pkg.pr.new/@tanstack/eslint-plugin-router@2356
@tanstack/create-router

pnpm add https://pkg.pr.new/@tanstack/create-router@2356
@tanstack/history

pnpm add https://pkg.pr.new/@tanstack/history@2356
@tanstack/react-cross-context

pnpm add https://pkg.pr.new/@tanstack/react-cross-context@2356
@tanstack/react-router

pnpm add https://pkg.pr.new/@tanstack/react-router@2356
@tanstack/react-router-with-query

pnpm add https://pkg.pr.new/@tanstack/react-router-with-query@2356
@tanstack/router-arktype-adapter

pnpm add https://pkg.pr.new/@tanstack/router-arktype-adapter@2356
@tanstack/router-cli

pnpm add https://pkg.pr.new/@tanstack/router-cli@2356
@tanstack/router-devtools

pnpm add https://pkg.pr.new/@tanstack/router-devtools@2356
@tanstack/router-generator

pnpm add https://pkg.pr.new/@tanstack/router-generator@2356
@tanstack/router-plugin

pnpm add https://pkg.pr.new/@tanstack/router-plugin@2356
@tanstack/router-valibot-adapter

pnpm add https://pkg.pr.new/@tanstack/router-valibot-adapter@2356
@tanstack/router-vite-plugin

pnpm add https://pkg.pr.new/@tanstack/router-vite-plugin@2356
@tanstack/router-zod-adapter

pnpm add https://pkg.pr.new/@tanstack/router-zod-adapter@2356
@tanstack/start

pnpm add https://pkg.pr.new/@tanstack/start@2356
@tanstack/virtual-file-routes

pnpm add https://pkg.pr.new/@tanstack/virtual-file-routes@2356
@tanstack/start-vite-plugin

pnpm add https://pkg.pr.new/@tanstack/start-vite-plugin@2356

commit: cdad546

pkg-pr-new[bot] avatar Sep 19 '24 01:09 pkg-pr-new[bot]

@microsoft/fetch-event-source was last updated 3 years ago. I ended up just going with extended-eventsource myself.

jadejr avatar Oct 19 '24 22:10 jadejr

@jadejr can you create an example based on that?

schiller-manuel avatar Oct 20 '24 00:10 schiller-manuel

Not until I at least have time to play with tanstack start in the first place. It's just a project I'm following. I'm not sure what I think of it just yet.

jadejr avatar Oct 22 '24 17:10 jadejr