Skip to content

Auto-detect of Hilla application based on Hilla views in frontend folder #18577

Closed

Description

@mshabarov

Describe your motivation

Vaadin Flow should automatically detect if Hilla views are used or it's a plain Flow application. Flow chooses between hot-deploy mode and bundle mode at startup based on whether any Hilla view exists in the application.

Hilla views are detected based on the existence of frontend/routes.ts, frontend/routes.tsx, the content of routes object and any file inside frontend/views/.

This should replace existing EndpointRequestUtil.isHillaAvailable() checks, as EndpointRequestUtil.isHillaAvailable() is true always now with unified platform.

Additional context

Is there anything else you can add about the proposal?

Activity

  1. self-assigned this
    on Feb 1, 2024
  2. moved this from 🟢Ready to Go to ⚒️ In progress in Vaadin Flow | Hilla | Kits ongoing workon Feb 1, 2024
  3. tltv commented on Feb 2, 2024

    @tltv
    Contributor

    EndpointRequestUtil.isHillaAvailable() is still useful after adding new method to check if Hilla views are used. It will tell if hilla endpoint is in the classpath (whole hilla could be excluded explicitly for some cases), new method will tell if hilla views are used.

  4. mshabarov commented on Feb 2, 2024

    @mshabarov
    ContributorAuthor

    So "is Hilla used in the project" would mean "isHillaAvailable() AND Hilla views are used".

  5. tltv commented on Feb 2, 2024

    @tltv
    Contributor

    Precisely. And now that you mention that, it probably makes sense to add another utility method called isHillaUsed(File frontnedDir) in EndpointRequestUtil that does that.

  6. mshabarov commented on Feb 2, 2024

    @mshabarov
    ContributorAuthor

    EndpointRequestUtil is probably not a best place where this should be added, we can create a new util/helper class or extend FrontendUtils.

  7. added a commit that references this issue on Feb 2, 2024
    c46c374
  8. added a commit that references this issue on Feb 5, 2024
    469ee4c
  9. vaadin-bot commented on Feb 7, 2024

    @vaadin-bot
    Collaborator

    This ticket/PR has been released with Vaadin 24.4.0.alpha3 and is also targeting the upcoming stable 24.4.0 version.

  10. added a commit that references this issue on Feb 8, 2024
    81f17a5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions