Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix web compilation #88

Open
wants to merge 2 commits into
base: v3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/isar/lib/isar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ import 'package:isar/src/native/split_words.dart'
import 'package:meta/meta.dart';
import 'package:meta/meta_meta.dart';

export 'dart:convert';

part 'src/xxh3/xxh3.dart';
part 'src/xxh3/math.dart';
part 'src/xxh3/util.dart';
part 'src/annotations/backlink.dart';
part 'src/annotations/collection.dart';
part 'src/annotations/embedded.dart';
Expand Down
10 changes: 5 additions & 5 deletions packages/isar/lib/src/native/bindings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2024,8 +2024,8 @@ class IsarCoreBindings {
}

late final _isar_q_aggregate_long_resultPtr = _lookup<
ffi.NativeFunction<
ffi.Int64 Function(ffi.Pointer<CAggregationResult>)>>(
ffi
.NativeFunction<ffi.Int64 Function(ffi.Pointer<CAggregationResult>)>>(
'isar_q_aggregate_long_result');
late final _isar_q_aggregate_long_result = _isar_q_aggregate_long_resultPtr
.asFunction<int Function(ffi.Pointer<CAggregationResult>)>();
Expand Down Expand Up @@ -2088,9 +2088,9 @@ class IsarCoreBindings {
}

late final _isar_txn_finishPtr = _lookup<
ffi.NativeFunction<
ffi.Int64 Function(
ffi.Pointer<CIsarTxn>, ffi.Bool)>>('isar_txn_finish');
ffi
.NativeFunction<ffi.Int64 Function(ffi.Pointer<CIsarTxn>, ffi.Bool)>>(
'isar_txn_finish');
late final _isar_txn_finish = _isar_txn_finishPtr
.asFunction<int Function(ffi.Pointer<CIsarTxn>, bool)>();

Expand Down
4 changes: 2 additions & 2 deletions packages/isar/lib/src/schema/collection_schema.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class CollectionSchema<OBJ> extends Schema<OBJ> {
/// @nodoc
@protected
const CollectionSchema({
required super.id,
required super.idGenerator,
required super.name,
required super.properties,
required super.estimateSize,
Expand All @@ -31,7 +31,7 @@ class CollectionSchema<OBJ> extends Schema<OBJ> {
factory CollectionSchema.fromJson(Map<String, dynamic> json) {
final collection = Schema<dynamic>.fromJson(json);
return CollectionSchema(
id: collection.id,
idGenerator: collection.idGenerator,
name: collection.name,
properties: collection.properties,
idName: json['idName'] as String,
Expand Down
8 changes: 5 additions & 3 deletions packages/isar/lib/src/schema/index_schema.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class IndexSchema {
/// @nodoc
@protected
const IndexSchema({
required this.id,
required this.idGenerator,
required this.name,
required this.unique,
required this.replace,
Expand All @@ -16,7 +16,7 @@ class IndexSchema {
@protected
factory IndexSchema.fromJson(Map<String, dynamic> json) {
return IndexSchema(
id: -1,
idGenerator: () => -1,
name: json['name'] as String,
unique: json['unique'] as bool,
replace: json['replace'] as bool,
Expand All @@ -27,7 +27,9 @@ class IndexSchema {
}

/// Internal id of this index.
final int id;
int get id => idGenerator();

final int Function() idGenerator;

/// Name of this index.
final String name;
Expand Down
8 changes: 5 additions & 3 deletions packages/isar/lib/src/schema/link_schema.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class LinkSchema {
/// @nodoc
@protected
const LinkSchema({
required this.id,
required this.idGenerator,
required this.name,
required this.target,
required this.single,
Expand All @@ -16,7 +16,7 @@ class LinkSchema {
@protected
factory LinkSchema.fromJson(Map<String, dynamic> json) {
return LinkSchema(
id: -1,
idGenerator: () => -1,
name: json['name'] as String,
target: json['target'] as String,
single: json['single'] as bool,
Expand All @@ -25,7 +25,9 @@ class LinkSchema {
}

/// Internal id of this link.
final int id;
int get id => idGenerator();

final int Function() idGenerator;

/// Name of this link.
final String name;
Expand Down
8 changes: 5 additions & 3 deletions packages/isar/lib/src/schema/schema.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class Schema<OBJ> {
/// @nodoc
@protected
const Schema({
required this.id,
required this.idGenerator,
required this.name,
required this.properties,
required this.estimateSize,
Expand All @@ -18,7 +18,7 @@ class Schema<OBJ> {
@protected
factory Schema.fromJson(Map<String, dynamic> json) {
return Schema(
id: -1,
idGenerator: () => -1,
name: json['name'] as String,
properties: {
for (final property in json['properties'] as List<dynamic>)
Expand All @@ -33,7 +33,9 @@ class Schema<OBJ> {
}

/// Internal id of this collection or embedded object.
final int id;
int get id => idGenerator();

final int Function() idGenerator;

/// Name of the collection or embedded object
final String name;
Expand Down
Loading