bun-types 1.3.2-canary.20251106T140813 → 1.3.2-canary.20251108T140624

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.
Files changed (316) hide show
  1. package/bun.d.ts +102 -6
  2. package/docs/bundler/bytecode.mdx +465 -0
  3. package/docs/bundler/css.mdx +1024 -0
  4. package/docs/bundler/esbuild.mdx +253 -0
  5. package/docs/bundler/executables.mdx +535 -0
  6. package/docs/bundler/fullstack.mdx +1064 -0
  7. package/docs/bundler/hot-reloading.mdx +229 -0
  8. package/docs/bundler/html-static.mdx +386 -0
  9. package/docs/bundler/index.mdx +1499 -0
  10. package/docs/bundler/loaders.mdx +356 -0
  11. package/docs/bundler/macros.mdx +328 -0
  12. package/docs/bundler/minifier.mdx +1306 -0
  13. package/docs/bundler/plugins.mdx +411 -0
  14. package/docs/feedback.mdx +85 -0
  15. package/docs/guides/binary/arraybuffer-to-array.mdx +29 -0
  16. package/docs/guides/binary/arraybuffer-to-blob.mdx +26 -0
  17. package/docs/guides/binary/arraybuffer-to-buffer.mdx +27 -0
  18. package/docs/guides/binary/arraybuffer-to-string.mdx +17 -0
  19. package/docs/guides/binary/arraybuffer-to-typedarray.mdx +41 -0
  20. package/docs/guides/binary/blob-to-arraybuffer.mdx +16 -0
  21. package/docs/guides/binary/blob-to-dataview.mdx +16 -0
  22. package/docs/guides/binary/blob-to-stream.mdx +16 -0
  23. package/docs/guides/binary/blob-to-string.mdx +17 -0
  24. package/docs/guides/binary/blob-to-typedarray.mdx +16 -0
  25. package/docs/guides/binary/buffer-to-arraybuffer.mdx +16 -0
  26. package/docs/guides/binary/buffer-to-blob.mdx +16 -0
  27. package/docs/guides/binary/buffer-to-readablestream.mdx +43 -0
  28. package/docs/guides/binary/buffer-to-string.mdx +27 -0
  29. package/docs/guides/binary/buffer-to-typedarray.mdx +16 -0
  30. package/docs/guides/binary/dataview-to-string.mdx +17 -0
  31. package/docs/guides/binary/typedarray-to-arraybuffer.mdx +27 -0
  32. package/docs/guides/binary/typedarray-to-blob.mdx +18 -0
  33. package/docs/guides/binary/typedarray-to-buffer.mdx +16 -0
  34. package/docs/guides/binary/typedarray-to-dataview.mdx +16 -0
  35. package/docs/guides/binary/typedarray-to-readablestream.mdx +43 -0
  36. package/docs/guides/binary/typedarray-to-string.mdx +18 -0
  37. package/docs/guides/deployment/aws-lambda.mdx +204 -0
  38. package/docs/guides/deployment/digital-ocean.mdx +161 -0
  39. package/docs/guides/deployment/google-cloud-run.mdx +197 -0
  40. package/docs/guides/deployment/railway.mdx +145 -0
  41. package/docs/guides/deployment/render.mdx +82 -0
  42. package/docs/guides/deployment/vercel.mdx +99 -0
  43. package/docs/guides/ecosystem/astro.mdx +82 -0
  44. package/docs/guides/ecosystem/discordjs.mdx +80 -0
  45. package/docs/guides/ecosystem/docker.mdx +151 -0
  46. package/docs/guides/ecosystem/drizzle.mdx +195 -0
  47. package/docs/guides/ecosystem/edgedb.mdx +257 -0
  48. package/docs/guides/ecosystem/elysia.mdx +31 -0
  49. package/docs/guides/ecosystem/express.mdx +43 -0
  50. package/docs/guides/ecosystem/hono.mdx +47 -0
  51. package/docs/guides/ecosystem/mongoose.mdx +92 -0
  52. package/docs/guides/ecosystem/neon-drizzle.mdx +234 -0
  53. package/docs/guides/ecosystem/neon-serverless-postgres.mdx +60 -0
  54. package/docs/guides/ecosystem/nextjs.mdx +57 -0
  55. package/docs/guides/ecosystem/nuxt.mdx +90 -0
  56. package/docs/guides/ecosystem/pm2.mdx +55 -0
  57. package/docs/guides/ecosystem/prisma-postgres.mdx +169 -0
  58. package/docs/guides/ecosystem/prisma.mdx +164 -0
  59. package/docs/guides/ecosystem/qwik.mdx +114 -0
  60. package/docs/guides/ecosystem/react.mdx +52 -0
  61. package/docs/guides/ecosystem/remix.mdx +97 -0
  62. package/docs/guides/ecosystem/sentry.mdx +54 -0
  63. package/docs/guides/ecosystem/solidstart.mdx +66 -0
  64. package/docs/guides/ecosystem/ssr-react.mdx +49 -0
  65. package/docs/guides/ecosystem/stric.mdx +54 -0
  66. package/docs/guides/ecosystem/sveltekit.mdx +138 -0
  67. package/docs/guides/ecosystem/systemd.mdx +114 -0
  68. package/docs/guides/ecosystem/upstash.mdx +87 -0
  69. package/docs/guides/ecosystem/vite.mdx +77 -0
  70. package/docs/guides/html-rewriter/extract-links.mdx +72 -0
  71. package/docs/guides/html-rewriter/extract-social-meta.mdx +97 -0
  72. package/docs/guides/http/cluster.mdx +69 -0
  73. package/docs/guides/http/fetch-unix.mdx +35 -0
  74. package/docs/guides/http/fetch.mdx +26 -0
  75. package/docs/guides/http/file-uploads.mdx +97 -0
  76. package/docs/guides/http/hot.mdx +28 -0
  77. package/docs/guides/http/proxy.mdx +26 -0
  78. package/docs/guides/http/server.mdx +48 -0
  79. package/docs/guides/http/simple.mdx +20 -0
  80. package/docs/guides/http/stream-file.mdx +50 -0
  81. package/docs/guides/http/stream-iterator.mdx +49 -0
  82. package/docs/guides/http/stream-node-streams-in-bun.mdx +22 -0
  83. package/docs/guides/http/tls.mdx +32 -0
  84. package/docs/guides/index.mdx +10 -0
  85. package/docs/guides/install/add-dev.mdx +28 -0
  86. package/docs/guides/install/add-git.mdx +38 -0
  87. package/docs/guides/install/add-optional.mdx +27 -0
  88. package/docs/guides/install/add-peer.mdx +45 -0
  89. package/docs/guides/install/add-tarball.mdx +35 -0
  90. package/docs/guides/install/add.mdx +44 -0
  91. package/docs/guides/install/azure-artifacts.mdx +76 -0
  92. package/docs/guides/install/cicd.mdx +43 -0
  93. package/docs/guides/install/custom-registry.mdx +32 -0
  94. package/docs/guides/install/from-npm-install-to-bun-install.mdx +230 -0
  95. package/docs/guides/install/git-diff-bun-lockfile.mdx +47 -0
  96. package/docs/guides/install/jfrog-artifactory.mdx +28 -0
  97. package/docs/guides/install/npm-alias.mdx +25 -0
  98. package/docs/guides/install/registry-scope.mdx +40 -0
  99. package/docs/guides/install/trusted.mdx +50 -0
  100. package/docs/guides/install/workspaces.mdx +70 -0
  101. package/docs/guides/install/yarnlock.mdx +50 -0
  102. package/docs/guides/process/argv.mdx +66 -0
  103. package/docs/guides/process/ctrl-c.mdx +18 -0
  104. package/docs/guides/process/ipc.mdx +69 -0
  105. package/docs/guides/process/nanoseconds.mdx +15 -0
  106. package/docs/guides/process/os-signals.mdx +41 -0
  107. package/docs/guides/process/spawn-stderr.mdx +34 -0
  108. package/docs/guides/process/spawn-stdout.mdx +28 -0
  109. package/docs/guides/process/spawn.mdx +43 -0
  110. package/docs/guides/process/stdin.mdx +62 -0
  111. package/docs/guides/read-file/arraybuffer.mdx +30 -0
  112. package/docs/guides/read-file/buffer.mdx +21 -0
  113. package/docs/guides/read-file/exists.mdx +18 -0
  114. package/docs/guides/read-file/json.mdx +19 -0
  115. package/docs/guides/read-file/mime.mdx +22 -0
  116. package/docs/guides/read-file/stream.mdx +28 -0
  117. package/docs/guides/read-file/string.mdx +24 -0
  118. package/docs/guides/read-file/uint8array.mdx +23 -0
  119. package/docs/guides/read-file/watch.mdx +66 -0
  120. package/docs/guides/runtime/build-time-constants.mdx +295 -0
  121. package/docs/guides/runtime/cicd.mdx +45 -0
  122. package/docs/guides/runtime/codesign-macos-executable.mdx +61 -0
  123. package/docs/guides/runtime/define-constant.mdx +149 -0
  124. package/docs/guides/runtime/delete-directory.mdx +39 -0
  125. package/docs/guides/runtime/delete-file.mdx +21 -0
  126. package/docs/guides/runtime/heap-snapshot.mdx +28 -0
  127. package/docs/guides/runtime/import-html.mdx +17 -0
  128. package/docs/guides/runtime/import-json.mdx +46 -0
  129. package/docs/guides/runtime/import-toml.mdx +32 -0
  130. package/docs/guides/runtime/import-yaml.mdx +104 -0
  131. package/docs/guides/runtime/read-env.mdx +37 -0
  132. package/docs/guides/runtime/set-env.mdx +51 -0
  133. package/docs/guides/runtime/shell.mdx +42 -0
  134. package/docs/guides/runtime/timezone.mdx +38 -0
  135. package/docs/guides/runtime/tsconfig-paths.mdx +31 -0
  136. package/docs/guides/runtime/typescript.mdx +51 -0
  137. package/docs/guides/runtime/vscode-debugger.mdx +48 -0
  138. package/docs/guides/runtime/web-debugger.mdx +103 -0
  139. package/docs/guides/streams/node-readable-to-arraybuffer.mdx +13 -0
  140. package/docs/guides/streams/node-readable-to-blob.mdx +13 -0
  141. package/docs/guides/streams/node-readable-to-json.mdx +14 -0
  142. package/docs/guides/streams/node-readable-to-string.mdx +14 -0
  143. package/docs/guides/streams/node-readable-to-uint8array.mdx +13 -0
  144. package/docs/guides/streams/to-array.mdx +16 -0
  145. package/docs/guides/streams/to-arraybuffer.mdx +16 -0
  146. package/docs/guides/streams/to-blob.mdx +16 -0
  147. package/docs/guides/streams/to-buffer.mdx +17 -0
  148. package/docs/guides/streams/to-json.mdx +16 -0
  149. package/docs/guides/streams/to-string.mdx +16 -0
  150. package/docs/guides/streams/to-typedarray.mdx +24 -0
  151. package/docs/guides/test/bail.mdx +24 -0
  152. package/docs/guides/test/coverage-threshold.mdx +67 -0
  153. package/docs/guides/test/coverage.mdx +49 -0
  154. package/docs/guides/test/happy-dom.mdx +73 -0
  155. package/docs/guides/test/migrate-from-jest.mdx +125 -0
  156. package/docs/guides/test/mock-clock.mdx +50 -0
  157. package/docs/guides/test/mock-functions.mdx +70 -0
  158. package/docs/guides/test/rerun-each.mdx +16 -0
  159. package/docs/guides/test/run-tests.mdx +116 -0
  160. package/docs/guides/test/skip-tests.mdx +43 -0
  161. package/docs/guides/test/snapshot.mdx +102 -0
  162. package/docs/guides/test/spy-on.mdx +49 -0
  163. package/docs/guides/test/svelte-test.mdx +113 -0
  164. package/docs/guides/test/testing-library.mdx +93 -0
  165. package/docs/guides/test/timeout.mdx +17 -0
  166. package/docs/guides/test/todo-tests.mdx +74 -0
  167. package/docs/guides/test/update-snapshots.mdx +49 -0
  168. package/docs/guides/test/watch-mode.mdx +24 -0
  169. package/docs/guides/util/base64.mdx +17 -0
  170. package/docs/guides/util/deep-equals.mdx +41 -0
  171. package/docs/guides/util/deflate.mdx +20 -0
  172. package/docs/guides/util/detect-bun.mdx +25 -0
  173. package/docs/guides/util/entrypoint.mdx +19 -0
  174. package/docs/guides/util/escape-html.mdx +24 -0
  175. package/docs/guides/util/file-url-to-path.mdx +16 -0
  176. package/docs/guides/util/gzip.mdx +20 -0
  177. package/docs/guides/util/hash-a-password.mdx +56 -0
  178. package/docs/guides/util/import-meta-dir.mdx +15 -0
  179. package/docs/guides/util/import-meta-file.mdx +15 -0
  180. package/docs/guides/util/import-meta-path.mdx +15 -0
  181. package/docs/guides/util/javascript-uuid.mdx +25 -0
  182. package/docs/guides/util/main.mdx +43 -0
  183. package/docs/guides/util/path-to-file-url.mdx +16 -0
  184. package/docs/guides/util/sleep.mdx +24 -0
  185. package/docs/guides/util/version.mdx +23 -0
  186. package/docs/guides/util/which-path-to-executable-bin.mdx +17 -0
  187. package/docs/guides/websocket/compression.mdx +33 -0
  188. package/docs/guides/websocket/context.mdx +74 -0
  189. package/docs/guides/websocket/pubsub.mdx +40 -0
  190. package/docs/guides/websocket/simple.mdx +35 -0
  191. package/docs/guides/write-file/append.mdx +54 -0
  192. package/docs/guides/write-file/basic.mdx +46 -0
  193. package/docs/guides/write-file/blob.mdx +30 -0
  194. package/docs/guides/write-file/cat.mdx +19 -0
  195. package/docs/guides/write-file/file-cp.mdx +18 -0
  196. package/docs/guides/write-file/filesink.mdx +54 -0
  197. package/docs/guides/write-file/response.mdx +19 -0
  198. package/docs/guides/write-file/stdout.mdx +23 -0
  199. package/docs/guides/write-file/stream.mdx +19 -0
  200. package/docs/guides/write-file/unlink.mdx +18 -0
  201. package/docs/index.mdx +133 -0
  202. package/docs/installation.mdx +365 -0
  203. package/docs/pm/bunx.mdx +83 -0
  204. package/docs/pm/catalogs.mdx +292 -0
  205. package/docs/pm/cli/add.mdx +179 -0
  206. package/docs/pm/cli/audit.mdx +60 -0
  207. package/docs/pm/cli/install.mdx +471 -0
  208. package/docs/pm/cli/link.mdx +48 -0
  209. package/docs/pm/cli/outdated.mdx +197 -0
  210. package/docs/pm/cli/patch.mdx +69 -0
  211. package/docs/pm/cli/pm.mdx +319 -0
  212. package/docs/pm/cli/publish.mdx +123 -0
  213. package/docs/pm/cli/remove.mdx +16 -0
  214. package/docs/pm/cli/update.mdx +140 -0
  215. package/docs/pm/cli/why.mdx +84 -0
  216. package/docs/pm/filter.mdx +102 -0
  217. package/docs/pm/global-cache.mdx +72 -0
  218. package/docs/pm/isolated-installs.mdx +205 -0
  219. package/docs/pm/lifecycle.mdx +57 -0
  220. package/docs/pm/lockfile.mdx +64 -0
  221. package/docs/pm/npmrc.mdx +111 -0
  222. package/docs/pm/overrides.mdx +83 -0
  223. package/docs/pm/scopes-registries.mdx +35 -0
  224. package/docs/pm/security-scanner-api.mdx +95 -0
  225. package/docs/pm/workspaces.mdx +109 -0
  226. package/docs/project/benchmarking.mdx +218 -0
  227. package/docs/project/bindgen.mdx +223 -0
  228. package/docs/project/building-windows.mdx +133 -0
  229. package/docs/project/contributing.mdx +343 -0
  230. package/docs/project/feedback.mdx +20 -0
  231. package/docs/project/license.mdx +78 -0
  232. package/docs/project/roadmap.mdx +8 -0
  233. package/docs/quickstart.mdx +240 -0
  234. package/docs/runtime/auto-install.mdx +97 -0
  235. package/docs/runtime/binary-data.mdx +846 -0
  236. package/docs/runtime/bun-apis.mdx +59 -0
  237. package/docs/runtime/bunfig.mdx +642 -0
  238. package/docs/runtime/c-compiler.mdx +204 -0
  239. package/docs/runtime/child-process.mdx +532 -0
  240. package/docs/runtime/color.mdx +267 -0
  241. package/docs/runtime/console.mdx +67 -0
  242. package/docs/runtime/cookies.mdx +454 -0
  243. package/docs/runtime/debugger.mdx +335 -0
  244. package/docs/runtime/environment-variables.mdx +214 -0
  245. package/docs/runtime/ffi.mdx +565 -0
  246. package/docs/runtime/file-io.mdx +306 -0
  247. package/docs/runtime/file-system-router.mdx +118 -0
  248. package/docs/runtime/file-types.mdx +354 -0
  249. package/docs/runtime/glob.mdx +181 -0
  250. package/docs/runtime/globals.mdx +72 -0
  251. package/docs/runtime/hashing.mdx +315 -0
  252. package/docs/runtime/html-rewriter.mdx +340 -0
  253. package/docs/runtime/http/cookies.mdx +79 -0
  254. package/docs/runtime/http/error-handling.mdx +40 -0
  255. package/docs/runtime/http/metrics.mdx +36 -0
  256. package/docs/runtime/http/routing.mdx +289 -0
  257. package/docs/runtime/http/server.mdx +647 -0
  258. package/docs/runtime/http/tls.mdx +101 -0
  259. package/docs/runtime/http/websockets.mdx +404 -0
  260. package/docs/runtime/index.mdx +223 -0
  261. package/docs/runtime/jsx.mdx +115 -0
  262. package/docs/runtime/module-resolution.mdx +342 -0
  263. package/docs/runtime/networking/dns.mdx +111 -0
  264. package/docs/runtime/networking/fetch.mdx +468 -0
  265. package/docs/runtime/networking/tcp.mdx +239 -0
  266. package/docs/runtime/networking/udp.mdx +129 -0
  267. package/docs/runtime/node-api.mdx +19 -0
  268. package/docs/runtime/nodejs-compat.mdx +468 -0
  269. package/docs/runtime/plugins.mdx +405 -0
  270. package/docs/runtime/redis.mdx +582 -0
  271. package/docs/runtime/s3.mdx +863 -0
  272. package/docs/runtime/secrets.mdx +336 -0
  273. package/docs/runtime/semver.mdx +57 -0
  274. package/docs/runtime/shell.mdx +637 -0
  275. package/docs/runtime/sql.mdx +1404 -0
  276. package/docs/runtime/sqlite.mdx +699 -0
  277. package/docs/runtime/streams.mdx +232 -0
  278. package/docs/runtime/templating/create.mdx +269 -0
  279. package/docs/runtime/templating/init.mdx +58 -0
  280. package/docs/runtime/transpiler.mdx +288 -0
  281. package/docs/runtime/typescript.mdx +58 -0
  282. package/docs/runtime/utils.mdx +922 -0
  283. package/docs/runtime/watch-mode.mdx +161 -0
  284. package/docs/runtime/web-apis.mdx +29 -0
  285. package/docs/runtime/workers.mdx +328 -0
  286. package/docs/runtime/yaml.mdx +469 -0
  287. package/docs/snippets/cli/add.mdx +166 -0
  288. package/docs/snippets/cli/build.mdx +196 -0
  289. package/docs/snippets/cli/feedback.mdx +17 -0
  290. package/docs/snippets/cli/init.mdx +84 -0
  291. package/docs/snippets/cli/install.mdx +173 -0
  292. package/docs/snippets/cli/link.mdx +163 -0
  293. package/docs/snippets/cli/outdated.mdx +140 -0
  294. package/docs/snippets/cli/patch.mdx +171 -0
  295. package/docs/snippets/cli/publish.mdx +198 -0
  296. package/docs/snippets/cli/remove.mdx +146 -0
  297. package/docs/snippets/cli/run.mdx +293 -0
  298. package/docs/snippets/cli/test.mdx +100 -0
  299. package/docs/snippets/cli/update.mdx +144 -0
  300. package/docs/snippets/product-card.mdx +32 -0
  301. package/docs/snippets/product-tiles.mdx +94 -0
  302. package/docs/test/code-coverage.mdx +409 -0
  303. package/docs/test/configuration.mdx +467 -0
  304. package/docs/test/dates-times.mdx +129 -0
  305. package/docs/test/discovery.mdx +90 -0
  306. package/docs/test/dom.mdx +226 -0
  307. package/docs/test/index.mdx +380 -0
  308. package/docs/test/lifecycle.mdx +348 -0
  309. package/docs/test/mocks.mdx +637 -0
  310. package/docs/test/reporters.mdx +117 -0
  311. package/docs/test/runtime-behavior.mdx +342 -0
  312. package/docs/test/snapshots.mdx +434 -0
  313. package/docs/test/writing-tests.mdx +635 -0
  314. package/docs/typescript.mdx +54 -0
  315. package/package.json +8 -6
  316. package/test.d.ts +2 -2
@@ -0,0 +1,114 @@
1
+ ---
2
+ title: Build an app with Qwik and Bun
3
+ sidebarTitle: Qwik with Bun
4
+ mode: center
5
+ ---
6
+
7
+ Initialize a new Qwik app with `bunx create-qwik`.
8
+
9
+ The `create-qwik` package detects when you are using `bunx` and will automatically install dependencies using `bun`.
10
+
11
+ ```sh terminal icon="terminal"
12
+ bun create qwik
13
+ ```
14
+
15
+ ```txts
16
+ ............
17
+ .::: :--------:.
18
+ .:::: .:-------:.
19
+ .:::::. .:-------.
20
+ ::::::. .:------.
21
+ ::::::. :-----:
22
+ ::::::. .:-----.
23
+ :::::::. .-----.
24
+ ::::::::.. ---:.
25
+ .:::::::::. :-:.
26
+ ..::::::::::::
27
+ ...::::
28
+
29
+
30
+ ┌ Let's create a Qwik App ✨ (v1.2.10)
31
+
32
+ ◇ Where would you like to create your new project? (Use '.' or './' for current directory)
33
+ │ ./my-app
34
+
35
+ ● Creating new project in /path/to/my-app ... 🐇
36
+
37
+ ◇ Select a starter
38
+ │ Basic App
39
+
40
+ ◇ Would you like to install bun dependencies?
41
+ │ Yes
42
+
43
+ ◇ Initialize a new git repository?
44
+ │ No
45
+
46
+ ◇ Finishing the install. Wanna hear a joke?
47
+ │ Yes
48
+
49
+ ○ ────────────────────────────────────────────────────────╮
50
+ │ │
51
+ │ How do you know if there’s an elephant under your bed? │
52
+ │ Your head hits the ceiling! │
53
+ │ │
54
+ ├──────────────────────────────────────────────────────────╯
55
+
56
+ ◇ App Created 🐰
57
+
58
+ ◇ Installed bun dependencies 📋
59
+
60
+ ○ Result ─────────────────────────────────────────────╮
61
+ │ │
62
+ │ Success! Project created in my-app directory │
63
+ │ │
64
+ │ Integrations? Add Netlify, Cloudflare, Tailwind... │
65
+ │ bun qwik add │
66
+ │ │
67
+ │ Relevant docs: │
68
+ │ https://qwik.builder.io/docs/getting-started/ │
69
+ │ │
70
+ │ Questions? Start the conversation at: │
71
+ │ https://qwik.builder.io/chat │
72
+ │ https://twitter.com/QwikDev │
73
+ │ │
74
+ │ Presentations, Podcasts and Videos: │
75
+ │ https://qwik.builder.io/media/ │
76
+ │ │
77
+ │ Next steps: │
78
+ │ cd my-app │
79
+ │ bun start │
80
+ │ │
81
+ │ │
82
+ ├──────────────────────────────────────────────────────╯
83
+
84
+ └ Happy coding! 🎉
85
+
86
+ ```
87
+
88
+ ---
89
+
90
+ Run `bun run dev` to start the development server.
91
+
92
+ ```sh terminal icon="terminal"
93
+ bun run dev
94
+ ```
95
+
96
+ ```txt
97
+ $ vite--mode ssr
98
+
99
+ VITE v4.4.7 ready in 1190 ms
100
+
101
+ ➜ Local: http://localhost:5173/
102
+ ➜ Network: use --host to expose
103
+ ➜ press h to show help
104
+ ```
105
+
106
+ ---
107
+
108
+ Open [http://localhost:5173](http://localhost:5173) with your browser to see the result. Qwik will hot-reload your app as you edit your source files.
109
+
110
+ <Frame>![Qwik screenshot](https://github.com/oven-sh/bun/assets/3084745/ec35f2f7-03dd-4c90-851e-fb4ad150bb28)</Frame>
111
+
112
+ ---
113
+
114
+ Refer to the [Qwik docs](https://qwik.builder.io/docs/getting-started/) for complete documentation.
@@ -0,0 +1,52 @@
1
+ ---
2
+ title: Build a React app with Bun
3
+ sidebarTitle: React with Bun
4
+ mode: center
5
+ ---
6
+
7
+ Bun supports `.jsx` and `.tsx` files out of the box. React just works with Bun.
8
+
9
+ Create a new React app with `bun init --react`. This gives you a template with a simple React app and a simple API server together in one full-stack app.
10
+
11
+ ```bash terminal icon="terminal"
12
+ # Create a new React app
13
+ bun init --react
14
+
15
+ # Run the app in development mode
16
+ bun dev
17
+
18
+ # Build as a static site for production
19
+ bun run build
20
+
21
+ # Run the server in production
22
+ bun start
23
+ ```
24
+
25
+ ---
26
+
27
+ ### Hot Reloading
28
+
29
+ Run `bun dev` to start the app in development mode. This will start the API server and the React app with hot reloading.
30
+
31
+ ### Full-Stack App
32
+
33
+ Run `bun start` to start the API server and frontend together in one process.
34
+
35
+ ### Static Site
36
+
37
+ Run `bun run build` to build the app as a static site. This will create a `dist` directory with the built app and all the assets.
38
+
39
+ ```txt File Tree icon="folder-tree"
40
+ ├── src/
41
+ │ ├── index.tsx # Server entry point with API routes
42
+ │ ├── frontend.tsx # React app entry point with HMR
43
+ │ ├── App.tsx # Main React component
44
+ │ ├── APITester.tsx # Component for testing API endpoints
45
+ │ ├── index.html # HTML template
46
+ │ ├── index.css # Styles
47
+ │ └── *.svg # Static assets
48
+ ├── package.json # Dependencies and scripts
49
+ ├── tsconfig.json # TypeScript configuration
50
+ ├── bunfig.toml # Bun configuration
51
+ └── bun.lock # Lock file
52
+ ```
@@ -0,0 +1,97 @@
1
+ ---
2
+ title: Build an app with Remix and Bun
3
+ sidebarTitle: Remix with Bun
4
+ mode: center
5
+ ---
6
+
7
+ <Note>
8
+ Currently the Remix development server (`remix dev`) relies on Node.js APIs that Bun does not yet implement. The guide
9
+ below uses Bun to initialize a project and install dependencies, but it uses Node.js to run the dev server.
10
+ </Note>
11
+
12
+ ---
13
+
14
+ Initialize a Remix app with `create-remix`.
15
+
16
+ ```sh terminal icon="terminal"
17
+ bun create remix
18
+ ```
19
+
20
+ ```txt
21
+ remix v1.19.3 💿 Let's build a better website...
22
+
23
+ dir Where should we create your new project?
24
+ ./my-app
25
+
26
+ ◼ Using basic template See https://remix.run/docs/en/main/guides/templates#templates for more
27
+ ✔ Template copied
28
+
29
+ git Initialize a new git repository?
30
+ Yes
31
+
32
+ deps Install dependencies with bun?
33
+ Yes
34
+
35
+ ✔ Dependencies installed
36
+ ✔ Git initialized
37
+
38
+ done That's it!
39
+ Enter your project directory using cd ./my-app
40
+ Check out README.md for development and deploy instructions.
41
+ ```
42
+
43
+ ---
44
+
45
+ To start the dev server, run `bun run dev` from the project root. This will start the dev server using the `remix dev` command. Note that Node.js will be used to run the dev server.
46
+
47
+ ```sh terminal icon="terminal"
48
+ cd my-app
49
+ bun run dev
50
+ ```
51
+
52
+ ```txt
53
+ $ remix dev
54
+
55
+ 💿 remix dev
56
+
57
+ info building...
58
+ info built (263ms)
59
+ Remix App Server started at http://localhost:3000 (http://172.20.0.143:3000)
60
+ ```
61
+
62
+ ---
63
+
64
+ Open [http://localhost:3000](http://localhost:3000) to see the app. Any changes you make to `app/routes/_index.tsx` will be hot-reloaded in the browser.
65
+
66
+ <Frame>
67
+ ![Remix app running on localhost](https://github.com/oven-sh/bun/assets/3084745/c26f1059-a5d4-4c0b-9a88-d9902472fd77)
68
+ </Frame>
69
+
70
+ ---
71
+
72
+ To build and start your app, run `bun run build`
73
+
74
+ ```sh terminal icon="terminal"
75
+ bun run build
76
+ ```
77
+
78
+ ```txt
79
+ $ remix build
80
+ info building... (NODE_ENV=production)
81
+ info built (158ms)
82
+ ```
83
+
84
+ Then `bun run start` from the project root.
85
+
86
+ ```sh terminal icon="terminal"
87
+ bun start
88
+ ```
89
+
90
+ ```txt
91
+ $ remix-serve ./build/index.js
92
+ [remix-serve] http://localhost:3000 (http://192.168.86.237:3000)
93
+ ```
94
+
95
+ ---
96
+
97
+ Read the [Remix docs](https://remix.run/) for more information on how to build apps with Remix.
@@ -0,0 +1,54 @@
1
+ ---
2
+ title: Add Sentry to a Bun app
3
+ sidebarTitle: Sentry with Bun
4
+ mode: center
5
+ ---
6
+
7
+ [Sentry](https://sentry.io) is a developer-first error tracking and performance monitoring platform. Sentry has a first-class SDK for Bun, `@sentry/bun`, that instruments your Bun application to automatically collect error and performance data.
8
+
9
+ Don't already have an account and Sentry project established? Head over to [sentry.io](https://sentry.io/signup/), then return to this page.
10
+
11
+ ---
12
+
13
+ To start using Sentry with Bun, first install the Sentry Bun SDK.
14
+
15
+ ```sh terminal icon="terminal"
16
+ bun add @sentry/bun
17
+ ```
18
+
19
+ ---
20
+
21
+ Then, initialize the Sentry SDK with your Sentry DSN in your app's entry file. You can find your DSN in your Sentry project settings.
22
+
23
+ ```js sentry.ts icon="/icons/typescript.svg"
24
+ import * as Sentry from "@sentry/bun";
25
+
26
+ // Ensure to call this before importing any other modules!
27
+ Sentry.init({
28
+ dsn: "__SENTRY_DSN__",
29
+
30
+ // Add Performance Monitoring by setting tracesSampleRate
31
+ // We recommend adjusting this value in production
32
+ tracesSampleRate: 1.0,
33
+ });
34
+ ```
35
+
36
+ ---
37
+
38
+ You can verify that Sentry is working by capturing a test error:
39
+
40
+ ```js sentry.ts icon="/icons/typescript.svg"
41
+ setTimeout(() => {
42
+ try {
43
+ foo();
44
+ } catch (e) {
45
+ Sentry.captureException(e);
46
+ }
47
+ }, 99);
48
+ ```
49
+
50
+ To view and resolve the recorded error, log into [sentry.io](https://sentry.io/) and open your project. Clicking on the error's title will open a page where you can see detailed information and mark it as resolved.
51
+
52
+ ---
53
+
54
+ To learn more about Sentry and using the Sentry Bun SDK, view the [Sentry documentation](https://docs.sentry.io/platforms/javascript/guides/bun).
@@ -0,0 +1,66 @@
1
+ ---
2
+ title: Build an app with SolidStart and Bun
3
+ sidebarTitle: "SolidStart with Bun"
4
+ mode: center
5
+ ---
6
+
7
+ <Warning>
8
+ SolidStart currently relies on Node.js APIs that Bun does not yet implement. The guide below uses Bun to initialize a
9
+ project and install dependencies, but it uses Node.js to run the dev server.
10
+ </Warning>
11
+
12
+ ---
13
+
14
+ Initialize a SolidStart app with `create-solid`.
15
+
16
+ ```sh terminal icon="terminal"
17
+ bun create solid my-app
18
+ ```
19
+
20
+ ```txt
21
+ create-solid version 0.2.31
22
+
23
+ Welcome to the SolidStart setup wizard!
24
+
25
+ There are definitely bugs and some feature might not work yet.
26
+ If you encounter an issue, have a look at
27
+ https://github.com/solidjs/solid-start/issues and open a new one,
28
+ if it is not already tracked.
29
+
30
+ ✔ Which template do you want to use? › todomvc
31
+ ✔ Server Side Rendering? … yes
32
+ ✔ Use TypeScript? … yes
33
+ cloned solidjs/solid-start#main to /path/to/my-app/.solid-start
34
+ ✔ Copied project files
35
+ ```
36
+
37
+ ---
38
+
39
+ As instructed by the `create-solid` CLI, let's install our dependencies.
40
+
41
+ ```sh terminal icon="terminal"
42
+ cd my-app
43
+ bun install
44
+ ```
45
+
46
+ ---
47
+
48
+ Then run the development server.
49
+
50
+ ```sh terminal icon="terminal"
51
+ bun run dev
52
+ # or, equivalently
53
+ bunx solid-start dev
54
+ ```
55
+
56
+ ---
57
+
58
+ Open [localhost:3000](http://localhost:3000). Any changes you make to `src/routes/index.tsx` will be hot-reloaded automatically.
59
+
60
+ <Frame>
61
+ ![SolidStart demo app](https://github.com/oven-sh/bun/assets/3084745/1e8043c4-49d1-498c-9add-c1eaab6c7167)
62
+ </Frame>
63
+
64
+ ---
65
+
66
+ Refer to the [SolidStart website](https://start.solidjs.com/getting-started/what-is-solidstart) for complete framework documentation.
@@ -0,0 +1,49 @@
1
+ ---
2
+ title: Server-side render (SSR) a React component
3
+ sidebarTitle: "SSR React with Bun"
4
+ mode: center
5
+ ---
6
+
7
+ To get started, install `react` & `react-dom`:
8
+
9
+ ```sh terminal icon="terminal"
10
+ # Any package manager can be used
11
+ bun add react react-dom
12
+ ```
13
+
14
+ ---
15
+
16
+ To render a React component to an HTML stream server-side (SSR):
17
+
18
+ ```tsx ssr-react.tsx icon="file-code"
19
+ import { renderToReadableStream } from "react-dom/server";
20
+
21
+ function Component(props: { message: string }) {
22
+ return (
23
+ <body>
24
+ <h1>{props.message}</h1>
25
+ </body>
26
+ );
27
+ }
28
+
29
+ const stream = await renderToReadableStream(<Component message="Hello from server!" />);
30
+ ```
31
+
32
+ ---
33
+
34
+ Combining this with `Bun.serve()`, we get a simple SSR HTTP server:
35
+
36
+ ```tsx server.ts icon="/icons/typescript.svg"
37
+ Bun.serve({
38
+ async fetch() {
39
+ const stream = await renderToReadableStream(<Component message="Hello from server!" />);
40
+ return new Response(stream, {
41
+ headers: { "Content-Type": "text/html" },
42
+ });
43
+ },
44
+ });
45
+ ```
46
+
47
+ ---
48
+
49
+ 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.
@@ -0,0 +1,54 @@
1
+ ---
2
+ title: Build an HTTP server using StricJS and Bun
3
+ sidebarTitle: "StricJS with Bun"
4
+ mode: center
5
+ ---
6
+
7
+ [StricJS](https://github.com/bunsvr) is a Bun framework for building high-performance web applications and APIs.
8
+
9
+ - **Fast** — Stric is one of the fastest Bun frameworks. See [benchmark](https://github.com/bunsvr/benchmark) for more details.
10
+ - **Minimal** — The basic components like `@stricjs/router` and `@stricjs/utils` are under 50kB and require no external dependencies.
11
+ - **Extensible** — Stric includes with a plugin system, dependency injection, and optional optimizations for handling requests.
12
+
13
+ ---
14
+
15
+ Use `bun init` to create an empty project.
16
+
17
+ ```bash terminal icon="terminal"
18
+ mkdir myapp
19
+ cd myapp
20
+ bun init
21
+ bun add @stricjs/router @stricjs/utils
22
+ ```
23
+
24
+ ---
25
+
26
+ To implement a simple HTTP server with StricJS:
27
+
28
+ ```ts index.ts icon="file-code"
29
+ import { Router } from "@stricjs/router";
30
+
31
+ export default new Router().get("/", () => new Response("Hi"));
32
+ ```
33
+
34
+ ---
35
+
36
+ To serve static files from `/public`:
37
+
38
+ ```ts index.ts icon="file-code"
39
+ import { dir } from "@stricjs/utils";
40
+
41
+ export default new Router().get("/", () => new Response("Hi")).get("/*", dir("./public"));
42
+ ```
43
+
44
+ ---
45
+
46
+ Run the file in watch mode to start the development server.
47
+
48
+ ```bash terminal icon="terminal"
49
+ bun --watch run index.ts
50
+ ```
51
+
52
+ ---
53
+
54
+ For more info, see Stric's [documentation](https://stricjs.netlify.app).
@@ -0,0 +1,138 @@
1
+ ---
2
+ title: Build an app with SvelteKit and Bun
3
+ sidebarTitle: "SvelteKit with Bun"
4
+ mode: center
5
+ ---
6
+
7
+ Use `sv create my-app` to create a SvelteKit project with SvelteKit CLI. Answer the prompts to select a template and set up your development environment.
8
+
9
+ ```sh terminal icon="terminal"
10
+ bunx sv create my-app
11
+ ```
12
+
13
+ ```txt
14
+ ┌ Welcome to the Svelte CLI! (v0.5.7)
15
+
16
+ ◇ Which template would you like?
17
+ │ SvelteKit demo
18
+
19
+ ◇ Add type checking with Typescript?
20
+ │ Yes, using Typescript syntax
21
+
22
+ ◆ Project created
23
+
24
+ ◇ What would you like to add to your project?
25
+ │ none
26
+
27
+ ◇ Which package manager do you want to install dependencies with?
28
+ │ bun
29
+
30
+ ◇ Successfully installed dependencies
31
+
32
+ ◇ Project next steps ─────────────────────────────────────────────────────╮
33
+ │ │
34
+ │ 1: cd my-app │
35
+ │ 2: git init && git add -A && git commit -m "Initial commit" (optional) │
36
+ │ 3: bun run dev -- --open │
37
+ │ │
38
+ │ To close the dev server, hit Ctrl-C │
39
+ │ │
40
+ │ Stuck? Visit us at https://svelte.dev/chat │
41
+ │ │
42
+ ├──────────────────────────────────────────────────────────────────────────╯
43
+
44
+ └ You're all set!
45
+ ```
46
+
47
+ ---
48
+
49
+ Once the project is initialized, `cd` into the new project. You don't need to run 'bun install' since the dependencies are already installed.
50
+
51
+ Then start the development server with `bun --bun run dev`.
52
+
53
+ To run the dev server with Node.js instead of Bun, you can omit the `--bun` flag.
54
+
55
+ ```sh terminal icon="terminal"
56
+ cd my-app
57
+ bun --bun run dev
58
+ ```
59
+
60
+ ```txt
61
+ $ vite dev
62
+ Forced re-optimization of dependencies
63
+
64
+ VITE v5.4.10 ready in 424 ms
65
+
66
+ ➜ Local: http://localhost:5173/
67
+ ➜ Network: use --host to expose
68
+ ➜ press h + enter to show help
69
+ ```
70
+
71
+ ---
72
+
73
+ Visit [http://localhost:5173](http://localhost:5173/) in a browser to see the template app.
74
+
75
+ <Frame>
76
+ ![SvelteKit app running](https://github.com/oven-sh/bun/assets/3084745/7c76eae8-78f9-44fa-9f15-1bd3ca1a47c0)
77
+ </Frame>
78
+
79
+ ---
80
+
81
+ If you edit and save `src/routes/+page.svelte`, you should see your changes hot-reloaded in the browser.
82
+
83
+ ---
84
+
85
+ To build for production, you'll need to add the right SvelteKit adapter. Currently we recommend the
86
+
87
+ `bun add -D svelte-adapter-bun`.
88
+
89
+ Now, make the following changes to your `svelte.config.js`.
90
+
91
+ ```ts svelte.config.js icon="file-code"
92
+ import adapter from "@sveltejs/adapter-auto"; // [!code --]
93
+ import adapter from "svelte-adapter-bun"; // [!code ++]
94
+ import { vitePreprocess } from "@sveltejs/vite-plugin-svelte";
95
+
96
+ /** @type {import('@sveltejs/kit').Config} */
97
+ const config = {
98
+ // Consult https://svelte.dev/docs/kit/integrations#preprocessors
99
+ // for more information about preprocessors
100
+ preprocess: vitePreprocess(),
101
+
102
+ kit: {
103
+ // adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.
104
+ // If your environment is not supported, or you settled on a specific environment, switch out the adapter.
105
+ // See https://svelte.dev/docs/kit/adapters for more information about adapters.
106
+ adapter: adapter(),
107
+ },
108
+ };
109
+
110
+ export default config;
111
+ ```
112
+
113
+ ---
114
+
115
+ To build a production bundle:
116
+
117
+ ```sh terminal icon="terminal"
118
+ bun --bun run build
119
+ ```
120
+
121
+ ```txt
122
+ $ vite build
123
+ vite v5.4.10 building SSR bundle for production...
124
+ "confetti" is imported from external module "@neoconfetti/svelte" but never used in "src/routes/sverdle/+page.svelte".
125
+ ✓ 130 modules transformed.
126
+ vite v5.4.10 building for production...
127
+ ✓ 148 modules transformed.
128
+ ...
129
+ ✓ built in 231ms
130
+ ...
131
+ ✓ built in 899ms
132
+
133
+ Run npm run preview to preview your production build locally.
134
+
135
+ > Using svelte-adapter-bun
136
+ ✔ Start server with: bun ./build/index.js
137
+ ✔ done
138
+ ```