--
You received this message because you are subscribed to the Google Groups "Play framework dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Play framework dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework-dev+unsub...@googlegroups.com.
Hi Greg,Congrats and thanks to the team!Few questions about compile-time DI.• guice optional dependencyGuice DI support moved to separate module
In Play 2.6, the core Play module no longer includes Guice. You will need to configure the Guice module by adding
guice
to yourlibraryDependencies
:libraryDependencies += guice
Is it possible now to run a play app without a runtime dependency injection framework at all and only rely on compile-time DI?Sorry to ask but it was not obvious reading the documentation above.• Akka system retrievalAkka Migration
The deprecated static methods
play.libs.Akka.system
andplay.api.libs.concurrent.Akka.system
were removed. Please dependency inject anActorSystem
instance for access to the actor system.For Scala:
class MyComponent @Inject() (system: ActorSystem) { }
I presume the actour system can be retrieved from the app in the application builder and given as standard constructor parameter to the component?If I am not wrong it will be good to add this in the migration method for all the people using compile-time DI.Thanks,Mariot
--
You received this message because you are subscribed to the Google Groups "Play Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framewor...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/play-framework/CAA%3D11HyXpPPu8SW1zyv7icbJwJjoG17yr9d1HkeMmwAiTaNyzw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
This e-mail and all attachments are confidential and may also be privileged. If you are not the named recipient, please notify the sender and delete the e-mail and all attachments immediately. Do not disclose the contents to another person. You may not use the information for any purpose, or store, or copy, it in any way. Guardian News & Media Limited is not liable for any computer viruses or other material transmitted with or as part of this e-mail. You should employ virus checking software.Guardian News & Media Limited is a member of Guardian Media Group plc. Registered Office: PO Box 68164, Kings Place, 90 York Way, London, N1P 2AP. Registered in England Number 908396
akka-http is not mentioned anywhere in the migration document at: https://www.playframework.com/documentation/2.6.x/Migration26Where could I read about the rationale of using akka-http?It caused a breakage for me because in one of my pages I have an (intentionally) long-running future (that does an initial computation for the first page) but with akka-http it returns a 503 after 20 seconds.Looks like akka-http "request-timeout" setting is 20 seconds by default. A stack overflow question said to set this setting to any value to make it infinite.However I was not able to set it by going straight to akka-http docs. I went to Play docs and there was no mention of that setting ( https://www.playframework.com/documentation/2.6.x/SettingsAkkaHttp )Hacking around in AkkaHttpServer class I found this:val requestTimeoutOption = akkaConfig.getOptional[Duration]("requestTimeout")I tried setting this setting in application.conf like you would in akka-http. It didn't work on dev/test.I looked at the implementation of getOptional to find that actually I'd need to do this:play.server.akka.requestTimeout = nullI tried again, didn't work on dev & test - but did work in prod (I stage'd it).From this I learned that not all settings from application.conf will be picked up in dev/test.I tried setting PlayKeys.devSettings += "play.server.akka.requestTimeout" -> null in build.sbt but that didn't seem to work either for whatever reason (doing something wrong? But when I put PlayKeys.devSettings += "play.server.akka.requestTimeout" -> "null" it gave an exception)Hope this feedback is helpful in improving some things :-)
Should we mention the new PlayMinimalJava plugin in the release highlights or the migration guide?When using the minimal java plugin some dependencies and twirl template imports won't be included:
Some feedback from just a few minutes with 2.6:- I noticed the Configuration API changes and like the Type Class approach but having yet another API for traversing trees and extracting values seems unnecessary. Can it use the same API as the JSON API? Also, these API changes aren't mentioned in the Migration Guide.- I think the docs should be updated to use Twirl Template injection. I noticed that https://www.playframework.com/documentation/2.6.x/Migration26#Assets doesn't and I'm sure there are some other places that could benefit from template injection as well.
public MyController @Inject()(template: views.html.index) extends Controller {
def index = Action {
Ok(template())
}
}
@this(messagesApi: play.api.i18n.MessagesApi)
@()
@{messagesApi("hello.world")}
TwirlKeys.constructorAnnotations += "@javax.inject.Inject()"
Is it possible now to run a play app without a runtime dependency injection framework at all and only rely on compile-time DI?
Sorry to ask but it was not obvious reading the documentation above.
I presume the actour system can be retrieved from the app in the application builder and given as standard constructor parameter to the component?
--
You received this message because you are subscribed to the Google Groups "Play framework dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to play-framework-dev+unsub...@googlegroups.com.