Skip to content

Commit

Permalink
separate changelog between core packages and Scrcpy-related packages
Browse files Browse the repository at this point in the history
  • Loading branch information
yume-chan committed Dec 25, 2024
1 parent 5c49199 commit ec06c00
Show file tree
Hide file tree
Showing 6 changed files with 222 additions and 581 deletions.
12 changes: 5 additions & 7 deletions docs/scrcpy/start-server.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,13 @@ declare const VERSION: string;
const options = new AdbScrcpyOptions2_1(
new ScrcpyOptions2_1({
// options
}),
})
);

const client: AdbScrcpyClient = await AdbScrcpyClient.start(
adb,
DEFAULT_SERVER_PATH,
// If server binary was downloaded manually, must provide the correct version
VERSION,
options,
options
);

// Print output of Scrcpy server
Expand All @@ -68,7 +66,7 @@ void client.stdout.pipeTo(
write(chunk) {
console.log(chunk);
},
}),
})
);

// `undefined` if `video: false` option was specified
Expand All @@ -82,7 +80,7 @@ if (client.videoStream) {
console.log(chunk.type);
// handle video stream (see next chapter)
},
}),
})
);
}

Expand Down Expand Up @@ -117,7 +115,7 @@ options.clipboard
// Handle device clipboard change
console.log(chunk);
},
}),
})
)
.catch((error) => {
console.error(error);
Expand Down
98 changes: 98 additions & 0 deletions docs/scrcpy/upgrade.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Upgrade from 1.0.0

import DiffTable from "../tango/diff-table";

This page lists changes from version 1.0.0 in Scrcpy-related packages.

This version doesn't include any changes in core packages.

## `@yume-chan/adb-scrcpy`

### Move version to option classes

Because now we have an option class for each Scrcpy version (including aliases for patch versions), we moved the `version` info into the option classes.

The `version` parameter has been removed from `AdbScrcpyClient.start`, `AdbScrcpyClient.getEncoders` and `AdbScrcpyClient.getDisplays`.

<DiffTable leftHeader="1.0.0" rightHeader="next">
<td>

```ts showLineNumbers
const options = new AdbScrcpyOptions2_1(
new ScrcpyOptions3_0({
// ...
})
);

const client = await AdbScrcpyClient.start(adb, path, version, options);
```

</td>
<td>

```ts showLineNumbers
const options = new AdbScrcpyOptions2_1(
new ScrcpyOptions3_0({
// ...
})
);

const client = await AdbScrcpyClient.start(adb, path, options);
```

</td>
</DiffTable>

If you are using the matching option class for your server binary, you don't need to specify the version. Otherwise, you can override it in the option class constructor:

```ts showLineNumbers
const options = new AdbScrcpyOptions2_1(
new ScrcpyOptions3_0(
{
// ...
},
"3.1"
)
);
```

## `@yume-chan/scrcpy`

### Support Scrcpy v3.1

`ScrcpyOptions3_1` and related types have been added to support new options in Scrcpy version 3.1.

### Accept raw values for complex options

We provided custom option value types from some complex options, for example `videoCodecOptions`, `scid` and `newDisplay`. Now they also accept the raw (serialized) value directly:

<DiffTable leftHeader="1.0.0" rightHeader="next">
<td>

```ts showLineNumbers
import { ScrcpyOptions3_1, ScrcpyNewDisplay } from "@yume-chan/scrcpy";

const options = new ScrcpyOptions3_1({
newDisplay: new ScrcpyNewDisplay(1920, 1080, 330),
});
```

</td>
<td>

```ts showLineNumbers
import { ScrcpyOptions3_1 } from "@yume-chan/scrcpy";

const options = new ScrcpyOptions3_1({
newDisplay: "1920x1080/330",
});
```

</td>
</DiffTable>

### Fix incorrect scroll controllers in `ScrcpyOptions1_22` and later

In `ScrcpyOptions1_22` and later, the scroll controller for the mouse scroll event has been fixed.

This fixes the [`injectScroll`](./control/scroll.mdx) control message.
19 changes: 19 additions & 0 deletions docs/tango/diff-table.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
export default function DiffTable(props: {
leftHeader: string;
rightHeader: string;
children: React.ReactNode;
}) {
return (
<table style={{ display: "table", width: "100%", tableLayout: "fixed" }}>
<thead>
<tr>
<td>{props.leftHeader}</td>
<td>{props.rightHeader}</td>
</tr>
</thead>
<tbody>
<tr>{props.children}</tr>
</tbody>
</table>
);
}
Loading

0 comments on commit ec06c00

Please sign in to comment.