Skip to content

Commit 23c57c8

Browse files
authored
feat!: rename enableDevServer (#15759)
Rename enableDevServer to frontendHotdeploy as devServer can at the moment mean too many things. Part of #15743
1 parent 5d0fb3f commit 23c57c8

28 files changed

+72
-80
lines changed

flow-client/eclipse/GWT tests.launch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@
2525
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.vaadin.client.GwtSuite"/>
2626
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="flow-client"/>
2727
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
28-
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dgwt.args=&quot;-war target/www-test -logLevel INFO -prod -ea -sourceLevel 1.8 -runStyle HtmlUnit:FF38 -style PRETTY&quot; -Dvaadin.enableDevServer=false"/>
28+
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dgwt.args=&quot;-war target/www-test -logLevel INFO -prod -ea -sourceLevel 1.8 -runStyle HtmlUnit:FF38 -style PRETTY&quot; -Dvaadin.frontend.hotdeploy=false"/>
2929
</launchConfiguration>

flow-plugins/flow-maven-plugin/src/test/java/com/vaadin/flow/plugin/maven/PrepareFrontendMojoTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public void tokenFileShouldExist_noDevModeTokenVisible()
161161
}
162162

163163
@Test
164-
public void existingTokenFile_enableDevServerShouldBeRemoved()
164+
public void existingTokenFile_frontendHotdeployShouldBeRemoved()
165165
throws IOException, MojoExecutionException, MojoFailureException {
166166

167167
JsonObject initialBuildInfo = Json.createObject();

flow-server/src/main/java/com/vaadin/flow/server/AbstractConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public interface AbstractConfiguration extends Serializable {
4646
*
4747
* @return true if dev server should be used
4848
*/
49-
default boolean enableDevServer() {
49+
default boolean frontendHotdeploy() {
5050
if (isProductionMode()) {
5151
return false;
5252
}

flow-server/src/main/java/com/vaadin/flow/server/DefaultDeploymentConfiguration.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public class DefaultDeploymentConfiguration
9393
private boolean syncIdCheck;
9494
private boolean sendUrlsAsParameters;
9595
private boolean requestTiming;
96-
private boolean enableDevServer;
96+
private boolean frontendHotdeploy;
9797

9898
private static AtomicBoolean logging = new AtomicBoolean(true);
9999
private List<String> warnings = new ArrayList<>();
@@ -247,8 +247,8 @@ public PushMode getPushMode() {
247247
}
248248

249249
@Override
250-
public boolean enableDevServer() {
251-
return enableDevServer;
250+
public boolean frontendHotdeploy() {
251+
return frontendHotdeploy;
252252
}
253253

254254
/**
@@ -383,8 +383,8 @@ private void checkSendUrlsAsParameters() {
383383
}
384384

385385
private void checkFrontendHotdeploy() {
386-
enableDevServer = getBooleanProperty(InitParameters.FRONTEND_HOTDEPLOY,
387-
DEFAULT_FRONTEND_HOTDEPLOY);
386+
frontendHotdeploy = getBooleanProperty(
387+
InitParameters.FRONTEND_HOTDEPLOY, DEFAULT_FRONTEND_HOTDEPLOY);
388388
}
389389

390390
}

flow-server/src/main/java/com/vaadin/flow/server/PropertyDeploymentConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,11 @@ public boolean isProductionMode() {
148148
}
149149

150150
@Override
151-
public boolean enableDevServer() {
151+
public boolean frontendHotdeploy() {
152152
if (isOwnProperty(FRONTEND_HOTDEPLOY)) {
153153
return getBooleanProperty(FRONTEND_HOTDEPLOY, false);
154154
}
155-
return parentConfig.enableDevServer();
155+
return parentConfig.frontendHotdeploy();
156156
}
157157

158158
@Override

flow-server/src/main/java/com/vaadin/flow/server/StaticFileServer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ public boolean serveStaticResource(HttpServletRequest request,
264264
deploymentConfiguration.getProjectFolder(),
265265
"webapp/" + filenameInsideBundle);
266266
} else if (APP_THEME_PATTERN.matcher(filenameWithPath).find()) {
267-
if (!deploymentConfiguration.enableDevServer()) {
267+
if (!deploymentConfiguration.frontendHotdeploy()) {
268268
resourceUrl = findAssetInFrontendThemesOrDevBundle(
269269
vaadinService,
270270
deploymentConfiguration.getProjectFolder(),

flow-server/src/main/java/com/vaadin/flow/server/VaadinServletService.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
import com.vaadin.flow.function.DeploymentConfiguration;
3535
import com.vaadin.flow.internal.DevModeHandler;
3636
import com.vaadin.flow.internal.DevModeHandlerManager;
37-
import com.vaadin.flow.internal.UsageStatistics;
3837
import com.vaadin.flow.server.communication.FaviconHandler;
3938
import com.vaadin.flow.server.communication.IndexHtmlRequestHandler;
4039
import com.vaadin.flow.server.communication.PushRequestHandler;
@@ -86,7 +85,7 @@ protected List<RequestHandler> createRequestHandlers()
8685
List<RequestHandler> handlers = super.createRequestHandlers();
8786
handlers.add(0, new FaviconHandler());
8887

89-
if (getDeploymentConfiguration().enableDevServer()) {
88+
if (getDeploymentConfiguration().frontendHotdeploy()) {
9089
Optional<DevModeHandler> handlerManager = DevModeHandlerManager
9190
.getDevModeHandler(this);
9291
if (handlerManager.isPresent()) {

flow-server/src/main/java/com/vaadin/flow/server/communication/IndexHtmlRequestHandler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public boolean synchronizedHandleRequest(VaadinSession session,
115115

116116
configureHiddenElementStyles(indexDocument);
117117

118-
if (!config.enableDevServer()) {
118+
if (!config.frontendHotdeploy()) {
119119
addStylesCssLink(config, indexDocument);
120120
}
121121

@@ -413,7 +413,7 @@ private static Document getIndexHtmlDocument(VaadinService service)
413413
if (config.isProductionMode()) {
414414
// The index.html is fetched from the bundle so it includes the
415415
// entry point javascripts
416-
} else if (!service.getDeploymentConfiguration().enableDevServer()) {
416+
} else if (!service.getDeploymentConfiguration().frontendHotdeploy()) {
417417
// When running without a frontend server, the index.html comes
418418
// directly from the frontend folder and the JS entrypoint(s) need
419419
// to be added

flow-server/src/main/java/com/vaadin/flow/server/frontend/AbstractUpdateImports.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,8 @@ && frontendFileExists(localModulePath)) {
382382
}
383383

384384
boolean devModeWithoutServer = !options.productionMode
385-
&& !options.isEnableDevServer() && !options.isDevBundleBuild();
385+
&& !options.isFrontendHotdeploy()
386+
&& !options.isDevBundleBuild();
386387
if (!npmNotFound.isEmpty() && getLogger().isInfoEnabled()
387388
&& !devModeWithoutServer) {
388389
getLogger().info(notFoundMessage(npmNotFound,

flow-server/src/main/java/com/vaadin/flow/server/frontend/NodeTasks.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
import java.util.List;
2424
import java.util.Set;
2525

26-
import org.slf4j.LoggerFactory;
27-
2826
import com.vaadin.experimental.FeatureFlags;
2927
import com.vaadin.flow.di.Lookup;
3028
import com.vaadin.flow.internal.UsageStatistics;
@@ -158,7 +156,7 @@ public NodeTasks(Options options) {
158156
addGenerateServiceWorkerTask(options,
159157
frontendDependencies.getPwaConfiguration());
160158

161-
if (options.productionMode || options.isEnableDevServer()
159+
if (options.productionMode || options.isFrontendHotdeploy()
162160
|| options.isDevBundleBuild()) {
163161
addGenerateTsConfigTask(options);
164162
}
@@ -207,7 +205,7 @@ public NodeTasks(Options options) {
207205
pwa = new PwaConfiguration();
208206
}
209207
commands.add(new TaskUpdateSettingsFile(options, themeName, pwa));
210-
if (options.productionMode || options.isEnableDevServer()
208+
if (options.productionMode || options.isFrontendHotdeploy()
211209
|| options.isDevBundleBuild()) {
212210
commands.add(new TaskUpdateVite(options));
213211
}
@@ -230,7 +228,7 @@ public NodeTasks(Options options) {
230228

231229
private void addBootstrapTasks(Options options) {
232230
commands.add(new TaskGenerateIndexHtml(options));
233-
if (options.productionMode || options.isEnableDevServer()
231+
if (options.productionMode || options.isFrontendHotdeploy()
234232
|| options.isDevBundleBuild()) {
235233
commands.add(new TaskGenerateIndexTs(options));
236234
if (!options.productionMode) {

0 commit comments

Comments
 (0)