Releases: webfirmframework/wff
wffweb-12.0.12
Release Changes
Major enhancements
Enhancements to JSON parser.
- Implementation of
getValueAsShortmethodJsonListNodeandJsonMapNodeclasses. - Implementation of
asShortmethod inJsonValueclass. - Modified
JsonConcurrentMap.parse&JsonConcurrentSkipListMap.parseto support parsingnullvalues from JSON text. ImplementedputNullmethod in these classes to addnullvalue (JsonValue.NULL) in the object so that itstoJsonStringcan containnullvalue in the key-value pair. - Implementation of
JsonNumberValueType.AUTO_INTEGER_LONG_BIG_INTEGER_BIG_DECIMAL. - Memory optimization improvements.
- Code optimization for performance improvement.
Other major improvements.
- Code optimization for performance improvement.
Migration changes
No code changes required to migrate from old wffweb-12.x.x version to this version.
wffweb-12.0.11
Release Changes
Major enhancements
This release is mainly for the enhancements of JSON parser.
The existing JsonParser is more advanced now.
It focuses on the following:
- In some cases, if the json data is large, the parsed json object (
JsonMapNode) will not be used to get all values by keys. In most of the case we parse a large json text just to get few properties. There should be some mechanism to do a lazy parsing so that the json parsing process may be finished quickly. The JSON value part parsing process may be postponed, it can be done at the time of getting the value. TheJsonValuevalue type implementation was incomplete for that purpose, this release contains needful enhancements for that. - Enhanced the basic parsing to more advanced parsing which will also parse unicode chars from json data to java chars if an optional argument
decodeUnicodeCharsSequenceis passed in string value getting methods. Now, the special/escape characters will be converted to JSON compatible string in the generated JSON string. convertTomethod is implemented inJsonListNodeandJsonMapNode. It can convertJsonListNodeandJsonMapNodeto a user defined JSON object and JSON array classes respectively.- New
JsonConcurrentSkipListMapis implemented.
Sample code to create JsonValue based parsing
JsonParser jsonParser = JsonParser.newBuilder()
.jsonObjectType(JsonObjectType.JSON_MAP)
.jsonArrayType(JsonArrayType.JSON_LIST)
.jsonStringValueTypeForObject(JsonStringValueType.JSON_VALUE)
.jsonStringValueTypeForArray(JsonStringValueType.JSON_VALUE)
.jsonNumberValueTypeForObject(JsonNumberValueType.JSON_VALUE)
.jsonNumberValueTypeForArray(JsonNumberValueType.JSON_VALUE)
.jsonBooleanValueTypeForObject(JsonBooleanValueType.JSON_VALUE)
.jsonBooleanValueTypeForArray(JsonBooleanValueType.JSON_VALUE)
.jsonNullValueTypeForObject(JsonNullValueType.JSON_VALUE)
.jsonNullValueTypeForObject(JsonNullValueType.JSON_VALUE).build();
JsonMap jsonMap = jsonParser.parseJsonObject(inputJsonObjectString) instanceof JsonMap jsonMapTmp ? jsonMapTmp : null;
convertTo method usage
class CustomJsonMap extends JsonLinkedMap {
}
class CustomList extends JsonList {
}
JsonLinkedMap jsonMap = new JsonLinkedMap();
jsonMap.put("number", new JsonValue("14", JsonValueType.NUMBER));
jsonMap.put("string", new JsonValue("string value", JsonValueType.STRING));
jsonMap.put("bool", new JsonValue("true", JsonValueType.BOOLEAN));
jsonMap.put("fornull", new JsonValue());
JsonList jsonList1 = new JsonList();
jsonList1.add("one");
jsonList1.add("two");
jsonList1.add(3);
jsonList1.add(true);
jsonList1.add(null);
jsonMap.put("jsonList1", jsonList1);
CustomJsonMap convertedJsonMap = jsonMap.convertTo(
CustomJsonMap::new, CustomJsonMap::put,
CustomList::new, CustomList::add, true);
CustomJsonList convertedJsonList = jsonList1.convertTo(
CustomJsonMap::new, CustomJsonMap::put,
CustomJsonList::new, CustomJsonList::add, true);
Other major changes
- Code optimizations for performance improvement.
Migration changes
No code changes required to migrate from old wffweb-12.x.x version to this version.
wffweb-12.0.10
Release Changes
Today January 14th is the birthday of the author of this framework so this is a birthday release!
Major enhancements
- Thread-safety & GC improvements.
- Introduced a secondary
Cleanerobject and used it in appropriate places (issue /issues/103). - Improved
SharedTagContentfor better thread-safety, performance and GC (issue /issues/104). - Improved
SharedTagContentTest.
Migration changes
No code changes required to migrate from old wffweb-12.x.x version to this version.
wffweb-12.0.9
Release Changes
New features
- New methods in
AbstractHtmltag class -getParentChildLinkedTags,getNextSiblingandgetPreviousSibling. - New method
toOutputStreamin JSON parser classes. ThetoBigJsonStringis also available forJsonListNode, it's a top level method inJsonBaseNodeclass.
Major bug fixes
- A bug fix related to losses communication (rarest possible bug).
Major enhancements
- Major improvements to lossess communication. A manual ping-pong is implemented for reliable websocket reconnection. This can prevent when user switches from one network to another or physical connection loss, eg: When user switches from WIFI to 2G/3G/4G/5G etc.. network. The heartbeat timeout value can be set by
setWebSocketHeartbeatTimeoutinBrowserPage. The default heartbeat timeout value is 10000 milliseconds.
Security improvements
- JavaScript security improvements to avoid wff objects mutation/deletion. This will prevent other JavaScript files in the browser to mutating/deleting the wffweb JavaScript objects.
Other improvements
- Better handling for
browserPageremoval fromBrowserPageContenton browser page close or related scenarios.
Migration changes
No code changes required to migrate from old wffweb-12.x.x version to this version.
wffweb-12.0.8
Release Changes
Client side JavaScript code optimization which may reduce CPU and memory consumption in the client browser page if there is a continues delivery of UI updates from the server. However, the difference may be negligible.
Note: This release doesn't contain any new features.
wffweb-12.0.7
Release Changes
Code optimization for performance improvement.
wffweb-12.0.6
Release Changes
New features
- Implemented
jsonMapFactoryandjsonListFactoryinJsonParser.
Major improvements
Major improvements to AbstractHtml
- Thread-safety and performance improvements.
- Now, for
appendChildren,prependChildren,insertAfter,insertBefore,replaceWith&addInnerHtmlsmethods, there is only a single implementation. If the given tags by these methods already exist in the browser page, the server will not send its entire tag data; instead, it will send only the wff id, and using its wff id the tags will be moved in the browser page for the ui changes. It will save a lot of data transfer in many scenarios,
eg: There is table in the browser page and it contains a large number of rows. The rows are sorted and added again to theTBodytag without removing it from the browser page, in such case we can see a significant performance improvement as it doesn't transfer the whole tags data to the UI.
Minor improvements
- Code optimization in
SharedTagContent.
wffweb-12.0.5
Release Changes
Major bug fixes
A major thread-safety bug fix in SharedTagContent reported in #97.
The bug is it throws NullPointerException while calling setContent/detach method if async update is enabled. To workaround this issue, disable async update by setAsyncUpdate method. By default, it is disabled.
Major improvements
JVM related improvements to prevent CPU overheating in a special multi-threading scenario.
wffweb-12.0.4
Release Changes
New Features
Support for basic JSON parser. This is the most efficient way to parse JSON text in the world.
Usage:
To parse json object string
JsonMapNode jsonMap = JsonMap.parse("""
{
"key" : "value",
"key1" : "value1"
}
""");
// To get value
String key1Value = jsonMap.getValueAsString("key1");
// Prints value
System.out.println("key1Value = " + key1Value); // key1Value = value1
String jsonString = jsonMap.toJsonString();
// Prints json string
System.out.println("jsonString = " + jsonString); // jsonString = {"key1":"value1","key":"value"}
To parse json array string
JsonListNode jsonList = JsonList.parse("[1, 4, 0, 1]");
//To get the value from an index
int intValueAt1 = jsonList.getValueAsInteger(1);
System.out.println("intValueAt1 = " + intValueAt1); // intValueAt1 = 4
//Prints the json string
System.out.println("toJsonString = " + jsonList.toJsonString()); // toJsonString = [1,4,0,1]
To parse json string with different config
JsonParser jsonParser = JsonParser.newBuilder()
.jsonObjectType(JsonObjectType.JSON_MAP)
.jsonArrayType(JsonArrayType.JSON_LIST)
.jsonNumberArrayUniformValueType(false)
.jsonNumberValueTypeForObject(JsonNumberValueType.BIG_DECIMAL)
.jsonNumberValueTypeForArray(JsonNumberValueType.BIG_DECIMAL)
.jsonStringValueTypeForObject(JsonStringValueType.STRING)
.jsonStringValueTypeForArray(JsonStringValueType.STRING)
.jsonBooleanValueTypeForObject(JsonBooleanValueType.BOOLEAN)
.jsonBooleanValueTypeForArray(JsonBooleanValueType.BOOLEAN)
.jsonNullValueTypeForObject(JsonNullValueType.NULL)
.jsonNullValueTypeForArray(JsonNullValueType.NULL)
.validateEscapeSequence(true).build();
JsonMap jsonObject = jsonParser.parseJsonObject("""
{
"key1" : "val1",
"key2" : "val2"
}""") instanceof JsonMap jsonMap ? jsonMap : null;
System.out.println(jsonObject.toJsonString()); //Prints {"key1":"val1","key2":"val2"}
Improvements
- Implemented
getValueAsWffBMObject&getValueAsWffBMArraymethods inWffBMArray&WffBMObject. - Optimized code for performance improvement.
wffweb-12.0.3
Release Changes
Major improvements
Performance improvements
Reduced the size of payload sending from the server to the client by implementing version 3 of Wff BM Bytes tag data compression algo. This should deliver data faster than before.
Major bug fixes
Major bug fix related to uri navigation
Bug: set uri from the server side using browserPage.setURI then click on back button on browser, it doesn't invoke the whenURI event. This bug is fixed now.
The workaround to fix this issue till wffweb-12.0.2 is to call wffGlobal.getAndUpdateLocation(); inside the wffGlobalListeners.onSetURI function implementation in the project.
Features
More finder methods findOneAttributeByFilter, findAttributesByFilter etc.. in TagRepository.
Implemented more feature methods in WffBMObject & WffBMArray to get values in different datatypes.
They are:
getValueAsBigDecimalgetValueAsBigIntegergetValueAsIntegergetValueAsLonggetValueAsDoublegetValueAsFloatgetValueAsBooleangetValueAsString
Implemented overloading put(... methods in WffBMObject.
They are:
put(String key, Number value)put(String key, Boolean value)put(String key, WffBMObject value)put(String key, WffBMArray value)put(String key, WffBMByteArray value)
Implemented other put...(... methods in WffBMObject.
They are:
putNull(String key)putUndefined(String key)putRegex(String key, String regex)putString(String key, String string)putFunction(String key, String function)
Implemented method similar in WffBMObject and WffBMArray to check if two objects contents are equal.
Implemented toStream method in WffBMNumberArray.
Improvements
In AbstractHtml, validating the appending/prepending children only if the debug mode is turned on by WffConfiguration.setDebugMode(true). If it is turned off it will save some memory and CPU consumption so it is turned off by default.
Java code improvements
Annotated serialVersionUID with @Serial in appropriate places.
Test cases
Test cases are added for all new features.
Migration changes
No code changes required to migrate from wffweb 12.0.2 to 12.0.3.