-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New flow-only project without hilla and react-components application test module #5060
Comments
I'm bit worried if this is what typical production Vaadin app builds start to look like 😬 I was also looking into a trimmed down projects with 24.4, as both the amount of dependencies and the artifact size grows significantly with it. Did you investigate if excluding the react stuff makes a difference for the artifact size or does it only add extra client side dependencies to look after? Do you happen to know what the
|
I haven't done any real world tests (wanted to checkout the first beta once I have time) - currently all my things are based on knowledge acquired from looking at the PRs in flow and the other repos :) My educational guess would be:
|
I created a branch that only exlcudes hilla: Not very pretty excludes, but this considerably trims down the jar size. I didn't go as far as you did excluding all react stuff, as then one would again need to get back to npm builds 😬 But this could maybe be basis for reactles project base as well. The (non-optimised) default front-end bundle grows a bit (1 extra request, ~ 200kb (~ 50kb compressed)). I didn't investigate if that is because of react stuff, but probably. But I'm (personally) ready to take that if I can avoid front-end build. Looking at excludes in above and e.g. in v24.4 quarkus branch, I would claim that this "unified platform" (whether you love the idea or not) is implemented in a wrong way. These exclusions underline that there is intermediate modules missing for hilla & flow, that would then be pulled together in an other. Now you need an axe to get something you want. There are very good reasons (performance, build time, artifact/fron-end weight, security) to trim down your projects/builds to minimum, and now that gets more complicated than it'd need to. Also, if existing users don't figure out to add these exclusions, they are getting a ton of new stuff both to their classpath and front-end bundle. I'm bit afraid this way there will be "surprises" when people just upgrade their minor versions. I'd instead of re-using the old module names, create new one. There could be for example be |
Those are two of my main concerns with the current approach. Coming from a highly restricted environment, I have to check and get approvements for everything transitive in my app. Therefore I'm trying to skim it down as much as possible. |
I know you are not the only one. Qualifying question, process involves also the front-end dependencies? (I can guess the answer based on your preferences, but just checkking) |
Yes, that's why I'm excluding the react-components -> reduce SBOMs; which we have to publish in our internal artifactory for our security guys. (I have developed a custom maven plugin that creates a combined SBOM from npm + maven dependencies to show the "real" dependencies of vaadin and not just the maven stuff for auditing - similar to the new flow maven plugin goal; just a little bit more features..) |
I suspect it would be difficult for users to understand the difference between If we assume that this is the solution we would want to have in the long term, then it opens the question on whether it would really be worthwhile to have an intermediate solution for a while rather than just going for |
There is no such a problem. People, especially the new ones, don't go to search.maven.org to look for dependecies they'd add to their app to add vaadin to it. And if they do, they are screwed already. New users take the modules we declared in the starter projects. |
Probably off topic; just saying: In my opinion it's wrong to have everything in com.vaadin:vaadin - as example: spring boot also does not have everything in a single dependency. You wanna develop flow? Use the vaadin-flow-spring-boot-starter. You also wanna start using hilla and/or react - simply add vaadin-hilla-spring-boot-starter next to your flow starter. I would say consistency is key here - not simplicity (a single bundle of mud) because of the additional complexity and problem this creates all sides It just feels wrong that I have to exclude Hilla from com.vaadin:vaadin in a Vaadin Quarkus or Jakarta EE app, so that I don't include Spring by accident |
Semantically meaningful names matter in lots of situations. Otherwise, we could just name dependencies
|
The comparison with Spring Boot is interesting even though I don't think it's fully comparable since we don't aspire to even get close to the same breadth. At the same time, Spring Boot also needs exclusions if you want to use Jetty instead of Tomcat so it's not like their approach is a panacea against application-level exclusions either. |
"Simplified" version of a spontaneous suggestion:
Quarkus + Jakarta could just include vaadin-flow as migration. |
With a bit of thinking, I'm quite sure this can be done in mostly backwards compatible manner. @Legioth If you are switiching from tomcat to jetty with Spring Boot, you are replacing a required transitive dependency (which has a good default that most people are happy with) to an alternative. Quite different to shipping everything in one dependency because somebody somewhere might need them all. If Spring Boot would ship all dependencies by default, they would need Initializr only to choose between Maven and Gradle 😁 |
I think that's the key to solving this puzzle. The As usual, we've got two different user categories to take into account. There's the new users who aren't yet familiar with exactly what the Vaadin platform is made up of and there's the veterans who know exactly what they want. For the veterans, there could be separate Spring Boot Starters for Flow and Hilla respectively along with similar Flow-branded dependencies for Quarkus, CDI and vanilla Servlet. These wouldn't include any UI components so the user should also separately choose separate dependencies for Flow, React and/or Lit with our without the commercial components. For new users, we would instead want to provide simplified single-dependency options tailored for the primary starting points: our own starting resources, Spring Initializer and the Quarkus extension directory. We want those dependencies to contain everything applicable so that new users can easily explore the possibilities. Our own starting points would use a single dependency with Spring Boot starters for both frameworks and all UI components for both Flow and React. 3rd party directories don't like to distribute commercial dependencies so Spring Initializer would have a similar dependency but without commercial components. Quarkus users would get a dependency with the extension for Flow and the open source Flow components. If we in the future make Hilla support Quarkus, then we would update this dependency to include Hilla and the open source React components whereas the other Quarkus extension intended for veterans would remain Flow-only. Would this seem like a good vision for the future? (Let's for the moment not think about how this might impact the already delayed Vaadin 24.4 release schedule.) |
I would prefer this, but I'm probably not seeing the whole picture you guys are planning for the next months/years - as of now (and how it currently looks with 24.4); that would be a good solution for the current problems.
Wouldn't this also mean flow-react has to be optional? Like e.g. flow-components?
Interesting; this would also mean that flow-react has to be excluded by default? Already in 24.4, otherwise you could get de-listed from Spring Initializer? |
Describe your motivation
Add a new test module into the platform and smoke tests for flow-only application that exclude hilla and react components.
To verify that this really works; the new SBOM Goal of flow could be executed and the created SBOM inspected that hilla and react-components are not there.
Example Pom:
Describe the solution you'd like
No response
Describe alternatives you've considered
No response
Additional context
Vaadin 24.4
The text was updated successfully, but these errors were encountered: