You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Jooby 2.x is a significant rewrite. The major breaking change is that there is no more Servlet support, which is a blocker for us.
Here are my notes from a quick investigation.
org.jooby.Result and org.jooby.Results are gone, the new io.jooby.Context should be used instead.
@Singleton
@Path("/something")
public class SomethingResource {
@GET
public Result getSomething(final Optional<String> maybeSomething) {
return Results.ok(...);
}
}
becomes
@Singleton
@Path("/something")
public class SomethingResource {
@GET
public void getSomething(final Optional<String> maybeSomething, final Context context) {
context.setResponseCode(StatusCode.OK);
}
}
public PluginApp build() {
final PluginApp app = new PluginApp(jackson, services, routeClasses);
final Environment origEnv = app.getEnvironment();
final Environment newEnv = new Environment(origEnv.getClassLoader(),
this.config.withFallback(origEnv.getConfig()),
origEnv.getActiveNames());
app.setEnvironment(newEnv);
return app;
}
org.jooby.Sse has become io.jooby.ServerSentEmitter
org.jooby.mvc.Local has become io.jooby.annotations.ContextParam
There is no injection framework in 2.x. Guice has been replaced with a simple hash map service registry. Extra work is needed to integrate Guice again: https://jooby.io/#dependency-injection-guice
As part of the upgrade, we should add a few tests (https://jooby.io/#testing) in our base framework, to help with such upgrades in the future.
The text was updated successfully, but these errors were encountered:
Jooby 2.x is a significant rewrite. The major breaking change is that there is no more Servlet support, which is a blocker for us.
Here are my notes from a quick investigation.
org.jooby.Result
andorg.jooby.Results
are gone, the newio.jooby.Context
should be used instead.becomes
Jooby#use(config)
has been removed: instead, we need to create a new environment (https://jooby.io/#configuration-custom-environment). Maybe something like that (untested):org.jooby.Sse
has becomeio.jooby.ServerSentEmitter
org.jooby.mvc.Local
has becomeio.jooby.annotations.ContextParam
As part of the upgrade, we should add a few tests (https://jooby.io/#testing) in our base framework, to help with such upgrades in the future.
The text was updated successfully, but these errors were encountered: