Skip to content

Commit

Permalink
Deprecate top-level members in moor package
Browse files Browse the repository at this point in the history
  • Loading branch information
simolus3 committed Oct 12, 2021
1 parent 7d41e42 commit 6b03003
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/pages/docs/name.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ path: /name

Moor has been renamed to `drift`. The reason for this is that, in some parts of the world, moor may be used as a derogatery term.
I have not been aware of this when starting this project, but we believe that the current name does not reflect the inclusivity of the Dart and Flutter communities.
Despite the associated effort, renaming the project is the right decision.
Despite the associated effort, I'm convinced that renaming the project is the right decision.
Thank you for your understanding!

Until version `5.0.0`, the current `moor` and `moor_generator` packages will continue to work - __no urgent action is necessary__.
Expand Down
3 changes: 3 additions & 0 deletions moor/lib/backends.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/// Utility classes to implement custom database backends that work together
/// with moor.
@moorDeprecated
library backends;

import 'package:moor/src/deprecated.dart';

export 'package:drift/backends.dart';
2 changes: 2 additions & 0 deletions moor/lib/extensions/json1.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
/// [moor_ffi](https://moor.simonbinder.eu/docs/other-engines/vm/) and it might
/// not work on older iOS versions.
@experimental
@moorDeprecated
library json1;

import 'package:meta/meta.dart';
import 'package:moor/src/deprecated.dart';

export 'package:drift/extensions/json1.dart';
3 changes: 3 additions & 0 deletions moor/lib/extensions/moor_ffi.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/// High-level bindings to mathematical functions that are only available in
/// `moor_ffi`.
@moorDeprecated
library moor_ffi_functions;

import 'package:moor/src/deprecated.dart';

export 'package:drift/extensions/native.dart';
2 changes: 2 additions & 0 deletions moor/lib/ffi.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
/// `sqlite3_flutter_libs` package to ship the latest sqlite3 version with your
/// app.
/// For more information other platforms, see [other engines](https://moor.simonbinder.eu/docs/other-engines/vm/).
@moorDeprecated
library moor.ffi;

import 'package:drift/native.dart';
import 'package:moor/src/deprecated.dart';

export 'package:drift/native.dart' hide NativeDatabase;

Expand Down
2 changes: 2 additions & 0 deletions moor/lib/isolate.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
/// Contains utils to run moor databases in a background isolate. This API is
/// not supported on the web.
@moorDeprecated
library isolate;

import 'package:drift/isolate.dart';
import 'package:moor/src/deprecated.dart';

export 'package:drift/isolate.dart';

Expand Down
9 changes: 9 additions & 0 deletions moor/lib/moor.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
@moorDeprecated
library moor;

import 'package:drift/drift.dart';

import 'src/deprecated.dart';

export 'package:drift/drift.dart'
hide
DriftRuntimeOptions,
Expand All @@ -26,6 +29,7 @@ export 'package:drift/drift.dart'
/// }
/// ```
@pragma('moor2drift', 'DriftDatabase')
@moorDeprecated
typedef UseMoor = DriftDatabase;

/// Annotation to use on classes that implement [DatabaseAccessor]. It specifies
Expand All @@ -52,6 +56,7 @@ typedef UseMoor = DriftDatabase;
/// See also:
/// - https://moor.simonbinder.eu/daos/
@pragma('moor2drift', 'DriftAccessor')
@moorDeprecated
typedef UseDao = DriftAccessor;

/// A wrapper class for internal exceptions thrown by the underlying database
Expand All @@ -60,21 +65,25 @@ typedef UseDao = DriftAccessor;
/// For instance, when we know that an invalid statement has been constructed,
/// we catch the database exception and try to explain why that has happened.
@pragma('moor2drift', 'DriftWrappedException')
@moorDeprecated
typedef MoorWrappedException = DriftWrappedException;

/// Defines additional runtime behavior for moor. Changing the fields of this
/// class is rarely necessary.
@pragma('moor2drift', 'DriftRuntimeOptions')
@moorDeprecated
typedef MoorRuntimeOptions = DriftRuntimeOptions;

/// Stores the [MoorRuntimeOptions] describing global moor behavior across
/// databases.
///
/// Note that is is adapting this behavior is rarely needed.
@pragma('moor2drift', 'driftRuntimeOptions')
@moorDeprecated
MoorRuntimeOptions get moorRuntimeOptions => driftRuntimeOptions;

@pragma('moor2drift', 'driftRuntimeOptions')
@moorDeprecated
set moorRuntimeOptions(MoorRuntimeOptions o) => driftRuntimeOptions = o;

/// For use by generated code in calculating hash codes. Do not use directly.
Expand Down
2 changes: 2 additions & 0 deletions moor/lib/moor_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
/// web version of moor. See [the documentation](https://moor.simonbinder.eu/web)
/// for a more detailed instruction.
@experimental
@moorDeprecated
library moor_web;

import 'package:drift/web.dart';
import 'package:meta/meta.dart';
import 'package:moor/src/deprecated.dart';

export 'package:drift/web.dart' hide DriftWebStorage;

Expand Down
2 changes: 2 additions & 0 deletions moor/lib/remote.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,12 @@
/// contains another implementation based on web workers that might be of
/// interest.
@experimental
@moorDeprecated
library remote;

import 'package:drift/remote.dart';
import 'package:meta/meta.dart';
import 'package:moor/src/deprecated.dart';
import 'package:stream_channel/stream_channel.dart';

export 'package:drift/remote.dart' hide DriftServer;
Expand Down
3 changes: 3 additions & 0 deletions moor/lib/sqlite_keywords.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/// Provides utilities around sql keywords, like optional escaping etc.
@moorDeprecated
library moor.sqlite_keywords;

import 'package:moor/src/deprecated.dart';

export 'package:drift/sqlite_keywords.dart';
5 changes: 5 additions & 0 deletions moor/lib/src/deprecated.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// Deprecation hint as a constant.
const moorDeprecated = Deprecated(
'Moor has been renamed to drift. See https://drift.simonbinder.eu/name for '
'more information and how to migrate in minutes.',
);

0 comments on commit 6b03003

Please sign in to comment.