http4s / http4s-servlet

http4s-servlet support
Apache License 2.0
6 stars 5 forks source link

Evaluate update to Servlet 4 and Jetty 10 #9

Closed arixmkii closed 1 year ago

arixmkii commented 3 years ago

Current builds of Http4s are using Servlet 3.0 as build dependency. It would be nice to bump this to Servlet 4.0 before full move to jakarta namespaces and version 5.0.

Now it should be possible to bump Servlet version.

Also, Jetty 10 kept javax.servlet namespace. So, upgrade should not be a breaking change at least for jetty server part.

If considered too dangerous the change could be skipped for series/0.21.

rossabaker commented 3 years ago

Upgrading major versions is not something we usually do until our own next version. Even if our integration is binary compatible under org.http4s, we'd be forcing our Jetty 9 users onto Jetty 10, and I don't know what breaking changes happen outside http4s. For instances, are those websocket and session refactors in the release notes compatible? It seems safer to me to just upgrade in 0.22 and 1.0.

The Servlet 4 vs. Servlet 5 is a tough question. Maintaining parallel versions of the servlet modules isn't something I'm enthusiastic about. But committing to Servlet 4 in http4s-1.0 when Servlet 5 is already here seems weird. Do you have a sense how many people are pausing at 4 instead of going all the way from 3 to 5? It's possible to maintain parallel versions, but these are among our lesser used modules, and as proud as I am that we still have this integration (I'm an old Java person!), I'm reluctant to double the work.

I'll comment on the code itself on the PR. Thanks for getting this started!

arixmkii commented 3 years ago

Yes, I totally agree, that major version bump is very painful. That why I created this issue with "Evaluate". As for PR, I made it mostly as POC, that it is relatively simple to apply this change (from code perspective).

Unfortunately I can't comment on the adoption rate of Servlet spec version 5. 2 major players (Jetty and Tomcat) are providing production builds of their servers, but it will take time until their users jump on.

arixmkii commented 3 years ago

The minimum required Java version for Jetty 10 is now Java 11.

Will need to check this. Is it needed in general or for some specific features. Because I noticed that Http4s has JDK 8 at least for CI.

rossabaker commented 3 years ago

Oh, right. Someone mentioned that Java 11 issue in another discussion. That definitely slams the door shut on 0.21: many of our users won't be able to upgrade.

We planned on spinning servlet support off into its own repos before 0.22 goes final. That would let us build http4s-jetty and http4s-jetty-client on Java >= 11. It also conceivably means we could support any combination of {Servlet 3, Servlet 4, Servlet 5} concurrently.

Jakarta EE 9 is here. I think we should aim for Servlet 5.0 in 0.22 and 1.0, and if anyone wants Servlet 3 and/or Servlet 4 support, we can give it a home in our org, but they'll have to help us maintain it.

Does that work for your needs?

arixmkii commented 3 years ago

Jakarta EE 9 is here. I think we should aim for Servlet 5.0 in 0.22 and 1.0

This suits my needs. I have only a 2 projects with Servlets, which are already moved to internal systems only and we are on a way to phase them out.

If I ever need to do Servlet related stuff again I will move on JakartaEE or use different tech for sure.

Feel free to close related PR and this issue, when you have issue or project of moving http4s mainline to Jakarta EE 9 level.

Did this mostly out of curiosity, because our actual stack is Tomcat anyway.

rossabaker commented 3 years ago

I think your PR (which I still haven't reviewed in depth -- I'll get there!) is still useful, because it handles some of the deprecations in modern Jetty. We'll just want to move it all the way to Jakarta.

rossabaker commented 1 year ago

Servlet 4 support arrived on series/0.24.