apache / pekko-http

The Streaming-first HTTP server/module of Apache Pekko
https://pekko.apache.org/
Apache License 2.0
152 stars 38 forks source link

new g8 template (pekko-http-quickstart-scala) #28

Closed pjfanning closed 1 year ago

pjfanning commented 1 year ago

introduction.md mentions

sbt new akka/pekko-http-quickstart-scala.g8
luksow commented 1 year ago

Probably not very helpful but I converted my OSS template (quite popular, by the way) and the transition was really smooth: https://github.com/theiterators/akka-http-microservice/pull/171

pjfanning commented 1 year ago

@luksow I would be open to adding a link to your template. It would allow us to long finger the task of replacing akka-http-quickstart-scala and concentrate on other tasks. When you have time, would you be able to create a pekko-http-microservice from your existing PR? We could mention that in our docs.

luksow commented 1 year ago

@pjfanning thanks for getting back to me! Actually, if pekko-http-quickstart-scala is endgame goal, I could devote some time to fork & convert it, as it shouldn't be too hard. Is anyone working on it already? Is Java version required?

Another question is, do we want to have a 1:1 version? What I dislike about akka-http-quickstart is that it mixes actors with akka http which is very often a bad idea - overkill for most of the use cases.

Also, I'm happy to create pekko-http-microservice from my PR. There are two things to consider. First of all, it's Scala 3 version, which means I have to use for3Use2_13 which is fine but it also requires me to use circe, instead of spray-json (which has poor/no Scala 3 support). This means I need https://github.com/hseeberger/akka-http-json equivalent. From what I have learnt so far, it's no longer maintained and thus no support for Pekko is planned (https://github.com/hseeberger/akka-http-json/issues/780). So we have two options here:

  1. I create pekko-http-microservice using Scala 2, spray-json.
  2. I'll create & maintain a fork of akka-http-json for Pekko (which I think will be very important at some point) and stick to Scala 3. Which approach is better in your opinion?

Lastly, having said that, looking forward to Scala 3, I think it's important to consider the role of spray-json in the core of pekko-http as it's basically obsolete.

pjfanning commented 1 year ago

Thanks @luksow - any direction that you choose will be useful. A Scala pekko version of akka-quickstart will be easier to integrate with the pekko docs but we can work with anything. Regarding JSON support, pekko-http-spray-json may be ok for now but cloning Heiko Seeburger's libs may be a good longer term plan. I plan to look at this latter option but if anyone else gets there first - that's great.

pjfanning commented 1 year ago

@luksow I forked akka-http-json and created https://github.com/pjfanning/pekko-http-json

I pushed snapshot jars to: https://oss.sonatype.org/content/repositories/snapshots/com/github/pjfanning/

luksow commented 1 year ago

@pjfanning cool, I've asked my colleagues to help with both pekko-http-microservice and pekko-http-quickstart-scala. We will be reporting our progress here.

luksow commented 1 year ago

@pjfanning https://github.com/theiterators/pekko-http-microservice is up. Now working on pekko-http-quickstart-scala.

luksow commented 1 year ago

@pjfanning I think it's ready: https://github.com/theiterators/pekko-http-quickstart-scala.g8

Also my colleague @rotifyld is happy to help, as she did the most of the migration.

jrudolph commented 1 year ago

I also updated one of my examples: https://github.com/jrudolph/pekko-http-scala-js-websocket-chat

jrudolph commented 1 year ago

instead of spray-json (which has poor/no Scala 3 support

The situation seems indeed a bit confused right now, but the latest version of spray-json seems to be published for Scala 3 even if the PR it was released from has not yet been merged.

pjfanning commented 1 year ago

@rotifyld @luksow if you ever decide to support the java g8 template, notify me and I will update the Pekko docs about it. The Akka project has templates for Scala and Java. Thanks for producing the Pekko Scala version.

rotifyld commented 1 year ago

@pjfanning I can take care of it in the following days

pjfanning commented 1 year ago

I also updated one of my examples: https://github.com/jrudolph/pekko-http-scala-js-websocket-chat

@jrudolph I'm doing an edit to the pekko-http docs. There doesn't seem to be a place to add references to useful examples. It seems like something we should have.

jrudolph commented 1 year ago

Maybe under "Extensions"? We could rename the menu point: https://nightlies.apache.org/pekko/docs/pekko-http/main-snapshot/docs//extensions.html

PJ Fanning @.***> schrieb am Mi., 1. März 2023, 15:09:

I also updated one of my examples: https://github.com/jrudolph/pekko-http-scala-js-websocket-chat

@jrudolph https://github.com/jrudolph I'm doing an edit to the pekko-http docs. There doesn't seem to be a place to add references to useful examples. It seems like something we should have.

— Reply to this email directly, view it on GitHub https://github.com/apache/incubator-pekko-http/issues/28#issuecomment-1450213720, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAACNDFDDZDPWVANGIYPC5LWZ5KCLANCNFSM6AAAAAAUCPLMDA . You are receiving this because you were mentioned.Message ID: @.***>

mkurz commented 1 year ago

Maybe add the templates to https://github.com/foundweekends/giter8/wiki/giter8-templates?

rotifyld commented 1 year ago

Both (scala/java) g8 templates are now migrated and available here:

Do you want to host these repositories here, under Apache organization? If so, feel free to fork them. I'll wait with adding them to the aforementioned giter8-templates until the decision.

The only thing that's left is to publish the paradox docs (I'm not familiar with your workflow), and then add the link to the documentation at the very beginning of both README files (here and here).

pjfanning commented 1 year ago

@rotifyld thanks for producing these so quickly. I'm happy to reference the 'theiterators' versions in our docs. For Apache repos, we need to do a fair amount of extra 'paperwork' - checking code licenses, adding disclaimers, etc.

pjfanning commented 1 year ago

@rotifyld would it possible to replace the 'About' links to akka.io (top right of pages)?

rotifyld commented 1 year ago

@pjfanning done, replaced with pekko.apache.org

rotifyld commented 1 year ago

And added to the giter8-wiki.

Then the only thing left to close the issue is to publish the docs. Are you able to host it by your side? Alternatively, I could get rid of the paradox directives and simply leave them as markdown files on GitHub wiki — I think however that the paradox capabilities greatly enhances the readability. I'm also not sure on the possibility of hosting it by our side, but I may inquire into it