Skip to content

Commit 10edc2d

Browse files
Add the migration guide for version 7
1 parent 8bf5d0b commit 10edc2d

File tree

3 files changed

+29
-9
lines changed

3 files changed

+29
-9
lines changed

CHANGELOG.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66

77
- `SimpleReactiveGlobalHook` was renamed to `ReactiveGlobalHook`.
88

9-
- The `Run`, `RunAsync`, and `Stop` methods were moved from `IGlobalHook` and `IReactiveGlobalHook` into
10-
`IBasicGlobalHook` which both `IGlobalHook` and `IReactiveGlobalHook` now extend.
9+
- The `Run`, `RunAsync`, and `Stop` methods as well as the `IsRunning` and `IsDisposed` properties were moved from
10+
`IGlobalHook` and `IReactiveGlobalHook` into `IBasicGlobalHook` which both `IGlobalHook` and `IReactiveGlobalHook` now
11+
extend.
1112

12-
- Because of the previous change, `RunAsync` for reactive global hooks now returns a `Task` instead of an
13+
- Because of the above change, `RunAsync` for reactive global hooks now returns a `Task` instead of an
1314
`IObservable<Unit>`.
1415

1516
- `ReactiveLogSourceAdapter` now contains a single constructor with a default parameter instead of two constructors.

docs/articles/about.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,11 @@ You need .NET 9 to build SharpHook.
6161

6262
- `SimpleReactiveGlobalHook` was renamed to `ReactiveGlobalHook`.
6363

64-
- The `Run`, `RunAsync`, and `Stop` methods were moved from `IGlobalHook` and `IReactiveGlobalHook` into
65-
`IBasicGlobalHook` which both `IGlobalHook` and `IReactiveGlobalHook` now extend.
64+
- The `Run`, `RunAsync`, and `Stop` methods as well as the `IsRunning` and `IsDisposed` properties were moved from
65+
`IGlobalHook` and `IReactiveGlobalHook` into `IBasicGlobalHook` which both `IGlobalHook` and `IReactiveGlobalHook` now
66+
extend.
6667

67-
- Because of the previous change, `RunAsync` for reactive global hooks now returns a `Task` instead of an
68+
- Because of the above change, `RunAsync` for reactive global hooks now returns a `Task` instead of an
6869
`IObservable<Unit>`.
6970

7071
- `ReactiveLogSourceAdapter` now contains a single constructor with a default parameter instead of two constructors.

docs/articles/migration.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,24 @@ low-level functionality providers, these interfaces need to be changed. Technica
99
would require bumping the major version. Instead, changes to these interfaces are usually treated as minor version
1010
updates since they are not expected to break client code.
1111

12+
## Version 6 to 7
13+
14+
Version 7 contains only a couple breaking changes and most of them are in SharpHook.Reactive.
15+
16+
`SimpleReactiveGlobalHook` was renamed to `ReactiveGlobalHook`.
17+
18+
`RunAsync` in `IReactiveGlobalHook` now returns a `Task` instead of an `IObservable<Unit>`. If you want to have
19+
`IObservable<Unit>` instead, you should wrap the returned task.
20+
21+
Other breaking changes only require recompilation and don't require changing any code (unless reflection is used).
22+
23+
The `Run`, `RunAsync`, and `Stop` methods as well as the `IsRunning` and `IsDisposed` properties were moved from
24+
`IGlobalHook` and `IReactiveGlobalHook` into `IBasicGlobalHook` which both `IGlobalHook` and `IReactiveGlobalHook` now
25+
extend.
26+
27+
`ReactiveLogSourceAdapter` now contains a single constructor with a default second parameter instead of two
28+
constructors.
29+
1230
## Version 5 to 6
1331

1432
Version 6 contains multiple breaking changes, so you will most probably need to change your code to upgrade.
@@ -81,9 +99,9 @@ actually always required by libuiohook, so previously the buttons were always pr
8199
`HookEventArgs` doesn't contain the `Reserved` property anymore as its purpose wasn't really clear. Now `HookEventArgs`
82100
contains the `SuppressEvent` property – set it to `true` inside an event handler to suppress the event.
83101

84-
On .NET 7 `[LibraryImport]` is now used instead of `[DllImport]`. This change required making `UioHookEvent` a blittable
85-
type, and as a result, the type of `KeyboardEventData.KeyChar` was changed from `char` to `ushort`. The field should
86-
still be used as a `char`.
102+
On .NET 7 and later, `[LibraryImport]` is now used instead of `[DllImport]`. This change required making `UioHookEvent`
103+
a blittable type, and as a result, the type of `KeyboardEventData.KeyChar` was changed from `char` to `ushort`. The
104+
field should still be used as a `char`.
87105

88106
Explicit targets for .NET 5 and .NET Core 3.1 were removed, though the library can be used on those platforms through
89107
.NET Standard.

0 commit comments

Comments
 (0)