DiceBear 10.3 - Release Notes #534
FlorianKoerner
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
For 10.3 we searched public code on GitHub to find which language was calling the DiceBear API the most without a native library of its own. The answer was Dart, mostly from Flutter apps: DiceBear now speaks Dart 🎯
That makes six official implementations: JavaScript, PHP, Python, Rust, Go, and now Dart. The API is the same in all of them, and the same seed and style definition produce byte-identical SVGs everywhere.
🎯 Dart Support
DiceBear is now available as a Dart package (Dart 3.4+), and it runs in Flutter apps too. As with the other languages, you need two packages: the core library
dicebear_coreand the avatar style definitionsdicebear_styles. Each style is a string constant in its own library, so a compiled app only embeds the styles it actually imports.Example:
🧩 The same
Avatar(style, …)call everywhereDart, Rust, and Go already required you to wrap a definition in a
Stylebefore building an avatar. With this release the JavaScript, PHP, and Python libraries move the same way, so every port now constructs an avatar with the sameAvatar(style, options)call.Passing a raw style definition straight to
Avataris therefore deprecated in JavaScript, PHP, and Python. Wrap it in aStylefirst:The old definition input still works and renders identically, but it now emits a deprecation warning (a one-time
console.warnin JS,E_USER_DEPRECATEDin PHP,DeprecationWarningin Python) and will be removed in v11. Building theStyleonce also lets you reuse it across many avatars instead of re-validating the definition every time.To make that wrapping step shorter, PHP and Python gained a constructor that takes a raw JSON string directly:
Style::fromJson($json)Style.from_json(json)No more separate
json_decode(..., true)orjson.loads(...)call. Malformed JSON raises the language's native parse error, and an invalid definition raises the usualStyleValidationError. This mirrorsStyle::from_strin Rust andStyle.parsein Dart.This discussion was created from the release DiceBear 10.3 - Release Notes.
Beta Was this translation helpful? Give feedback.
All reactions