bun-types 1.3.3-canary.20251111T140653 → 1.3.3-canary.20251112T140644
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/docs/bundler/executables.mdx +4 -4
- package/docs/guides/install/azure-artifacts.mdx +1 -1
- package/docs/guides/install/jfrog-artifactory.mdx +1 -1
- package/docs/guides/runtime/define-constant.mdx +1 -1
- package/docs/guides/runtime/import-html.mdx +0 -2
- package/docs/guides/runtime/typescript.mdx +1 -1
- package/docs/pm/lifecycle.mdx +1 -1
- package/docs/runtime/networking/dns.mdx +1 -1
- package/docs/runtime/sqlite.mdx +0 -2
- package/docs/runtime/workers.mdx +1 -3
- package/package.json +1 -1
|
@@ -154,8 +154,8 @@ Using bytecode compilation, `tsc` starts 2x faster:
|
|
|
154
154
|
Bytecode compilation moves parsing overhead for large input files from runtime to bundle time. Your app starts faster, in exchange for making the `bun build` command a little slower. It doesn't obscure source code.
|
|
155
155
|
|
|
156
156
|
<Warning>
|
|
157
|
-
**Experimental:** Bytecode compilation is an experimental feature
|
|
158
|
-
|
|
157
|
+
**Experimental:** Bytecode compilation is an experimental feature. Only `cjs` format is supported (which means no
|
|
158
|
+
top-level-await). Let us know if you run into any issues!
|
|
159
159
|
</Warning>
|
|
160
160
|
|
|
161
161
|
### What do these flags do?
|
|
@@ -320,7 +320,7 @@ new Worker(new URL("./my-worker.ts", import.meta.url));
|
|
|
320
320
|
new Worker(new URL("./my-worker.ts", import.meta.url).href);
|
|
321
321
|
```
|
|
322
322
|
|
|
323
|
-
|
|
323
|
+
When you add multiple entrypoints to a standalone executable, they will be bundled separately into the executable.
|
|
324
324
|
|
|
325
325
|
In the future, we may automatically detect usages of statically-known paths in `new Worker(path)` and then bundle those into the executable, but for now, you'll need to add it to the shell command manually like the above example.
|
|
326
326
|
|
|
@@ -395,7 +395,7 @@ This database is read-write, but all changes are lost when the executable exits
|
|
|
395
395
|
|
|
396
396
|
### Embed N-API Addons
|
|
397
397
|
|
|
398
|
-
|
|
398
|
+
You can embed `.node` files into executables.
|
|
399
399
|
|
|
400
400
|
```ts index.ts icon="/icons/typescript.svg"
|
|
401
401
|
const addon = require("./addon.node");
|
|
@@ -25,7 +25,7 @@ To use it with `bun install`, add a `bunfig.toml` file to your project with the
|
|
|
25
25
|
[install.registry]
|
|
26
26
|
url = "https://pkgs.dev.azure.com/my-azure-artifacts-user/_packaging/my-azure-artifacts-user/npm/registry"
|
|
27
27
|
username = "my-azure-artifacts-user"
|
|
28
|
-
#
|
|
28
|
+
# You can use an environment variable here
|
|
29
29
|
password = "$NPM_PASSWORD"
|
|
30
30
|
```
|
|
31
31
|
|
|
@@ -17,7 +17,7 @@ Make sure to replace `MY_SUBDOMAIN` with your JFrog Artifactory subdomain, such
|
|
|
17
17
|
```toml bunfig.toml icon="settings"
|
|
18
18
|
[install.registry]
|
|
19
19
|
url = "https://MY_SUBDOMAIN.jfrog.io/artifactory/api/npm/npm/_auth=MY_TOKEN"
|
|
20
|
-
#
|
|
20
|
+
# You can use an environment variable here
|
|
21
21
|
# url = "$NPM_CONFIG_REGISTRY"
|
|
22
22
|
```
|
|
23
23
|
|
|
@@ -120,7 +120,7 @@ console.log("abc");
|
|
|
120
120
|
|
|
121
121
|
You can also pass properties to the `--define` flag.
|
|
122
122
|
|
|
123
|
-
For example, to replace all usages of `console.write` with `console.log`, you can use the following command
|
|
123
|
+
For example, to replace all usages of `console.write` with `console.log`, you can use the following command
|
|
124
124
|
|
|
125
125
|
```sh
|
|
126
126
|
bun --define console.write=console.log src/index.ts
|
|
@@ -14,7 +14,7 @@ bun add -d @types/bun # dev dependency
|
|
|
14
14
|
|
|
15
15
|
Below is the full set of recommended `compilerOptions` for a Bun project. With this `tsconfig.json`, you can use top-level await, extensioned or extensionless imports, and JSX.
|
|
16
16
|
|
|
17
|
-
```json
|
|
17
|
+
```json tsconfig.json icon="file-json"
|
|
18
18
|
{
|
|
19
19
|
"compilerOptions": {
|
|
20
20
|
// Environment setup & latest features
|
package/docs/pm/lifecycle.mdx
CHANGED
|
@@ -44,7 +44,7 @@ Instead of executing arbitrary scripts, Bun uses a "default-secure" approach. Yo
|
|
|
44
44
|
|
|
45
45
|
Once added to `trustedDependencies`, install/re-install the package. Bun will read this field and run lifecycle scripts for `my-trusted-package`.
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
The top 500 npm packages with lifecycle scripts are allowed by default. You can see the full list [here](https://github.com/oven-sh/bun/blob/main/src/install/default-trusted-dependencies.txt).
|
|
48
48
|
|
|
49
49
|
---
|
|
50
50
|
|
|
@@ -23,7 +23,7 @@ dns.prefetch("bun.com", 443);
|
|
|
23
23
|
|
|
24
24
|
## DNS caching in Bun
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
Bun supports DNS caching. This cache makes repeated connections to the same hosts faster.
|
|
27
27
|
|
|
28
28
|
At the time of writing, we cache up to 255 entries for a maximum of 30 seconds (each). If any connections to a host fail, we remove the entry from the cache. When multiple connections are made to the same host simultaneously, DNS lookups are deduplicated to avoid making multiple requests for the same host.
|
|
29
29
|
|
package/docs/runtime/sqlite.mdx
CHANGED
package/docs/runtime/workers.mdx
CHANGED
|
@@ -76,11 +76,9 @@ const worker = new Worker("./worker.ts", {
|
|
|
76
76
|
});
|
|
77
77
|
```
|
|
78
78
|
|
|
79
|
-
This feature was added in Bun v1.1.35.
|
|
80
|
-
|
|
81
79
|
### `blob:` URLs
|
|
82
80
|
|
|
83
|
-
|
|
81
|
+
You can also pass a `blob:` URL to `Worker`. This is useful for creating workers from strings or other sources.
|
|
84
82
|
|
|
85
83
|
```js
|
|
86
84
|
const blob = new Blob(
|
package/package.json
CHANGED