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

Refactor VaadinHotswapper methods to take a single event paramter #20372

Open
mcollovati opened this issue Oct 29, 2024 · 0 comments
Open

Refactor VaadinHotswapper methods to take a single event paramter #20372

mcollovati opened this issue Oct 29, 2024 · 0 comments

Comments

@mcollovati
Copy link
Collaborator

VaadinHotswapper defines methods that take several parameters, like VaadinService, set of changed classes, redefine flag.
It would be good to refactor them to take a single parameter that encapsulates all the required information, to simplify refactorings avoiding breaking changes.
Existing methods can be deprecated, and the default implementation of new methods can delegate to them until they are removed.

    record HotswapEvent(VaadinService, Set<Class<?>>, redefined);
    default boolean onClassLoadEvent(HotswapEvent event) {
         return onClassLoadEvent(event.service, event.classes, event.redefined)
    }

    record HotswapSessionEvent(VaadinSession) extends HotswapEvent;
    default boolean onClassLoadEvent(HotswapSessionEvent event) {
         return onClassLoadEvent(event.session, event.classes, event.redefined)
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🅿️Parking lot - under consideration
Development

No branches or pull requests

1 participant