bun-types 1.1.44 → 1.1.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bun.d.ts +3 -0
- package/docs/api/fetch.md +1 -1
- package/docs/api/spawn.md +1 -1
- package/docs/cli/publish.md +1 -1
- package/docs/guides/ecosystem/ssr-react.md +3 -3
- package/docs/runtime/debugger.md +3 -3
- package/docs/test/dom.md +1 -1
- package/package.json +1 -1
package/bun.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ declare module "bun" {
|
|
|
22
22
|
PeerCertificate,
|
|
23
23
|
} from "tls";
|
|
24
24
|
import type { Stats } from "node:fs";
|
|
25
|
+
import type { X509Certificate } from "node:crypto";
|
|
25
26
|
interface Env {
|
|
26
27
|
NODE_ENV?: string;
|
|
27
28
|
/**
|
|
@@ -5594,6 +5595,7 @@ declare module "bun" {
|
|
|
5594
5595
|
* socket has been destroyed, `null` will be returned.
|
|
5595
5596
|
*/
|
|
5596
5597
|
getCertificate(): PeerCertificate | object | null;
|
|
5598
|
+
getX509Certificate(): X509Certificate | undefined;
|
|
5597
5599
|
|
|
5598
5600
|
/**
|
|
5599
5601
|
* Returns an object containing information on the negotiated cipher suite.
|
|
@@ -5632,6 +5634,7 @@ declare module "bun" {
|
|
|
5632
5634
|
* @return A certificate object.
|
|
5633
5635
|
*/
|
|
5634
5636
|
getPeerCertificate(): PeerCertificate;
|
|
5637
|
+
getPeerX509Certificate(): X509Certificate;
|
|
5635
5638
|
|
|
5636
5639
|
/**
|
|
5637
5640
|
* See [SSL\_get\_shared\_sigalgs](https://www.openssl.org/docs/man1.1.1/man3/SSL_get_shared_sigalgs.html) for more information.
|
package/docs/api/fetch.md
CHANGED
|
@@ -195,7 +195,7 @@ This will print the request and response headers to your terminal:
|
|
|
195
195
|
```sh
|
|
196
196
|
[fetch] > HTTP/1.1 GET http://example.com/
|
|
197
197
|
[fetch] > Connection: keep-alive
|
|
198
|
-
[fetch] > User-Agent: Bun/bun-v1.1.
|
|
198
|
+
[fetch] > User-Agent: Bun/bun-v1.1.45
|
|
199
199
|
[fetch] > Accept: */*
|
|
200
200
|
[fetch] > Host: example.com
|
|
201
201
|
[fetch] > Accept-Encoding: gzip, deflate, br
|
package/docs/api/spawn.md
CHANGED
|
@@ -110,7 +110,7 @@ You can read results from the subprocess via the `stdout` and `stderr` propertie
|
|
|
110
110
|
```ts
|
|
111
111
|
const proc = Bun.spawn(["bun", "--version"]);
|
|
112
112
|
const text = await new Response(proc.stdout).text();
|
|
113
|
-
console.log(text); // => "bun-v1.1.
|
|
113
|
+
console.log(text); // => "bun-v1.1.45"
|
|
114
114
|
```
|
|
115
115
|
|
|
116
116
|
Configure the output stream by passing one of the following values to `stdout/stderr`:
|
package/docs/cli/publish.md
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
name: Server-side render (SSR) a React component
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
To get started, install
|
|
5
|
+
To get started, install `react` & `react-dom`:
|
|
6
6
|
|
|
7
7
|
```sh
|
|
8
8
|
# Any package manager can be used
|
|
9
|
-
$ bun add react
|
|
9
|
+
$ bun add react react-dom
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
---
|
|
@@ -48,4 +48,4 @@ Bun.serve({
|
|
|
48
48
|
|
|
49
49
|
---
|
|
50
50
|
|
|
51
|
-
React `19` and later includes an [SSR optimization](https://github.com/facebook/react/pull/25597) that takes advantage of Bun's "direct" `ReadableStream` implementation. If you run into an error like `export named 'renderToReadableStream' not found`, please make sure to install
|
|
51
|
+
React `19` and later includes an [SSR optimization](https://github.com/facebook/react/pull/25597) that takes advantage of Bun's "direct" `ReadableStream` implementation. If you run into an error like `export named 'renderToReadableStream' not found`, please make sure to install version `19` of `react` & `react-dom`, or import from `react-dom/server.browser` instead of `react-dom/server`. See [facebook/react#28941](https://github.com/facebook/react/issues/28941) for more information.
|
package/docs/runtime/debugger.md
CHANGED
|
@@ -124,11 +124,11 @@ await fetch("https://example.com", {
|
|
|
124
124
|
This prints the `fetch` request as a single-line `curl` command to let you copy-paste into your terminal to replicate the request.
|
|
125
125
|
|
|
126
126
|
```sh
|
|
127
|
-
[fetch] $ curl --http1.1 "https://example.com/" -X POST -H "content-type: application/json" -H "Connection: keep-alive" -H "User-Agent: Bun/bun-v1.1.
|
|
127
|
+
[fetch] $ curl --http1.1 "https://example.com/" -X POST -H "content-type: application/json" -H "Connection: keep-alive" -H "User-Agent: Bun/bun-v1.1.45" -H "Accept: */*" -H "Host: example.com" -H "Accept-Encoding: gzip, deflate, br" --compressed -H "Content-Length: 13" --data-raw "{\"foo\":\"bar\"}"
|
|
128
128
|
[fetch] > HTTP/1.1 POST https://example.com/
|
|
129
129
|
[fetch] > content-type: application/json
|
|
130
130
|
[fetch] > Connection: keep-alive
|
|
131
|
-
[fetch] > User-Agent: Bun/bun-v1.1.
|
|
131
|
+
[fetch] > User-Agent: Bun/bun-v1.1.45
|
|
132
132
|
[fetch] > Accept: */*
|
|
133
133
|
[fetch] > Host: example.com
|
|
134
134
|
[fetch] > Accept-Encoding: gzip, deflate, br
|
|
@@ -170,7 +170,7 @@ This prints the following to the console:
|
|
|
170
170
|
[fetch] > HTTP/1.1 POST https://example.com/
|
|
171
171
|
[fetch] > content-type: application/json
|
|
172
172
|
[fetch] > Connection: keep-alive
|
|
173
|
-
[fetch] > User-Agent: Bun/bun-v1.1.
|
|
173
|
+
[fetch] > User-Agent: Bun/bun-v1.1.45
|
|
174
174
|
[fetch] > Accept: */*
|
|
175
175
|
[fetch] > Host: example.com
|
|
176
176
|
[fetch] > Accept-Encoding: gzip, deflate, br
|
package/docs/test/dom.md
CHANGED
package/package.json
CHANGED