File tree Expand file tree Collapse file tree 10 files changed +13
-13
lines changed Expand file tree Collapse file tree 10 files changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,9 @@ Changes to the project are tracked using build numbers behind the version number
1111
1212## [ Unreleased]
1313
14+ ## [ 1.0.0-beta.14+9] - 2024-07-17
15+ - Feat: Added ` SurrealWasm.getInstance() ` to simplify instantiation of the ` Surreal ` class with the ` WasmEngine ` .
16+
1417## [ 1.0.0-beta.14+8] - 2024-07-17
1518
1619- Feat: Upgraded surrealdb.wasm to 1.0.0-beta.14.
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ Please refer to the [surrealdb_js](https://pub.dev/packages/surrealdb_js#-featur
6262import 'package:surrealdb_js/surrealdb_js.dart';
6363import 'package:surrealdb_wasm/surrealdb_wasm.dart';
6464
65- final db = Surreal({'engines': WasmEngine()} );
65+ final db = SurrealWasm.getInstance( );
6666
6767await db.connect('indxdb://surreal');
6868await db.use(namespace: 'test', database: 'test');
Original file line number Diff line number Diff line change 1- - Feat: Upgraded surrealdb.wasm to 1.0.0-beta.14.
2- - Feat: Integrated with surrealdb_js 1.0.0-beta.14+3 that provide an unified API.
1+ - Feat: Added ` SurrealWasm.getInstance() ` to simplify instantiation of the ` Surreal ` class with the ` WasmEngine ` .
Original file line number Diff line number Diff line change 11import 'package:flutter/material.dart' ;
2- import 'package:surrealdb_js/surrealdb_js.dart' ;
32import 'package:surrealdb_wasm/surrealdb_wasm.dart' ;
43import 'package:flutter_console_widget/flutter_console.dart' ;
54
@@ -34,7 +33,7 @@ class HomePage extends StatefulWidget {
3433
3534class _HomePageState extends State <HomePage > {
3635 final FlutterConsoleController controller = FlutterConsoleController ();
37- final db = Surreal ({ 'engines' : WasmEngine ()} );
36+ final db = SurrealWasm . getInstance ( );
3837 static const commandSymbol = '>' ;
3938
4039 Future <dynamic > execute (Function function, [String ? message]) async {
Original file line number Diff line number Diff line change @@ -12,7 +12,8 @@ dependencies:
1212
1313 flutter_console_widget :
1414 path : flutter_console_widget
15- surrealdb_wasm : ^1.0.0-beta.14+8
15+ surrealdb_js : ^1.0.0-beta.14+3
16+ surrealdb_wasm : ^1.0.0-beta.14+9
1617
1718dev_dependencies :
1819 flutter_test :
Original file line number Diff line number Diff line change 11import 'package:flutter_test/flutter_test.dart' ;
22import 'package:integration_test/integration_test.dart' ;
3- import 'package:surrealdb_js/surrealdb_js.dart' ;
43import 'package:surrealdb_wasm/surrealdb_wasm.dart' ;
54
65void main ({bool wasm = false }) {
76 IntegrationTestWidgetsFlutterBinding .ensureInitialized ();
87
9- final db = Surreal ({ 'engines' : WasmEngine ()} );
8+ final db = SurrealWasm . getInstance ( );
109
1110 setUpAll (() async {
1211 if (wasm) {
Original file line number Diff line number Diff line change @@ -3,13 +3,12 @@ import 'dart:typed_data';
33
44import 'package:flutter_test/flutter_test.dart' ;
55import 'package:integration_test/integration_test.dart' ;
6- import 'package:surrealdb_js/surrealdb_js.dart' ;
76import 'package:surrealdb_wasm/surrealdb_wasm.dart' ;
87
98void main ({bool wasm = false }) {
109 IntegrationTestWidgetsFlutterBinding .ensureInitialized ();
1110
12- final db = Surreal ({ 'engines' : WasmEngine ()} );
11+ final db = SurrealWasm . getInstance ( );
1312 //Tests run with local SurrealDB instance started with the command below:
1413 //surreal start memory --log trace --allow-all --auth --user root --pass root
1514 setUpAll (() async {
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import 'package:surrealdb_wasm/surrealdb_wasm.dart';
1010void main ({bool wasm = false }) {
1111 IntegrationTestWidgetsFlutterBinding .ensureInitialized ();
1212
13- final db = Surreal ({ 'engines' : WasmEngine ()} );
13+ final db = SurrealWasm . getInstance ( );
1414
1515 setUpAll (() async {
1616 if (wasm) {
Original file line number Diff line number Diff line change 1- // ignore_for_file: public_member_api_docs
2-
31import 'dart:js_interop' ;
42
53/// `WasmEngine` class for the `Surreal` class of the `surrealdb_js` package.
64extension type WasmEngine ._(JSObject _) implements JSObject {
5+ /// constructor with no arguments
76 external WasmEngine ();
87}
Original file line number Diff line number Diff line change 22library surrealdb_wasm;
33
44export 'src/js.dart' ;
5+ export 'src/surreal_extension.dart' ;
You can’t perform that action at this time.
0 commit comments