Skip to content

Commit ec06c00

Browse files
committed
separate changelog between core packages and Scrcpy-related packages
1 parent 5c49199 commit ec06c00

File tree

6 files changed

+222
-581
lines changed

6 files changed

+222
-581
lines changed

docs/scrcpy/start-server.mdx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,13 @@ declare const VERSION: string;
5151
const options = new AdbScrcpyOptions2_1(
5252
new ScrcpyOptions2_1({
5353
// options
54-
}),
54+
})
5555
);
5656

5757
const client: AdbScrcpyClient = await AdbScrcpyClient.start(
5858
adb,
5959
DEFAULT_SERVER_PATH,
60-
// If server binary was downloaded manually, must provide the correct version
61-
VERSION,
62-
options,
60+
options
6361
);
6462

6563
// Print output of Scrcpy server
@@ -68,7 +66,7 @@ void client.stdout.pipeTo(
6866
write(chunk) {
6967
console.log(chunk);
7068
},
71-
}),
69+
})
7270
);
7371

7472
// `undefined` if `video: false` option was specified
@@ -82,7 +80,7 @@ if (client.videoStream) {
8280
console.log(chunk.type);
8381
// handle video stream (see next chapter)
8482
},
85-
}),
83+
})
8684
);
8785
}
8886

@@ -117,7 +115,7 @@ options.clipboard
117115
// Handle device clipboard change
118116
console.log(chunk);
119117
},
120-
}),
118+
})
121119
)
122120
.catch((error) => {
123121
console.error(error);

docs/scrcpy/upgrade.mdx

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# Upgrade from 1.0.0
2+
3+
import DiffTable from "../tango/diff-table";
4+
5+
This page lists changes from version 1.0.0 in Scrcpy-related packages.
6+
7+
This version doesn't include any changes in core packages.
8+
9+
## `@yume-chan/adb-scrcpy`
10+
11+
### Move version to option classes
12+
13+
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.
14+
15+
The `version` parameter has been removed from `AdbScrcpyClient.start`, `AdbScrcpyClient.getEncoders` and `AdbScrcpyClient.getDisplays`.
16+
17+
<DiffTable leftHeader="1.0.0" rightHeader="next">
18+
<td>
19+
20+
```ts showLineNumbers
21+
const options = new AdbScrcpyOptions2_1(
22+
new ScrcpyOptions3_0({
23+
// ...
24+
})
25+
);
26+
27+
const client = await AdbScrcpyClient.start(adb, path, version, options);
28+
```
29+
30+
</td>
31+
<td>
32+
33+
```ts showLineNumbers
34+
const options = new AdbScrcpyOptions2_1(
35+
new ScrcpyOptions3_0({
36+
// ...
37+
})
38+
);
39+
40+
const client = await AdbScrcpyClient.start(adb, path, options);
41+
```
42+
43+
</td>
44+
</DiffTable>
45+
46+
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:
47+
48+
```ts showLineNumbers
49+
const options = new AdbScrcpyOptions2_1(
50+
new ScrcpyOptions3_0(
51+
{
52+
// ...
53+
},
54+
"3.1"
55+
)
56+
);
57+
```
58+
59+
## `@yume-chan/scrcpy`
60+
61+
### Support Scrcpy v3.1
62+
63+
`ScrcpyOptions3_1` and related types have been added to support new options in Scrcpy version 3.1.
64+
65+
### Accept raw values for complex options
66+
67+
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:
68+
69+
<DiffTable leftHeader="1.0.0" rightHeader="next">
70+
<td>
71+
72+
```ts showLineNumbers
73+
import { ScrcpyOptions3_1, ScrcpyNewDisplay } from "@yume-chan/scrcpy";
74+
75+
const options = new ScrcpyOptions3_1({
76+
newDisplay: new ScrcpyNewDisplay(1920, 1080, 330),
77+
});
78+
```
79+
80+
</td>
81+
<td>
82+
83+
```ts showLineNumbers
84+
import { ScrcpyOptions3_1 } from "@yume-chan/scrcpy";
85+
86+
const options = new ScrcpyOptions3_1({
87+
newDisplay: "1920x1080/330",
88+
});
89+
```
90+
91+
</td>
92+
</DiffTable>
93+
94+
### Fix incorrect scroll controllers in `ScrcpyOptions1_22` and later
95+
96+
In `ScrcpyOptions1_22` and later, the scroll controller for the mouse scroll event has been fixed.
97+
98+
This fixes the [`injectScroll`](./control/scroll.mdx) control message.

docs/tango/diff-table.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
export default function DiffTable(props: {
2+
leftHeader: string;
3+
rightHeader: string;
4+
children: React.ReactNode;
5+
}) {
6+
return (
7+
<table style={{ display: "table", width: "100%", tableLayout: "fixed" }}>
8+
<thead>
9+
<tr>
10+
<td>{props.leftHeader}</td>
11+
<td>{props.rightHeader}</td>
12+
</tr>
13+
</thead>
14+
<tbody>
15+
<tr>{props.children}</tr>
16+
</tbody>
17+
</table>
18+
);
19+
}

0 commit comments

Comments
 (0)