kodi_script 0.2.0
kodi_script: ^0.2.0 copied to clipboard
A lightweight, embeddable scripting language for Dart applications.
Changelog #
0.2.0 #
Breaking Changes #
- Binding API: Objects passed to
.bind()must now implementKodiBindableinterface- This enables support for iOS, Android, and Web platforms
- Removed dependency on
dart:mirrorswhich is not available on these platforms
Migration Guide #
Before (0.1.x):
// Automatic reflection - no longer supported
class User {
final String name;
User(this.name);
String greet() => "Hello, $name!";
}
final result = KodiScript.builder('user.greet()').bind('user', User('Alice')).execute();
After (0.2.0):
class User implements KodiBindable {
final String name;
User(this.name);
String greet() => "Hello, $name!";
@override
Object? getProperty(String name) => name == 'name' ? this.name : null;
@override
Object? callMethod(String name, List<Object?> args) {
if (name == 'greet') return greet();
return null;
}
}
final result = KodiScript.builder('user.greet()').bind('user', User('Alice')).execute();
0.1.1 #
- Fixed string template parsing for complex expressions
- Improved error messages for undefined variables
- Performance optimizations for repeated script execution
0.1.0 #
- Added
for...inloop support for iterating over arrays - Added
whileloop support for conditional iteration - Added user-defined functions with
fnkeyword - Enhanced array operations:
map,filter,reduce,find,findIndex - Added operation limit and timeout for script execution
- Performance improvements via AST caching
0.0.1 #
- 🎉 Initial release
- Variables and expressions
- Null-safety operators (
?.,?:) - Control flow (if/else)
- Native functions:
- String manipulation
- Math operations
- Crypto (MD5, SHA1, SHA256)
- JSON parsing/stringify
- Base64/URL encoding
- Array operations
- Custom function registration
- Builder pattern API