Skip to content

Commit 534f3e3

Browse files
committed
📝 docs: update documentation for v2.0.0 with new API
Update CHANGELOG with v2.0.0 breaking changes and features. Rewrite README and README_zh to match new API signatures. Update pubspec.yaml to version 2.0.0. Key changes documented: - JsEngineCore renamed to JsEngine - Removed exec() method in favor of direct methods - Named parameters throughout for clarity - New methods: call(), evaluateModule(), isModuleDeclared() - Updated all code examples and API documentation BREAKING CHANGE: Version 2.0.0 - Major API restructuring
1 parent 0159a26 commit 534f3e3

4 files changed

Lines changed: 368 additions & 597 deletions

File tree

CHANGELOG.md

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,30 @@
11
# Changelog
22

3-
## 1.5.0
4-
5-
* **BREAKING**: Simplified Engine API - Removed `JsAction`, `JsCallback`, `JsCallbackResult`, and `JsActionResult` enums
6-
* **BREAKING**: Replaced action-based messaging with direct async methods for better developer experience
7-
* **FEATURE**: New direct async methods on `JsEngineCore`: `eval()`, `evaluateModule()`, `declareNewModule()`, `declareNewModules()`, `clearNewModules()`, `getDeclaredModules()`, `isModuleDeclared()`, `call()`
8-
* **FEATURE**: Simplified bridge callback - now uses `Fn(JsValue) -> DartFnFuture<JsResult>` instead of complex enum-based callbacks
9-
* **FEATURE**: Added `initWithoutBridge()` method for engines that don't need Dart bridge communication
10-
* **IMPROVEMENT**: Reduced code complexity by removing the action queue and channel-based messaging
11-
* **IMPROVEMENT**: Better error handling with direct result returns instead of callback-based error propagation
12-
* **IMPROVEMENT**: Cleaner API surface - engine methods now return results directly
13-
* **INTERNAL**: Updated FRB codegen for new API structure
14-
* **INTERNAL**: Refactored internal state management using `Arc<RwLock<Option<...>>>` for bridge storage
15-
* **DOCS**: Updated workflow configuration for FJS example builds
3+
## 2.0.0
4+
5+
* **BREAKING**: Renamed `JsEngineCore` to `JsEngine` for clearer naming convention
6+
* **BREAKING**: Removed `JsAction` system - direct API methods are now available on `JsEngine`
7+
* **BREAKING**: Removed `exec()` method - use direct methods like `eval()`, `call()`, `declareNewModule()` instead
8+
* **BREAKING**: Changed `eval()` parameter from positional to named parameter `source:` for better clarity
9+
* **BREAKING**: Changed `declareNewModule()` parameter to named parameter `module:`
10+
* **BREAKING**: Changed `declareNewModules()` parameter to named parameter `modules:`
11+
* **BREAKING**: Removed `engine.freezed.dart` - `JsEngine` is now a regular abstract class
12+
* **FEATURE**: Added `call()` method to invoke exported module functions directly
13+
* **FEATURE**: Added `evaluateModule()` method to execute modules immediately
14+
* **FEATURE**: Added `isModuleDeclared()` method to check module existence
15+
* **FEATURE**: Added `clearNewModules()` method to remove all dynamically declared modules
16+
* **FEATURE**: Added `initWithoutBridge()` method for engines that don't need bridge communication
17+
* **FEATURE**: Added `context` getter to access underlying `JsAsyncContext`
18+
* **FEATURE**: Added `disposed` getter to check engine disposal status
19+
* **FEATURE**: Added comprehensive API documentation with examples for all public methods
20+
* **IMPROVEMENT**: Migrated to named parameters throughout `JsEngine` API for better code clarity
21+
* **IMPROVEMENT**: Updated all example screens to use new API
22+
* **IMPROVEMENT**: Enhanced integration tests with new API coverage
23+
* **IMPROVEMENT**: Simplified engine lifecycle management with direct methods
24+
* **IMPROVEMENT**: Better error messages with detailed documentation
25+
* **DOCS**: Fixed README.md and README_zh.md to match actual API signatures
26+
* **DOCS**: Added detailed parameter descriptions and examples to all API methods
27+
* **CI/CD**: Added GitHub Actions workflow for building all platforms
1628

1729
## 1.4.0
1830

0 commit comments

Comments
 (0)