Why does activator hang when loading existing project in UI mode? - sbt

I'm migrating a project from terminal-based SBT to Typesafe Activator. It was my understanding that this would be a seamless process as the Typesafe Activator is using SBT underneath.
However, every time I try to load my existing project the Typesafe Activator console window displays "Compiling project definition...". Nothing else happens, no matter how long I wait. When I try to run the project only using SBT, everything works as before.

activator shell command should work anytime sbt does but activator ui (UI mode) has limitations that will keep it from working with many projects for now.
See Typesafe Activator - An Update and Roadmap Preview for the long story.

Related

Is it possible for dotnet watch to only build the changed ASP.NET project and not the projects it depended on?

I'm developing a Blazor application and I'm running dotnet watch on it for the hot module reload properties. It works great and fast when it is a standalone project, but after I introduced a DTO project and a client project as dependencies, it looks the dotnet watch has to build the two extra projects on every reload (if I understand it correctly) and the reload is a lot slower. Is there any way to somehow cache the projects? Does something like Vite not do that for fast Hot module reload? Or am I doing something wrong or misunderstand the dotnet watch?
Maybe it's something to do with the projects it depends on, which in that case is just bad luck and I'll have to live with the slow reload.
I have looked at the official Microsoft doc. and couldn't find anything relevant, might have missed something?
I have also tried the command:
dotnet watch run --no-dependencies
It seems like that the dependency projects is no longer build (they no longer appear in the cmd output) but it's still slow.

Code to Test In Blazor WASM (make it NOT slow)

How can I faster test changes in Layout using Blazor?
I used to code websites in good old Apache+PHP+MySQL. and now I am starting with some development in Blazor.
But I find it difficult to work on the user interface. When I need to test a small change, for instance moving a entry in a web form from one row to another...
Blazor WASM development process:
Edit the code
Shutdown the browser
Recompile (Pray that it compiles...)
Wait for the webapp+API-App+Identity App to startup
Navigate to the page I am making layout on.
PHP+X Process
Edit the code
Press F5
I wish for a similar experience.
How can I decrease the development code/test UI time when using Blazor?
The simplest way to do interactive development is using dotnet watch run from a command prompt (I add a .cmd script to my projects to run this for the project). This will run the project and watch for changes to files, then re-compile the project.
On .NET 3.x Blazor you'll have to refresh the browser (F5). On .NET 5 projects it does this automatically.
You may also want to read RĂ©mi Bourgarel's Blog article on this, although I am not sure all his points are still valid if you're using .NET 5.

How to set application name at runtime

Whether I run my JavaFX application in the IDE or build and run the .jar, the application's name showing in the toolbar is basically the Main class :
I tried to build the artifact with IntelliJ and also with Maven ($ mvn clean package), but same result for both. I'm using JDK8 on Ubuntu.
Is there a way to change the application name/title?
Thanks.
As far as I know there is no programmatic way to set the application name in JavaFX. This can however be done when you package your application via the new jpackage tool (JDK 14).

Spring boot hot deployment for templates and resources under IntelliJ

Is anyone aware of a mechanism to get hot deployment for resources and template working under IntelliJ 14.0.2 for a Spring Boot application.
I know that full Spring Boot support is scheduled for 14.1 but I have a project that I converted over from a standard WAR project to a Spring Boot project and I really miss the hot deployment.
At the moment I have to manually build the project that the resources are in to get hot deployment and even then it is a bit flaky sometimes. I would prefer to just save a template or a javascript/css file and get it picked up as I did when I was running my app using a local tomcat server via IntelliJ.
I could switch back to Eclipse to get this working, but my project is Scala based and IntelliJ Scala support is far superior.
So after some testing I came to few conclusions I think someone arriving here may find useful:
If you are running embedded spring boot application from IntelliJ IDEA (myself on 14 at the moment) in debug mode and you want to hot re-deploy resources you can do that via: Run -> Reload changed classes. Setting a keyboard shortcut much recommended.
Don't get fooled by Loaded classes are up to date. Nothing to reload. message. Your static resources have been updated (tested on .js files and Thymeleaf templates).
As pointed out in comments for thymeleaf templates hot-redeploy you would need:
spring.thymeleaf.cache=false
If you are running in external container IntelliJ provides extra features like action on Frame deactivation which is extremely handy for web development. This works fine as well just beware that external Jetty container on 9.2.7 will cause troubles, i.e. unload the resources on Update resources action breaking your webapp. The only fix was app restart for me. Works nicely in Tomcat 8 though.
As instructed here adding spring-boot-devtools dependency will enable static resources reloading (templates and css).
Beware that you need to select Build -> Compile for this to work.
Install jetbrains-ide-support
Start your Spring Boot app
Go in browser and open your_project_page(http://localhost:8080/)
right mouse click(on your page) -> choose "Inspect in IDEA"

running html version of playn

I have playn installed on eclipse (http://code.google.com/p/playn/wiki/GettingStarted#Running_via_Eclipse), i loaded the sample programs and they load file, the java one runs fine. But for html
I right click the showcase-html > google > compile
I don't get any errors:
Compiling module playn.showcase.Showcase
Compiling 1 permutation
Compiling permutation 0...
Compile of permutations succeeded
Linking into C:\Users\(my path)\playn-samples\showcase\html\target\playn-showcase-html-1.0-SNAPSHOT\showcase
Link succeeded
Compilation succeeded -- 12.208s
then
run as > web application
I get a url in the development tab:
http://127.0.0.1:8888/Showcase.html?gwt.codesvr=127.0.0.1:9997
when I run this it hangs my browser
when I run this:
http://127.0.0.1:8888/Showcase.html
it says "GWT MODULE MAY NEED TO BE (RECOMPILED)" on a popup and loads nothing.
Any idea what might be wrong?
I don't recommend using Eclipse to compile and test the HTML5 backend of a PlayN game.
Develop and test using the Java backend, and when the time comes to build the HTML5 version, use the Maven command line to build and test it. It is far more reliable.
However, if you insist on testing the HTML5 backend in Eclipse, you have to be careful. What you've done above is to first compile the Java code to JavaScript (by using Google -> Compile) and then overwritten the compiled JavaScript with GWT devmode stubs (when you used Run as -> Web application).
Instead, you should use Google -> Compile, and then expand playn-showcase-html -> target -> playn-showcase-html-1.0-SNAPSHOT and right click on Showcase.html and select Open With -> Web Browser. EDIT: You'll need to run the generated code in a webserver to avoid crosssite scripting issues.
You never want to use GWT devmode (Run as -> Web application) to test the HTML5 backend of your game, because GWT devmode is pathologically slow for running high-performance code like an HTML5 game.

Resources