Skip to content

Commit 7dd4090

Browse files
authored
Remove unstable native plugins (#10908)
This commit removes implementation of native plugins alongside the unstable "Deno.openPlugin()" API.
1 parent 2544ec9 commit 7dd4090

15 files changed

+4
-487
lines changed

Cargo.lock

Lines changed: 0 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ members = [
66
"cli",
77
"core",
88
"runtime",
9-
"test_plugin",
109
"test_util",
1110
"extensions/broadcast_channel",
1211
"extensions/console",

cli/dts/lib.deno.unstable.d.ts

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -129,37 +129,6 @@ declare namespace Deno {
129129
speed: number | undefined;
130130
}
131131

132-
/** **UNSTABLE**: new API, yet to be vetted.
133-
*
134-
* Open and initialize a plugin.
135-
*
136-
* ```ts
137-
* import { assert } from "https://deno.land/std/testing/asserts.ts";
138-
* const rid = Deno.openPlugin("./path/to/some/plugin.so");
139-
*
140-
* // The Deno.core namespace is needed to interact with plugins, but this is
141-
* // internal so we use ts-ignore to skip type checking these calls.
142-
* // @ts-ignore
143-
* const { op_test_sync, op_test_async } = Deno.core.ops();
144-
*
145-
* assert(op_test_sync);
146-
* assert(op_test_async);
147-
*
148-
* // @ts-ignore
149-
* const result = Deno.core.opSync("op_test_sync");
150-
*
151-
* // @ts-ignore
152-
* const result = await Deno.core.opAsync("op_test_sync");
153-
* ```
154-
*
155-
* Requires `allow-plugin` permission.
156-
*
157-
* The plugin system is not stable and will change in the future, hence the
158-
* lack of docs. For now take a look at the example
159-
* https://github.com/denoland/deno/tree/main/test_plugin
160-
*/
161-
export function openPlugin(filename: string): number;
162-
163132
/** The log category for a diagnostic message. */
164133
export enum DiagnosticCategory {
165134
Warning = 0,

cli/tests/integration/lsp_tests.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ fn lsp_hover_unstable_enabled() {
470470
"uri": "file:///a/file.ts",
471471
"languageId": "typescript",
472472
"version": 1,
473-
"text": "console.log(Deno.openPlugin);\n"
473+
"text": "console.log(Deno.ppid);\n"
474474
}
475475
}),
476476
);
@@ -495,9 +495,9 @@ fn lsp_hover_unstable_enabled() {
495495
"contents":[
496496
{
497497
"language":"typescript",
498-
"value":"function Deno.openPlugin(filename: string): number"
498+
"value":"const Deno.ppid: number"
499499
},
500-
"**UNSTABLE**: new API, yet to be vetted.\n\nOpen and initialize a plugin.\n\n```ts\nimport { assert } from \"https://deno.land/std/testing/asserts.ts\";\nconst rid = Deno.openPlugin(\"./path/to/some/plugin.so\");\n\n// The Deno.core namespace is needed to interact with plugins, but this is\n// internal so we use ts-ignore to skip type checking these calls.\n// @ts-ignore\nconst { op_test_sync, op_test_async } = Deno.core.ops();\n\nassert(op_test_sync);\nassert(op_test_async);\n\n// @ts-ignore\nconst result = Deno.core.opSync(\"op_test_sync\");\n\n// @ts-ignore\nconst result = await Deno.core.opAsync(\"op_test_sync\");\n```\n\nRequires `allow-plugin` permission.\n\nThe plugin system is not stable and will change in the future, hence the\nlack of docs. For now take a look at the example\nhttps://github.com/denoland/deno/tree/main/test_plugin"
500+
"The pid of the current process's parent."
501501
],
502502
"range":{
503503
"start":{
@@ -506,7 +506,7 @@ fn lsp_hover_unstable_enabled() {
506506
},
507507
"end":{
508508
"line":0,
509-
"character":27
509+
"character":21
510510
}
511511
}
512512
}))

runtime/js/40_plugins.js

Lines changed: 0 additions & 16 deletions
This file was deleted.

runtime/js/90_deno_ns.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@
109109
Signal: __bootstrap.signals.Signal,
110110
SignalStream: __bootstrap.signals.SignalStream,
111111
emit: __bootstrap.compilerApi.emit,
112-
openPlugin: __bootstrap.plugins.openPlugin,
113112
kill: __bootstrap.process.kill,
114113
setRaw: __bootstrap.tty.setRaw,
115114
consoleSize: __bootstrap.tty.consoleSize,

runtime/ops/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ pub mod fs_events;
55
pub mod io;
66
pub mod os;
77
pub mod permissions;
8-
pub mod plugin;
98
pub mod process;
109
pub mod runtime;
1110
pub mod signal;

runtime/ops/plugin.rs

Lines changed: 0 additions & 86 deletions
This file was deleted.

runtime/web_worker.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,6 @@ impl WebWorker {
333333
deno_net::init::<Permissions>(options.unstable),
334334
ops::os::init(),
335335
ops::permissions::init(),
336-
ops::plugin::init(),
337336
ops::process::init(),
338337
ops::signal::init(),
339338
ops::tty::init(),

runtime/worker.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ impl MainWorker {
124124
deno_net::init::<Permissions>(options.unstable),
125125
ops::os::init(),
126126
ops::permissions::init(),
127-
ops::plugin::init(),
128127
ops::process::init(),
129128
ops::signal::init(),
130129
ops::tty::init(),

test_plugin/Cargo.toml

Lines changed: 0 additions & 19 deletions
This file was deleted.

test_plugin/README.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

test_plugin/src/lib.rs

Lines changed: 0 additions & 114 deletions
This file was deleted.

0 commit comments

Comments
 (0)