|
| 1 | +=== Upgrading from 3.x to 4.x |
| 2 | +You will find here notes/tips about how to migrate from 3.x to 4.x. |
| 3 | + |
| 4 | +[NOTE] |
| 5 | +===== |
| 6 | +This is a **work in progress** document, if something is wrong or missing please https://github.com/jooby-project/jooby/issues/new[report to Github] or better https://github.com/jooby-project/jooby/edit/3.x/docs/asciidoc/migration/4.x.adoc[edit this file and fix it] |
| 7 | +===== |
| 8 | + |
| 9 | +==== Requirements |
| 10 | + |
| 11 | +- Java 21 as minimum |
| 12 | + |
| 13 | +==== module-info.java |
| 14 | + |
| 15 | +Jooby is now compatible with Java Module system. |
| 16 | + |
| 17 | +Almost all Jooby components are now Java Modules, but not all them. For those where wasn't |
| 18 | +possible the Jooby module contains the `Automatic-Module-Name` manifest entry. |
| 19 | + |
| 20 | +==== Buffer API |
| 21 | + |
| 22 | +The package `io.jooby.buffer` is gone. It was replaced by `io.jooby.output` these classes |
| 23 | +are used mainly by the javadoc:MessageEncoder[] API, the new API is easier to use and has better |
| 24 | +performance. |
| 25 | + |
| 26 | +==== Value API |
| 27 | + |
| 28 | +The new package is now `io.jooby.value`. The API has now decoupled from javadoc:Context[] |
| 29 | +in future release will be the basis of a new configuration system. |
| 30 | + |
| 31 | +Also, the `io.jooby.ValueNode` and `io.jooby.ValueNodeConverter` are gone. |
| 32 | + |
| 33 | +==== Session API |
| 34 | + |
| 35 | +For security reasons, the default HTTP session was removed. You need to configure the session |
| 36 | +explicitly and provide a cookie session name. The `jooby.sid` cookie name was removed from project. |
| 37 | + |
| 38 | +==== Server configuration |
| 39 | + |
| 40 | +The `install(Server)`, `setServerOptions`, `start()` method are gone. With the new support for |
| 41 | +multiple applications in a single server, these methods are useless. |
| 42 | + |
| 43 | +The new way: |
| 44 | + |
| 45 | +.New way to boot |
| 46 | +---- |
| 47 | +runApp(args, new NettyServer(new ServerOptions()), App::new); |
| 48 | +---- |
| 49 | + |
| 50 | + |
| 51 | +==== Packages |
| 52 | +|=== |
| 53 | +|3.x|4.x|Module |
| 54 | +|io.jooby.buffer| io.jooby.output | replacement jooby (core) |
| 55 | +|=== |
| 56 | + |
| 57 | +==== Classes |
| 58 | +|=== |
| 59 | +|3.x|4.x|Description|Module |
| 60 | +|io.jooby.buffer.*|-| removed | jooby (core) |
| 61 | +||io.jooby.output.*| new output API | jooby (core) |
| 62 | +|io.jooby.MvcFactory|-| was deprecated and now removed | jooby (core) |
| 63 | +|io.jooby.annotation.ResultType|-| removed | jooby (core) |
| 64 | +|io.jooby.ValueNode|io.jooby.value.Value| replaced/merged | jooby (core) |
| 65 | +|io.jooby.ValueNodeConverter|io.jooby.value.ValueConverter| replaced/merged | jooby (core) |
| 66 | +|io.jooby.RouteSet|io.jooby.Route.Set| moved into Route and renamed to Set | jooby (core) |
| 67 | +|=== |
| 68 | + |
| 69 | +==== Method |
| 70 | +|=== |
| 71 | +|2.x|3.x|Description |
| 72 | +|io.jooby.Jooby.setServerOptions()|Server.setOptions()| removed in favor of `Server.setOptions()` |
| 73 | +|io.jooby.Router.mvc|-| it was deprecated and now removed |
| 74 | +|io.jooby.Router.decorator|-| it was deprecated and now removed |
| 75 | +|io.jooby.Router.getConverters|io.jooby.Router.getValueFactory| replaced |
| 76 | +|io.jooby.Router.getBeanConverters|io.jooby.Router.getValueFactory| replaced |
| 77 | +|io.jooby.Router.attribute(String)|Router.getAttribute(String)| Renamed |
| 78 | +|io.jooby.Router.RouteOption|io.jooby.RouterOptions| Moved to `RouterOptions` |
| 79 | +|io.jooby.Router.setTrustProxy|RouterOptions.setTrustProxy| Moved to `RouterOptions` |
| 80 | +|=== |
0 commit comments