Skip to content

Commit

Permalink
feat: implement Flow hotswap API
Browse files Browse the repository at this point in the history
Implements Flow hotswap API and removes the hotswap agent plugin.

Part of vaadin/flow#19261
  • Loading branch information
mcollovati committed Jul 1, 2024
1 parent c4dc4c2 commit a74c530
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 80 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,29 @@
import java.util.List;
import java.util.Set;

import com.vaadin.flow.hotswap.VaadinHotswapper;
import com.vaadin.flow.server.VaadinService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
* Takes care of updating internals of Hilla that need updates when application
* classes are updated.
*/
public class Hotswapper {
public class Hotswapper implements VaadinHotswapper {

private static boolean inUse;

private static Logger getLogger() {
return LoggerFactory.getLogger(Hotswapper.class);
}

@Override
public boolean onClassLoadEvent(VaadinService vaadinService, Set<Class<?>> classes, boolean redefined) {
onHotswap(redefined, classes.stream().map(Class::getName).toArray(String[]::new));
return false;
}

/**
* Called by hot swap solutions when one or more classes have been updated.
* <p>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
com.vaadin.hilla.Hotswapper
6 changes: 0 additions & 6 deletions packages/java/hilla-dev/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@
<version>${project.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.hotswapagent</groupId>
<artifactId>hotswap-agent</artifactId>
<version>1.4.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down

This file was deleted.

0 comments on commit a74c530

Please sign in to comment.