Skip to content

Commit b9caf98

Browse files
Merge pull request #99 from webfirmframework/dev-12.x.x
wffweb-12.0.6 release changes
2 parents 427a4f7 + e31e9e4 commit b9caf98

36 files changed

+3819
-1908
lines changed

.circleci/config.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,23 @@ jobs:
110110
name: Test
111111
command: mvn test
112112

113+
build-and-test-openjdk-24:
114+
docker:
115+
- image: cimg/openjdk:24.0
116+
working_directory: ~/wff/wffweb
117+
steps:
118+
# Checkout the code as the first step.
119+
- checkout:
120+
path: ~/wff
121+
# Use mvn clean and package as the standard maven build phase
122+
- run:
123+
name: Build
124+
command: mvn -B -DskipTests clean package
125+
# Then run your tests!
126+
- run:
127+
name: Test
128+
command: mvn test
129+
113130
workflows:
114131
# Below is the definition of your workflow.
115132
# Inside the workflow, you provide the jobs you want to run, e.g this workflow runs the build-and-test job above.
@@ -123,3 +140,4 @@ workflows:
123140
- build-and-test-openjdk-20
124141
- build-and-test-openjdk-21
125142
- build-and-test-openjdk-23
143+
- build-and-test-openjdk-24

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[![Build Status](https://img.shields.io/badge/build-passing-greensvg?style=flat)](https://app.circleci.com/pipelines/github/webfirmframework/wff?branch=master&filter=all)
22
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/410601e16dc54b0a973c03845ad790c2)](https://www.codacy.com/app/webfirm-framework/wff?utm_source=github.com&utm_medium=referral&utm_content=webfirmframework/wff&utm_campaign=Badge_Grade)
33
[![Stackoverflow](https://img.shields.io/badge/stackoverflow-wffweb-orange.svg)](https://stackoverflow.com/questions/tagged/wffweb)
4-
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.webfirmframework/wffweb/badge.svg)](https://search.maven.org/#artifactdetails%7Ccom.webfirmframework%7Cwffweb%7C12.0.5%7Cjar)
4+
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.webfirmframework/wffweb/badge.svg)](https://search.maven.org/#artifactdetails%7Ccom.webfirmframework%7Cwffweb%7C12.0.6%7Cjar)
55
[![javadoc](https://javadoc.io/badge2/com.webfirmframework/wffweb/javadoc.svg)](https://javadoc.io/doc/com.webfirmframework/wffweb)
66
[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-blue.svg?style=flat)](https://www.apache.org/licenses/LICENSE-2.0)
77

wffweb/pom.xml

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>com.webfirmframework</groupId>
66
<artifactId>wffweb</artifactId>
7-
<version>12.0.5</version>
7+
<version>12.0.6</version>
88

99
<properties>
1010
<maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format>
@@ -47,14 +47,15 @@
4747
<build>
4848
<plugins>
4949
<plugin>
50-
<groupId>org.apache.maven.plugins</groupId>
51-
<artifactId>maven-release-plugin</artifactId>
52-
<version>3.1.1</version>
50+
<groupId>org.sonatype.central</groupId>
51+
<artifactId>central-publishing-maven-plugin</artifactId>
52+
<version>0.8.0</version>
53+
<extensions>true</extensions>
5354
<configuration>
54-
<arguments>-Dgpg.passphrase=${gpg.passphrase}</arguments>
55+
<publishingServerId>central</publishingServerId>
56+
<autoPublish>false</autoPublish>
5557
</configuration>
5658
</plugin>
57-
5859
<plugin>
5960
<groupId>org.apache.maven.plugins</groupId>
6061
<artifactId>maven-gpg-plugin</artifactId>
@@ -72,7 +73,6 @@
7273
</execution>
7374
</executions>
7475
</plugin>
75-
7676
<plugin>
7777
<groupId>org.apache.maven.plugins</groupId>
7878
<artifactId>maven-compiler-plugin</artifactId>
@@ -102,7 +102,7 @@
102102
<plugin>
103103
<groupId>org.apache.maven.plugins</groupId>
104104
<artifactId>maven-javadoc-plugin</artifactId>
105-
<version>3.11.2</version>
105+
<version>3.11.3</version>
106106
<executions>
107107
<execution>
108108
<id>attach-javadocs</id>
@@ -126,15 +126,10 @@
126126

127127
<distributionManagement>
128128
<snapshotRepository>
129-
<id>sonatype-nexus-snapshots</id>
130-
<name>Sonatype Nexus snapshot repository</name>
131-
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
129+
<id>central-portal-snapshots</id>
130+
<name>Central Portal Snapshots repository</name>
131+
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
132132
</snapshotRepository>
133-
<repository>
134-
<id>sonatype-nexus-staging</id>
135-
<name>Sonatype Nexus release repository</name>
136-
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
137-
</repository>
138133
</distributionManagement>
139134

140135
<dependencies>
@@ -147,7 +142,7 @@
147142
<dependency>
148143
<groupId>com.fasterxml.jackson.core</groupId>
149144
<artifactId>jackson-databind</artifactId>
150-
<version>2.19.0</version>
145+
<version>2.19.2</version>
151146
<scope>test</scope>
152147
</dependency>
153148
<dependency>

wffweb/src/main/java/com/webfirmframework/wffweb/internal/server/page/js/WffJsFile.java

Lines changed: 54 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,12 @@ public enum WffJsFile {
8484

8585
public static final boolean COMPRESSED_WFF_DATA = true;
8686

87-
private static String allOptimizedContent;
87+
private static final String allOptimizedContent;
8888

8989
private final String filename;
9090

9191
private final String optimizedFileContent;
9292

93-
private static volatile Map<String, Boolean> functionAndVarNames;
94-
9593
private static String[][] minifiableParts = { { "else {", "else{" }, { "} else", "}else" }, { "if (", "if(" },
9694
{ ") {", "){" } };
9795

@@ -364,7 +362,7 @@ private static final record FunctionOrVarName(String name, boolean function) {
364362

365363
// NB: passing descendingLength comparator as constructor argument
366364
// in TreeSet makes bug it also removes elements having same length
367-
functionAndVarNames = new LinkedHashMap<>(functionAndVarNameList.size());
365+
final Map<String, Boolean> functionAndVarNames = new LinkedHashMap<>(functionAndVarNameList.size());
368366
for (final FunctionOrVarName each : functionAndVarNameList) {
369367
functionAndVarNames.put(each.name, each.function);
370368
}
@@ -394,6 +392,9 @@ private static final record FunctionOrVarName(String name, boolean function) {
394392
functionAndVarNames.remove("h");
395393
functionAndVarNames.remove("action");
396394
functionAndVarNames.remove("perform");
395+
allOptimizedContent = buildAllFilesContent(functionAndVarNames);
396+
} else {
397+
allOptimizedContent = buildAllFilesContent(null);
397398
}
398399
}
399400

@@ -402,6 +403,47 @@ private WffJsFile(final String filename) {
402403
optimizedFileContent = buildOptimizedFileContent();
403404
}
404405

406+
private static String buildAllFilesContent(final Map<String, Boolean> functionAndVarNames) {
407+
int totalContentLength = 0;
408+
for (final WffJsFile wffJsFile : WffJsFile.values()) {
409+
totalContentLength += wffJsFile.optimizedFileContent.length();
410+
}
411+
412+
final StringBuilder builder = new StringBuilder(totalContentLength);
413+
414+
final WffJsFile[] wffJsFiles = WffJsFile.values();
415+
for (int i = 2; i < wffJsFiles.length; i++) {
416+
builder.append('\n').append(wffJsFiles[i].optimizedFileContent);
417+
}
418+
419+
String allOptimizedContent = StringBuilderUtil.getTrimmedString(builder);
420+
421+
if (functionAndVarNames != null) {
422+
423+
int functionId = 0;
424+
int variableId = 0;
425+
426+
for (final Entry<String, Boolean> entry : functionAndVarNames.entrySet()) {
427+
428+
final String minName = entry.getValue() ? "f" + (++functionId) : "v" + (++variableId);
429+
allOptimizedContent = allOptimizedContent.replace(entry.getKey(), minName);
430+
}
431+
432+
for (final String[] each : minifiableParts) {
433+
allOptimizedContent = allOptimizedContent.replace(each[0], each[1]);
434+
}
435+
436+
if (Task.SHORT_NAME_ENABLED) {
437+
for (final Task task : Task.getSortedTasks()) {
438+
allOptimizedContent = allOptimizedContent.replace("taskValues.".concat(task.name()),
439+
"taskValues.".concat(task.getShortName()));
440+
}
441+
}
442+
}
443+
444+
return allOptimizedContent;
445+
}
446+
405447
private String buildOptimizedFileContent() {
406448

407449
try (final InputStream in = WffJsFile.class.getResourceAsStream(filename);
@@ -520,100 +562,23 @@ public static String getAllOptimizedContent(final String wsUrl, final String ins
520562
final int wsReconnectInterval, final boolean autoremoveParentScript, final boolean losslessCommunication,
521563
final String onPayloadLossJS) {
522564

523-
if (allOptimizedContent != null) {
524-
525-
if (heartbeatInterval > 0) {
526-
if (autoremoveParentScript) {
527-
return buildJsContentWithHeartbeat(wsUrl, instanceId, removePrevBPOnInitTab,
528-
removePrevBPOnClosetTab, heartbeatInterval, wsReconnectInterval, losslessCommunication,
529-
onPayloadLossJS).append(AUTOREMOVE_PARENT_SCRIPT).toString();
530-
}
531-
return buildJsContentWithHeartbeat(wsUrl, instanceId, removePrevBPOnInitTab, removePrevBPOnClosetTab,
532-
heartbeatInterval, wsReconnectInterval, losslessCommunication, onPayloadLossJS).toString();
533-
}
534-
565+
if (heartbeatInterval > 0) {
535566
if (autoremoveParentScript) {
536-
return buildJsContentWithoutHeartbeat(wsUrl, instanceId, removePrevBPOnInitTab, removePrevBPOnClosetTab,
567+
return buildJsContentWithHeartbeat(wsUrl, instanceId, removePrevBPOnInitTab, removePrevBPOnClosetTab,
537568
heartbeatInterval, wsReconnectInterval, losslessCommunication, onPayloadLossJS)
538569
.append(AUTOREMOVE_PARENT_SCRIPT).toString();
539570
}
540-
return buildJsContentWithoutHeartbeat(wsUrl, instanceId, removePrevBPOnInitTab, removePrevBPOnClosetTab,
571+
return buildJsContentWithHeartbeat(wsUrl, instanceId, removePrevBPOnInitTab, removePrevBPOnClosetTab,
541572
heartbeatInterval, wsReconnectInterval, losslessCommunication, onPayloadLossJS).toString();
542573
}
543574

544-
try {
545-
546-
int totalContentLength = 0;
547-
for (final WffJsFile wffJsFile : WffJsFile.values()) {
548-
totalContentLength += wffJsFile.optimizedFileContent.length();
549-
}
550-
551-
final StringBuilder builder = new StringBuilder(totalContentLength);
552-
553-
final WffJsFile[] wffJsFiles = WffJsFile.values();
554-
for (int i = 2; i < wffJsFiles.length; i++) {
555-
builder.append('\n').append(wffJsFiles[i].optimizedFileContent);
556-
}
557-
558-
allOptimizedContent = StringBuilderUtil.getTrimmedString(builder);
559-
560-
if (PRODUCTION_MODE && functionAndVarNames != null) {
561-
562-
synchronized (WffJsFile.class) {
563-
564-
if (functionAndVarNames != null) {
565-
566-
int functionId = 0;
567-
int variableId = 0;
568-
569-
for (final Entry<String, Boolean> entry : functionAndVarNames.entrySet()) {
570-
571-
final String minName = entry.getValue() ? "f" + (++functionId) : "v" + (++variableId);
572-
allOptimizedContent = allOptimizedContent.replace(entry.getKey(), minName);
573-
}
574-
575-
for (final String[] each : minifiableParts) {
576-
allOptimizedContent = allOptimizedContent.replace(each[0], each[1]);
577-
}
578-
579-
// there is bug while enabling this, also enable in Task
580-
// for (final Task task : Task.getSortedTasks()) {
581-
// allOptimizedContent = allOptimizedContent
582-
// .replace(task.name(), task.getShortName());
583-
// }
584-
585-
functionAndVarNames = null;
586-
minifiableParts = null;
587-
588-
}
589-
590-
}
591-
592-
}
593-
594-
if (heartbeatInterval > 0) {
595-
if (autoremoveParentScript) {
596-
return buildJsContentWithHeartbeat(wsUrl, instanceId, removePrevBPOnInitTab,
597-
removePrevBPOnClosetTab, heartbeatInterval, wsReconnectInterval, losslessCommunication,
598-
onPayloadLossJS).append(AUTOREMOVE_PARENT_SCRIPT).toString();
599-
}
600-
return buildJsContentWithHeartbeat(wsUrl, instanceId, removePrevBPOnInitTab, removePrevBPOnClosetTab,
601-
heartbeatInterval, wsReconnectInterval, losslessCommunication, onPayloadLossJS).toString();
602-
}
603-
604-
if (autoremoveParentScript) {
605-
return buildJsContentWithoutHeartbeat(wsUrl, instanceId, removePrevBPOnInitTab, removePrevBPOnClosetTab,
606-
heartbeatInterval, wsReconnectInterval, losslessCommunication, onPayloadLossJS)
607-
.append(AUTOREMOVE_PARENT_SCRIPT).toString();
608-
}
575+
if (autoremoveParentScript) {
609576
return buildJsContentWithoutHeartbeat(wsUrl, instanceId, removePrevBPOnInitTab, removePrevBPOnClosetTab,
610-
heartbeatInterval, wsReconnectInterval, losslessCommunication, onPayloadLossJS).toString();
611-
} catch (final Exception e) {
612-
if (LOGGER.isLoggable(Level.SEVERE)) {
613-
LOGGER.log(Level.SEVERE, e.getMessage(), e);
614-
}
577+
heartbeatInterval, wsReconnectInterval, losslessCommunication, onPayloadLossJS)
578+
.append(AUTOREMOVE_PARENT_SCRIPT).toString();
615579
}
616-
return "";
580+
return buildJsContentWithoutHeartbeat(wsUrl, instanceId, removePrevBPOnInitTab, removePrevBPOnClosetTab,
581+
heartbeatInterval, wsReconnectInterval, losslessCommunication, onPayloadLossJS).toString();
617582
}
618583

619584
private static StringBuilder buildJsContentWithHeartbeat(final String wsUrl, final String instanceId,
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* Copyright since 2014 Web Firm Framework
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.webfirmframework.wffweb.internal.tag.html.listener;
17+
18+
import com.webfirmframework.wffweb.tag.html.AbstractHtml;
19+
20+
public record ChildCreatedOrMovedEvent(AbstractHtml childTag, boolean movable) {
21+
}

wffweb/src/main/java/com/webfirmframework/wffweb/internal/tag/html/listener/ChildTagAppendListener.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import com.webfirmframework.wffweb.server.page.ChildTagAppendListenerImpl;
2222
import com.webfirmframework.wffweb.tag.html.AbstractHtml;
2323

24+
@Deprecated(forRemoval = true, since = "12.0.6")
2425
public sealed interface ChildTagAppendListener extends Serializable permits ChildTagAppendListenerImpl {
2526

2627
public static record Event(AbstractHtml parentTag, AbstractHtml appendedChildTag,
@@ -33,8 +34,10 @@ public static record ChildMovedEvent(AbstractHtml previousParentTag, AbstractHtm
3334

3435
}
3536

37+
@Deprecated(forRemoval = true, since = "12.0.6")
3638
public void childAppended(Event event);
3739

40+
@Deprecated(forRemoval = true, since = "12.0.6")
3841
public void childrenAppended(Event event);
3942

4043
/**
@@ -44,8 +47,10 @@ public static record ChildMovedEvent(AbstractHtml previousParentTag, AbstractHtm
4447
* @since 2.0.0
4548
* @author WFF
4649
*/
50+
@Deprecated(forRemoval = true, since = "12.0.6")
4751
public void childMoved(ChildMovedEvent event);
4852

53+
@Deprecated(forRemoval = true, since = "12.0.6")
4954
public void childrendAppendedOrMoved(Collection<ChildMovedEvent> events);
5055

5156
}

wffweb/src/main/java/com/webfirmframework/wffweb/internal/tag/html/listener/InsertAfterListener.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
* @since 3.0.7
2626
*
2727
*/
28+
@Deprecated(forRemoval = true, since = "12.0.6")
2829
public sealed interface InsertAfterListener extends Serializable permits InsertAfterListenerImpl {
2930

3031
public static record Event(AbstractHtml insertedTag, AbstractHtml previousParentTag) {
@@ -39,6 +40,7 @@ public static record Event(AbstractHtml insertedTag, AbstractHtml previousParent
3940
* @since 3.0.7
4041
* @author WFF
4142
*/
43+
@Deprecated(forRemoval = true, since = "12.0.6")
4244
public void insertedAfter(final AbstractHtml parentTag, final AbstractHtml afterTag, final Event... events);
4345

4446
}

wffweb/src/main/java/com/webfirmframework/wffweb/internal/tag/html/listener/InsertBeforeListener.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import com.webfirmframework.wffweb.server.page.InsertBeforeListenerImpl;
2121
import com.webfirmframework.wffweb.tag.html.AbstractHtml;
2222

23+
@Deprecated(forRemoval = true, since = "12.0.6")
2324
public sealed interface InsertBeforeListener extends Serializable permits InsertBeforeListenerImpl {
2425

2526
public static record Event(AbstractHtml parentTag, AbstractHtml insertedTag, AbstractHtml beforeTag,
@@ -34,6 +35,7 @@ public static record Event(AbstractHtml parentTag, AbstractHtml insertedTag, Abs
3435
* @since 2.1.1
3536
* @author WFF
3637
*/
38+
@Deprecated(forRemoval = true, since = "12.0.6")
3739
public void insertedBefore(Event... events);
3840

3941
}

0 commit comments

Comments
 (0)