aboutsummaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
Diffstat (limited to 'packages')
-rw-r--r--packages/bun-debug-adapter-protocol/scripts/generate-protocol.ts2
-rw-r--r--packages/bun-debug-adapter-protocol/src/protocol/index.d.ts22
-rw-r--r--packages/bun-debug-adapter-protocol/src/protocol/protocol.json20
-rw-r--r--packages/bun-inspector-protocol/scripts/generate-protocol.ts2
-rw-r--r--packages/bun-inspector-protocol/src/protocol/v8/index.d.ts245
-rw-r--r--packages/bun-inspector-protocol/src/protocol/v8/protocol.json209
-rw-r--r--packages/bun-inspector-protocol/src/util/preview.ts5
-rw-r--r--packages/bun-types/bun-test.d.ts10
-rw-r--r--packages/bun-types/globals.d.ts2
-rw-r--r--packages/bun-types/ws.d.ts4
-rw-r--r--packages/bun-usockets/src/eventing/epoll_kqueue.c18
-rw-r--r--packages/bun-usockets/src/libusockets.h2
-rw-r--r--packages/bun-usockets/src/loop.c2
-rw-r--r--packages/bun-uws/capi/examples/Broadcast.c4
-rw-r--r--packages/bun-uws/capi/examples/HelloWorldAsync.c4
-rw-r--r--packages/bun-uws/capi/examples/UpgradeAsync.c4
-rw-r--r--packages/bun-uws/examples/UpgradeAsync.cpp2
-rw-r--r--packages/bun-uws/src/Loop.h2
18 files changed, 433 insertions, 126 deletions
diff --git a/packages/bun-debug-adapter-protocol/scripts/generate-protocol.ts b/packages/bun-debug-adapter-protocol/scripts/generate-protocol.ts
index 51b2765b5..41847c6db 100644
--- a/packages/bun-debug-adapter-protocol/scripts/generate-protocol.ts
+++ b/packages/bun-debug-adapter-protocol/scripts/generate-protocol.ts
@@ -5,7 +5,7 @@ import { spawnSync } from "node:child_process";
run().catch(console.error);
async function run() {
- const cwd = new URL("../protocol/", import.meta.url);
+ const cwd = new URL("../src/protocol/", import.meta.url);
const runner = "Bun" in globalThis ? "bunx" : "npx";
const write = (name: string, data: string) => {
const path = new URL(name, cwd);
diff --git a/packages/bun-debug-adapter-protocol/src/protocol/index.d.ts b/packages/bun-debug-adapter-protocol/src/protocol/index.d.ts
index abf9ecdec..7a8dcc312 100644
--- a/packages/bun-debug-adapter-protocol/src/protocol/index.d.ts
+++ b/packages/bun-debug-adapter-protocol/src/protocol/index.d.ts
@@ -638,7 +638,7 @@ export namespace DAP {
*/
export type BreakpointLocationsRequest = {
/**
- * The source location of the breakpoints; either `source.path` or `source.reference` must be specified.
+ * The source location of the breakpoints; either `source.path` or `source.sourceReference` must be specified.
*/
source: Source;
/**
@@ -1139,6 +1139,12 @@ export namespace DAP {
* The value should be less than or equal to 2147483647 (2^31-1).
*/
indexedVariables?: number;
+ /**
+ * A memory reference to a location appropriate for this result.
+ * For pointer type eval results, this is generally a reference to the memory address contained in the pointer.
+ * This attribute may be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true.
+ */
+ memoryReference?: string;
};
/**
* Arguments for `source` request.
@@ -1286,7 +1292,7 @@ export namespace DAP {
/**
* A memory reference to a location appropriate for this result.
* For pointer type eval results, this is generally a reference to the memory address contained in the pointer.
- * This attribute should be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true.
+ * This attribute may be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true.
*/
memoryReference?: string;
};
@@ -1344,6 +1350,12 @@ export namespace DAP {
* The value should be less than or equal to 2147483647 (2^31-1).
*/
indexedVariables?: number;
+ /**
+ * A memory reference to a location appropriate for this result.
+ * For pointer type eval results, this is generally a reference to the memory address contained in the pointer.
+ * This attribute may be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true.
+ */
+ memoryReference?: string;
};
/**
* Arguments for `stepInTargets` request.
@@ -2064,8 +2076,10 @@ export namespace DAP {
*/
indexedVariables?: number;
/**
- * The memory reference for the variable if the variable represents executable code, such as a function pointer.
- * This attribute is only required if the corresponding capability `supportsMemoryReferences` is true.
+ * A memory reference associated with this variable.
+ * For pointer type variables, this is generally a reference to the memory address contained in the pointer.
+ * For executable data, this reference may later be used in a `disassemble` request.
+ * This attribute may be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true.
*/
memoryReference?: string;
};
diff --git a/packages/bun-debug-adapter-protocol/src/protocol/protocol.json b/packages/bun-debug-adapter-protocol/src/protocol/protocol.json
index 00a2ab014..41d65608e 100644
--- a/packages/bun-debug-adapter-protocol/src/protocol/protocol.json
+++ b/packages/bun-debug-adapter-protocol/src/protocol/protocol.json
@@ -108,7 +108,7 @@
{ "$ref": "#/definitions/Request" },
{
"type": "object",
- "description": "The `cancel` request is used by the client in two situations:\n- to indicate that it is no longer interested in the result produced by a specific request issued earlier\n- to cancel a progress sequence. Clients should only call this request if the corresponding capability `supportsCancelRequest` is true.\nThis request has a hint characteristic: a debug adapter can only be expected to make a 'best effort' in honoring this request but there are no guarantees.\nThe `cancel` request may return an error if it could not cancel an operation but a client should refrain from presenting this error to end users.\nThe request that got cancelled still needs to send a response back. This can either be a normal result (`success` attribute true) or an error response (`success` attribute false and the `message` set to `cancelled`).\nReturning partial results from a cancelled request is possible but please note that a client has no generic way for detecting that a response is partial or not.\nThe progress that got cancelled still needs to send a `progressEnd` event back.\n A client should not assume that progress just got cancelled after sending the `cancel` request.",
+ "description": "The `cancel` request is used by the client in two situations:\n- to indicate that it is no longer interested in the result produced by a specific request issued earlier\n- to cancel a progress sequence.\nClients should only call this request if the corresponding capability `supportsCancelRequest` is true.\nThis request has a hint characteristic: a debug adapter can only be expected to make a 'best effort' in honoring this request but there are no guarantees.\nThe `cancel` request may return an error if it could not cancel an operation but a client should refrain from presenting this error to end users.\nThe request that got cancelled still needs to send a response back. This can either be a normal result (`success` attribute true) or an error response (`success` attribute false and the `message` set to `cancelled`).\nReturning partial results from a cancelled request is possible but please note that a client has no generic way for detecting that a response is partial or not.\nThe progress that got cancelled still needs to send a `progressEnd` event back.\n A client should not assume that progress just got cancelled after sending the `cancel` request.",
"properties": {
"command": { "type": "string", "enum": ["cancel"] },
"arguments": { "$ref": "#/definitions/CancelArguments" }
@@ -1074,7 +1074,7 @@
"properties": {
"source": {
"$ref": "#/definitions/Source",
- "description": "The source location of the breakpoints; either `source.path` or `source.reference` must be specified."
+ "description": "The source location of the breakpoints; either `source.path` or `source.sourceReference` must be specified."
},
"line": {
"type": "integer",
@@ -2035,6 +2035,10 @@
"indexedVariables": {
"type": "integer",
"description": "The number of indexed child variables.\nThe client can use this information to present the variables in a paged UI and fetch them in chunks.\nThe value should be less than or equal to 2147483647 (2^31-1)."
+ },
+ "memoryReference": {
+ "type": "string",
+ "description": "A memory reference to a location appropriate for this result.\nFor pointer type eval results, this is generally a reference to the memory address contained in the pointer.\nThis attribute may be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true."
}
},
"required": ["value"]
@@ -2326,7 +2330,7 @@
},
"memoryReference": {
"type": "string",
- "description": "A memory reference to a location appropriate for this result.\nFor pointer type eval results, this is generally a reference to the memory address contained in the pointer.\nThis attribute should be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true."
+ "description": "A memory reference to a location appropriate for this result.\nFor pointer type eval results, this is generally a reference to the memory address contained in the pointer.\nThis attribute may be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true."
}
},
"required": ["result", "variablesReference"]
@@ -2397,6 +2401,10 @@
"indexedVariables": {
"type": "integer",
"description": "The number of indexed child variables.\nThe client can use this information to present the variables in a paged UI and fetch them in chunks.\nThe value should be less than or equal to 2147483647 (2^31-1)."
+ },
+ "memoryReference": {
+ "type": "string",
+ "description": "A memory reference to a location appropriate for this result.\nFor pointer type eval results, this is generally a reference to the memory address contained in the pointer.\nThis attribute may be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true."
}
},
"required": ["value"]
@@ -3240,7 +3248,7 @@
},
"memoryReference": {
"type": "string",
- "description": "The memory reference for the variable if the variable represents executable code, such as a function pointer.\nThis attribute is only required if the corresponding capability `supportsMemoryReferences` is true."
+ "description": "A memory reference associated with this variable.\nFor pointer type variables, this is generally a reference to the memory address contained in the pointer.\nFor executable data, this reference may later be used in a `disassemble` request.\nThis attribute may be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true."
}
},
"required": ["name", "value", "variablesReference"]
@@ -3299,8 +3307,8 @@
"Indicates that the object is a constant.",
"Indicates that the object is read only.",
"Indicates that the object is a raw string.",
- "Indicates that the object can have an Object ID created for it.",
- "Indicates that the object has an Object ID associated with it.",
+ "Indicates that the object can have an Object ID created for it. This is a vestigial attribute that is used by some clients; 'Object ID's are not specified in the protocol.",
+ "Indicates that the object has an Object ID associated with it. This is a vestigial attribute that is used by some clients; 'Object ID's are not specified in the protocol.",
"Indicates that the evaluation had side effects.",
"Indicates that the object has its value tracked by a data breakpoint."
]
diff --git a/packages/bun-inspector-protocol/scripts/generate-protocol.ts b/packages/bun-inspector-protocol/scripts/generate-protocol.ts
index c53153bb4..7a0826009 100644
--- a/packages/bun-inspector-protocol/scripts/generate-protocol.ts
+++ b/packages/bun-inspector-protocol/scripts/generate-protocol.ts
@@ -5,7 +5,7 @@ import { spawnSync } from "node:child_process";
run().catch(console.error);
async function run() {
- const cwd = new URL("../protocol/", import.meta.url);
+ const cwd = new URL("../src/protocol/", import.meta.url);
const runner = "Bun" in globalThis ? "bunx" : "npx";
const write = (name: string, data: string) => {
const path = new URL(name, cwd);
diff --git a/packages/bun-inspector-protocol/src/protocol/v8/index.d.ts b/packages/bun-inspector-protocol/src/protocol/v8/index.d.ts
index f0e82acb4..579adf70c 100644
--- a/packages/bun-inspector-protocol/src/protocol/v8/index.d.ts
+++ b/packages/bun-inspector-protocol/src/protocol/v8/index.d.ts
@@ -1136,7 +1136,8 @@ export namespace V8 {
| "Canceled"
| "RpPageNotVisible"
| "SilentMediationFailure"
- | "ThirdPartyCookiesBlocked";
+ | "ThirdPartyCookiesBlocked"
+ | "NotSignedInWithIdp";
export type FederatedAuthUserInfoRequestIssueDetails = {
federatedAuthUserInfoRequestIssueReason: FederatedAuthUserInfoRequestIssueReason;
};
@@ -1192,6 +1193,25 @@ export namespace V8 {
*/
failedRequestInfo?: FailedRequestInfo | undefined;
};
+ export type PropertyRuleIssueReason = "InvalidSyntax" | "InvalidInitialValue" | "InvalidInherits" | "InvalidName";
+ /**
+ * This issue warns about errors in property rules that lead to property
+ * registrations being ignored.
+ */
+ export type PropertyRuleIssueDetails = {
+ /**
+ * Source code position of the property rule.
+ */
+ sourceCodeLocation: SourceCodeLocation;
+ /**
+ * Reason why the property rule was discarded.
+ */
+ propertyRuleIssueReason: PropertyRuleIssueReason;
+ /**
+ * The value of the property rule property that failed to parse
+ */
+ propertyValue?: string | undefined;
+ };
/**
* A unique identifier for the type of issue. Each type may use one of the
* optional fields in InspectorIssueDetails to convey more specific
@@ -1215,7 +1235,8 @@ export namespace V8 {
| "FederatedAuthRequestIssue"
| "BounceTrackingIssue"
| "StylesheetLoadingIssue"
- | "FederatedAuthUserInfoRequestIssue";
+ | "FederatedAuthUserInfoRequestIssue"
+ | "PropertyRuleIssue";
/**
* This struct holds a list of optional fields with additional information
* specific to the kind of issue. When adding a new issue code, please also
@@ -1239,6 +1260,7 @@ export namespace V8 {
federatedAuthRequestIssueDetails?: FederatedAuthRequestIssueDetails | undefined;
bounceTrackingIssueDetails?: BounceTrackingIssueDetails | undefined;
stylesheetLoadingIssueDetails?: StylesheetLoadingIssueDetails | undefined;
+ propertyRuleIssueDetails?: PropertyRuleIssueDetails | undefined;
federatedAuthUserInfoRequestIssueDetails?: FederatedAuthUserInfoRequestIssueDetails | undefined;
};
/**
@@ -1390,17 +1412,83 @@ export namespace V8 {
*/
name: string;
/**
- * address field name, for example Jon Doe.
+ * address field value, for example Jon Doe.
*/
value: string;
};
+ /**
+ * A list of address fields.
+ */
+ export type AddressFields = {
+ fields: AddressField[];
+ };
export type Address = {
/**
- * fields and values defining a test address.
+ * fields and values defining an address.
*/
fields: AddressField[];
};
/**
+ * Defines how an address can be displayed like in chrome://settings/addresses.
+ * Address UI is a two dimensional array, each inner array is an "address information line", and when rendered in a UI surface should be displayed as such.
+ * The following address UI for instance:
+ * [[{name: "GIVE_NAME", value: "Jon"}, {name: "FAMILY_NAME", value: "Doe"}], [{name: "CITY", value: "Munich"}, {name: "ZIP", value: "81456"}]]
+ * should allow the receiver to render:
+ * Jon Doe
+ * Munich 81456
+ */
+ export type AddressUI = {
+ /**
+ * A two dimension array containing the repesentation of values from an address profile.
+ */
+ addressFields: AddressFields[];
+ };
+ /**
+ * Specified whether a filled field was done so by using the html autocomplete attribute or autofill heuristics.
+ */
+ export type FillingStrategy = "autocompleteAttribute" | "autofillInferred";
+ export type FilledField = {
+ /**
+ * The type of the field, e.g text, password etc.
+ */
+ htmlType: string;
+ /**
+ * the html id
+ */
+ id: string;
+ /**
+ * the html name
+ */
+ name: string;
+ /**
+ * the field value
+ */
+ value: string;
+ /**
+ * The actual field type, e.g FAMILY_NAME
+ */
+ autofillType: string;
+ /**
+ * The filling strategy
+ */
+ fillingStrategy: FillingStrategy;
+ };
+ /**
+ * Emitted when an address form is filled.
+ * @event `Autofill.addressFormFilled`
+ */
+ export type AddressFormFilledEvent = {
+ /**
+ * Information about the fields that were filled
+ */
+ filledFields: FilledField[];
+ /**
+ * An UI representation of the address used to fill the form.
+ * Consists of a 2D array where each child represents an address/profile line.
+ */
+ addressUi: AddressUI;
+ };
+ /**
* Trigger autofill on a form identified by the fieldId.
* If the field and related form cannot be autofilled, returns an error.
* @request `Autofill.trigger`
@@ -1437,6 +1525,26 @@ export namespace V8 {
* @response `Autofill.setAddresses`
*/
export type SetAddressesResponse = {};
+ /**
+ * Disables autofill domain notifications.
+ * @request `Autofill.disable`
+ */
+ export type DisableRequest = {};
+ /**
+ * Disables autofill domain notifications.
+ * @response `Autofill.disable`
+ */
+ export type DisableResponse = {};
+ /**
+ * Enables autofill domain notifications.
+ * @request `Autofill.enable`
+ */
+ export type EnableRequest = {};
+ /**
+ * Enables autofill domain notifications.
+ * @response `Autofill.enable`
+ */
+ export type EnableResponse = {};
}
export namespace BackgroundService {
/**
@@ -3574,6 +3682,25 @@ export namespace V8 {
*/
export type SetEffectivePropertyValueForNodeResponse = {};
/**
+ * Modifies the property rule property name.
+ * @request `CSS.setPropertyRulePropertyName`
+ */
+ export type SetPropertyRulePropertyNameRequest = {
+ styleSheetId: StyleSheetId;
+ range: SourceRange;
+ propertyName: string;
+ };
+ /**
+ * Modifies the property rule property name.
+ * @response `CSS.setPropertyRulePropertyName`
+ */
+ export type SetPropertyRulePropertyNameResponse = {
+ /**
+ * The resulting key text after modification.
+ */
+ propertyName: Value;
+ };
+ /**
* Modifies the keyframe rule key text.
* @request `CSS.setKeyframeKey`
*/
@@ -7168,6 +7295,16 @@ export namespace V8 {
* @response `EventBreakpoints.removeInstrumentationBreakpoint`
*/
export type RemoveInstrumentationBreakpointResponse = {};
+ /**
+ * Removes all breakpoints
+ * @request `EventBreakpoints.disable`
+ */
+ export type DisableRequest = {};
+ /**
+ * Removes all breakpoints
+ * @response `EventBreakpoints.disable`
+ */
+ export type DisableResponse = {};
}
export namespace FedCm {
/**
@@ -7178,7 +7315,7 @@ export namespace V8 {
/**
* Whether the dialog shown is an account chooser or an auto re-authentication dialog.
*/
- export type DialogType = "AccountChooser" | "AutoReauthn" | "ConfirmIdpSignin";
+ export type DialogType = "AccountChooser" | "AutoReauthn" | "ConfirmIdpLogin";
/**
* Corresponds to IdentityRequestAccount
*/
@@ -7189,7 +7326,7 @@ export namespace V8 {
givenName: string;
pictureUrl: string;
idpConfigUrl: string;
- idpSigninUrl: string;
+ idpLoginUrl: string;
loginState: LoginState;
/**
* These two are only set if the loginState is signUp
@@ -7253,6 +7390,20 @@ export namespace V8 {
*/
export type SelectAccountResponse = {};
/**
+ * Only valid if the dialog type is ConfirmIdpLogin. Acts as if the user had
+ * clicked the continue button.
+ * @request `FedCm.confirmIdpLogin`
+ */
+ export type ConfirmIdpLoginRequest = {
+ dialogId: string;
+ };
+ /**
+ * Only valid if the dialog type is ConfirmIdpLogin. Acts as if the user had
+ * clicked the continue button.
+ * @response `FedCm.confirmIdpLogin`
+ */
+ export type ConfirmIdpLoginResponse = {};
+ /**
* undefined
* @request `FedCm.dismissDialog`
*/
@@ -10477,6 +10628,7 @@ export namespace V8 {
| "ch-ect"
| "ch-prefers-color-scheme"
| "ch-prefers-reduced-motion"
+ | "ch-prefers-reduced-transparency"
| "ch-rtt"
| "ch-save-data"
| "ch-ua"
@@ -13109,7 +13261,6 @@ export namespace V8 {
| "LowEndDevice"
| "InvalidSchemeRedirect"
| "InvalidSchemeNavigation"
- | "InProgressNavigation"
| "NavigationRequestBlockedByCsp"
| "MainFrameNavigation"
| "MojoBinderPolicy"
@@ -13121,7 +13272,6 @@ export namespace V8 {
| "NavigationBadHttpStatus"
| "ClientCertRequested"
| "NavigationRequestNetworkError"
- | "MaxNumOfRunningPrerendersExceeded"
| "CancelAllHostsForTesting"
| "DidFailLoad"
| "Stop"
@@ -13133,9 +13283,8 @@ export namespace V8 {
| "MixedContent"
| "TriggerBackgrounded"
| "MemoryLimitExceeded"
- | "FailToGetMemoryUsage"
| "DataSaverEnabled"
- | "HasEffectiveUrl"
+ | "TriggerUrlHasEffectiveUrl"
| "ActivatedBeforeStarted"
| "InactivePageRestriction"
| "StartFailed"
@@ -13166,7 +13315,13 @@ export namespace V8 {
| "PrerenderingDisabledByDevTools"
| "ResourceLoadBlockedByClient"
| "SpeculationRuleRemoved"
- | "ActivatedWithAuxiliaryBrowsingContexts";
+ | "ActivatedWithAuxiliaryBrowsingContexts"
+ | "MaxNumOfRunningEagerPrerendersExceeded"
+ | "MaxNumOfRunningNonEagerPrerendersExceeded"
+ | "MaxNumOfRunningEmbedderPrerendersExceeded"
+ | "PrerenderingUrlHasEffectiveUrl"
+ | "RedirectedPrerenderingUrlHasEffectiveUrl"
+ | "ActivationUrlHasEffectiveUrl";
/**
* Preloading status values, see also PreloadingTriggeringOutcome. This
* status is shared by prefetchStatusUpdated and prerenderStatusUpdated.
@@ -13222,24 +13377,6 @@ export namespace V8 {
id: RuleSetId;
};
/**
- * Fired when a prerender attempt is completed.
- * @event `Preload.prerenderAttemptCompleted`
- */
- export type PrerenderAttemptCompletedEvent = {
- key: PreloadingAttemptKey;
- /**
- * The frame id of the frame initiating prerendering.
- */
- initiatingFrameId: Page.FrameId;
- prerenderingUrl: string;
- finalStatus: PrerenderFinalStatus;
- /**
- * This is used to give users more information about the name of the API call
- * that is incompatible with prerender and has caused the cancellation of the attempt
- */
- disallowedApiMethod?: string | undefined;
- };
- /**
* Fired when a preload enabled state is updated.
* @event `Preload.preloadEnabledStateUpdated`
*/
@@ -13935,12 +14072,21 @@ export namespace V8 {
/**
* Enum of interest group access types.
*/
- export type InterestGroupAccessType = "join" | "leave" | "update" | "loaded" | "bid" | "win";
+ export type InterestGroupAccessType =
+ | "join"
+ | "leave"
+ | "update"
+ | "loaded"
+ | "bid"
+ | "win"
+ | "additionalBid"
+ | "additionalBidWin"
+ | "clear";
/**
* Ad advertising element inside an interest group.
*/
export type InterestGroupAd = {
- renderUrl: string;
+ renderURL: string;
metadata?: string | undefined;
};
/**
@@ -13951,10 +14097,10 @@ export namespace V8 {
name: string;
expirationTime: Network.TimeSinceEpoch;
joiningOrigin: string;
- biddingUrl?: string | undefined;
- biddingWasmHelperUrl?: string | undefined;
- updateUrl?: string | undefined;
- trustedBiddingSignalsUrl?: string | undefined;
+ biddingLogicURL?: string | undefined;
+ biddingWasmHelperURL?: string | undefined;
+ updateURL?: string | undefined;
+ trustedBiddingSignalsURL?: string | undefined;
trustedBiddingSignalsKeys: string[];
userBiddingSignals?: string | undefined;
ads: InterestGroupAd[];
@@ -14099,20 +14245,27 @@ export namespace V8 {
key: string;
value: UnsignedInt128AsBase16;
};
- export type AttributionReportingSourceRegistration = {
- time: Network.TimeSinceEpoch;
+ export type AttributionReportingEventReportWindows = {
/**
* duration in seconds
*/
- expiry?: number | undefined;
+ start: number;
+ /**
+ * duration in seconds
+ */
+ ends: number[];
+ };
+ export type AttributionReportingSourceRegistration = {
+ time: Network.TimeSinceEpoch;
/**
* duration in seconds
*/
- eventReportWindow?: number | undefined;
+ expiry: number;
+ eventReportWindows: AttributionReportingEventReportWindows;
/**
* duration in seconds
*/
- aggregatableReportWindow?: number | undefined;
+ aggregatableReportWindow: number;
type: AttributionReportingSourceType;
sourceOrigin: string;
reportingOrigin: string;
@@ -16381,6 +16534,7 @@ export namespace V8 {
"Animation.animationCreated": Animation.AnimationCreatedEvent;
"Animation.animationStarted": Animation.AnimationStartedEvent;
"Audits.issueAdded": Audits.IssueAddedEvent;
+ "Autofill.addressFormFilled": Autofill.AddressFormFilledEvent;
"BackgroundService.recordingStateChanged": BackgroundService.RecordingStateChangedEvent;
"BackgroundService.backgroundServiceEventReceived": BackgroundService.BackgroundServiceEventReceivedEvent;
"Browser.downloadWillBegin": Browser.DownloadWillBeginEvent;
@@ -16460,7 +16614,6 @@ export namespace V8 {
"PerformanceTimeline.timelineEventAdded": PerformanceTimeline.TimelineEventAddedEvent;
"Preload.ruleSetUpdated": Preload.RuleSetUpdatedEvent;
"Preload.ruleSetRemoved": Preload.RuleSetRemovedEvent;
- "Preload.prerenderAttemptCompleted": Preload.PrerenderAttemptCompletedEvent;
"Preload.preloadEnabledStateUpdated": Preload.PreloadEnabledStateUpdatedEvent;
"Preload.prefetchStatusUpdated": Preload.PrefetchStatusUpdatedEvent;
"Preload.prerenderStatusUpdated": Preload.PrerenderStatusUpdatedEvent;
@@ -16533,6 +16686,8 @@ export namespace V8 {
"Audits.checkFormsIssues": Audits.CheckFormsIssuesRequest;
"Autofill.trigger": Autofill.TriggerRequest;
"Autofill.setAddresses": Autofill.SetAddressesRequest;
+ "Autofill.disable": Autofill.DisableRequest;
+ "Autofill.enable": Autofill.EnableRequest;
"BackgroundService.startObserving": BackgroundService.StartObservingRequest;
"BackgroundService.stopObserving": BackgroundService.StopObservingRequest;
"BackgroundService.setRecording": BackgroundService.SetRecordingRequest;
@@ -16583,6 +16738,7 @@ export namespace V8 {
"CSS.trackComputedStyleUpdates": CSS.TrackComputedStyleUpdatesRequest;
"CSS.takeComputedStyleUpdates": CSS.TakeComputedStyleUpdatesRequest;
"CSS.setEffectivePropertyValueForNode": CSS.SetEffectivePropertyValueForNodeRequest;
+ "CSS.setPropertyRulePropertyName": CSS.SetPropertyRulePropertyNameRequest;
"CSS.setKeyframeKey": CSS.SetKeyframeKeyRequest;
"CSS.setMediaText": CSS.SetMediaTextRequest;
"CSS.setContainerQueryText": CSS.SetContainerQueryTextRequest;
@@ -16705,9 +16861,11 @@ export namespace V8 {
"Emulation.setAutomationOverride": Emulation.SetAutomationOverrideRequest;
"EventBreakpoints.setInstrumentationBreakpoint": EventBreakpoints.SetInstrumentationBreakpointRequest;
"EventBreakpoints.removeInstrumentationBreakpoint": EventBreakpoints.RemoveInstrumentationBreakpointRequest;
+ "EventBreakpoints.disable": EventBreakpoints.DisableRequest;
"FedCm.enable": FedCm.EnableRequest;
"FedCm.disable": FedCm.DisableRequest;
"FedCm.selectAccount": FedCm.SelectAccountRequest;
+ "FedCm.confirmIdpLogin": FedCm.ConfirmIdpLoginRequest;
"FedCm.dismissDialog": FedCm.DismissDialogRequest;
"FedCm.resetCooldown": FedCm.ResetCooldownRequest;
"Fetch.disable": Fetch.DisableRequest;
@@ -16979,6 +17137,8 @@ export namespace V8 {
"Audits.checkFormsIssues": Audits.CheckFormsIssuesResponse;
"Autofill.trigger": Autofill.TriggerResponse;
"Autofill.setAddresses": Autofill.SetAddressesResponse;
+ "Autofill.disable": Autofill.DisableResponse;
+ "Autofill.enable": Autofill.EnableResponse;
"BackgroundService.startObserving": BackgroundService.StartObservingResponse;
"BackgroundService.stopObserving": BackgroundService.StopObservingResponse;
"BackgroundService.setRecording": BackgroundService.SetRecordingResponse;
@@ -17029,6 +17189,7 @@ export namespace V8 {
"CSS.trackComputedStyleUpdates": CSS.TrackComputedStyleUpdatesResponse;
"CSS.takeComputedStyleUpdates": CSS.TakeComputedStyleUpdatesResponse;
"CSS.setEffectivePropertyValueForNode": CSS.SetEffectivePropertyValueForNodeResponse;
+ "CSS.setPropertyRulePropertyName": CSS.SetPropertyRulePropertyNameResponse;
"CSS.setKeyframeKey": CSS.SetKeyframeKeyResponse;
"CSS.setMediaText": CSS.SetMediaTextResponse;
"CSS.setContainerQueryText": CSS.SetContainerQueryTextResponse;
@@ -17151,9 +17312,11 @@ export namespace V8 {
"Emulation.setAutomationOverride": Emulation.SetAutomationOverrideResponse;
"EventBreakpoints.setInstrumentationBreakpoint": EventBreakpoints.SetInstrumentationBreakpointResponse;
"EventBreakpoints.removeInstrumentationBreakpoint": EventBreakpoints.RemoveInstrumentationBreakpointResponse;
+ "EventBreakpoints.disable": EventBreakpoints.DisableResponse;
"FedCm.enable": FedCm.EnableResponse;
"FedCm.disable": FedCm.DisableResponse;
"FedCm.selectAccount": FedCm.SelectAccountResponse;
+ "FedCm.confirmIdpLogin": FedCm.ConfirmIdpLoginResponse;
"FedCm.dismissDialog": FedCm.DismissDialogResponse;
"FedCm.resetCooldown": FedCm.ResetCooldownResponse;
"Fetch.disable": Fetch.DisableResponse;
diff --git a/packages/bun-inspector-protocol/src/protocol/v8/protocol.json b/packages/bun-inspector-protocol/src/protocol/v8/protocol.json
index 979091bf0..cee8c2ca4 100644
--- a/packages/bun-inspector-protocol/src/protocol/v8/protocol.json
+++ b/packages/bun-inspector-protocol/src/protocol/v8/protocol.json
@@ -1091,7 +1091,8 @@
"Canceled",
"RpPageNotVisible",
"SilentMediationFailure",
- "ThirdPartyCookiesBlocked"
+ "ThirdPartyCookiesBlocked",
+ "NotSignedInWithIdp"
]
},
{
@@ -1164,6 +1165,34 @@
]
},
{
+ "id": "PropertyRuleIssueReason",
+ "type": "string",
+ "enum": ["InvalidSyntax", "InvalidInitialValue", "InvalidInherits", "InvalidName"]
+ },
+ {
+ "id": "PropertyRuleIssueDetails",
+ "description": "This issue warns about errors in property rules that lead to property\nregistrations being ignored.",
+ "type": "object",
+ "properties": [
+ {
+ "name": "sourceCodeLocation",
+ "description": "Source code position of the property rule.",
+ "$ref": "SourceCodeLocation"
+ },
+ {
+ "name": "propertyRuleIssueReason",
+ "description": "Reason why the property rule was discarded.",
+ "$ref": "PropertyRuleIssueReason"
+ },
+ {
+ "name": "propertyValue",
+ "description": "The value of the property rule property that failed to parse",
+ "optional": true,
+ "type": "string"
+ }
+ ]
+ },
+ {
"id": "InspectorIssueCode",
"description": "A unique identifier for the type of issue. Each type may use one of the\noptional fields in InspectorIssueDetails to convey more specific\ninformation about the kind of issue.",
"type": "string",
@@ -1185,7 +1214,8 @@
"FederatedAuthRequestIssue",
"BounceTrackingIssue",
"StylesheetLoadingIssue",
- "FederatedAuthUserInfoRequestIssue"
+ "FederatedAuthUserInfoRequestIssue",
+ "PropertyRuleIssue"
]
},
{
@@ -1227,6 +1257,7 @@
},
{ "name": "bounceTrackingIssueDetails", "optional": true, "$ref": "BounceTrackingIssueDetails" },
{ "name": "stylesheetLoadingIssueDetails", "optional": true, "$ref": "StylesheetLoadingIssueDetails" },
+ { "name": "propertyRuleIssueDetails", "optional": true, "$ref": "PropertyRuleIssueDetails" },
{
"name": "federatedAuthUserInfoRequestIssueDetails",
"optional": true,
@@ -1344,20 +1375,76 @@
"type": "object",
"properties": [
{ "name": "name", "description": "address field name, for example GIVEN_NAME.", "type": "string" },
- { "name": "value", "description": "address field name, for example Jon Doe.", "type": "string" }
+ { "name": "value", "description": "address field value, for example Jon Doe.", "type": "string" }
]
},
{
+ "id": "AddressFields",
+ "description": "A list of address fields.",
+ "type": "object",
+ "properties": [{ "name": "fields", "type": "array", "items": { "$ref": "AddressField" } }]
+ },
+ {
"id": "Address",
"type": "object",
"properties": [
{
"name": "fields",
- "description": "fields and values defining a test address.",
+ "description": "fields and values defining an address.",
"type": "array",
"items": { "$ref": "AddressField" }
}
]
+ },
+ {
+ "id": "AddressUI",
+ "description": "Defines how an address can be displayed like in chrome://settings/addresses.\nAddress UI is a two dimensional array, each inner array is an \"address information line\", and when rendered in a UI surface should be displayed as such.\nThe following address UI for instance:\n[[{name: \"GIVE_NAME\", value: \"Jon\"}, {name: \"FAMILY_NAME\", value: \"Doe\"}], [{name: \"CITY\", value: \"Munich\"}, {name: \"ZIP\", value: \"81456\"}]]\nshould allow the receiver to render:\nJon Doe\nMunich 81456",
+ "type": "object",
+ "properties": [
+ {
+ "name": "addressFields",
+ "description": "A two dimension array containing the repesentation of values from an address profile.",
+ "type": "array",
+ "items": { "$ref": "AddressFields" }
+ }
+ ]
+ },
+ {
+ "id": "FillingStrategy",
+ "description": "Specified whether a filled field was done so by using the html autocomplete attribute or autofill heuristics.",
+ "type": "string",
+ "enum": ["autocompleteAttribute", "autofillInferred"]
+ },
+ {
+ "id": "FilledField",
+ "type": "object",
+ "properties": [
+ { "name": "htmlType", "description": "The type of the field, e.g text, password etc.", "type": "string" },
+ { "name": "id", "description": "the html id", "type": "string" },
+ { "name": "name", "description": "the html name", "type": "string" },
+ { "name": "value", "description": "the field value", "type": "string" },
+ { "name": "autofillType", "description": "The actual field type, e.g FAMILY_NAME", "type": "string" },
+ { "name": "fillingStrategy", "description": "The filling strategy", "$ref": "FillingStrategy" }
+ ]
+ }
+ ],
+ "events": [
+ {
+ "name": "addressFormFilled",
+ "description": "Emitted when an address form is filled.",
+ "parameters": [
+ {
+ "name": "filledFields",
+ "description": "Information about the fields that were filled",
+ "type": "array",
+ "items": { "$ref": "FilledField" }
+ },
+ {
+ "name": "addressUi",
+ "description": "An UI representation of the address used to fill the form.\nConsists of a 2D array where each child represents an address/profile line.",
+ "$ref": "AddressUI"
+ }
+ ]
}
],
"commands": [
@@ -1387,7 +1474,9 @@
"name": "setAddresses",
"description": "Set addresses so that developers can verify their forms implementation.",
"parameters": [{ "name": "addresses", "type": "array", "items": { "$ref": "Address" } }]
- }
+ },
+ { "name": "disable", "description": "Disables autofill domain notifications." },
+ { "name": "enable", "description": "Enables autofill domain notifications." }
]
},
{
@@ -3212,6 +3301,18 @@
]
},
{
+ "name": "setPropertyRulePropertyName",
+ "description": "Modifies the property rule property name.",
+ "parameters": [
+ { "name": "styleSheetId", "$ref": "StyleSheetId" },
+ { "name": "range", "$ref": "SourceRange" },
+ { "name": "propertyName", "type": "string" }
+ ],
+ "returns": [
+ { "name": "propertyName", "description": "The resulting key text after modification.", "$ref": "Value" }
+ ]
+ },
+ {
"name": "setKeyframeKey",
"description": "Modifies the keyframe rule key text.",
"parameters": [
@@ -4628,7 +4729,7 @@
{
"domain": "DOMDebugger",
"description": "DOM debugging allows setting breakpoints on particular DOM operations and events. JavaScript\nexecution will stop on these operations as if there was a regular breakpoint set.",
- "dependencies": ["DOM", "Debugger", "Runtime"],
+ "dependencies": ["DOM", "Runtime"],
"types": [
{
"id": "DOMBreakpointType",
@@ -4738,6 +4839,8 @@
"name": "removeInstrumentationBreakpoint",
"description": "Removes breakpoint on particular native event.",
"experimental": true,
+ "deprecated": true,
+ "redirect": "EventBreakpoints",
"parameters": [{ "name": "eventName", "description": "Instrumentation name to stop on.", "type": "string" }]
},
{
@@ -4788,6 +4891,8 @@
"name": "setInstrumentationBreakpoint",
"description": "Sets breakpoint on particular native event.",
"experimental": true,
+ "deprecated": true,
+ "redirect": "EventBreakpoints",
"parameters": [{ "name": "eventName", "description": "Instrumentation name to stop on.", "type": "string" }]
},
{
@@ -6069,7 +6174,7 @@
},
{
"domain": "EventBreakpoints",
- "description": "EventBreakpoints permits setting breakpoints on particular operations and\nevents in targets that run JavaScript but do not have a DOM.\nJavaScript execution will stop on these operations as if there was a regular\nbreakpoint set.",
+ "description": "EventBreakpoints permits setting JavaScript breakpoints on operations and events\noccurring in native code invoked from JavaScript. Once breakpoint is hit, it is\nreported through Debugger domain, similarly to regular breakpoints being hit.",
"experimental": true,
"commands": [
{
@@ -6081,7 +6186,8 @@
"name": "removeInstrumentationBreakpoint",
"description": "Removes breakpoint on particular native event.",
"parameters": [{ "name": "eventName", "description": "Instrumentation name to stop on.", "type": "string" }]
- }
+ },
+ { "name": "disable", "description": "Removes all breakpoints" }
]
},
{
@@ -6099,7 +6205,7 @@
"id": "DialogType",
"description": "Whether the dialog shown is an account chooser or an auto re-authentication dialog.",
"type": "string",
- "enum": ["AccountChooser", "AutoReauthn", "ConfirmIdpSignin"]
+ "enum": ["AccountChooser", "AutoReauthn", "ConfirmIdpLogin"]
},
{
"id": "Account",
@@ -6112,7 +6218,7 @@
{ "name": "givenName", "type": "string" },
{ "name": "pictureUrl", "type": "string" },
{ "name": "idpConfigUrl", "type": "string" },
- { "name": "idpSigninUrl", "type": "string" },
+ { "name": "idpLoginUrl", "type": "string" },
{ "name": "loginState", "$ref": "LoginState" },
{
"name": "termsOfServiceUrl",
@@ -6161,6 +6267,11 @@
]
},
{
+ "name": "confirmIdpLogin",
+ "description": "Only valid if the dialog type is ConfirmIdpLogin. Acts as if the user had\nclicked the continue button.",
+ "parameters": [{ "name": "dialogId", "type": "string" }]
+ },
+ {
"name": "dismissDialog",
"parameters": [
{ "name": "dialogId", "type": "string" },
@@ -6987,16 +7098,14 @@
{
"name": "tiltX",
"description": "The plane angle between the Y-Z plane and the plane containing both the stylus axis and the Y axis, in degrees of the range [-90,90], a positive tiltX is to the right (default: 0)",
- "experimental": true,
"optional": true,
- "type": "integer"
+ "type": "number"
},
{
"name": "tiltY",
"description": "The plane angle between the X-Z plane and the plane containing both the stylus axis and the X axis, in degrees of the range [-90,90], a positive tiltY is towards the user (default: 0).",
- "experimental": true,
"optional": true,
- "type": "integer"
+ "type": "number"
},
{
"name": "twist",
@@ -7280,16 +7389,14 @@
{
"name": "tiltX",
"description": "The plane angle between the Y-Z plane and the plane containing both the stylus axis and the Y axis, in degrees of the range [-90,90], a positive tiltX is to the right (default: 0).",
- "experimental": true,
"optional": true,
- "type": "integer"
+ "type": "number"
},
{
"name": "tiltY",
"description": "The plane angle between the X-Z plane and the plane containing both the stylus axis and the X axis, in degrees of the range [-90,90], a positive tiltY is towards the user (default: 0).",
- "experimental": true,
"optional": true,
- "type": "integer"
+ "type": "number"
},
{
"name": "twist",
@@ -9158,6 +9265,7 @@
"ch-ect",
"ch-prefers-color-scheme",
"ch-prefers-reduced-motion",
+ "ch-prefers-reduced-transparency",
"ch-rtt",
"ch-save-data",
"ch-ua",
@@ -11403,7 +11511,6 @@
"LowEndDevice",
"InvalidSchemeRedirect",
"InvalidSchemeNavigation",
- "InProgressNavigation",
"NavigationRequestBlockedByCsp",
"MainFrameNavigation",
"MojoBinderPolicy",
@@ -11415,7 +11522,6 @@
"NavigationBadHttpStatus",
"ClientCertRequested",
"NavigationRequestNetworkError",
- "MaxNumOfRunningPrerendersExceeded",
"CancelAllHostsForTesting",
"DidFailLoad",
"Stop",
@@ -11427,9 +11533,8 @@
"MixedContent",
"TriggerBackgrounded",
"MemoryLimitExceeded",
- "FailToGetMemoryUsage",
"DataSaverEnabled",
- "HasEffectiveUrl",
+ "TriggerUrlHasEffectiveUrl",
"ActivatedBeforeStarted",
"InactivePageRestriction",
"StartFailed",
@@ -11460,7 +11565,13 @@
"PrerenderingDisabledByDevTools",
"ResourceLoadBlockedByClient",
"SpeculationRuleRemoved",
- "ActivatedWithAuxiliaryBrowsingContexts"
+ "ActivatedWithAuxiliaryBrowsingContexts",
+ "MaxNumOfRunningEagerPrerendersExceeded",
+ "MaxNumOfRunningNonEagerPrerendersExceeded",
+ "MaxNumOfRunningEmbedderPrerendersExceeded",
+ "PrerenderingUrlHasEffectiveUrl",
+ "RedirectedPrerenderingUrlHasEffectiveUrl",
+ "ActivationUrlHasEffectiveUrl"
]
},
{
@@ -11516,26 +11627,6 @@
},
{ "name": "ruleSetRemoved", "parameters": [{ "name": "id", "$ref": "RuleSetId" }] },
{
- "name": "prerenderAttemptCompleted",
- "description": "Fired when a prerender attempt is completed.",
- "parameters": [
- { "name": "key", "$ref": "PreloadingAttemptKey" },
- {
- "name": "initiatingFrameId",
- "description": "The frame id of the frame initiating prerendering.",
- "$ref": "Page.FrameId"
- },
- { "name": "prerenderingUrl", "type": "string" },
- { "name": "finalStatus", "$ref": "PrerenderFinalStatus" },
- {
- "name": "disallowedApiMethod",
- "description": "This is used to give users more information about the name of the API call\nthat is incompatible with prerender and has caused the cancellation of the attempt",
- "optional": true,
- "type": "string"
- }
- ]
- },
- {
"name": "preloadEnabledStateUpdated",
"description": "Fired when a preload enabled state is updated.",
"parameters": [
@@ -12077,14 +12168,14 @@
"id": "InterestGroupAccessType",
"description": "Enum of interest group access types.",
"type": "string",
- "enum": ["join", "leave", "update", "loaded", "bid", "win"]
+ "enum": ["join", "leave", "update", "loaded", "bid", "win", "additionalBid", "additionalBidWin", "clear"]
},
{
"id": "InterestGroupAd",
"description": "Ad advertising element inside an interest group.",
"type": "object",
"properties": [
- { "name": "renderUrl", "type": "string" },
+ { "name": "renderURL", "type": "string" },
{ "name": "metadata", "optional": true, "type": "string" }
]
},
@@ -12097,10 +12188,10 @@
{ "name": "name", "type": "string" },
{ "name": "expirationTime", "$ref": "Network.TimeSinceEpoch" },
{ "name": "joiningOrigin", "type": "string" },
- { "name": "biddingUrl", "optional": true, "type": "string" },
- { "name": "biddingWasmHelperUrl", "optional": true, "type": "string" },
- { "name": "updateUrl", "optional": true, "type": "string" },
- { "name": "trustedBiddingSignalsUrl", "optional": true, "type": "string" },
+ { "name": "biddingLogicURL", "optional": true, "type": "string" },
+ { "name": "biddingWasmHelperURL", "optional": true, "type": "string" },
+ { "name": "updateURL", "optional": true, "type": "string" },
+ { "name": "trustedBiddingSignalsURL", "optional": true, "type": "string" },
{ "name": "trustedBiddingSignalsKeys", "type": "array", "items": { "type": "string" } },
{ "name": "userBiddingSignals", "optional": true, "type": "string" },
{ "name": "ads", "type": "array", "items": { "$ref": "InterestGroupAd" } },
@@ -12276,19 +12367,23 @@
]
},
{
+ "id": "AttributionReportingEventReportWindows",
+ "experimental": true,
+ "type": "object",
+ "properties": [
+ { "name": "start", "description": "duration in seconds", "type": "integer" },
+ { "name": "ends", "description": "duration in seconds", "type": "array", "items": { "type": "integer" } }
+ ]
+ },
+ {
"id": "AttributionReportingSourceRegistration",
"experimental": true,
"type": "object",
"properties": [
{ "name": "time", "$ref": "Network.TimeSinceEpoch" },
- { "name": "expiry", "description": "duration in seconds", "optional": true, "type": "integer" },
- { "name": "eventReportWindow", "description": "duration in seconds", "optional": true, "type": "integer" },
- {
- "name": "aggregatableReportWindow",
- "description": "duration in seconds",
- "optional": true,
- "type": "integer"
- },
+ { "name": "expiry", "description": "duration in seconds", "type": "integer" },
+ { "name": "eventReportWindows", "$ref": "AttributionReportingEventReportWindows" },
+ { "name": "aggregatableReportWindow", "description": "duration in seconds", "type": "integer" },
{ "name": "type", "$ref": "AttributionReportingSourceType" },
{ "name": "sourceOrigin", "type": "string" },
{ "name": "reportingOrigin", "type": "string" },
diff --git a/packages/bun-inspector-protocol/src/util/preview.ts b/packages/bun-inspector-protocol/src/util/preview.ts
index c6d748304..78b1484ed 100644
--- a/packages/bun-inspector-protocol/src/util/preview.ts
+++ b/packages/bun-inspector-protocol/src/util/preview.ts
@@ -46,7 +46,10 @@ export function objectPreviewToString(objectPreview: JSC.Runtime.ObjectPreview):
items = entries.map(entryPreviewToString).sort();
} else if (properties) {
if (isIndexed(subtype)) {
- items = properties.map(indexedPropertyPreviewToString).sort();
+ items = properties.map(indexedPropertyPreviewToString);
+ if (subtype !== "array") {
+ items.sort();
+ }
} else {
items = properties.map(namedPropertyPreviewToString).sort();
}
diff --git a/packages/bun-types/bun-test.d.ts b/packages/bun-types/bun-test.d.ts
index a78c74b85..47380f63c 100644
--- a/packages/bun-types/bun-test.d.ts
+++ b/packages/bun-types/bun-test.d.ts
@@ -983,6 +983,16 @@ declare module "bun:test" {
*/
toBeWithin(start: number, end: number): void;
/**
+ * Asserts that a value is equal to the expected string, ignoring any whitespace.
+ *
+ * @example
+ * expect(" foo ").toEqualIgnoringWhitespace("foo");
+ * expect("bar").toEqualIgnoringWhitespace(" bar ");
+ *
+ * @param expected the expected string
+ */
+ toEqualIgnoringWhitespace(expected: string): void;
+ /**
* Asserts that a value is a `symbol`.
*
* @example
diff --git a/packages/bun-types/globals.d.ts b/packages/bun-types/globals.d.ts
index ea73b506d..207f4608a 100644
--- a/packages/bun-types/globals.d.ts
+++ b/packages/bun-types/globals.d.ts
@@ -733,6 +733,8 @@ interface Process {
* On other operating systems, this returns `undefined`.
*/
constrainedMemory(): number | undefined;
+
+ send(data: any): void;
}
interface MemoryUsageObject {
diff --git a/packages/bun-types/ws.d.ts b/packages/bun-types/ws.d.ts
index a14f87edd..fc489006f 100644
--- a/packages/bun-types/ws.d.ts
+++ b/packages/bun-types/ws.d.ts
@@ -74,6 +74,8 @@ declare module "ws" {
WebSocket?: U | undefined;
}
+ interface ServerOption extends WebSocketServerOptions {}
+
interface AddressInfo {
address: string;
family: string;
@@ -219,4 +221,6 @@ declare module "ws" {
listener: (...args: any[]) => void,
): this;
}
+
+ var Server: typeof WebSocketServer;
}
diff --git a/packages/bun-usockets/src/eventing/epoll_kqueue.c b/packages/bun-usockets/src/eventing/epoll_kqueue.c
index 44212d3be..d051f5b5a 100644
--- a/packages/bun-usockets/src/eventing/epoll_kqueue.c
+++ b/packages/bun-usockets/src/eventing/epoll_kqueue.c
@@ -414,14 +414,18 @@ struct us_timer_t *us_create_timer(struct us_loop_t *loop, int fallthrough, unsi
#endif
#ifdef LIBUS_USE_EPOLL
-void us_timer_close(struct us_timer_t *timer) {
+void us_timer_close(struct us_timer_t *timer, int fallthrough) {
struct us_internal_callback_t *cb = (struct us_internal_callback_t *) timer;
us_poll_stop(&cb->p, cb->loop);
close(us_poll_fd(&cb->p));
- /* (regular) sockets are the only polls which are not freed immediately */
- us_poll_free((struct us_poll_t *) timer, cb->loop);
+ /* (regular) sockets are the only polls which are not freed immediately */
+ if(fallthrough){
+ us_free(timer);
+ }else {
+ us_poll_free((struct us_poll_t *) timer, cb->loop);
+ }
}
void us_timer_set(struct us_timer_t *t, void (*cb)(struct us_timer_t *t), int ms, int repeat_ms) {
@@ -438,7 +442,7 @@ void us_timer_set(struct us_timer_t *t, void (*cb)(struct us_timer_t *t), int ms
us_poll_start((struct us_poll_t *) t, internal_cb->loop, LIBUS_SOCKET_READABLE);
}
#else
-void us_timer_close(struct us_timer_t *timer) {
+void us_timer_close(struct us_timer_t *timer, int fallthrough) {
struct us_internal_callback_t *internal_cb = (struct us_internal_callback_t *) timer;
struct kevent64_s event;
@@ -446,7 +450,11 @@ void us_timer_close(struct us_timer_t *timer) {
kevent64(internal_cb->loop->fd, &event, 1, NULL, 0, 0, NULL);
/* (regular) sockets are the only polls which are not freed immediately */
- us_poll_free((struct us_poll_t *) timer, internal_cb->loop);
+ if(fallthrough){
+ us_free(timer);
+ }else {
+ us_poll_free((struct us_poll_t *) timer, internal_cb->loop);
+ }
}
void us_timer_set(struct us_timer_t *t, void (*cb)(struct us_timer_t *t), int ms, int repeat_ms) {
diff --git a/packages/bun-usockets/src/libusockets.h b/packages/bun-usockets/src/libusockets.h
index c0e3fad90..ea17a3622 100644
--- a/packages/bun-usockets/src/libusockets.h
+++ b/packages/bun-usockets/src/libusockets.h
@@ -132,7 +132,7 @@ struct us_timer_t *us_create_timer(struct us_loop_t *loop, int fallthrough, unsi
void *us_timer_ext(struct us_timer_t *timer);
/* */
-void us_timer_close(struct us_timer_t *timer);
+void us_timer_close(struct us_timer_t *timer, int fallthrough);
/* Arm a timer with a delay from now and eventually a repeat delay.
* Specify 0 as repeat delay to disable repeating. Specify both 0 to disarm. */
diff --git a/packages/bun-usockets/src/loop.c b/packages/bun-usockets/src/loop.c
index 9ad1e64bf..e230fa29b 100644
--- a/packages/bun-usockets/src/loop.c
+++ b/packages/bun-usockets/src/loop.c
@@ -47,7 +47,7 @@ void us_internal_loop_data_free(struct us_loop_t *loop) {
free(loop->data.recv_buf);
- us_timer_close(loop->data.sweep_timer);
+ us_timer_close(loop->data.sweep_timer, 0);
us_internal_async_close(loop->data.wakeup_async);
}
diff --git a/packages/bun-uws/capi/examples/Broadcast.c b/packages/bun-uws/capi/examples/Broadcast.c
index dc6787349..ef1b09101 100644
--- a/packages/bun-uws/capi/examples/Broadcast.c
+++ b/packages/bun-uws/capi/examples/Broadcast.c
@@ -14,7 +14,7 @@ void uws_timer_close(struct us_timer_t *timer)
struct timer_handler_data *data;
memcpy(&data, us_timer_ext(t), sizeof(struct timer_handler_data *));
free(data);
- us_timer_close(t);
+ us_timer_close(t, 0);
}
//Timer create helper
struct us_timer_t *uws_create_timer(int ms, int repeat_ms, void (*handler)(void *data), void *data)
@@ -47,7 +47,7 @@ struct us_timer_t *uws_create_timer(int ms, int repeat_ms, void (*handler)(void
if (!data->repeat)
{
free(data);
- us_timer_close(t);
+ us_timer_close(t, 0);
}
},
ms, repeat_ms);
diff --git a/packages/bun-uws/capi/examples/HelloWorldAsync.c b/packages/bun-uws/capi/examples/HelloWorldAsync.c
index b8549b07e..e22dd44c1 100644
--- a/packages/bun-uws/capi/examples/HelloWorldAsync.c
+++ b/packages/bun-uws/capi/examples/HelloWorldAsync.c
@@ -19,7 +19,7 @@ void uws_timer_close(struct us_timer_t *timer)
struct timer_handler_data *data;
memcpy(&data, us_timer_ext(t), sizeof(struct timer_handler_data *));
free(data);
- us_timer_close(t);
+ us_timer_close(t, 0);
}
//Timer create helper
struct us_timer_t *uws_create_timer(int ms, int repeat_ms, void (*handler)(void *data), void *data)
@@ -52,7 +52,7 @@ struct us_timer_t *uws_create_timer(int ms, int repeat_ms, void (*handler)(void
if (!data->repeat)
{
free(data);
- us_timer_close(t);
+ us_timer_close(t, 0);
}
},
ms, repeat_ms);
diff --git a/packages/bun-uws/capi/examples/UpgradeAsync.c b/packages/bun-uws/capi/examples/UpgradeAsync.c
index 3dacd8c8e..8c6e73542 100644
--- a/packages/bun-uws/capi/examples/UpgradeAsync.c
+++ b/packages/bun-uws/capi/examples/UpgradeAsync.c
@@ -62,7 +62,7 @@ void uws_timer_close(struct us_timer_t *timer)
struct timer_handler_data *data;
memcpy(&data, us_timer_ext(t), sizeof(struct timer_handler_data *));
free(data);
- us_timer_close(t);
+ us_timer_close(t, 0);
}
//Timer create helper
struct us_timer_t *uws_create_timer(int ms, int repeat_ms, void (*handler)(void *data), void *data)
@@ -95,7 +95,7 @@ struct us_timer_t *uws_create_timer(int ms, int repeat_ms, void (*handler)(void
if (!data->repeat)
{
free(data);
- us_timer_close(t);
+ us_timer_close(t, 0);
}
},
ms, repeat_ms);
diff --git a/packages/bun-uws/examples/UpgradeAsync.cpp b/packages/bun-uws/examples/UpgradeAsync.cpp
index 0c5301be4..045605831 100644
--- a/packages/bun-uws/examples/UpgradeAsync.cpp
+++ b/packages/bun-uws/examples/UpgradeAsync.cpp
@@ -90,7 +90,7 @@ int main() {
delete upgradeData;
- us_timer_close(t);
+ us_timer_close(t, 0);
}, 5000, 0);
},
diff --git a/packages/bun-uws/src/Loop.h b/packages/bun-uws/src/Loop.h
index d3ca45b58..7311dd976 100644
--- a/packages/bun-uws/src/Loop.h
+++ b/packages/bun-uws/src/Loop.h
@@ -126,7 +126,7 @@ public:
LoopData *loopData = (LoopData *) us_loop_ext((us_loop_t *) this);
/* Stop and free dateTimer first */
- us_timer_close(loopData->dateTimer);
+ us_timer_close(loopData->dateTimer, 1);
loopData->~LoopData();
/* uSockets will track whether this loop is owned by us or a borrowed alien loop */