Repository navigation
The main focus of this update was moving every identifier in the library to UUIDs while keeping older saves loadable, and making the library build, work and testable on multiple platforms: Windows, Linux, MacOS and the Web.
Main Changes
UUID identifiers
All IDs in the library (nodes, sockets, node areas, group comments, reroute nodes and link records) are now VisNodeSys::FEUUID values instead of 24-character hex strings. FEUUID is an alias of uuids::uuid from the bundled stduuid library. The main reason for this change is performance: a 24-character string is too long for the small-string optimization of the standard library implementations, so every copy of an ID allocated and freed heap memory, while a FEUUID is a 16-byte value that is copied, compared and hashed without any allocation. This change alone made the Release build of the test suite take about 35% less time (from 1515 ms to 980 ms). UUIDs also make ID collisions even less likely.
Older saves still load
Every ID read from a saved JSON file goes through FromStringLegacyCompatible, which accepts both UUID strings and the legacy hex IDs. Legacy IDs are converted deterministically with ConvertLegacyHexID, using the same namespace as FEBasicApplication, so the same old ID always becomes the same FEUUID in every module. Saves produced by 0.2.0 therefore load without any manual migration.
Linux, MacOS and web support
The library now compiles with GCC, Clang and Emscripten in addition to MSVC, and links correctly on Linux. The Visual Node System Example builds for Windows, MacOS, Linux and the web, and a live demo runs directly in the browser (WebGPU is required).
Icons are loaded from memory
Built-in icons were previously decoded, written to TemporaryIcon.png in the process working directory, passed to the texture loader by path and deleted again, which fails in read-only or shared directories. The texture loader set with NodeCore::SetTextureLoader now receives the decoded image bytes directly as a pointer and a size. Contributed by LamaQuest in #7.
Tests on every platform
The test suite now runs in continuous integration on Windows, Linux (Debug and Release), MacOS (Apple Silicon, Debug and Release) and the Web (Emscripten, run with Node.js), and each platform has its own badge in the README. New tests verify that saves with legacy hex IDs are read correctly. The tests branch also gained scripts to run all tests locally: on Windows, Linux (through WSL) and the web from one script.
Changes
Breaking Changes:
Compatibility:
- The library now requires C++17. Its public headers include stduuid, so projects that include them must also be compiled with C++17.
- Saves written by this version store IDs as UUID strings. Saves from earlier versions still load.
Behavioral changes:
- Null IDs are now saved as the nil UUID instead of an empty string.
- Node area link record IDs are now generated with
GenerateIDinstead of being built from the IDs of the two link nodes. - Copy and paste of nodes now goes through the Dear ImGui clipboard when an ImGui context exists, instead of calling the Win32 or X11 clipboard directly.
Removals:
NodeCore::GetUniqueHexIDandNodeCore::GetUniqueIDwere removed, useVisNodeSys::GenerateIDinstead.
Deprecations:
- The file-path based
NodeCore::SetTextureLoader(std::function<ImTextureID(const std::string&)>)overload is kept for backward compatibility but is now deprecated. It writes temporary icon files with unique names tostd::filesystem::temp_directory_path()instead of the working directory.
Signature / return-type changes:
- Every ID in the public API changed from
std::stringtoVisNodeSys::FEUUID. This includes allGetIDfunctions, lookups such asGetNodeByID,GetSocketByID,GetNodeAreaByID,GetGroupCommentByIDandGetRerouteNodeByID, connection functions such asTryToConnect,TryToDisconnectandIsConnected,DeleteSocket,DeleteRerouteNodeByID,SetExecutionEntryNodeByID,LinkNodeAreas,UnlinkNodeAreasandIsLinked, the area filters of theNodeSystemstatistics functions, the map returned byGetLastExecutedNodes, and the constructors ofNode,NodeAreaandGroupComment. NodeCore::SetTextureLoadernow takesstd::function<ImTextureID(const unsigned char* Data, std::size_t Size)>, the loader receives the image bytes instead of a file path.
Bug Fixes (selected):
- Fixed Linux builds failing with
VISUAL_NODE_SYSTEM_Version.h could not be found(#5, thanks to biglari). - Fixed linking on Linux failing with undefined references to X11 symbols used by the clipboard functions.
- Fixed compilation errors with Clang (found in the Emscripten build):
NodeCoreis now a friend ofSocketMirrorNode, a socket index is cast toJson::UInt64before it is written inNodeArea::ToJson(size_tisunsigned longon Emscripten and MacOS, which made the assignment ambiguous), and a variable that redeclared a range-based for loop variable inNodeSystem::UnlinkNodeAreaswas removed. - Fixed compilation errors with GCC:
BaseArithmeticOperatorNodeinteger and floatPerformOperationare now overloads instead of explicit specializations inside the class, and the execution flow nodes define is now added withadd_compile_definitionsinstead of the MSVC-only/Dflag. VisualNodeCore.hexposed Xlib macros such asNoneandBoolto every file that included the library, which broke unrelated code (for example GoogleTest).- The first call to a singleton's
GetInstance(SINGLETON_PUBLIC_PART) is now thread-safe, the instance is constructed in the static initializer. CMAKE_BUILD_TYPEwas always forced to Debug, so Release builds were not possible with single-configuration generators (Ninja, Makefiles, Emscripten). It is now set to Debug only when no build type is provided.BaseComparisonOperatorNodepassed its text toImGui::Textas a format string, a%in it would be interpreted as a format specifier. It now usesImGui::TextUnformatted.- Continuous integration tested the master branch instead of the pull request code, now a push tests the pushed commit and a pull request tests the pull request merged into master.
Other Notable Changes:
- Added stduuid to
ThirdParty. - Upgraded jsoncpp from v1.9.3 to v1.9.8.
- Continuous integration is now split into separate Windows, Linux, MacOS and Web workflows, each with its own badge in the README.
- Added
CONTRIBUTING.mdwith contribution guidelines. - README now links to the live demo, describes the new IDs and lists the stduuid license.