Skip to content
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

draft: add/move hilla dependencies #4953

Merged
merged 6 commits into from
Jan 29, 2024
Merged

draft: add/move hilla dependencies #4953

merged 6 commits into from
Jan 29, 2024

Conversation

ZheSun88
Copy link
Contributor

related to #4934 #4946

@@ -209,6 +209,11 @@
<artifactId>vaadin-menu-bar-flow</artifactId>
</dependency>

<dependency>
<groupId>com.vaadin.hilla</groupId>
<artifactId>hilla</artifactId>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better to add hilla to vaadin until at least we don't have a split for core and all react components?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, the idea to add hilla to vaadin-spring-boot-starter looks not that bad to me now. As Jakarta EE and Quarkus users can just not add vaadin-spring-boot-starter to their pom.xml and they won't have Spring and Hilla then.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would also make it pretty easy to exclude hilla by not using vaadin-spring-boot-starter because it is only a wrapper for vaadin-spring, vaadin-core and hilla. So the flow developer only has to add vaadin-spring and vaadin-core if they don't wanna deal with exclusions.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would also give easy option to divide it in two platform modules like vaadin-spring-boot-starter and vaadin-hilla-spring-boot-starter.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is to use one dependency vaadin-spring-boot-starter and avoid "hilla" artifacts, so having a second one with the hilla in the middle is approx. the same as have old hilla-spring-boot-starter.

@@ -209,6 +209,11 @@
<artifactId>vaadin-menu-bar-flow</artifactId>
</dependency>

<dependency>
<groupId>com.vaadin.hilla</groupId>
<artifactId>hilla</artifactId>
Copy link
Contributor

@mshabarov mshabarov Jan 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also I think we have to make changes in hilla artifact, so here are some possible actions:

  1. pom.xml can be retained as is in hilla.
  2. @NpmPackage annotations should be removed from hilla.
  3. hilla-react can be just removed from Hilla as it has the same pom.xml as hilla.
  4. hilla then is added to Platform.
    5. Flow adds these three react packages (Auto Crud etc.) if reactRouterEnabled=true otherwise it adds one lit form package (in NodeUpdater class).

UPD: 5. Flow adds these three react packages (Auto Crud etc.) if reactRouterEnabled=true and Hilla is used, otherwise, if reactRouterEnabled=false and Hilla is used, it adds one lit form package. Else, if pure Flow app, it doesn't add these deps. Can be done in NodeUpdater class.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flow adds these three react packages (Auto Crud etc.) if reactRouterEnabled=true otherwise it adds one lit form package (in NodeUpdater class).

I would vote against this; or add "if hilla is on the class path" - otherwise flow only apps gets react packages thanks to reactRouterEnabled=true as default

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or add "if hilla is on the class path"

Yes, agree, that's a good point.

I proposed to remove npm package annotations and add packages imperatively in NodeUpdater, so that to relief developers from excluding artifacts by themselves.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the wording for 5.

@tltv
Copy link
Member

tltv commented Jan 25, 2024

Build fails due to hilla-bom is not defining hilla-dev-mode.

<!-- workaround,should be removed after this module has been added to hilla-bom -->
<dependency>
<groupId>com.vaadin.hilla</groupId>
<artifactId>hilla-dev-mode</artifactId>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I missed something important, but how with this structure one can exclude all development related dependencies in hybrid app ? I expected only one step as previously - excluding vaadin-dev in pom.xml.
See my comment here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is only a bom, which doesn't bring in any dependency directly, as it is only under dependencyManagement.

also for this case, it is a workaround as hilla-dev-mode is not in hilla-bom yet

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, agree, maybe this isn't a better place to ask this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

However, not clear to me how Hilla dev things should be excluded in prod mode, and should they even be excluded?

@manolo manolo merged commit bb9d615 into main Jan 29, 2024
2 of 3 checks passed
@manolo manolo deleted the move-hilla-dependency branch January 29, 2024 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants