Skip to content

Commit 204ce2a

Browse files
committed
Remove libsyncrpc and rust related stuff
1 parent 4a343b0 commit 204ce2a

File tree

12 files changed

+9
-112
lines changed

12 files changed

+9
-112
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
},
1414
"ghcr.io/devcontainers-extra/features/dprint-asdf:2": {
1515
"version": "latest"
16-
},
17-
"ghcr.io/devcontainers/features/rust:1": {}
16+
}
1817
},
1918

2019
// Use 'forwardPorts' to make a list of ports inside the container available locally.

.github/workflows/ci.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ jobs:
3232
dotnet: false
3333
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3434
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
35-
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
3635
- uses: ./.github/actions/setup-go
3736

3837
# Avoid duplicate PR annotations.
@@ -52,7 +51,6 @@ jobs:
5251
steps:
5352
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
5453
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
55-
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
5654

5755
- run: npm ci
5856

@@ -122,7 +120,6 @@ jobs:
122120
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
123121
with:
124122
node-version: 'lts/*'
125-
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
126123
- uses: ./.github/actions/setup-go
127124

128125
# Avoid duplicate PR annotations.
@@ -213,7 +210,6 @@ jobs:
213210
dotnet: false
214211
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
215212
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
216-
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
217213
- uses: ./.github/actions/setup-go
218214
with:
219215
lint-cache: 'true'
@@ -236,7 +232,6 @@ jobs:
236232
steps:
237233
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
238234
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
239-
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
240235
- uses: ./.github/actions/setup-go
241236

242237
- run: npm ci
@@ -258,7 +253,6 @@ jobs:
258253
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
259254
with:
260255
node-version: '>=22.16.0'
261-
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
262256
- uses: ./.github/actions/setup-go
263257

264258
- run: npm ci
@@ -305,7 +299,6 @@ jobs:
305299
with:
306300
submodules: true
307301
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
308-
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
309302
- uses: ./.github/actions/setup-go
310303

311304
# Avoid duplicate PR annotations.

.github/workflows/copilot-setup-steps.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ jobs:
2828
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
2929
with:
3030
node-version: '>=22.16.0'
31-
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
3231
- uses: ./.github/actions/setup-go
3332
with:
3433
lint-cache: 'true'

.github/workflows/create-cache.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ jobs:
4747
with:
4848
submodules: true
4949
- uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
50-
- uses: dtolnay/rust-toolchain@fcf085fcb4b4b8f63f96906cd713eb52181b5ea4 # stable
5150

5251
- uses: ./.github/actions/setup-go
5352
with:

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ TypeScript 7.0 will be a key bridge release between TypeScript 6.0 (the [last Ja
66

77
## How to Build and Run
88

9-
This repo uses [Go 1.26 or higher](https://go.dev/dl/), [Rust 1.88 or higher](https://www.rust-lang.org/tools/install), [Node.js with npm](https://nodejs.org/), and [`hereby`](https://www.npmjs.com/package/hereby).
9+
This repo uses [Go 1.26 or higher](https://go.dev/dl/), [Node.js with npm](https://nodejs.org/), and [`hereby`](https://www.npmjs.com/package/hereby).
1010

1111
For tests and code generation, this repo contains a git submodule to the main TypeScript repo pointing to the commit being ported.
1212
When cloning, you'll want to clone with submodules:

_packages/api/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@
6060
"dependencies": {
6161
"@types/node": "^25.2.0",
6262
"@typescript/ast": "1.0.0",
63-
"@typescript/libsyncrpc": "github:microsoft/libsyncrpc#00f42f7e419186ae06c768cb75fff973d95bcaa6",
6463
"vscode-jsonrpc": "^9.0.0-next.11"
6564
}
6665
}

_packages/api/src/api.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,7 @@ import {
1515
type Type as BaseType,
1616
} from "./base/api.ts";
1717
import { ObjectRegistry } from "./base/objectRegistry.ts";
18-
import {
19-
type ChannelType,
20-
Client,
21-
} from "./client.ts";
18+
import { Client } from "./client.ts";
2219
import type { FileSystem } from "./fs.ts";
2320
import { RemoteSourceFile } from "./node.ts";
2421
import type {
@@ -29,12 +26,11 @@ import type {
2926
} from "./proto.ts";
3027

3128
export { SymbolFlags, TypeFlags };
32-
export type { ChannelType, FileIdentifier };
29+
export type { FileIdentifier };
3330
export { documentURIToFileName, fileNameToDocumentURI } from "./path.ts";
3431

3532
export interface APIOptions extends BaseAPIOptions {
3633
fs?: FileSystem;
37-
channel?: ChannelType;
3834
}
3935

4036
/** Type alias for the sync object registry */

_packages/api/src/client.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
1-
import { SyncRpcChannel as NativeSyncRpcChannel } from "@typescript/libsyncrpc";
21
import type { FileSystem } from "./fs.ts";
32
import { SyncRpcChannel } from "./syncChannel.ts";
43

5-
export type ChannelType = "js" | "native";
6-
74
export interface ClientOptions {
85
tsserverPath: string;
96
cwd?: string;
107
logFile?: string;
118
fs?: FileSystem;
12-
channel?: ChannelType;
139
}
1410

1511
export class Client {
16-
private channel: SyncRpcChannel | NativeSyncRpcChannel;
12+
private channel: SyncRpcChannel;
1713
private encoder = new TextEncoder();
1814

1915
constructor(options: ClientOptions) {
@@ -28,8 +24,7 @@ export class Client {
2824
args.push(`--callbacks=${Object.keys(options.fs).join(",")}`);
2925
}
3026

31-
const ChannelImpl = options.channel === "native" ? NativeSyncRpcChannel : SyncRpcChannel;
32-
this.channel = new ChannelImpl(options.tsserverPath, args);
27+
this.channel = new SyncRpcChannel(options.tsserverPath, args);
3328

3429
if (options.fs) {
3530
for (const [key, callback] of Object.entries(options.fs)) {

_packages/api/test/api.bench.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@ import { runBenchmarks as runSyncBenchmarks } from "./api.sync.bench.ts";
55
const isMain = process.argv[1] === fileURLToPath(import.meta.url);
66
if (isMain) {
77
await runAsyncBenchmarks();
8-
await runSyncBenchmarks({ channel: "js" });
9-
await runSyncBenchmarks({ channel: "native" });
8+
await runSyncBenchmarks();
109
}

_packages/api/test/api.sync.bench.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import {
22
API,
3-
type ChannelType,
43
type Project,
54
} from "@typescript/api";
65
import {
@@ -25,14 +24,12 @@ if (isMain) {
2524

2625
export interface SyncBenchmarkOptions {
2726
singleIteration?: boolean;
28-
channel?: ChannelType;
2927
}
3028

3129
export async function runBenchmarks(options?: boolean | SyncBenchmarkOptions) {
3230
// Support legacy boolean argument for singleIteration
3331
const opts: SyncBenchmarkOptions = typeof options === "boolean" ? { singleIteration: options } : (options ?? {});
34-
const { singleIteration, channel } = opts;
35-
const channelLabel = channel === "native" ? "native" : "js";
32+
const { singleIteration } = opts;
3633

3734
const repoRoot = fileURLToPath(new URL("../../../", import.meta.url).toString());
3835
if (!existsSync(path.join(repoRoot, "_submodules/TypeScript/src/compiler"))) {
@@ -41,7 +38,7 @@ export async function runBenchmarks(options?: boolean | SyncBenchmarkOptions) {
4138
}
4239

4340
const bench = new Bench({
44-
name: `Sync API (${channelLabel})`,
41+
name: `Sync API`,
4542
teardown,
4643
// Reduce iterations from the default 64 to 10. Slow tasks
4744
// (e.g. getSymbolAtLocation over 10k ids at ~450ms each) are
@@ -190,7 +187,6 @@ export async function runBenchmarks(options?: boolean | SyncBenchmarkOptions) {
190187
api = new API({
191188
cwd: repoRoot,
192189
tsserverPath: fileURLToPath(new URL(`../../../built/local/tsgo${process.platform === "win32" ? ".exe" : ""}`, import.meta.url).toString()),
193-
channel,
194190
});
195191
}
196192

@@ -199,7 +195,6 @@ export async function runBenchmarks(options?: boolean | SyncBenchmarkOptions) {
199195
cwd: repoRoot,
200196
tsserverPath: fileURLToPath(new URL(`../../../built/local/tsgo${process.platform === "win32" ? ".exe" : ""}`, import.meta.url).toString()),
201197
fs: createNodeFileSystem(),
202-
channel,
203198
});
204199
}
205200

0 commit comments

Comments
 (0)