Skip to content

0.3.0: UUID Identifiers and Cross-Platform Support

Latest

Choose a tag to compare

@Azzinoth Azzinoth released this 11 Oct 20:25
· 4 commits to master since this release

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 GenerateID instead 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::GetUniqueHexID and NodeCore::GetUniqueID were removed, use VisNodeSys::GenerateID instead.

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 to std::filesystem::temp_directory_path() instead of the working directory.

Signature / return-type changes:

  • Every ID in the public API changed from std::string to VisNodeSys::FEUUID. This includes all GetID functions, lookups such as GetNodeByID, GetSocketByID, GetNodeAreaByID, GetGroupCommentByID and GetRerouteNodeByID, connection functions such as TryToConnect, TryToDisconnect and IsConnected, DeleteSocket, DeleteRerouteNodeByID, SetExecutionEntryNodeByID, LinkNodeAreas, UnlinkNodeAreas and IsLinked, the area filters of the NodeSystem statistics functions, the map returned by GetLastExecutedNodes, and the constructors of Node, NodeArea and GroupComment.
  • NodeCore::SetTextureLoader now takes std::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): NodeCore is now a friend of SocketMirrorNode, a socket index is cast to Json::UInt64 before it is written in NodeArea::ToJson (size_t is unsigned long on Emscripten and MacOS, which made the assignment ambiguous), and a variable that redeclared a range-based for loop variable in NodeSystem::UnlinkNodeAreas was removed.
  • Fixed compilation errors with GCC: BaseArithmeticOperatorNode integer and float PerformOperation are now overloads instead of explicit specializations inside the class, and the execution flow nodes define is now added with add_compile_definitions instead of the MSVC-only /D flag.
  • VisualNodeCore.h exposed Xlib macros such as None and Bool to 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_TYPE was 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.
  • BaseComparisonOperatorNode passed its text to ImGui::Text as a format string, a % in it would be interpreted as a format specifier. It now uses ImGui::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.md with contribution guidelines.
  • README now links to the live demo, describes the new IDs and lists the stduuid license.