Upgrade from 0.0.24
The version 1.0.0 contains many breaking changes, mainly to improve developer experience and reduce bundling size by improve tree-shaking.
This page lists changes from version 0.0.24 in core packages.
For changes in Scrcpy-related packages, see this page.
@yume-chan/adb
Remove TypeScript enums and namespaces
TypeScript enums and namespaces transpiles to IIFEs with side effects, which can't be tree-shaken.
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:
AdbShellProtocolIdAdbSyncSendV2FlagsLinuxFileTypeAdbSyncStatErrorCode(useAdbSyncStatErrorNameto convert values back to names)AdbAuthTypeAdbCommandAdbBannerKeyAdbFeature
| 0.0.24 | 1.0.0 |
| |
Device watcher API change
AdbServerClient.prototype.trackDevices now returns an AdbServerClient.DeviceObserver instead of an async generator.
| 0.0.24 | 1.0.0 |
| |
Fix pushing files with custom server connector
The connect method of AdbServerClient.ServerConnector instances now needs to return a WritableStream<MaybeConsumable<Uint8Array>> instead of a WritableStream<Uint8Array>. It's unsafe to automatically unwrap MaybeConsumables, the old version was causing corruptions when pushing files.
@yume-chan/adb-daemon-webusb
Simplified device filter
AdbDaemonWebUsbDeviceManager.prototype.requestDevice 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.
| 0.0.24 | 1.0.0 |
| |
As a result, AdbDeviceFilter type and ADB_DEFAULT_DEVICE_FILTER constant are removed.
Exclusive filter in getDevices
Changed AdbDaemonWebUsbDeviceManager.prototype.getDevices method to also accept exclusionFilters.
| 0.0.24 | 1.0.0 |
| |
Device watcher API change
The exported type AdbDaemonWebUsbDeviceWatcher has been replaced by AdbDaemonWebUsbDeviceObserver. It shares the same interface as AdbServerClient.DeviceObserver to improve consistency and ease of use.
| 0.0.24 | 1.0.0 |
| |
Added AdbDaemonWebUsbDeviceManager.prototype.trackDevices method that creates an AdbDaemonWebUsbDeviceObserver instance. It mirrors AdbServerClient.prototype.trackDevices.
const observer1 = new AdbDaemonWebUsbDeviceObserver(navigator.usb, {
filters: [{ vendorId: 0x1234 }],
});
const observer2 = manager.trackDevices();
@yume-chan/android-bin
Remove TypeScript enums
For the reason stated above, the following TypeScript enums are converted to plain objects:
DumpSys.Battery.StatusDumpSys.Battery.HealthLogId(useLogIdNameto convert values back to names)AndroidLogPriorityLogcatFormat
Add Intent.prototype.addStringExtra method
Thanks @cedricdevriendt for submitting #644!
@yume-chan/stream-extra
Add BufferedReadableStream.prototype.iterateExactly
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.
Workaround a ESBuild bug
Changed the coding style to workaround evanw/esbuild#3923. This should allow using in Vite without optimizeDeps.exclude option.
Simplify PushReadableStream usage
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.
Polyfill ReadableStream.from and ReadableStream.prototype[Symbol.asyncIterator]
Automatically polyfill ReadableStream.from, ReadableStream.prototype[Symbol.asyncIterator] and ReadableStream.prototype.values when necessary.
@yume-chan/struct
Whole package rewrite
The whole package has been mostly rewritten:
SyncPromisehas been replaced withbipedalto support running async functions synchronously when possible.new Structhas been replaced withstructmethod.- Fluent style API has been replaced by individual field type methods for easier extension and better tree-shaking.
The new API is inspired by TypeGPU and gensync. Check README for documentation.
Remove ValueOrPromise
The exported type ValueOrPromise has been moved to @yume-chan/async and renamed to MaybePromiseLike.
Rename EMPTY_UINT8_ARRAY
The exported value EMPTY_UINT8_ARRAY has been renamed to EmptyUint8Array. We will use PascalCase for constants in the future.