softwaremill / softwaremill/tapir

SSE with a project having shared routes for jvm and scalajs

Open
#4,724 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Scala
Stars
1.5k
Forks
468
Avg merge
5h 37m
Merged PRs (30d)
34

Description

Hello, I have a project using scalajs for the front and tapir with netty sync for the backend.

I'm currently wanting add some SSE endpoints and so had a look at the corresponding example at https://github.com/softwaremill/tapir/blob/master/examples/src/main/scala/sttp/tapir/examples/sse/sseNettySyncServer.scala

This example shows that we need, in the route definition, some classes coming from the server part, describing the streaming. However, this doesn't seem to make any sense for the scalajs client, which shouldn't know about netty or ox.

how would you recommend sharing the route definitions between back and front for SSE? Also, do you have some example code using a SSE client with tapir?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with examples/src/main/scala/sttp/tapir/examples/sse/sseNettySyncServer.scala and examine how its server-specific streaming types relate to route definitions shared with Scala.js. Check the existing SSE documentation and examples; done means documenting a sharing approach and providing an SSE client example without exposing Netty or Ox to the Scala.js client.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala
Domain
api, documentation, full-stack
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.