Skip to content
Closed

WIP 4.x #3697

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
8c8d9f3
value api: remove context from api and internal classes
jknack Jun 16, 2025
e042e6b
value api: fix tests + code cleanup
jknack Jun 18, 2025
a802108
value api: fix tests
jknack Jun 19, 2025
0be56e5
value api: remove internal class ValueConverters
jknack Jun 19, 2025
e293f85
value api: remove Value/BeanConverter
jknack Jun 19, 2025
be75181
value api: merge builtin converter into standard converter
jknack Jun 19, 2025
5e4c455
value api: replace `convertXXX` with hint parameter
jknack Jun 19, 2025
afa3b3f
value api: reduce API by removing `ValueNode`
jknack Jun 19, 2025
c474469
value api: move Value to `value` package
jknack Jun 19, 2025
23fe055
value api: make reflective bean converter a converter and use method …
jknack Jun 19, 2025
707fb7f
value api: remove `@EmptyBean` annotation and make `QueryString.toNul…
jknack Jun 21, 2025
379f8fe
value api: javadoc for ValueFactory
jknack Jun 21, 2025
bcc8ae4
value api: move reflective and standard converter to public package
jknack Jun 21, 2025
94f37c0
output api:
jknack Jun 26, 2025
b40f3ef
output api: completely remove DataBuffer from source code (happy to d…
jknack Jun 26, 2025
492c516
output api: remove public chunked version (no need to be public)
jknack Jun 26, 2025
056d55f
output api: code clean up + refactor
jknack Jun 26, 2025
0b127d8
output api: doc, code cleanup + refactor
jknack Jun 27, 2025
8571614
output api: remove wrap from Output
jknack Jun 27, 2025
1a03a6f
netty: clean up netty source code
jknack Jun 27, 2025
790c7fe
netty: more code cleanup
jknack Jun 28, 2025
c419435
output api: rename to buffered output + add buffer options
jknack Jun 28, 2025
0032049
netty: fix outputstream with new buffer size
jknack Jun 28, 2025
49fc58f
router: remove setServerOptions from router fix #3703
jknack Jun 29, 2025
d8c9c3e
remove: Jooby.start() fix #3704
jknack Jun 29, 2025
0793992
remove: MvcFactory fix #3705
jknack Jun 29, 2025
ded9a21
remove: MvcFactory
jknack Jun 30, 2025
0e01cf4
remove: MvcFactory
jknack Jun 30, 2025
647520a
context: move default method to defaultcontext
jknack Jun 30, 2025
b882feb
session: require cookie session name
jknack Jun 30, 2025
bb83266
jooby-apt: should not generate META-INF/services by default fix #3542
jknack Jun 30, 2025
71305e1
jooby-apt: turn off mvcMethod generator by default fix #3535
jknack Jun 30, 2025
5ff899a
router: clean up
jknack Jun 30, 2025
dadaca4
router: remove deprecated code
jknack Jun 30, 2025
66e14eb
router: improve routeSet API
jknack Jun 30, 2025
eee7937
open api: remove dead code
jknack Jun 30, 2025
9af5e36
route: remove handle field
jknack Jun 30, 2025
635688b
router: make router option a class
jknack Jul 1, 2025
3878647
Merge branch '3.x' into 4.x
jknack Jul 1, 2025
0aacf7b
Merge branch '3.x' into 4.x
jknack Jul 2, 2025
02a9b6e
refactor: move RouteSet as inner class of Route and rename to Set, so…
jknack Jul 2, 2025
161f147
refactor: Context: replace call to getRouter.getValueFactory by getVa…
jknack Jul 2, 2025
91f121f
refactor: code cleanup
jknack Jul 2, 2025
b934718
refactor: rename buffer interal package
jknack Jul 3, 2025
30d5ad1
upgrade: hibernate-orm 7.0 and hibernate-validator 9.0
jknack Jul 3, 2025
5c1377b
refactor: remove deprecated code
jknack Jul 3, 2025
5a1c064
Merge branch '3.x' into 4.x
jknack Jul 7, 2025
993782b
remove: ResultType annotation
jknack Jul 10, 2025
ced3b2a
jetty: remove usage of deprecated method
jknack Jul 10, 2025
2e4e193
netty: get back custom headers implementation
jknack Jul 13, 2025
76d391f
output api: make sure outputfactory is accessible while creating the …
jknack Jul 14, 2025
1761a34
netty: improve performance by caching the content-length header on by…
jknack Jul 14, 2025
7987cd1
Merge branch '3.x' into 4.x
jknack Jul 17, 2025
71e2581
Merge branch '3.x' into 4.x
jknack Jul 17, 2025
15ad691
server: remove server from application
jknack Jul 18, 2025
43a7951
Merge branch '3.x' into 4.x
jknack Jul 19, 2025
6671558
buffer: bug fixing
jknack Jul 19, 2025
97ad1ef
performance: attempt to improve performance
jknack Jul 20, 2025
2f39651
output: remove buffer name from output classes
jknack Jul 20, 2025
8c37006
server: make server options available on app initialization
jknack Jul 20, 2025
3dbbddd
router: move more options to corresponding class
jknack Jul 20, 2025
c207551
Merge branch '3.x' into 4.x
jknack Jul 21, 2025
27a3650
open-api: javadoc
jknack Jul 22, 2025
5ea74d6
output-api: refactor API
jknack Jul 23, 2025
bc0d836
performance: netty optimize response headers
jknack Jul 23, 2025
2807a23
open-api: mock of javadoc
jknack Jul 23, 2025
8b3ee28
doc: migration notes for 4.x
jknack Jul 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion docs/asciidoc/body.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Raw `request body` is available via javadoc:Context[body] method:
<2> `HTTP Body` as `byte array`
<3> `HTTP Body` as `InputStream`

This give us the `raw body`.
This gives us the `raw body`.

==== Message Decoder

Expand Down
1 change: 1 addition & 0 deletions docs/asciidoc/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ Latest Release: https://github.com/jooby-project/jooby/releases/tag/v{joobyVersi

Looking for a previous version?

* Access to link:v3[3.x] documentation. See link:/migration/4.x[migrating from 3.x to 4.x]
* Access to link:v2[2.x] documentation. See link:/migration/3.x[migrating from 2.x to 3.x]
* Access to link:v1[1.x] documentation.
====
Expand Down
1 change: 1 addition & 0 deletions docs/asciidoc/migration.adoc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include::migration/4.x.adoc[]
include::migration/3.x.adoc[]

=== Upgrading from 1.x to 2.x
Expand Down
80 changes: 80 additions & 0 deletions docs/asciidoc/migration/4.x.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
=== Upgrading from 3.x to 4.x
You will find here notes/tips about how to migrate from 3.x to 4.x.

[NOTE]
=====
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]
=====

==== Requirements

- Java 21 as minimum

==== module-info.java

Jooby is now compatible with Java Module system.

Almost all Jooby components are now Java Modules, but not all them. For those where wasn't
possible the Jooby module contains the `Automatic-Module-Name` manifest entry.

==== Buffer API

The package `io.jooby.buffer` is gone. It was replaced by `io.jooby.output` these classes
are used mainly by the javadoc:MessageEncoder[] API, the new API is easier to use and has better
performance.

==== Value API

The new package is now `io.jooby.value`. The API has now decoupled from javadoc:Context[]
in future release will be the basis of a new configuration system.

Also, the `io.jooby.ValueNode` and `io.jooby.ValueNodeConverter` are gone.

==== Session API

For security reasons, the default HTTP session was removed. You need to configure the session
explicitly and provide a cookie session name. The `jooby.sid` cookie name was removed from project.

==== Server configuration

The `install(Server)`, `setServerOptions`, `start()` method are gone. With the new support for
multiple applications in a single server, these methods are useless.

The new way:

.New way to boot
----
runApp(args, new NettyServer(new ServerOptions()), App::new);
----


==== Packages
|===
|3.x|4.x|Module
|io.jooby.buffer| io.jooby.output | replacement jooby (core)
|===

==== Classes
|===
|3.x|4.x|Description|Module
|io.jooby.buffer.*|-| removed | jooby (core)
||io.jooby.output.*| new output API | jooby (core)
|io.jooby.MvcFactory|-| was deprecated and now removed | jooby (core)
|io.jooby.annotation.ResultType|-| removed | jooby (core)
|io.jooby.ValueNode|io.jooby.value.Value| replaced/merged | jooby (core)
|io.jooby.ValueNodeConverter|io.jooby.value.ValueConverter| replaced/merged | jooby (core)
|io.jooby.RouteSet|io.jooby.Route.Set| moved into Route and renamed to Set | jooby (core)
|===

==== Method
|===
|2.x|3.x|Description
|io.jooby.Jooby.setServerOptions()|Server.setOptions()| removed in favor of `Server.setOptions()`
|io.jooby.Router.mvc|-| it was deprecated and now removed
|io.jooby.Router.decorator|-| it was deprecated and now removed
|io.jooby.Router.getConverters|io.jooby.Router.getValueFactory| replaced
|io.jooby.Router.getBeanConverters|io.jooby.Router.getValueFactory| replaced
|io.jooby.Router.attribute(String)|Router.getAttribute(String)| Renamed
|io.jooby.Router.RouteOption|io.jooby.RouterOptions| Moved to `RouterOptions`
|io.jooby.Router.setTrustProxy|RouterOptions.setTrustProxy| Moved to `RouterOptions`
|===
13 changes: 6 additions & 7 deletions docs/asciidoc/modules/redis.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,12 @@ import io.jooby.redis.RedisSessionStore;
import io.lettuce.core.RedisClient;

{
install(new RedisModule()); <1>
install(new RedisModule()); <1>

setSessionStore(new RedisSessionStore(require(RedisClient.class))); <2>
setSessionStore(new RedisSessionStore(Cookie.session("myappid"), require(RedisClient.class))); <2>

get("/", ctx -> {
Session httpSession = ctx.session(); <3>
Session httpSession = ctx.session(); <3>
// HTTP session is backed by Redis
});
}
Expand All @@ -160,12 +160,12 @@ import io.jooby.redis.RedisSessionStore
import io.lettuce.core.RedisClient

{
install(RedisModule()) <1>
install(RedisModule()) <1>

sessionStore = RedisSessionStore(require(RedisClient::class)) <2>
sessionStore = RedisSessionStore(Cookie.session("myappid"), require(RedisClient::class)) <2>

get("/") {
val httpSession = ctx.session() <3>
val httpSession = ctx.session() <3>
// HTTP session is backed by Redis
}
}
Expand All @@ -179,4 +179,3 @@ More Options:

- javadoc:redis.RedisSessionStore[setTimeout, java.time.Duration, artifact="jooby-redis"]: Set session timeout. Default is: `30 minutes`
- javadoc:redis.RedisSessionStore[setNamespace, java.lang.String, artifact="jooby-redis"]: Set key prefix. Default is: `sessions`
- javadoc:redis.RedisSessionStore[setToken, io.jooby.SessionToken, artifact="jooby-redis"]: Set session token. Default is a cookie token: `jooby.sid`
25 changes: 16 additions & 9 deletions docs/asciidoc/session.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@ objects. It's intended as a simple mechanism to store basic data (not an object

Jooby provides the following javadoc:SessionStore[]:

- In-Memory sessions - which you should combine with an a sticky sessions proxy if you plan to run multiple instances.
- In-Memory sessionswhich you should combine with a sticky sessions proxy if you plan to run multiple instances.
- Cookie sessions signed with a secret key
- JSON Web Token sessions

Since 4.0.0 no session is configured by default. Attempt to access to a session at runtime results
in exception.

=== In-Memory Session

Default session store uses memory to save session data. This store:
Expand All @@ -28,6 +31,8 @@ Default session store uses memory to save session data. This store:
[source,java,role="primary"]
----
{
setSessionStore(SessionStore.memory(Cookie.session("myappid")));

get("/", ctx -> {
Session session = ctx.session(); // <1>

Expand All @@ -42,6 +47,8 @@ Default session store uses memory to save session data. This store:
[source,kotlin,role="secondary"]
----
{
setSessionStore(SessionStore.memory(Cookie.session("myappid")))

get("/") {
val session = ctx.session() // <1>

Expand All @@ -56,7 +63,7 @@ Default session store uses memory to save session data. This store:
<2> Set a session attribute
<3> Get a session attribute

Session token/ID is retrieved it from request cookie. Default session cookie is javadoc:SessionToken[SID, text=jooby.sid]. To customize cookie details:
Session token/ID is retrieved it from request cookie. Default session cookie never expires, it is http only under the `/` path. To customize cookie details:

.In-Memory Session with Custom Cookie
[source,java,role="primary"]
Expand Down Expand Up @@ -92,7 +99,7 @@ Session token/ID is retrieved it from request cookie. Default session cookie is

<1> Set an `in-memory` session store with a custom cookie named: `SESSION`

Alternative you can use a request header to retrieve a session token/ID:
Alternatively, you can use a request header to retrieve a session token/ID:

.In-Memory Session with HTTP Header
[source,java,role="primary"]
Expand Down Expand Up @@ -177,9 +184,9 @@ Data sign/unsign is done using javadoc:Cookie[sign, java.lang.String, java.lang.
[source,java,role="primary"]
----
{
String secret = "super secret key"; // <1>
String secret = "super secret key"; // <1>

setSessionStore(SessionStore.signed(secret)); // <2>
setSessionStore(SessionStore.signed(Cookie.session("myappid"), secret)); // <2>

get("/", ctx -> {
Session session = ctx.session();
Expand All @@ -195,9 +202,9 @@ Data sign/unsign is done using javadoc:Cookie[sign, java.lang.String, java.lang.
[source,kotlin,role="secondary"]
----
{
val secret = "super secret key" // <1>
val secret = "super secret key" // <1>

sessionStore = SessionStore.signed(secret) // <2>
sessionStore = SessionStore.signed(Cookie.session("myappid"),secret) // <2>

get("/") {
val session = ctx.session()
Expand All @@ -220,7 +227,7 @@ Like with `memory` session store you can use HTTP headers:
{
String secret = "super secret key"; // <1>

setSessionStore(SessionStore.signed(secret, SessionToken.header("TOKEN"))); // <2>
setSessionStore(SessionStore.signed(SessionToken.header("TOKEN"), secret)); // <2>

get("/", ctx -> {
Session session = ctx.session();
Expand All @@ -238,7 +245,7 @@ Like with `memory` session store you can use HTTP headers:
{
val secret = "super secret key" // <1>

sessionStore = SessionStore.signed(secret, SessionToken.header("TOKEN")) // <2>
sessionStore = SessionStore.signed(SessionToken.header("TOKEN"), secret) // <2>

get("/") {
val session = ctx.session()
Expand Down
1 change: 0 additions & 1 deletion jooby/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@
<version>3.4.15</version>
<scope>test</scope>
</dependency>

</dependencies>

<build>
Expand Down
34 changes: 0 additions & 34 deletions jooby/src/main/java/io/jooby/BeanConverter.java

This file was deleted.

Loading
Loading