Releases: gonuit/dart_objectid
Releases · gonuit/dart_objectid
Release list
v4.0.3
v4.0.2
What's Changed
- Fix
ObjectId.fromHexString(…)on web by @JonasWanke in #5- Rewrote
ObjectId.fromHexStringto parse hex directly into bytes, avoiding 32-bit bitwise limitation on web and improving performance (~4x faster).
- Rewrote
- Fixed
ObjectId.fromValuesweb support by replacing>> 32with integer division intoProcessUniqueBytes. - Fixed
Random.secure()fallback inFallbackProcessUniqueto catch all exceptions, enabling Node.js compatibility. - Added CI pipeline with formatting, analysis, and tests on VM, Chrome, and Node.js.
New Contributors
- @JonasWanke made their first contribution in #5
Full Changelog: v4.0.1...v4.0.2
v4.0.1
Changes
- Removed deprecated implementation related to
dart:js_util.- Process unique on the web platform is now based on
Random.secured().
- Process unique on the web platform is now based on
Full Changelog: v4.0.0...v4.0.1
v4.0.0
v3.1.0
Changes:
- Added the ObjectId.toJson() method to enable straightforward serialization of ObjectId instances. You can now serialize an ObjectId simply by calling jsonEncode or using the built-in JsonEncoder.
- Added the ObjectId.fromJson(String json) factory constructor. This serves as an alias to the existing ObjectId.fromHexString constructor, clearly indicating the intention to deserialize from a JSON value.
Resolves #3
v3.0.0
Changes:
⚠️ The strict runtime type checking in the equals operator has been removed. Now all classes that extend ObjectId and have the same value will be matched by this operator.class MyObjectId extends ObjectId {} const hexString = '606eed9d7203bfbbb7fffffe'; ObjectId.fromHexString(hexString) == MyObjectId.fromHexString(hexString); // true
- Updated dart sdk constraints to match new requirements.
- Updated package dependencies
- Replaced the code analysis rules defined by the effective_dart package with the lints package.
- Removed unnecessary (for packages) pubspec.lock file.
Full Changelog: v2.1.0...v3.0.0
v2.1.0
v2.0.0
Changes:
- Stable nullsafety release
- Fixed a bug that caused the counter value to overflow at
0xfffffe.- Enabled counter overflow unit test.
toStringmethod now instead ofruntimeType(hexString), returns objectid'shexString.TIP:/// Before: print(ObjectId()) // => "ObjectId(606eed9d7203bfbbb7fffffe)" /// Now: print(ObjectId()) // => "606eed9d7203bfbbb7fffffe"
If you still want to use thetoStringmethod withruntimeType, you can override theObjectIdclass. Example:class MyObjectId extends ObjectId { @override String toString() => '$runtimeType($hexString)'; }
2.0.0-nullsafety.0
Changes:
- Initial move towards null safety
- Updated changelog (removed release dates)