i took a quick look at the vaadin 25 alpha11 with the latest spring boot 4 SNAPSHOT
is vaadin 25 only compatible currently with spring boot 3 since spring boot 3 is not released yet?
the blog says there is already support for spring 7
on application start i get this error:
***************************
APPLICATION FAILED TO START
***************************
Description:
Parameter 0 of method pushEndpoint in com.vaadin.hilla.push.PushConfigurer required a bean of type 'org.springframework.http.converter.json.Jackson2ObjectMapperBuilder' that could not be found.
Action:
Consider defining a bean of type 'org.springframework.http.converter.json.Jackson2ObjectMapperBuilder' in your configuration.
Jackson2ObjectMapperBuilder seems to be deprecated in spring 7 (spring boot 4)
You can try Vaadin 25.0 alpha11 by using Spring Boot 4.0 M2 instead of M3. Or as Artur said, wait until tomorrow when the next alpha is hopefully done.
Thanks, its totally understandable that things might break, being unfinished and not yet documented in this stage where at the same time spring 7 and spring boot 4 is not released yet. i am looking forward for the new vaadin 25 version. i am not being scared of making fixes here and there for spring boot compatabilty. i am more afraid of migrating my lumo theme customizations
next problem the security settings dont work any more for the vaadin flow views.
@RolesAllowed(UserRole.USER)
@Route(layout = MyAppLayoutRouterLayout.class)
public class MainView extends SceneReleaseView {
}
now i am wondering if there is a change how to implement security in vaadin 25 or there is a breaking change in spring security. the login authentication seem to work, i get redirected after successful login from the /login page back to the mainview. but i can not access the main view
well, then i have to set @PermitAll on the AppLayout since there is no @Authenticated annotation, but on the views which using the applayout i will override with specific requirements @RolesAllowed.
One thing to note is that if all views that use MyAppLayoutRouterLayout require UserRole.USER or stricter, then the behavior in Vaadin 25 allows you to add that @RolesAllowed on the layout but omit it from each individual view.
We’ve tried to minimize breaking changes to Lumo, but there are some. Please let us know if you find something that is completely broken, we’ll take a look if that is intentional or not.
I am using the “/src/main/fronted/themes/my-theme/component-styles” folder to apply some modifications to my theme. it works in general still in vaadin 25 which is nice. but for example the styling for the “LoginOverlay” component stopped working.
there is this file “/src/main/fronted/themes/my-theme/component-styles/vaadin-login-overlay-wrapper.css”
No setting is applied from this file.
The image is in the folder “…/my-theme/images/image.jpg”. But the custom color for the “brand” part is also not working.
it might be probably something security related. for some reason no css resources from the component-styles folder are loaded for an the LoginView which is accessible by non authenticated users.
@Route(value = LoginView.ROUTE)
@PageTitle("Login")
@AnonymousAllowed
public class LoginView extends LoginOverlay implements BeforeEnterObserver {
public static final String ROUTE = "login";
i saw in the blog for the vaadin 25 preview a new theme “Aura” mentions. But currently i can not find a themeClass for the @Theme annotation to activate this new theme. The default seems to be “Lumo.class”
just checked alpha12 with spring boot 4 M3 and it worked fine. Had to make some small adjustments to the MainLayout from the starter, though, implement AfterNavigationObserver.
I’d like to check out Aura as well. The @Theme annotation is marked as deprecated in Vaadin 25, and there are properties to use instead (or are those AI hallucinations?), but claude couldn’t make it work neither for aura nor lumo, so I’m sticking with @Theme and Lumo.class for now, until Aura is available or i figure out how to use it.
thank you! it works perfect now. also switched to vaadin-alpha12 and spring-boot 4.0.0-M3 (even on github its already alpha18, but the maven download does work only for alpha12)
when switching from alpha11 to alpha12 i noticed that you can not override
AppLayout::afterNavigation anymore.
i am overriding now AppLayout::showRouterLayoutContent instead to implement some “after navigation” logic for any AppLayout navigation. is this the "correct way to this?
@Theme is deprecated since alpha12 i see. i have so many questions.
do we still use the “/src/main/frontend/themes” folder? the documentation says we should use @Css import with “src/main/resources/META-INF/resources/frontend” but i dont understand the java doc examples.
where to put the custom theme now to use it with @CssImport? what value has to be used in @CssImport so that it is able to find the theme?
using @CssImport(“./themes/my-theme/styles.css”) does not work instead @Theme(“my-theme”). it pick up my css but no lumo theme is applied.
We’re still working on the alternative for the theme folder, and the docs have not been updated at all yet. In general you should be able to keep using your theme folder and @Theme for now until things have settled.
One alternative is to use @CssImport and point it at the styles.css you currently have in your theme folder:
@CssImport("./themes/my-theme/styles.css")
Without @Theme, Lumo is not loaded automatically anymore. So to keep using it you should also add this import to your main stylesheet:
@import '@vaadin/vaadin-lumo-styles/lumo.css';
With @CssImport you are also not bound to the old theme folder structure. You can move your stylesheets anywhere else, as long as its in the frontend folder.
thx! it works now with @CssImport(“./themes/my-theme/styles.css”) and the import for lumo.
Another Question. i have the file “theme.json” in my theme folder. i am not sure what its used for. but i guess its not picked up by the new @CssImport.