scalajs-react
tapir
Our great sponsors
scalajs-react | tapir | |
---|---|---|
13 | 14 | |
1,631 | 1,275 | |
- | 1.1% | |
4.3 | 9.8 | |
23 days ago | 7 days ago | |
Scala | Scala | |
Apache License 2.0 | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
scalajs-react
- Scala DevInTraining looking to contribute to projects
-
Monorepo: seeking for an advice for bi-lang project
Then there's scalajs-react, which can be integrated with existing React ecosystem, but it's just sooo compex: macros, 5-6 type parameters, hundreds and hundreds of cryptic types. We decided to stick with TypeScript instead.
-
Show HN: Simple games ported to Scala 3 – Try them in the browser
Or the OG React Scala.js library: https://github.com/japgolly/scalajs-react
-
What are Diode alternatives?
I've started with scalajs-react. Overall the experience was good (perhaps the overloaded API is my biggest concern, but we can live with that). Then I stumbled upon a problem where I need to propagate a state change from two leaf components and found out I need something like this Redux thing. I trtied built-in StateSnapshot, but couldn't make it working. Then I googled for Scala-land alternatives and it seems like there are few semi-abandoned Redux facades and Diode. Diode looks like what I need, but:
-
From ES6 to Scala: Basics
Event ho it's a React wrapper it's still a really good one: https://github.com/japgolly/scalajs-react
The downside of this approach is the ecosystem isn't that big compared to JS.
Japgolly has put a ton of time and care into https://github.com/japgolly/scalajs-react which is a complete React binding in scalajs. This paired with something like Diode (https://github.com/suzaku-io/diode) and you get a full frontend solution in scalajs.
-
What's the maturity level of ScalaJS?
We've got server-side rendering with scalajs-react and scala-graal. Here's a tutorial if anyone's interested. What's really cool about scala-graal is that it has some pretty cool caching so that even with dynamic inputs, you can render pages in nanoseconds (as opposed to 10+ or even 100+ ms).
-
I know the basics, what’s next?
You can use React with Scala.js, and also most other common JS libraries. Or you can use a Scala.js specific library like Laminar, which I haven't tried myself but it looks nice.
-
What language(s) pair well with Rust (learning, using, etc.)? Also, what other languages did you learn before learning Rust?
I don't have a lot of experience with it, but many seem to be very pleased with it. Interop with JS is good and you can use React and other common JS libraries, but there is also Scala.js specific frameworks like Laminar.
tapir
-
what library/framework should I use for backend development?
You're not confined to the usual suggestions below (play, http4s). There's a ton of options. (I wrote test cases using a bunch of different frameworks a few years ago at https://github.com/hohonuuli/msdemos). Having written services using a variety of frameworks in production, I would strongly suggest using one that auto-generates API docs (openapi, swagger) for you. That will save you a huge amount of time later on. For heavier services, like the one at https://fathomnet.org/, I tend to the Java side (Quarkus is my current top choice, but Micronaut and Helidon are both great). For everything else I use Scala. My go-to right now is tapir using a vertx backend. See https://tapir.softwaremill.com/
-
Micronaut vs others(Spring Boot, Quarkus and co.)
Tapir is a Scala framework. (which runs on the JDK) Since the recent release of version 1.0, it's become my go to for many projects. It doens't provide much in the way of integrations with 3rd party frameworks, but I actually prefer that. It does autogenerate great swagger docs though.
-
Programming language comparison by reimplementing the same transit data app
I do wonder where the recommendation to use http4s for beginners came from. http4s is a very capable library (and if you care much about composition it is excellent), but I wouldn't describe the documentation as beginner friendly.
A slightly better starting point for scala 3 + type-safe server building is tapir e.g. https://github.com/softwaremill/tapir/blob/master/examples3/... . With that, you get a declarative definition of your endpoints (+ error types, auth, etc.) that you can use for both servers and clients, which comes very handy when writing integration tests of course.
> absolutely ridiculous the fetishization of extremely complex FP and type-level hacking that goes on in the ecosystem
An alternative way to look at it is that there is a lot of essential domain complexity that gets encoded via the type system to let the compiler do the hard work. That "extremely complex FP" does not arrive out of nowhere - I really recommend at least skimming through the slides from rossabaker, the http4s designer, that motivate where the core type signature comes from https://rossabaker.github.io/boston-http4s/#2
I suppose one of the "features" that I like about the (typelevel) community is that the approach of "worse is better" is not taken, and a lot of effort is expended to make things correct, modular and orthogonal. This has the drawback of increased upfront complexity, that anecdotally pays off the moment your compiler does not error and the program runs as intended.
-
Scala.js AWS Lambda, using Scala 3
Did you try tapir? There is a module for deploying aws lambda with Scala js. Not sure whether it is compatible with Scala 3, I am sticking with Scala 2 until Scala 3 gets more mature.
-
Library recommendations?
I'm aware, but it's a design decision that was made on purpose, and which I find in practice not a big problem at all.
In any case I strongly suggest to have a look at Tapir which will make your life a bit easier and allow you to swap the HTTP backend in the future if needed.
-
Monorepo: seeking for an advice for bi-lang project
Backend is source of truth for types on frontend (backend generated OpenAPI definition with tapir, frontend takes it with orval)
-
Experienced dev new to Scala looking for a quick answer to get me on the right track - Advice on *standard* Scala framework stack to quickly set up a web-app backend ;
In all cases I would strongly suggest to have a look at Tapir, regardless of the server implementation that you pick.
-
Resources for learning about http4s and Typelevel ecosystem?
Finally I would strongly recommend having a look at Tapir. Even if you don't need to share endpoints or generate OpenAPI documentation, it provides a really neat abstraction on top of http4s.
-
Scala 3 Reflection
Sounds like you want an IDL. smithy4s and tapir come to mind as potential solutions. Scala code gets generated for you from some intermediate format.
What are some alternatives?
slinky - Write Scala.js React apps just like you would in ES6
smithy4s - https://disneystreaming.github.io/smithy4s/
Laminar - Simple, expressive, and safe UI library for Scala.js
Scala.js - Scala.js, the Scala to JavaScript compiler
ZIO - ZIO — A type-safe, composable library for async and concurrent programming in Scala
React4s - Production ready React wrapper for Scala.js - composable lifecycle - no memoization, no macros, no implicits.
js-scala - js.scala: JavaScript as an embedded DSL in Scala
cats-effect - The pure asynchronous runtime for Scala
sri
tyrian - Elm-inspired Scala UI library.
http4s-jwt-auth - :lock: Opinionated JWT authentication library for Http4s
rustdesk - An open-source remote desktop, and alternative to TeamViewer.