You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -6,7 +6,11 @@ Here are all the changes, grouped by package:
6
6
7
7
## `@yume-chan/adb`
8
8
9
-
The following TypeScript enums have been converted to plain objects to improve tree-shaking in Rollup. Type aliases that represents the union of their values has been added to keep source-compatibility. But you can't directly convert the value back to its name any more:
9
+
### Remove TypeScript enums and namespaces
10
+
11
+
TypeScript enums and namespaces transpiles to IIFEs with side effects, which can't be tree-shaken.
12
+
13
+
To reduce the bundling size, the following TypeScript enums have been converted to plain objects. Type aliases that represents the union of their values has been added to keep source-compatibility. However, you can't directly convert the value back to its name any more:
10
14
11
15
-`AdbShellProtocolId`
12
16
-`AdbSyncSendV2Flags`
@@ -46,7 +50,9 @@ const name = AdbCommand[AdbCommand.Connect]; // Error
46
50
</tbody>
47
51
</table>
48
52
49
-
[`AdbServerClient#trackDevices`](./server/watch.mdx) now returns an `AdbServerClient.DeviceObserver` instead of an async generator.
53
+
### Device watcher API change
54
+
55
+
[`AdbServerClient.prototype.trackDevices`](./server/watch.mdx) now returns an `AdbServerClient.DeviceObserver` instead of an async generator.
`AdbServerClient.ServerConnector#connect` now needs to return a `WritableStream<MaybeConsumable<Uint8Array>>` instead of a [`WritableStream<Uint8Array>`](./web-stream/index.mdx#writeablestream). It's unsafe to automatically unwrap [`MaybeConsumable`](./consumable.mdx#writablestream)s, the old version was causing corruptions when [pushing files](../api/adb/sync/write.mdx).
93
+
### Fix pushing files with custom server connector
94
+
95
+
The `connect` method of `AdbServerClient.ServerConnector` instances now needs to return a `WritableStream<MaybeConsumable<Uint8Array>>` instead of a [`WritableStream<Uint8Array>`](./web-stream/index.mdx#writeablestream). It's unsafe to automatically unwrap [`MaybeConsumable`](./consumable.mdx#writablestream)s, the old version was causing corruptions when [pushing files](../api/adb/sync/write.mdx).
88
96
89
97
## `@yume-chan/adb-daemon-webusb`
90
98
91
-
Removed `AdbDeviceFilter` and `ADB_DEFAULT_DEVICE_FILTER`.
99
+
### Simplified device filter
92
100
93
-
[`AdbDaemonWebUsbDeviceManager#requestDevice`](./daemon/usb/request-device.mdx) now accepts normal `USBDeviceFilter` objects (means all fields are optional), and automatically merges default ADB interface filters (`classCode`, `subclassCode` and `protocolCode`) into each of them if not exist.
101
+
[`AdbDaemonWebUsbDeviceManager.prototype.requestDevice`](./daemon/usb/request-device.mdx) now accepts normal `USBDeviceFilter` objects (which means all fields are optional), and automatically merges default ADB interface filters (`classCode`, `subclassCode` and `protocolCode`) into each of them if not exist.
The exported type `AdbDaemonWebUsbDeviceWatcher` has been replaced by [`AdbDaemonWebUsbDeviceObserver`](./daemon/usb/watch-devices.mdx). It shares the same interface as `AdbServerClient.DeviceObserver` to improve consistency and ease of use.
170
+
### Device watcher API change
171
+
172
+
The exported type `AdbDaemonWebUsbDeviceWatcher` has been replaced by [`AdbDaemonWebUsbDeviceObserver`](./daemon/usb/watch-devices.mdx). It shares the same interface as [`AdbServerClient.DeviceObserver`](#device-watcher-api-change) to improve consistency and ease of use.
Added `AdbDaemonWebUsbDeviceManager#trackDevices` method that creates an `AdbDaemonWebUsbDeviceObserver` instance. It mirrors `AdbServerClient#trackDevices`.
210
+
Added `AdbDaemonWebUsbDeviceManager.prototype.trackDevices` method that creates an `AdbDaemonWebUsbDeviceObserver` instance. It mirrors `AdbServerClient.prototype.trackDevices`.
Fixed a bug that `AdbScrcpyOptionsX_XX` doesn't [automatically switch to forward tunnel mode](../scrcpy/connect-server.mdx#with-yume-chanadb-scrcpy) when reverse tunnel is not supported.
208
224
209
-
Now it handles errors and stream closures when parsing the device message stream. The errors and closures will be propagated to [`ScrcpyOptionsX_XX#clipboard`](../scrcpy/options/index.mdx#watch-device-clipboard-changes) and `ScrcpyOptionsX_XX#uHidOutput` (docs to be added).
225
+
### Properly handle device message stream
226
+
227
+
Now it handles errors and stream closures when parsing the device message stream. The errors and closures will be propagated to [`ScrcpyOptionsX_XX.prototype.clipboard`](../scrcpy/options/index.mdx#watch-device-clipboard-changes) and `ScrcpyOptionsX_XX.prototype.uHidOutput` (docs to be added).
210
228
211
229
## `@yume-chan/android-bin`
212
230
213
-
Similar to `@yume-chan/adb`, the following TypeScript enums are converted to plain objects:
231
+
### Remove TypeScript enums
232
+
233
+
For the reason stated [above](#remove-typescript-enums-and-namespaces), the following TypeScript enums are converted to plain objects:
214
234
215
235
-`DumpSys.Battery.Status`
216
236
-`DumpSys.Battery.Health`
217
237
-`LogId` (use `LogIdName` to convert values back to names)
218
238
-`AndroidLogPriority`
219
239
-`LogcatFormat`
220
240
221
-
Added `Intent#addStringExtra` method. Thanks [@cedricdevriendt](https://github.com/cedricdevriendt) for submitting [#644](https://github.com/yume-chan/ya-webadb/pull/644)!
241
+
### Add `Intent.prototype.addStringExtra` method
242
+
243
+
Thanks [@cedricdevriendt](https://github.com/cedricdevriendt) for submitting [#644](https://github.com/yume-chan/ya-webadb/pull/644)!
The whole package has been completely rewritten. Options classes now shares code using ES modules, instead of inheritance, so if you only import one options class, only the related code will be included in the output bundle.
287
+
### Rewrite options classes
266
288
267
-
Removed `ScrcpyOptionsX_XX#defaults`. Now there is only `ScrcpyOptionsX_XX.Defaults`.
289
+
Options classes now share code using ES modules, instead of inheritance, so if you only import one options class, unused code can be tree-shaken.
290
+
291
+
Removed `ScrcpyOptionsX_XX.prototype.defaults`. Now there is only `ScrcpyOptionsX_XX.Defaults`.
268
292
269
293
Added `ScrcpyOptionsX_XX.Init` type aliases for the options types.
270
294
271
-
Set `ScrcpyOptionsX_XX#clipboard` to `undefined` if it's disabled by options, and allows `ScrcpyOptionsX_XX#clipboard#cancel` to ignore future messages.
295
+
### Rename `AndroidKeyEventMeta` values
296
+
297
+
Addition to the [enum-to-object conversion](#remove-typescript-enums-and-namespaces), the `AndroidKeyEventMeta` enum also have its value names changed:
Set `ScrcpyOptionsX_XX.prototype.clipboard` to `undefined` when it's disabled by options.
272
339
273
340
```ts showLineNumbers
274
341
const options =newScrcpyOptions3_0({
@@ -284,12 +351,20 @@ const options = new ScrcpyOptions3_0({
284
351
options.clipboard; // undefined
285
352
```
286
353
354
+
`ScrcpyOptionsX_XX.prototype.clipboard.cancel` now correctly ignores future messages.
355
+
287
356
```ts showLineNumbers
288
357
const options =newScrcpyOptions3_0();
289
358
awaitoptions.clipboard.cancel();
290
359
```
291
360
292
-
Support Scrcpy UHID messages via `ScrcpyOptionsX_XX#uHidOutput` (from v2.4), `ScrcpyControlMessageSerializer#uHidCreate` (from v2.4), `ScrcpyControlMessageSerializer#uHidInput` (from v2.4) and `ScrcpyControlMessageSerializer#uHidDestroy` (from v2.7).
361
+
### Add basic UHID support
362
+
363
+
Support Scrcpy UHID messages via `ScrcpyOptionsX_XX.prototype.uHidOutput` (from v2.4), `ScrcpyControlMessageSerializer.prototype.uHidCreate` (from v2.4), `ScrcpyControlMessageSerializer.prototype.uHidInput` (from v2.4) and `ScrcpyControlMessageSerializer.prototype.uHidDestroy` (from v2.7).
364
+
365
+
A better integration is coming soon.
366
+
367
+
### Add support for Scrcpy 3.0
293
368
294
369
Support all new [options](../scrcpy/versions.mdx) up to Scrcpy 3.0.
295
370
@@ -299,30 +374,50 @@ Support [rendering to `OffscreenCanvas`](../scrcpy/video/tiny-h264.mdx#create-a-
299
374
300
375
## `@yume-chan/scrcpy-decoder-webcodecs`
301
376
302
-
Added multiple [rendering modes](../scrcpy/video/web-codecs.mdx#renderer) and [rendering to `OffscreenCanvas`](../scrcpy/video/web-codecs.mdx#create-a-decoder).
377
+
### Add multiple renderers
378
+
379
+
There are multiple ways to render WebCodecs video frames. Now the package ships with [several renderers](../scrcpy/video/web-codecs.mdx#renderer), and you need to create a renderer before creating a decoder.
380
+
381
+
For canvas-based renderers, [rendering to `OffscreenCanvas`](../scrcpy/video/web-codecs.mdx#create-a-decoder) is now also supported.
382
+
383
+
### Fix rendering H.265 in Microsoft Edge
303
384
304
-
Fixed rendering H.265 videos having incorrect size on Microsoft Edge on Windows.
385
+
Fixed rendering H.265 videos having incorrect size in Microsoft Edge on Windows.
305
386
306
387
## `@yume-chan/stream-extra`
307
388
308
-
Added `BufferedReadableStream#iterateExactly` which returns raw chunks until the requested size is reached (while `BufferedReadableStream#readExactly` combines the chunks into one `Uint8Array`). This allows incremental processing and more granular control.
Which returns chunks of data until the requested size is reached (while `BufferedReadableStream.prototype.readExactly` combines the chunks into one `Uint8Array`). This allows incremental processing and more granular control.
392
+
393
+
### Workaround a ESBuild bug
309
394
310
395
Changed the coding style to workaround [evanw/esbuild#3923](https://github.com/evanw/esbuild/issues/3923). This should allow using in Vite without `optimizeDeps.exclude` option.
311
396
397
+
### Simplify `PushReadableStream` usage
398
+
312
399
`PushReadableStream` now ignores (instead of throwing an error) calling `controller.enqueue`, `controller.close` and `controller.error` when the stream is already in an errored or closed state. This simplifies the usage.
313
400
314
-
Automatically polyfill [`ReadableStream.from`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/from_static), [`ReadableStream.prototype[Symbol.asyncIterator]` and `ReadableStream#values`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream#async_iteration) when necessary.
401
+
### Polyfill `ReadableStream.from` and `ReadableStream.prototype[Symbol.asyncIterator]`
402
+
403
+
Automatically polyfill [`ReadableStream.from`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream/from_static), [`ReadableStream.prototype[Symbol.asyncIterator]` and `ReadableStream.prototype.values`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream#async_iteration) when necessary.
315
404
316
405
## `@yume-chan/struct`
317
406
407
+
### Whole package rewrite
408
+
318
409
The whole package has been mostly rewritten:
319
410
320
-
-`SyncPromise` has been replaced with `bipedal` to support running async functions synchronously if possible.
411
+
-`SyncPromise` has been replaced with `bipedal` to support running async functions synchronously when possible.
321
412
-`new Struct` has been replaced with `struct` method.
322
413
- Fluent style API has been replaced by individual field type methods for easier extension and better tree-shaking.
323
414
324
415
The new API is inspired by [TypeGPU](https://docs.swmansion.com/TypeGPU/) and [gensync](https://github.com/loganfsmyth/gensync). Check [README](https://www.npmjs.com/package/@yume-chan/struct/v/1.0.0) for documentation.
325
416
417
+
### Remove `ValueOrPromise`
418
+
326
419
The exported type `ValueOrPromise` has been moved to `@yume-chan/async` and renamed to `MaybePromiseLike`.
327
420
421
+
### Rename `EMPTY_UINT8_ARRAY`
422
+
328
423
The exported value `EMPTY_UINT8_ARRAY` has been renamed to `EmptyUint8Array`. We will use `PascalCase` for constants in the future.
0 commit comments