mirror of
https://github.com/denoland/deno.git
synced 2025-09-23 02:42:34 +00:00
feat: Codegen feature flags (#28920)
This commit adds "deno_features" crate that contains definitions of all unstable features in Deno. Based on these definitions, both Rust and JS code is generated ensuring that the two are always in sync. In addition some of flag handling was rewritten to use the generated definitions, instead of hand rolling these flag definitions. --------- Co-authored-by: snek <snek@deno.com>
This commit is contained in:
parent
4924731ac3
commit
189ccffdb9
19 changed files with 701 additions and 284 deletions
|
@ -31,6 +31,7 @@ import * as kv from "ext:deno_kv/01_db.ts";
|
|||
import * as cron from "ext:deno_cron/01_cron.ts";
|
||||
import * as webgpuSurface from "ext:deno_webgpu/02_surface.js";
|
||||
import * as telemetry from "ext:deno_telemetry/telemetry.ts";
|
||||
import { unstableIds } from "ext:deno_features/flags.js";
|
||||
import { loadWebGPU } from "ext:deno_webgpu/00_init.js";
|
||||
|
||||
const { ObjectDefineProperties } = primordials;
|
||||
|
@ -150,26 +151,6 @@ const denoNs = {
|
|||
createHttpClient: httpClient.createHttpClient,
|
||||
};
|
||||
|
||||
// NOTE(bartlomieju): keep IDs in sync with `runtime/lib.rs`
|
||||
const unstableIds = {
|
||||
broadcastChannel: 1,
|
||||
cron: 2,
|
||||
ffi: 3,
|
||||
fs: 4,
|
||||
http: 5,
|
||||
kv: 6,
|
||||
net: 7,
|
||||
noLegacyAbort: 8,
|
||||
nodeGlobals: 9,
|
||||
otel: 10,
|
||||
process: 11,
|
||||
temporal: 12,
|
||||
unsafeProto: 13,
|
||||
vsock: 14,
|
||||
webgpu: 15,
|
||||
workerOptions: 16,
|
||||
};
|
||||
|
||||
const denoNsUnstableById = { __proto__: null };
|
||||
|
||||
// denoNsUnstableById[unstableIds.broadcastChannel] = { __proto__: null }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue