From 943a6642243cbc8a180ab7108279dd7110ab1eaf Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Fri, 18 Aug 2023 19:58:03 -0700 Subject: Remove most C API usages, add debugger pretty printers for `Headers`, `URLSearchParams`, `FormData`, `Worker`, `EventTarget` (#4187) * Add pretty printers for `Headers`, `URLSearchParams`, and `FormData` * [untested] Add way to code generate getInternalProperties * bump * Bump Webkit * Ref the event loop while loaded * wip * checkpoint * another checkpoint * The code has been written * Fixup exports * Fix all the errors * Fix bug * [console.log] Fix bug when printing non-reified types missing values * Fix loading hash table * fix plugin * Fix ref & unref * auto-unref * various fixes * Update bun.zig * Set toStringTag * Delete code for macro JSX * Delete code for `bun dev` HTTP JS * Move Bun.serve to C++ API * Delete JSC C API code * :scissors: :skull: code * Use JSC C++ for `confirm`, `Crypto`, `prompt`, `alert` * more dead code * Update exports.zig * Use JSC C++ API for FFI * Remove remaining usages * Remove remaining usages * Update ffi.ts * Update InternalModuleRegistryConstants.h * draw the rest of the owl * Update webcore.zig * bind it * Fix performance regression in crypto.randomUIUD() * Update js_parser.zig --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> --- src/bun.js/api/server.classes.ts | 47 +++++++++++++++++++++++++++++++++++----- 1 file changed, 41 insertions(+), 6 deletions(-) (limited to 'src/bun.js/api/server.classes.ts') diff --git a/src/bun.js/api/server.classes.ts b/src/bun.js/api/server.classes.ts index 3aaea871f..7db8a3444 100644 --- a/src/bun.js/api/server.classes.ts +++ b/src/bun.js/api/server.classes.ts @@ -5,21 +5,56 @@ function generate(name) { name, proto: { fetch: { - fn: "fetch", + fn: "doFetch", length: 1, }, + upgrade: { + fn: "doUpgrade", + length: 1, + }, + publish: { + fn: "doPublish", + length: 3, + }, + reload: { + fn: "doReload", + length: 2, + }, + stop: { + fn: "doStop", + length: 1, + }, + port: { + getter: "getPort", + }, + pendingRequests: { + getter: "getPendingRequests", + }, + pendingWebSockets: { + getter: "getPendingWebSockets", + }, + hostname: { + getter: "getHostname", + cache: true, + }, + protocol: { + getter: "getProtocol", + }, + development: { + getter: "getDevelopment", + }, }, - values: ["callback"], klass: {}, finalize: true, construct: true, + noConstructor: true, }); } export default [ - // generate(`HTTPServer`), - // generate(`DebugModeHTTPServer`), - // generate(`HTTPSServer`), - // generate(`DebugModeHTTPSServer`), + generate(`HTTPServer`), + generate(`DebugHTTPServer`), + generate(`HTTPSServer`), + generate(`DebugHTTPSServer`), define({ name: "ServerWebSocket", -- cgit v1.2.3