Releases: ProjectSky/sm-ext-yyjson
Release 1.1.0
ver 1.1.0
fix: fix float comparison and update yyjson
-
Fix float comparison in Equals function
- Uses epsilon comparison for reliable float equality checks
-
Update yyjson to latest version
- See yyjson changelog for details
-
Documentation improvements
- Clarify JSON Pointer usage
-
Minor code improvements
- Remove redundant areClose function
- Update float comparison in array functions
Release 1.0.9a
ci: automate release creation and simplify workflow
- Remove SM 1.11 from build matrix
- Update to latest SourceMod master branch only
- Update GitHub Actions to latest versions
- Simplify matrix configuration
- Add automatic release creation based on SMEXT_CONF_VERSION
- Generate release notes from commit messages
- Create GitHub release with build artifacts
Now releases are automatically created when pushbuild.txt is updated.
The release version is taken from SMEXT_CONF_VERSION in smsdk_config.h,
and release notes are generated from commit messages since the last release.
1.0.9
feat: add immutable JSON document support
This commit adds support for immutable JSON documents and ensures proper handling
of both mutable and immutable operations. The changes include:
- Parse Function Changes:
- Modify all parse functions to return immutable documents by default:
- YYJSONObject.FromString
- YYJSONObject.FromFile
- YYJSONArray.FromString
- YYJSONArray.FromFile
- YYJSON.Parse
- Require explicit conversion to mutable using YYJSON.ToMutable when modification is needed
- Improve parse performance by avoiding unnecessary mutable document creation
- New Native Functions:
- Add YYJSON.IsMutable.get to check if a JSON value is mutable
- Add YYJSON.IsImmutable.get to check if a JSON value is immutable
- Add YYJSON.ToMutable to convert an immutable JSON value to mutable
- Add YYJSON.ToImmutable to convert a mutable JSON value to immutable
- Core Changes:
- Add immutable document support in YYJsonWrapper
- Add immutable iterators for objects and arrays
- Add IsMutable() and IsImmutable() checks
- Function Updates:
- Add immutable support for value type checking functions
- Add immutable support for array operations (get, size, iterate)
- Add immutable support for object operations (get, iterate)
- Add immutable support for document comparison and copying
- Add immutable checks for modification operations
- Safety Improvements:
- Add proper handle checks for operations with multiple JSON values
- Add clear error messages for immutable modification attempts
- Ensure proper memory management for both document types
- Performance Improvements:
Parse operations:
- Before: 891.95 MB/s (1481.02 ops/sec)
- After: 2502.53 MB/s (4155.23 ops/sec)
- Improvement: 2.80x faster
Stringify operations:
- Before: 4229.64 MB/s (7022.96 ops/sec)
- After: 4768.86 MB/s (7918.31 ops/sec)
- Improvement: 1.12x faster
This change maintains backward compatibility while adding support for
read-only JSON documents and significantly improves parsing performance.
The new native functions provide full control over JSON document mutability.
Parse functions now return immutable documents by default, requiring explicit
conversion to mutable when modifications are needed, which helps prevent
unnecessary mutable document creation and improves performance.
ver 1.0.7
refactor: improve memory management and error handling
Memory management improvements:
- Add custom deleter for yyjson_mut_doc in shared_ptr
- Add CreateDocument and CopyDocument helper method for consistent document creation and copy
- Update all document creation points to use shared_ptr
- Keep m_pVal_mut as raw pointer since it's managed by document
Error handling improvements:
- Add int64 value validity check
- Add bounds checking for array operations
- Add key existence validation for object operations
- Enhance error messages with more context and details
- Add type checking with descriptive error messages
- Improve error reporting for JSON pointer operations
Add methods to find the index of values in JSON arrays:
- IndexOfBool: Find boolean value
- IndexOfString: Find string value
- IndexOfInt: Find integer value
- IndexOfFloat: Find float value
Add YYJSONArray.Sort method to sort array elements
- Support ascending/descending order
- Compare elements based on their types and values
- Handle different value types (string, number, bool)
- Use stable sort to maintain relative order of equal elements
Add YYJSONObject.Sort method to sort object by keys
- Support ascending/descending order for key names
- Maintain key-value associations during sorting
- Use stable sort to preserve order of equal keys
Update README and API documentation
- Add detailed comments for sort methods
ver 1.0.2
- improved error handling
- improved the log when write/read errors
- new native GetTypeDesc
- update yyjson