Skip to content

Commit

Permalink
feat: ready for the 1.0.0-beta.14+8 released
Browse files Browse the repository at this point in the history
  • Loading branch information
limcheekin committed Jul 17, 2024
1 parent bc7e792 commit 34faddd
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 33 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ Changes to the project are tracked using build numbers behind the version number

## [Unreleased]

## [1.0.0-beta.14+8] - 2024-07-17

- Feat: Upgraded surrealdb.wasm to 1.0.0-beta.14.
- Feat: Integrated with surrealdb_js 1.0.0-beta.14+3 that provide an unified API.

## [0.9.0+7] - 2024-03-13

- Feat: Upgraded to surrealdb.wasm 0.9.0, the official release of wasm module of the surrealdb 1.3.0.
Expand Down
7 changes: 4 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Welcome to the surrealdb_wasm project! We're excited to have you as a potential

### Project Overview

The Flutter SurrealDB WebAssembly (WASM) package is a powerful integration for Flutter, built upon the foundation of [surrealdb.wasm](https://github.com/surrealdb/surrealdb.wasm), the official SurrealDB library for WebAssembly. We value contributions that enhance this project's functionality and maintain its quality.
The Flutter SurrealDB WebAssembly (WASM) package is a powerful integration for Flutter, built upon the foundation of [surrealdb.wasm](https://github.com/surrealdb/surrealdb.wasm), the WebAssembly engine for the SurrealDB JavaScript SDK. Consequently, the [surrealdb_js](https://pub.dev/packages/surrealdb_js) package will provide an unified API for the WebAssembly engine. We value contributions that enhance this project's functionality and maintain its quality.

### Licensing

Expand All @@ -32,10 +32,11 @@ Please review our [Code of Conduct](CODE_OF_CONDUCT.md) before contributing. We

### Getting Started

1. Clone the repository: `git clone https://github.com/limcheekin/surrealdb_wasm.git`
1. Fork and clone the repository: https://github.com/limcheekin/surrealdb_wasm/fork
2. Install dependencies: `flutter pub get`
3. Set up your development environments:
- [Download and install Node.js and NPM](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) to build `surrealdb_wasm.js` with the `npm run package` command after making changes to [surrealdb.js](https://github.com/limcheekin/surrealdb_wasm/blob/main/assets/wasm/surrealdb/surrealdb.js).
- [Download and install Node.js and NPM](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) to build `surrealdb_wasm.js` with the `npm run package` command after making changes to [surrealdb.js](https://github.com/limcheekin/surrealdb_wasm/blob/main/assets/wasm/surrealdb/surrealdb.js) file.
- [Install SurrealDB on Linux](https://surrealdb.com/docs/surrealdb/installation/linux).
- Download [Chrome Driver](https://chromedriver.chromium.org/downloads) for integration test execution.

### Contributor Guidelines
Expand Down
49 changes: 24 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![style: very good analysis][very_good_analysis_badge]][very_good_analysis_link]
[![License: MIT][license_badge]][license_link]

The Flutter SurrealDB WebAssembly (WASM) package is a powerful integration for Flutter, built upon the foundation of [surrealdb.wasm](https://github.com/surrealdb/surrealdb.wasm), the official SurrealDB library for WebAssembly.
The Flutter SurrealDB WebAssembly (WASM) package is a powerful integration for Flutter, built upon the foundation of [surrealdb.wasm](https://github.com/surrealdb/surrealdb.wasm), the WebAssembly engine for the SurrealDB JavaScript SDK. Consequently, the [surrealdb_js](https://pub.dev/packages/surrealdb_js) package will provide an unified API for the WebAssembly engine.

## 🔍 Demo

Expand Down Expand Up @@ -37,33 +37,32 @@ Install it:
flutter pub get
```

Lastly, add the following code before the `</head>` tag in the `web/index.html` file:
```html
<script type="module">
import { Surreal, StringRecordId } from "/assets/packages/surrealdb_js/assets/js/index.bundled.mjs";
import { surrealdbWasmEngines } from "/assets/packages/surrealdb_wasm/assets/wasm/surrealdb/esm.bundled.js";
// expose the type to the global scope
globalThis.SurrealJS = Surreal;
globalThis.StringRecordId = StringRecordId;
globalThis.WasmEngine = surrealdbWasmEngines;
</script>
```

## ✨ Features

- <input type="checkbox" checked disabled /> [x] `connect()`
- <input type="checkbox" checked disabled /> [x] `use()`
- <input type="checkbox" checked disabled /> [x] `create()`
- <input type="checkbox" checked disabled /> [x] `update()`
- <input type="checkbox" checked disabled /> [x] `merge()`
- <input type="checkbox" checked disabled /> [x] `delete()`
- <input type="checkbox" checked disabled /> [x] `select()`
- <input type="checkbox" checked disabled /> [x] `query()`
- <input type="checkbox" checked disabled /> [x] `transaction()`
- <input type="checkbox" checked disabled /> [x] `set()`
- <input type="checkbox" checked disabled /> [x] `unset()`
- <input type="checkbox" checked disabled /> [x] `signup()`
- <input type="checkbox" checked disabled /> [x] `signin()`
- <input type="checkbox" disabled /> [ ] `invalidate()`
- <input type="checkbox" disabled /> [ ] `authenticate()`
- <input type="checkbox" checked disabled /> [x] `patch()`
- <input type="checkbox" checked disabled /> [x] `version()`
- <input type="checkbox" checked disabled /> [x] `health()`
Please refer to the [surrealdb_js](https://pub.dev/packages/surrealdb_js#-features) package for a comprehensive list of features.

## 🏃 Examples

### Basic

```dart
final db = Surreal();
import 'package:surrealdb_js/surrealdb_js.dart';
import 'package:surrealdb_wasm/surrealdb_wasm.dart';
final db = Surreal({'engines': WasmEngine()});
await db.connect('indxdb://surreal');
await db.use(namespace: 'test', database: 'test');
Expand All @@ -79,17 +78,17 @@ final created = db.create('person',
},
);
// created['id']: person:b9eht8bie8abf0vbcfxh
final id = created['id'].toString();
final merged = await db.merge(
created['id'],
id,
{
'marketing': false,
},
);
final tom = await db.select(created['id']);
final tom = await db.select(id);
final deleted = await db.delete(created['id']);
final deleted = await db.delete(id);
```

For more code examples, kindly refer to the [integration test](https://github.com/limcheekin/surrealdb_wasm/blob/main/integration_test/surrealdb_wasm_test.dart) and the [example project](https://github.com/limcheekin/surrealdb_wasm/blob/main/example/lib/main.dart).
Expand All @@ -115,7 +114,7 @@ For more code examples, kindly refer to the [integration test of transaction](ht

## 🧑‍💼 Contributing

Contributions are welcome! Please check out the unimplemented features above, issues on the repository, and feel free to open a pull request.
Contributions are welcome! Please check out the unimplemented features or issues on the repository, and feel free to open a pull request.
For more information, please see the [contribution guide](CONTRIBUTING.md).

<a href="https://github.com/limcheekin/surrealdb_wasm/graphs/contributors">
Expand Down
6 changes: 2 additions & 4 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
- Feat: Upgraded to surrealdb.wasm 0.9.0, the official release of wasm module of the surrealdb 1.3.0.
- Feat: API breaking changes:
- `db.select()` and `db.query()` that return single result, no longer requiring casting to `List` and retrieval by `.first`.
- Fix: Catched the error `Encountered a non-object value in array` within the library, preventing it from being exposed to the user. Reported the bug at [surrealdb.wasm#56](https://github.com/surrealdb/surrealdb.wasm/issues/56).
- Feat: Upgraded surrealdb.wasm to 1.0.0-beta.14.
- Feat: Integrated with surrealdb_js 1.0.0-beta.14+3 that provide an unified API.
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: surrealdb_wasm
description: Flutter SurrealDB WebAssembly(WASM) package
version: 0.9.0
version: 1.0.0-beta.14
repository: https://github.com/limcheekin/surrealdb_wasm

environment:
Expand Down

0 comments on commit 34faddd

Please sign in to comment.