kodi_script 0.2.0 copy "kodi_script: ^0.2.0" to clipboard
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 implement KodiBindable interface
    • This enables support for iOS, Android, and Web platforms
    • Removed dependency on dart:mirrors which 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...in loop support for iterating over arrays
  • Added while loop support for conditional iteration
  • Added user-defined functions with fn keyword
  • 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
1
likes
150
points
262
downloads

Publisher

unverified uploader

Weekly Downloads

A lightweight, embeddable scripting language for Dart applications.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

crypto

More

Packages that depend on kodi_script