aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile15
-rw-r--r--README.md15
-rw-r--r--build-id2
-rw-r--r--packages/bun-landing/index.css732
-rw-r--r--packages/bun-landing/package.json9
-rw-r--r--packages/bun-landing/page.tsx511
-rw-r--r--packages/bun-landing/public/Bun.pngbin0 -> 1304 bytes
-rw-r--r--packages/bun-landing/public/Bun@2x.pngbin0 -> 2336 bytes
-rw-r--r--packages/bun-landing/public/index.html181
-rw-r--r--packages/bun-landing/public/logo.pngbin0 -> 4009 bytes
-rw-r--r--packages/bun-landing/public/logo@2x.pngbin0 -> 7895 bytes
-rw-r--r--packages/bun-landing/public/next.svg12
-rw-r--r--packages/bun-landing/public/remix.svg4
-rw-r--r--packages/bun-landing/public/ssr.tsx0
-rw-r--r--packages/bun-landing/react-dom-server.bun.production.min.js2082
-rw-r--r--packages/bun-landing/ssr.tsx28
-rw-r--r--packages/bun-landing/tsconfig.json10
m---------src/bun.js/WebKit0
-rw-r--r--src/bun.js/bindings/ZigGlobalObject.cpp48
-rw-r--r--src/bun.js/bindings/ZigGlobalObject.h7
-rw-r--r--src/bun.js/event_loop.zig8
-rw-r--r--src/bun.js/fs.exports.js72
-rw-r--r--src/bun.js/javascript.zig5
-rw-r--r--src/bun.js/javascript_core_c_api.zig18
-rw-r--r--src/bun.js/webcore.zig36
m---------src/deps/uws0
-rw-r--r--src/feature_flags.zig2
-rw-r--r--src/js_printer.zig10
-rw-r--r--src/sourcemap/sourcemap.zig6
-rw-r--r--src/string_immutable.zig45
30 files changed, 3777 insertions, 81 deletions
diff --git a/Makefile b/Makefile
index 8458d68fe..d43aff416 100644
--- a/Makefile
+++ b/Makefile
@@ -43,7 +43,7 @@ RELEASE_BUN = $(PACKAGE_DIR)/bun
DEBUG_BIN = $(DEBUG_PACKAGE_DIR)/
DEBUG_BUN = $(DEBUG_BIN)/bun-debug
BUILD_ID = $(shell cat ./build-id)
-PACKAGE_JSON_VERSION = 0.0.$(BUILD_ID)
+PACKAGE_JSON_VERSION = 0.1.$(BUILD_ID)
BUN_BUILD_TAG = bun-v$(PACKAGE_JSON_VERSION)
BUN_RELEASE_BIN = $(PACKAGE_DIR)/bun
PRETTIER ?= $(shell which prettier || echo "./node_modules/.bin/prettier")
@@ -580,8 +580,8 @@ USOCKETS_SRC_DIR = $(BUN_DEPS_DIR)/uws/uSockets/src/
usockets:
rm -rf $(BUN_DEPS_DIR)/uws/uSockets/*.o $(BUN_DEPS_DIR)/uws/uSockets/**/*.o $(BUN_DEPS_DIR)/uws/uSockets/*.a $(BUN_DEPS_DIR)/uws/uSockets/*.bc
- cd $(USOCKETS_DIR) && $(CC) $(EMIT_LLVM_FOR_RELEASE) $(MACOS_MIN_FLAG) -fPIC $(CFLAGS) $(UWS_CC_FLAGS) -save-temps -I$(BUN_DEPS_DIR)/uws/uSockets/src $(UWS_LDFLAGS) -g $(DEFAULT_LINKER_FLAGS) $(PLATFORM_LINKER_FLAGS) $(OPTIMIZATION_LEVEL) -g -c $(wildcard $(USOCKETS_SRC_DIR)/*.c) $(wildcard $(USOCKETS_SRC_DIR)/**/*.c)
- cd $(USOCKETS_DIR) && $(CXX) $(EMIT_LLVM_FOR_RELEASE) $(MACOS_MIN_FLAG) -fPIC $(CXXFLAGS) $(UWS_CXX_FLAGS) -save-temps -I$(BUN_DEPS_DIR)/uws/uSockets/src $(UWS_LDFLAGS) -g $(DEFAULT_LINKER_FLAGS) $(PLATFORM_LINKER_FLAGS) $(OPTIMIZATION_LEVEL) -g -c $(wildcard $(USOCKETS_SRC_DIR)/*.cpp) $(wildcard $(USOCKETS_SRC_DIR)/**/*.cpp)
+ cd $(USOCKETS_DIR) && $(CC) -fno-builtin-malloc -fno-builtin-free -fno-builtin-realloc $(EMIT_LLVM_FOR_RELEASE) $(MACOS_MIN_FLAG) -fPIC $(CFLAGS) $(UWS_CC_FLAGS) -save-temps -I$(BUN_DEPS_DIR)/uws/uSockets/src $(UWS_LDFLAGS) -g $(DEFAULT_LINKER_FLAGS) $(PLATFORM_LINKER_FLAGS) $(OPTIMIZATION_LEVEL) -g -c $(wildcard $(USOCKETS_SRC_DIR)/*.c) $(wildcard $(USOCKETS_SRC_DIR)/**/*.c)
+ cd $(USOCKETS_DIR) && $(CXX) -fno-builtin-malloc -fno-builtin-free -fno-builtin-realloc $(EMIT_LLVM_FOR_RELEASE) $(MACOS_MIN_FLAG) -fPIC $(CXXFLAGS) $(UWS_CXX_FLAGS) -save-temps -I$(BUN_DEPS_DIR)/uws/uSockets/src $(UWS_LDFLAGS) -g $(DEFAULT_LINKER_FLAGS) $(PLATFORM_LINKER_FLAGS) $(OPTIMIZATION_LEVEL) -g -c $(wildcard $(USOCKETS_SRC_DIR)/*.cpp) $(wildcard $(USOCKETS_SRC_DIR)/**/*.cpp)
cd $(USOCKETS_DIR) && $(AR) rcvs $(BUN_DEPS_OUT_DIR)/libusockets.a *.bc
uws: usockets
$(CXX) $(BITCODE_OR_SECTIONS) $(EMIT_LLVM_FOR_RELEASE) -fPIC -I$(BUN_DEPS_DIR)/uws/uSockets/src $(CLANG_FLAGS) $(CFLAGS) $(UWS_CXX_FLAGS) $(UWS_LDFLAGS) $(PLATFORM_LINKER_FLAGS) -c -I$(BUN_DEPS_DIR) $(BUN_DEPS_OUT_DIR)/libusockets.a $(BUN_DEPS_DIR)/libuwsockets.cpp -o $(BUN_DEPS_OUT_DIR)/libuwsockets.o
@@ -729,7 +729,7 @@ MIMALLOC_OVERRIDE_FLAG ?=
bump:
- expr $(BUILD_ID) + 1 > build-id
+ expr 0.1.0 + 1 > build-id
identifier-cache:
@@ -1132,10 +1132,9 @@ mimalloc:
-DMI_OSX_INTERPOSE=OFF \
-DMI_BUILD_OBJECT=ON \
-DMI_USE_CXX=ON \
- -DMI_OVERRIDE=ON \
+ -DMI_OVERRIDE=OFF \
+ -DMI_OSX_ZONE=OFF \
-DCMAKE_C_FLAGS="$(CFLAGS)" \
- -DCMAKE_CXX_FLAGS="$(CFLAGS) -fno-exceptions -fno-rtti" \
- ${MIMALLOC_OVERRIDE_FLAG} \
.\
&& make -j $(CPUS);
cp $(BUN_DEPS_DIR)/mimalloc/$(MIMALLOC_INPUT_PATH) $(BUN_DEPS_OUT_DIR)/$(MIMALLOC_FILE)
@@ -1224,7 +1223,7 @@ generate-sink:
EMIT_LLVM_FOR_RELEASE=-emit-llvm -flto="full"
EMIT_LLVM_FOR_DEBUG=
-EMIT_LLVM=$(EMIT_LLVM_FOR_DEBUG)
+EMIT_LLVM=$(EMIT_LLVM_FOR_RELEASE)
# We do this outside of build.zig for performance reasons
# The C compilation stuff with build.zig is really slow and we don't need to run this as often as the rest
diff --git a/README.md b/README.md
index 29dbb5a74..7787a4d36 100644
--- a/README.md
+++ b/README.md
@@ -212,6 +212,8 @@ Server-side render React:
// react-ssr.tsx
import { renderToReadableStream } from "react-dom/server";
+const dt = new Intl.DateTimeFormat();
+
export default {
port: 3000,
async fetch(request: Request) {
@@ -223,7 +225,7 @@ export default {
</head>
<body>
<h1>Hello from React!</h1>
- <p>The date is {new Intl.DateTimeFormat().format(new Date())}</p>
+ <p>The date is {dt.format(new Date())}</p>
</body>
</html>
)
@@ -504,13 +506,16 @@ bun.js == bun’s JavaScriptCore integration that executes JavaScript. Similar t
### Limitations & intended usage
-bun's bundler & transpiler are great for building websites &amp; webapps, but note that bun doesn't have a minifier or support tree-shaking yet. For production, you probably still want to use a tool like esbuild to do that.
+Today, bun is mostly focused on bun.js: the JavaScript runtime.
+
+While you could use bun's bundler & transpiler separately to build for browsers or node, bun doesn't have a minifier or support tree-shaking yet. For production browser builds, you probably should use a tool like esbuild or swc.
-Today, bun is mostly focused on compatibility with existing frameworks & tooling.
+Longer-term, bun intends to replace Node.js, Webpack, Babel, yarn, and PostCSS (in production).
-Ideally, most projects can use bun with their existing tooling while making few changes to their codebase. For frontend work, that means using bun in development, and continuing to use Webpack, esbuild, or another bundler in production. Using two bundlers might sound strange at first, but after all the production-only AST transforms, minification, and special development/production-only imported files...it’s not far from the status quo.
+### Upcoming breaking changes
-Longer-term, bun intends to replace Node.js, Webpack, Babel, and PostCSS (in production).
+- Bun's CLI flags will change to better support bun as a JavaScript runtime. They were chosen when bun was just a frontend development tool.
+- Bun's bundling format will change to accomdate production browser bundles and on-demand production bundling
## Configuration
diff --git a/build-id b/build-id
index 871727de1..573541ac9 100644
--- a/build-id
+++ b/build-id
@@ -1 +1 @@
-84
+0
diff --git a/packages/bun-landing/index.css b/packages/bun-landing/index.css
new file mode 100644
index 000000000..25a7d1382
--- /dev/null
+++ b/packages/bun-landing/index.css
@@ -0,0 +1,732 @@
+:root {
+ --black: #0b0a08;
+ --blue: #00a6e1;
+ --orange: #f89b4b;
+ --orange-light: #d4d3d2;
+
+ --monospace-font: "Fira Code", "Hack", "Source Code Pro", "SF Mono",
+ "Inconsolata", monospace;
+
+ --dark-border: rgba(200, 200, 25, 0.2);
+ --max-width: 1152px;
+
+ --system-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
+ Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
+
+ --horizontal-padding: 3rem;
+ --vertical-padding: 4rem;
+ --line-height: 1.4;
+}
+* {
+ box-sizing: border-box;
+}
+head,
+body,
+:root {
+ margin: 0 auto;
+ padding: 0;
+ font-family: var(--system-font);
+}
+
+body {
+ background-color: #fbf0df;
+}
+
+a {
+ color: inherit;
+ text-decoration: none;
+ transition: transform 0.1s linear;
+}
+a:visited {
+ color: inherit;
+}
+a:hover {
+ text-decoration: underline;
+ transform: scale(1.06, 1.06);
+ transform-origin: middle center;
+}
+#header-wrap,
+#pitch {
+ background-color: var(--black);
+ color: #fbf0df;
+ width: 100%;
+}
+
+#logo-link {
+ width: fit-content;
+ display: flex;
+ gap: 24px;
+ align-items: center;
+}
+main {
+ width: auto;
+
+ margin: 0 auto;
+ max-width: var(--max-width);
+ display: grid;
+ grid-template-columns: auto auto;
+}
+
+main,
+header,
+#explain-section {
+ margin: 0 auto;
+ max-width: var(--max-width);
+ padding: 0 var(--horizontal-padding);
+}
+
+#cards-wrap,
+#usecases,
+main,
+header {
+ padding: var(--vertical-padding) var(--horizontal-padding);
+}
+
+#pitch-content {
+ max-width: 600px;
+}
+
+.tagline {
+ margin-top: 0;
+ line-height: 1;
+ font-size: 36pt;
+}
+
+.subtitle {
+ font-size: 1.2rem;
+}
+nav {
+ white-space: nowrap;
+ display: flex;
+ gap: 2rem;
+ list-style: none;
+}
+
+.NavText {
+ color: #fbf0df;
+ display: block;
+ font-weight: 500;
+ font-size: 1.2rem;
+}
+
+#HeaderInstallButton {
+ margin-left: 2.4rem;
+}
+
+#pitch main {
+ gap: 2rem;
+}
+
+#logo {
+ max-width: 70px;
+ margin: auto 0;
+}
+
+#logo-text {
+ max-width: 96px;
+}
+
+header {
+ display: grid;
+ grid-template-columns: auto max-content min-content;
+ background-color: var(--black);
+ padding: 1.5rem 3rem;
+ align-items: center;
+ color: white;
+}
+
+#HeaderInstallButton:hover {
+ cursor: pointer;
+ transform: scale(1.06);
+}
+#HeaderInstallButton {
+ transition: transform 0.1s linear;
+ background: #00a6e1;
+ padding: 8px 16px;
+ border-radius: 100px;
+ color: black;
+ font-weight: 500;
+}
+
+.InstallBox {
+ margin-top: 2rem;
+ background: #15140e;
+ padding: 24px 24px;
+ border-radius: 24px;
+}
+
+#install-label-heading {
+ font-size: 1.4rem;
+ margin-bottom: 1rem;
+ font-weight: 500;
+ font-weight: 500;
+}
+
+#install-label-subtitle {
+ font-size: 0.9rem;
+ color: var(--orange-light);
+}
+
+.unselectable {
+ user-select: none;
+ -webkit-user-select: none;
+ -webkit-user-drag: none;
+ -moz-user-select: none;
+}
+
+#usecases-section {
+ background: linear-gradient(12deg, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.2)),
+ conic-gradient(
+ from 6.27deg at 46.95% 50.05%,
+ #ff8181 0deg,
+ #e5f067 75deg,
+ #6dd9ba 155.62deg,
+ #67f0ae 168.75deg,
+ #8b67f0 243.75deg,
+ #f067e2 300deg,
+ #e967e3 334.49deg,
+ #f06767 348.9deg,
+ #ff8181 360deg
+ );
+ color: white;
+ font-family: var(--monospace-font);
+ contain: paint;
+
+ font-size: 24pt;
+ font-weight: bold;
+}
+
+#usecases-section {
+ padding: 0;
+ margin: 0;
+}
+
+#usecases {
+ padding-top: 1rem;
+ padding-bottom: 1rem;
+}
+
+#usecases-section h1 {
+ background: linear-gradient(90deg, #ff0000 0%, #faff00 50.52%, #0500ff 100%);
+ -webkit-background-clip: text;
+ -webkit-text-fill-color: transparent;
+ background-clip: text;
+ text-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
+ font-family: Helvetica;
+ margin: 0;
+ padding: 0;
+}
+
+#code-box {
+ background-color: rgb(37, 36, 32);
+ padding: 4px 16px;
+ position: relative;
+ border-radius: 8px;
+ text-align: center;
+ align-items: center;
+ border: 1px solid var(--orange);
+ margin-top: 1rem;
+ display: grid;
+ align-content: center;
+ white-space: nowrap;
+ margin-bottom: 1rem;
+}
+
+#code-box {
+ font-family: var(--monospace-font);
+ position: relative;
+}
+
+#curl:hover {
+ cursor: text;
+ pointer-events: auto;
+}
+
+#curl::before {
+ display: block;
+ content: "$";
+ color: var(--orange);
+ pointer-events: none;
+ width: 1ch;
+ height: 1ch;
+}
+
+#curl {
+ user-select: all;
+ -webkit-user-select: text;
+ pointer-events: auto;
+ white-space: nowrap;
+ cursor: text;
+ display: inline-flex;
+ padding: 12px 8px;
+ gap: 2ch;
+}
+
+#view-source-link {
+ color: var(--orange-light);
+}
+
+#code-box-copy {
+ position: absolute;
+ right: 16px;
+ top: 0;
+ bottom: 0;
+ height: 100%;
+
+ display: flex;
+ align-items: center;
+ z-index: 5;
+
+ color: var(--orange-light);
+ transition: transform 0.05s linear;
+ transition-property: color, transform;
+ transform-origin: center center;
+ cursor: pointer;
+}
+
+#code-box-copy:hover {
+ color: var(--blue);
+ transform: scale(1.06);
+}
+
+#code-box-copy:active {
+ transform: scale(1.12);
+}
+
+.Tabs {
+ display: grid;
+ grid-template-columns: repeat(3, 1fr);
+ margin-left: auto;
+ margin-right: auto;
+ justify-content: center;
+ align-items: center;
+ width: min-content;
+ white-space: nowrap;
+ gap: 2rem;
+}
+
+.Tab {
+ width: min-content;
+ font-family: var(--monospace-font);
+ text-align: center;
+ padding-bottom: 8px;
+ border-bottom: 1px solid #ccc;
+}
+
+.Tab--active {
+ border-bottom-color: aquamarine;
+}
+
+.BarGraph {
+ padding: 24px;
+ display: flex;
+ flex-direction: column;
+}
+
+.BarGraph-heading {
+ font-weight: 500;
+ font-size: 1.5rem;
+}
+
+.BarGraphList {
+ flex: 1;
+ position: relative;
+}
+.BarGraph,
+.ActiveTab,
+.Graphs {
+ height: auto;
+}
+
+.BarGraph-subheading {
+ font-size: 0.9rem;
+ color: rgb(135, 134, 134);
+}
+
+.BarGraphList {
+ margin-top: 1rem;
+ display: grid;
+ grid-template-columns: repeat(var(--count), 1fr);
+ font-variant-numeric: tabular-nums;
+ font-family: var(--monospace-font);
+ justify-content: center;
+ align-items: flex-start;
+ height: 100%;
+ background-color: #080808;
+}
+
+.BarGraphKey {
+ display: grid;
+ text-align: center;
+ margin-top: 1rem;
+ grid-template-columns: repeat(var(--count), 1fr);
+}
+
+.BarGraphBar {
+ --primary: 70px;
+ --opposite: 100%;
+}
+
+.BarGraph,
+.BarGraphBar-label,
+.BarGraphItem {
+ --level: calc(var(--amount) / 50000);
+ --inverse: calc(1 / var(--level));
+}
+
+.BarGraphBar {
+ margin: 0 auto;
+
+ width: var(--primary);
+ height: var(--opposite);
+
+ background-color: pink;
+ transform-origin: bottom center;
+ transform: scaleY(var(--level));
+ position: relative;
+}
+
+.BarGraphItem {
+ border-right: 1px dashed var(--dark-border);
+ border-top: 1px dashed var(--dark-border);
+ border-bottom: 1px dashed var(--dark-border);
+}
+
+.BarGraphItem--deno {
+ border-right-color: transparent;
+}
+
+.BarGraph--horizontal .BarGraphBar {
+ min-height: 200px;
+}
+
+.BarGraph--vertical .BarGraphBar {
+ max-width: 90%;
+}
+
+.BarGraphBar-label {
+ color: white;
+ font-variant-numeric: tabular-nums;
+ font-family: var(--monospace-font);
+ width: 100%;
+ text-align: center;
+
+ position: relative;
+}
+
+.CardContent {
+ position: relative;
+}
+
+.BarGraph--vertical .BarGraphBar-label {
+ transform: scaleX(var(--inverse));
+ bottom: 0;
+ right: 0;
+}
+
+.BarGraph--horizontal .BarGraphBar-label {
+ transform: scaleY(var(--inverse));
+ top: calc(-20px * var(--inverse));
+}
+
+.BarGraphItem--bun .BarGraphBar {
+ background-color: rgb(249, 241, 225);
+ box-shadow: inset 1px 1px 3px rgb(204, 198, 187);
+ background-image: url("/public/logo.png");
+ background-repeat: no-repeat;
+ background-size: 56px 48.8px;
+ background-position: 6px 20%;
+}
+
+.BarGraph--vertical .BarGraphItem--bun {
+ border-top-right-radius: 12px;
+ border-bottom-right-radius: 12px;
+}
+
+.BarGraph--horizontal .BarGraphItem--bun {
+ border-top-left-radius: 12px;
+ border-top-right-radius: 12px;
+}
+
+.BarGraph--vertical .BarGraphBar {
+ height: var(--primary);
+ width: var(--opposite);
+
+ transform: scaleX(var(--level));
+ transform-origin: bottom left;
+
+ max-height: 40px;
+ margin-top: 1rem;
+ margin-bottom: 1rem;
+}
+
+.BarGraph--vertical .BarGraphList,
+.BarGraph--vertical .BarGraphKey--vertical {
+ grid-template-columns: 1fr;
+ grid-template-rows: repeat(var(--count), 1fr);
+}
+
+.BarGraph--vertical .BarGraphList {
+ direction: rtl;
+}
+
+.BarGraphKeyItem-label {
+ color: white;
+}
+.BarGraphKeyItem-value {
+ color: #666;
+ margin-top: 0.5rem;
+}
+
+.DemphasizedLabel {
+ text-transform: uppercase;
+ white-space: nowrap;
+}
+
+#frameworks {
+ display: flex;
+}
+
+.FrameworksGroup {
+ display: grid;
+ grid-template-rows: auto 40px;
+ gap: 0.5rem;
+}
+
+.DemphasizedLabel {
+ color: #666;
+ font-weight: 300;
+}
+
+.FrameworksList {
+ display: grid;
+ grid-template-columns: repeat(2, 40px);
+ gap: 3.5rem;
+ align-items: center;
+}
+
+#cards {
+ display: grid;
+}
+
+#explain-section {
+}
+#explain ul {
+ font-size: 1.2rem;
+}
+
+#explain li {
+ margin-bottom: 1rem;
+ line-height: var(--line-height);
+}
+
+.Tag {
+ --background: rgba(31, 31, 132, 0.15);
+ background-color: var(--background);
+ border-radius: 8px;
+ padding: 3px 8px;
+ color: white;
+ text-decoration: none !important;
+ display: inline-block;
+ font-family: var(--monospace-font) !important;
+}
+
+.Tag:visited {
+ color: white;
+}
+
+.mono {
+ font-family: var(--monospace-font);
+}
+
+.Tag--Command {
+ --background: #111;
+ font-weight: medium;
+ color: rgb(163, 255, 133);
+}
+
+.Tag--Command:before {
+ content: "❯";
+ color: rgba(255, 255, 255, 0.35);
+ margin-top: auto;
+ margin-bottom: auto;
+ margin-right: 1ch;
+ margin-left: 0.5ch;
+ display: inline-block;
+ transform: translateY(-1px);
+}
+
+.Tag--WebAPI {
+ --background: #29b6f6;
+ color: white;
+ box-shadow: inset -1px -1px 3px rgb(231, 187, 73);
+}
+
+.Tag--NodeJS {
+ --background: rgb(130, 172, 108);
+}
+
+.Tag--TypeScript {
+ --background: rgb(69, 119, 192);
+}
+
+.Tag--React {
+ color: rgb(130, 216, 247);
+ --background: #333;
+}
+
+.Tag--React:before {
+ color: rgba(130, 216, 247, 0.5);
+ content: "<";
+}
+
+.Tag--React:after {
+ color: rgba(130, 216, 247, 0.5);
+ content: ">";
+}
+
+.Tag--Bun {
+ --background: #ff17ff;
+}
+
+ul,
+li {
+}
+
+.mono {
+ font-family: var(--monospace-font);
+ border-radius: 6px;
+ color: rgb(0, 103, 19);
+}
+
+@media (min-width: 931px) {
+ .InstallBox--mobile {
+ display: none;
+ }
+}
+
+@media (max-width: 930px) {
+ header {
+ padding: 24px 16px;
+ }
+ .InstallBox--desktop {
+ display: none;
+ }
+
+ #logo {
+ max-width: 48px;
+ }
+
+ :root {
+ --max-width: 100%;
+ --horizontal-padding: 16px;
+ --vertical-padding: 2rem;
+ --line-height: 1.6;
+ }
+
+ main {
+ grid-template-columns: auto;
+ grid-template-rows: auto auto auto;
+ }
+
+ #explain li {
+ line-height: var(--line-height);
+ margin-bottom: 1.5rem;
+ }
+
+ ul {
+ padding: 0;
+ list-style: none;
+ }
+
+ .Tabs {
+ margin-left: 0;
+ }
+
+ .Graphs,
+ .BarGraph,
+ .BarGraphList {
+ max-width: calc(100vw - (var(--horizontal-padding) * 2));
+ }
+
+ .BarGraph {
+ padding: 24px 0;
+ }
+
+ #pitch-content {
+ max-width: auto;
+ }
+
+ #pitch main {
+ gap: 1rem;
+ }
+
+ #install {
+ margin-top: 0;
+ }
+
+ .tagline {
+ font-size: 32pt;
+ }
+
+ #logo-text,
+ #HeaderInstallButton {
+ display: none;
+ }
+}
+
+.InstallBox--mobile {
+ padding: calc(var(--vertical-padding) * 1.5) var(--horizontal-padding);
+ margin: calc(-1 * var(--vertical-padding))
+ calc(-1 * var(--horizontal-padding));
+ box-sizing: content-box;
+ border-radius: 0;
+ max-width: calc(100vw - (var(--horizontal-padding) * 2));
+}
+
+@media (max-width: 599px) {
+ #code-box-copy {
+ display: none;
+ }
+
+ #code-box {
+ font-size: 0.8rem;
+ }
+}
+
+@media (max-width: 360px) {
+ .tagline {
+ font-size: 22pt;
+ }
+}
+
+#explain p {
+ line-height: var(--line-height);
+ font-size: 1.2rem;
+}
+
+#explain p a {
+ text-decoration: underline;
+}
+
+.Zig {
+ transform: translateY(15%);
+}
+
+.CodeBlock .shiki {
+ padding: 1rem;
+ border-radius: 8px;
+ font-family: var(--monospace-font);
+ font-size: 1rem;
+}
+
+.Identifier {
+ font-family: var(--monospace-font);
+ font-size: 1rem;
+ color: #50fa7b !important;
+ background-color: #282a36;
+ padding: 0.25rem;
+ border-radius: 8px;
+ text-decoration: none !important;
+ margin-right: 0.2rem;
+}
diff --git a/packages/bun-landing/package.json b/packages/bun-landing/package.json
new file mode 100644
index 000000000..e71b0db13
--- /dev/null
+++ b/packages/bun-landing/package.json
@@ -0,0 +1,9 @@
+{
+ "dependencies": {
+ "bun-livereload": "1.0.2",
+ "bun-types": "latest",
+ "react": "^18.2.0",
+ "react-dom": "^18.2.0",
+ "shiki": "^0.10.1"
+ }
+} \ No newline at end of file
diff --git a/packages/bun-landing/page.tsx b/packages/bun-landing/page.tsx
new file mode 100644
index 000000000..9162b5ef9
--- /dev/null
+++ b/packages/bun-landing/page.tsx
@@ -0,0 +1,511 @@
+import * as shiki from "shiki";
+
+globalThis._highlighter ||= await shiki.getHighlighter({
+ theme: "dracula",
+});
+
+const highlighter = globalThis._highlighter as shiki.Highlighter;
+
+const CodeBlock = ({ children, lang = "js" }) => {
+ const html = highlighter.codeToHtml(children.trim(), { lang });
+ return (
+ <div className="CodeBlock" dangerouslySetInnerHTML={{ __html: html }} />
+ );
+};
+
+const Command = ({ children, href, Tag = href ? "a" : "span" }) => (
+ <Tag target="_blank" href={href} className="Tag Tag--Command">
+ {children}
+ </Tag>
+);
+const WebAPI = ({ children, href, Tag = href ? "a" : "span" }) => (
+ <Tag target="_blank" href={href} className="Tag Tag--WebAPI">
+ {children}
+ </Tag>
+);
+const NodeJS = ({ children, href, Tag = href ? "a" : "span" }) => (
+ <Tag target="_blank" href={href} className="Tag Tag--NodeJS">
+ {children}
+ </Tag>
+);
+const TypeScript = ({ children, href, Tag = href ? "a" : "span" }) => (
+ <Tag target="_blank" href={href} className="Tag Tag--TypeScript">
+ {children}
+ </Tag>
+);
+const React = ({ children, href, Tag = href ? "a" : "span" }) => (
+ <Tag target="_blank" className="Tag Tag--React">
+ {children}
+ </Tag>
+);
+
+const Bun = ({ children, href, Tag = href ? "a" : "span" }) => (
+ <Tag target="_blank" href={href} className="Tag Tag--Bun">
+ {children}
+ </Tag>
+);
+
+const Zig = ({}) => (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ height="1.2rem"
+ className="Zig"
+ viewBox="0 0 400 140"
+ >
+ <g fill="#F7A41D">
+ <g>
+ <polygon points="46,22 28,44 19,30" />
+ <polygon
+ points="46,22 33,33 28,44 22,44 22,95 31,95 20,100 12,117 0,117 0,22"
+ shape-rendering="crispEdges"
+ />
+ <polygon points="31,95 12,117 4,106" />
+ </g>
+ <g>
+ <polygon points="56,22 62,36 37,44" />
+ <polygon
+ points="56,22 111,22 111,44 37,44 56,32"
+ shape-rendering="crispEdges"
+ />
+ <polygon points="116,95 97,117 90,104" />
+ <polygon
+ points="116,95 100,104 97,117 42,117 42,95"
+ shape-rendering="crispEdges"
+ />
+ <polygon points="150,0 52,117 3,140 101,22" />
+ </g>
+ <g>
+ <polygon points="141,22 140,40 122,45" />
+ <polygon
+ points="153,22 153,117 106,117 120,105 125,95 131,95 131,45 122,45 132,36 141,22"
+ shape-rendering="crispEdges"
+ />
+ <polygon points="125,95 130,110 106,117" />
+ </g>
+ </g>
+ <g fill="#121212">
+ <g>
+ <polygon
+ points="260,22 260,37 229,40 177,40 177,22"
+ shape-rendering="crispEdges"
+ />
+ <polygon points="260,37 207,99 207,103 176,103 229,40 229,37" />
+ <polygon
+ points="261,99 261,117 176,117 176,103 206,99"
+ shape-rendering="crispEdges"
+ />
+ </g>
+ <rect
+ x="272"
+ y="22"
+ shape-rendering="crispEdges"
+ width="22"
+ height="95"
+ />
+ <g>
+ <polygon
+ points="394,67 394,106 376,106 376,81 360,70 346,67"
+ shape-rendering="crispEdges"
+ />
+ <polygon points="360,68 376,81 346,67" />
+ <path
+ d="M394,106c-10.2,7.3-24,12-37.7,12c-29,0-51.1-20.8-51.1-48.3c0-27.3,22.5-48.1,52-48.1
+ c14.3,0,29.2,5.5,38.9,14l-13,15c-7.1-6.3-16.8-10-25.9-10c-17,0-30.2,12.9-30.2,29.5c0,16.8,13.3,29.6,30.3,29.6
+ c5.7,0,12.8-2.3,19-5.5L394,106z"
+ />
+ </g>
+ </g>
+ </svg>
+);
+
+const InstallBox = ({ desktop = false }) => (
+ <div
+ className={
+ "InstallBox " + (desktop ? "InstallBox--desktop" : "InstallBox--mobile")
+ }
+ id="install"
+ >
+ <div id="install-label">
+ <div className="unselectable" id="install-label-heading">
+ Install Bun CLI v0.1.0 (beta)
+ </div>
+ <div className="unselectable" id="install-label-subtitle">
+ macOS x64 &amp; Silicon, Linux x64, Windows Subsystem for Linux
+ </div>
+ </div>
+ <div id="code-box">
+ <div id="curl">curl https://bun.sh/install | bash</div>
+ <div className="unselectable" id="code-box-copy">
+ copy
+ </div>
+ </div>
+ <a
+ className="unselectable"
+ id="view-source-link"
+ target="_blank"
+ href="https://bun.sh/install"
+ >
+ Show script source
+ </a>
+ </div>
+);
+
+export default () => (
+ <html>
+ <head>
+ <link rel="stylesheet" href="/index.css" />
+ <script type="module" src="/index.js"></script>
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ </head>
+
+ <body>
+ <div id="header-wrap">
+ <header>
+ <a href="/" id="logo-link">
+ <img src="/public/logo@2x.png" alt="Bun" id="logo" />
+ <img src="/public/Bun@2x.png" alt="Bun" id="logo-text" />
+ </a>
+
+ <nav className="Navigation">
+ <li>
+ <a className="NavText" href="/docs">
+ Docs
+ </a>
+ </li>
+ <li>
+ <a className="NavText" href="/discord">
+ Discord
+ </a>
+ </li>
+ <li>
+ <a className="NavText" href="/github">
+ GitHub
+ </a>
+ </li>
+ </nav>
+ <div id="HeaderInstallButton">Install</div>
+ </header>
+ </div>
+ <div id="pitch">
+ <main>
+ <div id="pitch-content">
+ <h1 className="tagline">
+ Bun is a fast all-in-one JavaScript runtime
+ </h1>
+ <p className="subtitle">
+ Bundle, transpile, install and run JavaScript &amp; TypeScript
+ projects &mdash; all in Bun. Bun is a new JavaScript runtime with
+ a native bundler, transpiler, task runner and npm client built-in.
+ </p>
+
+ <InstallBox desktop />
+ </div>
+ <div className="Graphs">
+ <div className="Tabs">
+ <div className="Tab Tab--active">Bun.serve</div>
+ <div className="Tab">bun:sqlite</div>
+ <div className="Tab">bun:ffi</div>
+ </div>
+ <div className="ActiveTab">
+ <div className="BarGraph BarGraph--horizontal BarGraph--dark">
+ <div className="BarGraph-heading">HTTP requests per second</div>
+ <div className="BarGraph-subheading">
+ Serving a 47 KB file * Bigger is better
+ </div>
+
+ <div style={{ "--count": 3 }} className="BarGraphList">
+ <div
+ className="BarGraphItem BarGraphItem--bun"
+ style={{ "--amount": 41829 }}
+ >
+ <div
+ style={{ "--amount": 41829 }}
+ title="41829 requests per second"
+ className="BarGraphBar"
+ >
+ <div
+ style={{ "--amount": 41829 }}
+ className="BarGraphBar-label"
+ >
+ 41,829
+ </div>
+ </div>
+ </div>
+
+ <div
+ style={{ "--amount": 2584 }}
+ className="BarGraphItem BarGraphItem--node"
+ >
+ <div
+ title="1,843 requests per second"
+ style={{ "--amount": 2584 }}
+ className="BarGraphBar"
+ >
+ <div
+ style={{ "--amount": 2584 }}
+ className="BarGraphBar-label"
+ >
+ 2,584
+ </div>
+ </div>
+ </div>
+
+ <div
+ className="BarGraphItem BarGraphItem--deno"
+ style={{ "--amount": 365 }}
+ >
+ <div
+ style={{ "--amount": 365 }}
+ title="365 requests per second"
+ className="BarGraphBar"
+ >
+ <div
+ style={{ "--amount": 365 }}
+ className="BarGraphBar-label"
+ >
+ 365
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div style={{ "--count": 3 }} className="BarGraphKey">
+ <div className="BarGraphKeyItem">
+ <div className="BarGraphKeyItem-label">bun.js</div>
+ <div className="BarGraphKeyItem-value">v0.0.78</div>
+ </div>
+
+ <div className="BarGraphKeyItem">
+ <div className="BarGraphKeyItem-label">node.js</div>
+ <div className="BarGraphKeyItem-value">v17.7.1</div>
+ </div>
+
+ <div className="BarGraphKeyItem">
+ <div className="BarGraphKeyItem-label">deno</div>
+ <div className="BarGraphKeyItem-value">v1.20.5</div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <InstallBox desktop={false} />
+ </main>
+ </div>
+ <section id="explain-section">
+ <div id="explain">
+ <h1>🐚 All the tools</h1>
+ <ul>
+ <li title="npm takes 160ms to run a script that does nothing">
+ <Command>bun run</Command> start &nbsp;
+ <code className="mono">package.json "scripts"</code> 30x faster
+ than <code className="mono">npm run</code>
+ </li>
+
+ <li title="JavaScript package managers are not using the fastest system calls">
+ <Command>bun install</Command> installs npm packages up to 100x
+ faster than npm, yarn or pnpm (when disk cached)
+ </li>
+ <li>
+ <Command>bun dev</Command> bun's frontend dev server starts in
+ about 15ms
+ </li>
+
+ <li>
+ <Command>bun bun</Command> bundle node_modules into a single file
+ (~1 million LOC/s input)
+ </li>
+
+ <li>
+ <Command>bun wiptest</Command> you've never seen a JavaScript test
+ runner this fast (or incomplete)
+ </li>
+ </ul>
+
+ <h1>🔋 Batteries included</h1>
+ <ul>
+ <li>
+ Web APIs like{" "}
+ <WebAPI href="https://developer.mozilla.org/en-US/docs/Web/API/fetch">
+ fetch
+ </WebAPI>
+ ,{" "}
+ <WebAPI href="https://developer.mozilla.org/en-US/docs/Web/API/WebSocket">
+ WebSocket
+ </WebAPI>
+ , and{" "}
+ <WebAPI href="https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream">
+ ReadableStream
+ </WebAPI>{" "}
+ are builtin
+ </li>
+ <li>
+ <NodeJS>node_modules</NodeJS> bun implements Node.js' module
+ resolution algorithm, so you can use npm packages in bun.js. ESM
+ and CommonJS are supported, but Bun internally uses ESM.
+ </li>
+ <li>
+ <React>JSX</React> <TypeScript>TypeScript</TypeScript> in bun.js,
+ every file is transpiled. TypeScript &amp; JSX just work.
+ </li>
+ <li>
+ <TypeScript>tsconfig.json</TypeScript> bun supports{" "}
+ <code className="">"paths"</code>, <code>"jsxImportSource"</code>
+ and more from tsconfig.json
+ </li>
+ <li>
+ <Bun>Bun.Transpiler</Bun> bun's JSX &amp; TypeScript transpiler is
+ available as an API in Bun.js
+ </li>
+ <li>
+ <Bun>Bun.write</Bun> use the fastest system calls available to
+ write, copy, pipe, send and clone files.
+ </li>
+ <li>
+ <Bun>.env</Bun> bun.js automatically loads environment variables
+ from .env files. No more{" "}
+ <code class="mono">require("dotenv").load()</code>
+ </li>
+ <li>
+ <Bun>bun:sqlite</Bun> fast SQLite3 client built-in
+ </li>
+ <li>
+ <NodeJS href="https://github.com/Jarred-Sumner/bun/issues/158">
+ Node-API
+ </NodeJS>{" "}
+ bun.js implements most of Node-API (NAPI). Many Node.js native
+ modules just work.
+ </li>
+ <li>
+ <Bun>bun:ffi</Bun> call native code from JavaScript with bun's
+ low-overhead foreign function interface
+ </li>
+ <li>
+ <NodeJS>node:fs</NodeJS> <NodeJS>node:path</NodeJS> bun.js
+ natively supports a growing list of Node.js core modules along
+ with globals like Buffer and process.
+ </li>
+ </ul>
+
+ <h1>Getting started</h1>
+
+ <p>
+ To install bun, run this{" "}
+ <a target="_blank" href="https://bun.sh/install">
+ install script
+ </a>{" "}
+ in your terminal. It downloads Bun from GitHub.
+ </p>
+
+ <CodeBlock lang="shell">{`
+curl https://bun.sh/install | bash
+ `}</CodeBlock>
+
+ <p>
+ {" "}
+ Bun's HTTP server is built on web standards like
+ <a
+ className="Identifier"
+ href="https://developer.mozilla.org/en-US/docs/Web/API/Request"
+ >
+ Request
+ </a>
+ and{" "}
+ <a
+ className="Identifier"
+ href="https://developer.mozilla.org/en-US/docs/Web/API/Response"
+ >
+ Response
+ </a>
+ </p>
+
+ <CodeBlock lang="js">{`
+// http.js
+export default {
+ port: 3000,
+ fetch(request) {
+ return new Response("Welcome to Bun!");
+ },
+};
+ `}</CodeBlock>
+
+ <p>Run it with bun:</p>
+
+ <CodeBlock lang="shell">{`bun run http.js`}</CodeBlock>
+
+ <p>
+ Then open{" "}
+ <a target="_blank" href="http://localhost:3000">
+ http://localhost:3000
+ </a>{" "}
+ in your browser
+ <br />
+ <br />
+ See{" "}
+ <a href="https://github.com/Jarred-Sumner/bun/tree/main/examples">
+ more examples
+ </a>{" "}
+ and check out <a href="/docs">the docs</a>. If you have any
+ questions or want help, join{" "}
+ <a href="https://bun.sh/discord">Bun's Discord</a>
+ </p>
+
+ <h1>How does Bun work?</h1>
+
+ <p>
+ Bun.js uses the{" "}
+ <a href="https://github.com/WebKit/WebKit/tree/main/Source/JavaScriptCore">
+ JavaScriptCore
+ </a>{" "}
+ engine, which tends{" "}
+ <a
+ target="blank"
+ href="https://twitter.com/jarredsumner/status/1499225725492076544"
+ >
+ to start
+ </a>{" "}
+ and perform a little faster than more traditional choices like V8.
+ Bun is written in{" "}
+ <a href="https://ziglang.org/">
+ <Zig></Zig>
+ </a>
+ , a low-level programming language with manual memory management.
+ <br />
+ <br />
+ Most of Bun is written from scratch including the JSX/TypeScript
+ transpiler, npm client, bundler, SQLite client, HTTP client,
+ WebSocket client and more.
+ </p>
+
+ <h1>Why is Bun fast?</h1>
+ <p>
+ An enourmous amount of time spent profiling, benchmarking and
+ optimizing things. The answer is different for every part of Bun,
+ but one general theme:{" "}
+ <a href="https://ziglang.org/">
+ <Zig></Zig>
+ </a>{" "}
+ 's low-level control over memory and lack of hidden control flow
+ makes it much simpler to write fast software.{" "}
+ <a href="https://github.com/sponsors/ziglang">
+ Sponsor the Zig Software Foundation
+ </a>
+ </p>
+
+ <h1>What is the license?</h1>
+ <p>
+ MIT License, excluding dependencies which have various licenses.
+ </p>
+
+ <h1>How do I see the source code?</h1>
+ <p>
+ Bun is on <a href="https://github.com/Jarred-Sumner/bun">GitHub</a>
+ </p>
+ </div>
+ </section>
+
+ <section id="explain-section">
+ <div id="explain"></div>
+ </section>
+ </body>
+ </html>
+);
diff --git a/packages/bun-landing/public/Bun.png b/packages/bun-landing/public/Bun.png
new file mode 100644
index 000000000..759b156a3
--- /dev/null
+++ b/packages/bun-landing/public/Bun.png
Binary files differ
diff --git a/packages/bun-landing/public/Bun@2x.png b/packages/bun-landing/public/Bun@2x.png
new file mode 100644
index 000000000..34072c3c6
--- /dev/null
+++ b/packages/bun-landing/public/Bun@2x.png
Binary files differ
diff --git a/packages/bun-landing/public/index.html b/packages/bun-landing/public/index.html
new file mode 100644
index 000000000..2f1d41e2b
--- /dev/null
+++ b/packages/bun-landing/public/index.html
@@ -0,0 +1,181 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <link rel="stylesheet" href="/index.css" />
+ <script type="module" src="/index.js"></script>
+ </head>
+
+ <body>
+ <div id="header-wrap">
+ <header>
+ <a href="/" id="logo-link">
+ <img src="/public/logo@2x.png" alt="Bun" id="logo" />
+ <img src="/public/Bun@2x.png" alt="Bun" id="logo-text" />
+ </a>
+
+ <nav class="Navigation">
+ <li>
+ <a class="NavText" href="/docs">Docs</a>
+ </li>
+ <li>
+ <a class="NavText" href="/discord">Discord</a>
+ </li>
+ <li>
+ <a class="NavText" href="/github">GitHub</a>
+ </li>
+ </nav>
+ <div id="HeaderInstallButton">Install</div>
+ </header>
+ </div>
+ <div id="pitch">
+ <main>
+ <div id="pitch-content">
+ <h1 class="tagline">Bun is a fast all-in-one JavaScript runtime</h1>
+ <p class="subtitle">
+ Bundle, transpile, install and run JavaScript & TypeScript projects
+ &mdash; all in Bun. Bun is a new JavaScript runtime with a native
+ bundler, transpiler, task runner and npm client built-in.
+ </p>
+
+ <div id="install">
+ <div id="install-label">
+ <div class="unselectable" id="install-label-heading">
+ Install Bun CLI v0.1.0 (beta)
+ </div>
+ <div class="unselectable" id="install-label-subtitle">
+ macOS x64 &amp; Silicon, Linux x64, Windows Subsystem for Linux
+ </div>
+ </div>
+ <div id="code-box">
+ <div id="curl">curl https://bun.sh/install | bash</div>
+ <div class="unselectable" id="code-box-copy">copy</div>
+ </div>
+ <a
+ class="unselectable"
+ id="view-source-link"
+ target="_blank"
+ href="https://bun.sh/install"
+ >Show script source</a
+ >
+ </div>
+ </div>
+ <div class="Graphs">
+ <div class="Tabs">
+ <div class="Tab Tab--active">Bun.serve</div>
+ <div class="Tab">bun:sqlite</div>
+ <div class="Tab">bun:ffi</div>
+ </div>
+ <div class="ActiveTab">
+ <div class="BarGraph BarGraph--horizontal BarGraph--dark">
+ <div class="BarGraph-heading">HTTP requests per second</div>
+ <div class="BarGraph-subheading">
+ Serving a 47 KB file * Bigger is better
+ </div>
+
+ <div style="--count: 3" class="BarGraphList">
+ <div
+ class="BarGraphItem BarGraphItem--bun"
+ style="--amount: 41829"
+ >
+ <div
+ style="--amount: 41829"
+ title="41829 requests per second"
+ class="BarGraphBar"
+ >
+ <div style="--amount: 41829" class="BarGraphBar-label">
+ 41,829
+ </div>
+ </div>
+ </div>
+
+ <div
+ style="--amount: 2584"
+ class="BarGraphItem BarGraphItem--node"
+ >
+ <div
+ title="1,843 requests per second"
+ style="--amount: 2584"
+ class="BarGraphBar"
+ >
+ <div style="--amount: 2584" class="BarGraphBar-label">
+ 2,584
+ </div>
+ </div>
+ </div>
+
+ <div
+ class="BarGraphItem BarGraphItem--deno"
+ style="--amount: 365"
+ >
+ <div
+ style="--amount: 365"
+ title="365 requests per second"
+ class="BarGraphBar"
+ >
+ <div style="--amount: 365" class="BarGraphBar-label">
+ 365
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div style="--count: 3" class="BarGraphKey">
+ <div class="BarGraphKeyItem">
+ <div class="BarGraphKeyItem-label">bun.js</div>
+ <div class="BarGraphKeyItem-value">v0.0.78</div>
+ </div>
+
+ <div class="BarGraphKeyItem">
+ <div class="BarGraphKeyItem-label">node.js</div>
+ <div class="BarGraphKeyItem-value">v17.7.1</div>
+ </div>
+
+ <div class="BarGraphKeyItem">
+ <div class="BarGraphKeyItem-label">deno</div>
+ <div class="BarGraphKeyItem-value">v1.20.5</div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <!-- <div id="frameworks">
+ <div class="FrameworksGroup">
+ <div class="DemphasizedLabel">Supported frameworks</div>
+ <div class="FrameworksList">
+ <a
+ referrerpolicy="no-referrer"
+ class="Framework"
+ href="https://nextjs.org"
+ target="_blank"
+ ><img
+ src="/public/next.svg"
+ height="40"
+ alt="Next.js"
+ decoding="async"
+ /></a>
+ <a
+ class="Framework"
+ referrerpolicy="no-referrer"
+ href="https://remix.run"
+ target="_blank"
+ >
+ <img
+ src="/public/remix.svg"
+ alt="Remix"
+ height="26"
+ decoding="async"
+ />
+ </a>
+ </div>
+ </div>
+ </div> -->
+ </main>
+ </div>
+ <section id="explain-section">
+ <div id="explain">
+ <h1>Getting started</h1>
+ </div>
+ </section>
+ </body>
+</html>
diff --git a/packages/bun-landing/public/logo.png b/packages/bun-landing/public/logo.png
new file mode 100644
index 000000000..ea9eb97dc
--- /dev/null
+++ b/packages/bun-landing/public/logo.png
Binary files differ
diff --git a/packages/bun-landing/public/logo@2x.png b/packages/bun-landing/public/logo@2x.png
new file mode 100644
index 000000000..d232243e5
--- /dev/null
+++ b/packages/bun-landing/public/logo@2x.png
Binary files differ
diff --git a/packages/bun-landing/public/next.svg b/packages/bun-landing/public/next.svg
new file mode 100644
index 000000000..c7ce692a7
--- /dev/null
+++ b/packages/bun-landing/public/next.svg
@@ -0,0 +1,12 @@
+<svg width="81" height="48" viewBox="0 0 81 48" fill="none" xmlns="http://www.w3.org/2000/svg">
+<g clip-path="url(#clip0_450_101)">
+<path d="M19.0273 12.6317H34.0839V13.8246H20.4075V22.8027H33.2684V23.9956H20.4075V33.8527H34.2408V35.0456H19.0273V12.6317ZM35.4328 12.6317H37.0325L44.1217 22.4888L51.3677 12.6317L61.2234 0.111023L45.0314 23.5247L53.3752 35.0456H51.7127L44.1217 24.5607L36.4993 35.0456H34.8681L43.2747 23.5247L35.4328 12.6317ZM53.9712 13.8246V12.6317H71.1295V13.8246H63.2247V35.0456H61.8446V13.8246H53.9712Z" fill="#4B5563"/>
+<path d="M0.19043 12.6317H1.91567L25.7057 48.1173L15.8744 35.0455L1.63335 14.3269L1.57062 35.0455H0.19043V12.6317Z" fill="#4B5563"/>
+<path d="M70.9896 33.4927C71.2749 33.4927 71.483 33.2749 71.483 32.9934C71.483 32.712 71.2749 32.4942 70.9896 32.4942C70.7076 32.4942 70.4961 32.712 70.4961 32.9934C70.4961 33.2749 70.7076 33.4927 70.9896 33.4927ZM72.3458 32.1792C72.3458 33.0102 72.9467 33.553 73.8228 33.553C74.756 33.553 75.32 32.9934 75.32 32.0218V28.6009H74.5681V32.0184C74.5681 32.5579 74.2961 32.846 73.8161 32.846C73.3864 32.846 73.0944 32.578 73.0843 32.1792H72.3458ZM76.3036 32.1357C76.3573 33.0001 77.079 33.553 78.1533 33.553C79.3013 33.553 80.0197 32.9733 80.0197 32.0486C80.0197 31.3215 79.6102 30.9194 78.6165 30.6882L78.0828 30.5576C77.4517 30.4102 77.1965 30.2125 77.1965 29.8674C77.1965 29.4318 77.5926 29.147 78.1868 29.147C78.7508 29.147 79.1402 29.4251 79.2107 29.8707H79.9425C79.8989 29.0565 79.1805 28.4836 78.1969 28.4836C77.1395 28.4836 76.4345 29.0565 76.4345 29.9176C76.4345 30.6279 76.834 31.0501 77.7101 31.2545L78.3345 31.4053C78.9757 31.556 79.2577 31.7772 79.2577 32.1457C79.2577 32.5746 78.8146 32.8862 78.2103 32.8862C77.5624 32.8862 77.1126 32.5947 77.0488 32.1357H76.3036Z" fill="#4B5563"/>
+</g>
+<defs>
+<clipPath id="clip0_450_101">
+<rect width="80" height="48" fill="white" transform="translate(0.112305)"/>
+</clipPath>
+</defs>
+</svg>
diff --git a/packages/bun-landing/public/remix.svg b/packages/bun-landing/public/remix.svg
new file mode 100644
index 000000000..86dd2f1e1
--- /dev/null
+++ b/packages/bun-landing/public/remix.svg
@@ -0,0 +1,4 @@
+<svg width="28" height="32" viewBox="0 0 28 32" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M26.1614 24.5649C25.9906 22.7985 25.4478 21.5069 24.5868 20.5805L24.5868 20.5805C23.8406 19.7774 22.8311 19.2222 21.5486 18.8828L21.5744 17.91C24.931 17.2093 27.3665 14.4499 27.3665 10.2733C27.3665 7.28162 26.3804 4.89134 24.436 3.24179C22.4825 1.58457 19.5125 0.633057 15.4674 0.633057H0.633789V6.31314H13.9593C15.8136 6.31314 17.2629 6.70825 18.2561 7.48269L18.2561 7.48271C19.2633 8.26814 19.7546 9.40713 19.7546 10.7783C19.7546 12.313 19.2701 13.4421 18.2416 14.1659C17.2423 14.8692 15.7906 15.1434 13.9593 15.1434H0.633789V20.9642H11.0186H13.5571C15.0067 20.9642 16.226 21.1624 17.1094 21.8999M26.1614 24.5649L17.1094 21.8999M26.1614 24.5649C26.4258 27.9461 26.4431 29.6469 26.4443 31.3669H18.7292C18.7318 31.1029 18.7367 30.8486 18.7418 30.5899L18.7419 30.5899V30.5833C18.7649 29.4127 18.7883 28.1848 18.5988 25.7252V25.7128L18.5966 25.6948M26.1614 24.5649L18.5966 25.6948M17.1094 21.8999C17.9993 22.6428 18.4667 23.8616 18.5966 25.6948M17.1094 21.8999L18.5966 25.6948" stroke="#4B5563"/>
+<path d="M10.6519 31.3669H0.633789V27.2145H9.20185C9.84554 27.2145 10.1855 27.4454 10.3765 27.7007C10.5814 27.9746 10.6519 28.3277 10.6519 28.6067V31.3669Z" stroke="#4B5563"/>
+</svg>
diff --git a/packages/bun-landing/public/ssr.tsx b/packages/bun-landing/public/ssr.tsx
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/packages/bun-landing/public/ssr.tsx
diff --git a/packages/bun-landing/react-dom-server.bun.production.min.js b/packages/bun-landing/react-dom-server.bun.production.min.js
new file mode 100644
index 000000000..8d0b12dc7
--- /dev/null
+++ b/packages/bun-landing/react-dom-server.bun.production.min.js
@@ -0,0 +1,2082 @@
+/**
+ * @license React
+ * react-dom-server.bun.production.min.js
+ *
+ * Copyright (c) Facebook, Inc. and its affiliates.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
+"use strict";
+var aa = require("react");
+function h(a) {
+ let b = "https://reactjs.org/docs/error-decoder.html?invariant=" + a;
+ for (let a = 1; a < arguments.length; a++)
+ b += "&args[]=" + encodeURIComponent(arguments[a]);
+ return (
+ `Minified React error #${a}; visit ${b} for the full message or ` +
+ "use the non-minified dev environment for full errors and additional helpful warnings."
+ );
+}
+const ba = new TextEncoder();
+function m(a) {
+ return ba.encode(a);
+}
+const q = Object.prototype.hasOwnProperty,
+ ca =
+ /^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,
+ ia = {},
+ ja = {};
+function ka(a) {
+ if (q.call(ja, a)) return !0;
+ if (q.call(ia, a)) return !1;
+ if (ca.test(a)) return (ja[a] = !0);
+ ia[a] = !0;
+ return !1;
+}
+function u(a, b, c, d, e, f, g) {
+ this.acceptsBooleans = 2 === b || 3 === b || 4 === b;
+ this.attributeName = d;
+ this.attributeNamespace = e;
+ this.mustUseProperty = c;
+ this.propertyName = a;
+ this.type = b;
+ this.sanitizeURL = f;
+ this.removeEmptyString = g;
+}
+const v = {},
+ la =
+ "children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(
+ " "
+ );
+la.push("innerText", "textContent");
+la.forEach((a) => {
+ v[a] = new u(a, 0, !1, a, null, !1, !1);
+});
+[
+ ["acceptCharset", "accept-charset"],
+ ["className", "class"],
+ ["htmlFor", "for"],
+ ["httpEquiv", "http-equiv"],
+].forEach(([a, b]) => {
+ v[a] = new u(a, 1, !1, b, null, !1, !1);
+});
+["contentEditable", "draggable", "spellCheck", "value"].forEach((a) => {
+ v[a] = new u(a, 2, !1, a.toLowerCase(), null, !1, !1);
+});
+[
+ "autoReverse",
+ "externalResourcesRequired",
+ "focusable",
+ "preserveAlpha",
+].forEach((a) => {
+ v[a] = new u(a, 2, !1, a, null, !1, !1);
+});
+"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope"
+ .split(" ")
+ .forEach((a) => {
+ v[a] = new u(a, 3, !1, a.toLowerCase(), null, !1, !1);
+ });
+["checked", "multiple", "muted", "selected"].forEach((a) => {
+ v[a] = new u(a, 3, !0, a, null, !1, !1);
+});
+["capture", "download"].forEach((a) => {
+ v[a] = new u(a, 4, !1, a, null, !1, !1);
+});
+["cols", "rows", "size", "span"].forEach((a) => {
+ v[a] = new u(a, 6, !1, a, null, !1, !1);
+});
+["rowSpan", "start"].forEach((a) => {
+ v[a] = new u(a, 5, !1, a.toLowerCase(), null, !1, !1);
+});
+const ma = /[\-:]([a-z])/g,
+ na = (a) => a[1].toUpperCase();
+"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height"
+ .split(" ")
+ .forEach((a) => {
+ const b = a.replace(ma, na);
+ v[b] = new u(b, 1, !1, a, null, !1, !1);
+ });
+"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type"
+ .split(" ")
+ .forEach((a) => {
+ const b = a.replace(ma, na);
+ v[b] = new u(b, 1, !1, a, "http://www.w3.org/1999/xlink", !1, !1);
+ });
+["xml:base", "xml:lang", "xml:space"].forEach((a) => {
+ const b = a.replace(ma, na);
+ v[b] = new u(b, 1, !1, a, "http://www.w3.org/XML/1998/namespace", !1, !1);
+});
+["tabIndex", "crossOrigin"].forEach((a) => {
+ v[a] = new u(a, 1, !1, a.toLowerCase(), null, !1, !1);
+});
+v.xlinkHref = new u(
+ "xlinkHref",
+ 1,
+ !1,
+ "xlink:href",
+ "http://www.w3.org/1999/xlink",
+ !0,
+ !1
+);
+["src", "href", "action", "formAction"].forEach((a) => {
+ v[a] = new u(a, 1, !1, a.toLowerCase(), null, !0, !0);
+});
+const w = {
+ animationIterationCount: !0,
+ aspectRatio: !0,
+ borderImageOutset: !0,
+ borderImageSlice: !0,
+ borderImageWidth: !0,
+ boxFlex: !0,
+ boxFlexGroup: !0,
+ boxOrdinalGroup: !0,
+ columnCount: !0,
+ columns: !0,
+ flex: !0,
+ flexGrow: !0,
+ flexPositive: !0,
+ flexShrink: !0,
+ flexNegative: !0,
+ flexOrder: !0,
+ gridArea: !0,
+ gridRow: !0,
+ gridRowEnd: !0,
+ gridRowSpan: !0,
+ gridRowStart: !0,
+ gridColumn: !0,
+ gridColumnEnd: !0,
+ gridColumnSpan: !0,
+ gridColumnStart: !0,
+ fontWeight: !0,
+ lineClamp: !0,
+ lineHeight: !0,
+ opacity: !0,
+ order: !0,
+ orphans: !0,
+ tabSize: !0,
+ widows: !0,
+ zIndex: !0,
+ zoom: !0,
+ fillOpacity: !0,
+ floodOpacity: !0,
+ stopOpacity: !0,
+ strokeDasharray: !0,
+ strokeDashoffset: !0,
+ strokeMiterlimit: !0,
+ strokeOpacity: !0,
+ strokeWidth: !0,
+ },
+ oa = ["Webkit", "ms", "Moz", "O"];
+Object.keys(w).forEach(function (a) {
+ oa.forEach(function (b) {
+ b = b + a.charAt(0).toUpperCase() + a.substring(1);
+ w[b] = w[a];
+ });
+});
+const pa = global.Bun.escapeHTML;
+function x(a) {
+ return "boolean" === typeof a || "number" === typeof a ? "" + a : pa(a);
+}
+const qa = /([A-Z])/g,
+ ra = /^ms-/,
+ sa = Array.isArray,
+ ta = m("<script>"),
+ ua = m("\x3c/script>"),
+ va = m('<script src="'),
+ wa = m('<script type="module" src="'),
+ xa = m('" async="">\x3c/script>'),
+ ya = /(<\/|<)(s)(cript)/gi,
+ za = (a, b, c, d) => `${b}${"s" === c ? "\\u0073" : "\\u0053"}${d}`;
+function Aa(a, b, c, d, e) {
+ a = void 0 === a ? "" : a;
+ b = void 0 === b ? ta : m('<script nonce="' + x(b) + '">');
+ const f = [];
+ void 0 !== c && f.push(b, ("" + c).replace(ya, za), ua);
+ if (void 0 !== d) for (c = 0; c < d.length; c++) f.push(va, x(d[c]), xa);
+ if (void 0 !== e) for (d = 0; d < e.length; d++) f.push(wa, x(e[d]), xa);
+ return {
+ bootstrapChunks: f,
+ startInlineScript: b,
+ placeholderPrefix: m(a + "P:"),
+ segmentPrefix: m(a + "S:"),
+ boundaryPrefix: a + "B:",
+ idPrefix: a,
+ nextSuspenseID: 0,
+ sentCompleteSegmentFunction: !1,
+ sentCompleteBoundaryFunction: !1,
+ sentClientRenderFunction: !1,
+ };
+}
+function Ba(a) {
+ return {
+ insertionMode:
+ "http://www.w3.org/2000/svg" === a
+ ? 2
+ : "http://www.w3.org/1998/Math/MathML" === a
+ ? 3
+ : 0,
+ selectedValue: null,
+ };
+}
+function Ca(a, b, c) {
+ switch (b) {
+ case "select":
+ return {
+ insertionMode: 1,
+ selectedValue: null != c.value ? c.value : c.defaultValue,
+ };
+ case "svg":
+ return { insertionMode: 2, selectedValue: null };
+ case "math":
+ return { insertionMode: 3, selectedValue: null };
+ case "foreignObject":
+ return { insertionMode: 1, selectedValue: null };
+ case "table":
+ return { insertionMode: 4, selectedValue: null };
+ case "thead":
+ case "tbody":
+ case "tfoot":
+ return { insertionMode: 5, selectedValue: null };
+ case "colgroup":
+ return { insertionMode: 7, selectedValue: null };
+ case "tr":
+ return { insertionMode: 6, selectedValue: null };
+ }
+ return 4 <= a.insertionMode || 0 === a.insertionMode
+ ? { insertionMode: 1, selectedValue: null }
+ : a;
+}
+const Da = m("\x3c!-- --\x3e");
+function Ea(a, b, c, d) {
+ if ("" === b) return d;
+ d && a.push(Da);
+ a.push(x(b));
+ return !0;
+}
+const Fa = new Map(),
+ Ga = m(' style="'),
+ Ha = m(":"),
+ Ia = m(";");
+function Ja(a, b, c) {
+ if ("object" !== typeof c) throw Error(h(62));
+ b = !0;
+ for (const g in c)
+ if (q.call(c, g)) {
+ var d = c[g];
+ if (null != d && "boolean" !== typeof d && "" !== d) {
+ var e = void 0;
+ if (0 === g.indexOf("--")) (e = x(g)), (d = x(("" + d).trim()));
+ else {
+ e = g;
+ var f = Fa.get(e);
+ void 0 !== f
+ ? (e = f)
+ : ((f = m(
+ x(e.replace(qa, "-$1").toLowerCase().replace(ra, "-ms-"))
+ )),
+ Fa.set(e, f),
+ (e = f));
+ d =
+ "number" === typeof d
+ ? 0 === d || q.call(w, g)
+ ? "" + d
+ : d + "px"
+ : x(("" + d).trim());
+ }
+ b ? ((b = !1), a.push(Ga, e, Ha, d)) : a.push(Ia, e, Ha, d);
+ }
+ }
+ b || a.push(y);
+}
+const z = m(" "),
+ A = m('="'),
+ y = m('"'),
+ Ka = m('=""');
+function B(a, b, c, d) {
+ switch (c) {
+ case "style":
+ Ja(a, b, d);
+ return;
+ case "defaultValue":
+ case "defaultChecked":
+ case "innerHTML":
+ case "suppressContentEditableWarning":
+ case "suppressHydrationWarning":
+ return;
+ }
+ if (
+ !(2 < c.length) ||
+ ("o" !== c[0] && "O" !== c[0]) ||
+ ("n" !== c[1] && "N" !== c[1])
+ )
+ if (((b = v.hasOwnProperty(c) ? v[c] : null), null !== b)) {
+ switch (typeof d) {
+ case "function":
+ case "symbol":
+ return;
+ case "boolean":
+ if (!b.acceptsBooleans) return;
+ }
+ c = b.attributeName;
+ switch (b.type) {
+ case 3:
+ d && a.push(z, c, Ka);
+ break;
+ case 4:
+ !0 === d ? a.push(z, c, Ka) : !1 !== d && a.push(z, c, A, x(d), y);
+ break;
+ case 5:
+ isNaN(d) || a.push(z, c, A, x(d), y);
+ break;
+ case 6:
+ !isNaN(d) && 1 <= d && a.push(z, c, A, x(d), y);
+ break;
+ default:
+ b.sanitizeURL && (d = "" + d), a.push(z, c, A, x(d), y);
+ }
+ } else if (ka(c)) {
+ switch (typeof d) {
+ case "function":
+ case "symbol":
+ return;
+ case "boolean":
+ if (
+ ((b = c.toLowerCase().slice(0, 5)), "data-" !== b && "aria-" !== b)
+ )
+ return;
+ }
+ a.push(z, c, A, x(d), y);
+ }
+}
+const C = m(">"),
+ La = m("/>");
+function D(a, b, c) {
+ if (null != b) {
+ if (null != c) throw Error(h(60));
+ if ("object" !== typeof b || !("__html" in b)) throw Error(h(61));
+ b = b.__html;
+ null !== b && void 0 !== b && a.push("" + b);
+ }
+}
+function Ma(a) {
+ let b = "";
+ aa.Children.forEach(a, function (a) {
+ null != a && (b += a);
+ });
+ return b;
+}
+const Na = m(' selected=""');
+function Oa(a, b, c, d) {
+ a.push(E(c));
+ let e = (c = null);
+ for (const f in b)
+ if (q.call(b, f)) {
+ const g = b[f];
+ if (null != g)
+ switch (f) {
+ case "children":
+ c = g;
+ break;
+ case "dangerouslySetInnerHTML":
+ e = g;
+ break;
+ default:
+ B(a, d, f, g);
+ }
+ }
+ a.push(C);
+ D(a, e, c);
+ return "string" === typeof c ? (a.push(x(c)), null) : c;
+}
+const Pa = m("\n"),
+ Ra = /^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,
+ Sa = new Map();
+function E(a) {
+ let b = Sa.get(a);
+ if (void 0 === b) {
+ if (!Ra.test(a)) throw Error(h(65, a));
+ b = m("<" + a);
+ Sa.set(a, b);
+ }
+ return b;
+}
+const Ta = m("<!DOCTYPE html>");
+function Ua(a, b, c, d, e) {
+ switch (b) {
+ case "select":
+ a.push(E("select"));
+ var f = null,
+ g = null;
+ for (var l in c)
+ if (q.call(c, l)) {
+ var k = c[l];
+ if (null != k)
+ switch (l) {
+ case "children":
+ f = k;
+ break;
+ case "dangerouslySetInnerHTML":
+ g = k;
+ break;
+ case "defaultValue":
+ case "value":
+ break;
+ default:
+ B(a, d, l, k);
+ }
+ }
+ a.push(C);
+ D(a, g, f);
+ return (a = f);
+ case "option":
+ g = e.selectedValue;
+ a.push(E("option"));
+ var n = (k = null),
+ r = null;
+ l = null;
+ for (f in c)
+ if (q.call(c, f)) {
+ var t = c[f];
+ if (null != t)
+ switch (f) {
+ case "children":
+ k = t;
+ break;
+ case "selected":
+ r = t;
+ break;
+ case "dangerouslySetInnerHTML":
+ l = t;
+ break;
+ case "value":
+ n = t;
+ default:
+ B(a, d, f, t);
+ }
+ }
+ if (null != g)
+ if (((c = null !== n ? "" + n : Ma(k)), sa(g)))
+ for (d = 0; d < g.length; d++) {
+ if ("" + g[d] === c) {
+ a.push(Na);
+ break;
+ }
+ }
+ else "" + g === c && a.push(Na);
+ else r && a.push(Na);
+ a.push(C);
+ D(a, l, k);
+ return (a = k);
+ case "textarea":
+ a.push(E("textarea"));
+ l = g = f = null;
+ for (k in c)
+ if (q.call(c, k) && ((n = c[k]), null != n))
+ switch (k) {
+ case "children":
+ l = n;
+ break;
+ case "value":
+ f = n;
+ break;
+ case "defaultValue":
+ g = n;
+ break;
+ case "dangerouslySetInnerHTML":
+ throw Error(h(91));
+ default:
+ B(a, d, k, n);
+ }
+ null === f && null !== g && (f = g);
+ a.push(C);
+ if (null != l) {
+ if (null != f) throw Error(h(92));
+ if (sa(l) && 1 < l.length) throw Error(h(93));
+ f = "" + l;
+ }
+ "string" === typeof f && "\n" === f[0] && a.push(Pa);
+ null !== f && a.push(x("" + f));
+ return null;
+ case "input":
+ a.push(E("input"));
+ n = l = k = f = null;
+ for (g in c)
+ if (q.call(c, g) && ((r = c[g]), null != r))
+ switch (g) {
+ case "children":
+ case "dangerouslySetInnerHTML":
+ throw Error(h(399, "input"));
+ case "defaultChecked":
+ n = r;
+ break;
+ case "defaultValue":
+ k = r;
+ break;
+ case "checked":
+ l = r;
+ break;
+ case "value":
+ f = r;
+ break;
+ default:
+ B(a, d, g, r);
+ }
+ null !== l ? B(a, d, "checked", l) : null !== n && B(a, d, "checked", n);
+ null !== f ? B(a, d, "value", f) : null !== k && B(a, d, "value", k);
+ a.push(La);
+ return null;
+ case "menuitem":
+ a.push(E("menuitem"));
+ for (const b in c)
+ if (q.call(c, b) && ((f = c[b]), null != f))
+ switch (b) {
+ case "children":
+ case "dangerouslySetInnerHTML":
+ throw Error(h(400));
+ default:
+ B(a, d, b, f);
+ }
+ a.push(C);
+ return null;
+ case "title":
+ a.push(E("title"));
+ f = null;
+ for (t in c)
+ if (q.call(c, t) && ((g = c[t]), null != g))
+ switch (t) {
+ case "children":
+ f = g;
+ break;
+ case "dangerouslySetInnerHTML":
+ throw Error(h(434));
+ default:
+ B(a, d, t, g);
+ }
+ a.push(C);
+ return (a = f);
+ case "listing":
+ case "pre":
+ a.push(E(b));
+ g = f = null;
+ for (n in c)
+ if (q.call(c, n) && ((k = c[n]), null != k))
+ switch (n) {
+ case "children":
+ f = k;
+ break;
+ case "dangerouslySetInnerHTML":
+ g = k;
+ break;
+ default:
+ B(a, d, n, k);
+ }
+ a.push(C);
+ if (null != g) {
+ if (null != f) throw Error(h(60));
+ if ("object" !== typeof g || !("__html" in g)) throw Error(h(61));
+ c = g.__html;
+ null !== c &&
+ void 0 !== c &&
+ ("string" === typeof c && 0 < c.length && "\n" === c[0]
+ ? a.push(Pa, c)
+ : a.push("" + c));
+ }
+ "string" === typeof f && "\n" === f[0] && a.push(Pa);
+ return (a = f);
+ case "area":
+ case "base":
+ case "br":
+ case "col":
+ case "embed":
+ case "hr":
+ case "img":
+ case "keygen":
+ case "link":
+ case "meta":
+ case "param":
+ case "source":
+ case "track":
+ case "wbr":
+ a.push(E(b));
+ for (const e in c)
+ if (q.call(c, e) && ((f = c[e]), null != f))
+ switch (e) {
+ case "children":
+ case "dangerouslySetInnerHTML":
+ throw Error(h(399, b));
+ default:
+ B(a, d, e, f);
+ }
+ a.push(La);
+ return null;
+ case "annotation-xml":
+ case "color-profile":
+ case "font-face":
+ case "font-face-src":
+ case "font-face-uri":
+ case "font-face-format":
+ case "font-face-name":
+ case "missing-glyph":
+ return Oa(a, c, b, d);
+ case "html":
+ return 0 === e.insertionMode && a.push(Ta), Oa(a, c, b, d);
+ default:
+ if (-1 === b.indexOf("-") && "string" !== typeof c.is)
+ return Oa(a, c, b, d);
+ a.push(E(b));
+ g = f = null;
+ for (r in c)
+ if (
+ q.call(c, r) &&
+ ((k = c[r]),
+ null != k &&
+ "function" !== typeof k &&
+ "object" !== typeof k &&
+ !1 !== k)
+ )
+ switch (
+ (!0 === k && (k = ""), "className" === r && (r = "class"), r)
+ ) {
+ case "children":
+ f = k;
+ break;
+ case "dangerouslySetInnerHTML":
+ g = k;
+ break;
+ case "style":
+ Ja(a, d, k);
+ break;
+ case "suppressContentEditableWarning":
+ case "suppressHydrationWarning":
+ break;
+ default:
+ ka(r) &&
+ "function" !== typeof k &&
+ "symbol" !== typeof k &&
+ a.push(z, r, A, x(k), y);
+ }
+ a.push(C);
+ D(a, g, f);
+ return (a = f);
+ }
+}
+const Va = m("</"),
+ Wa = m(">"),
+ Xa = m('<template id="'),
+ Ya = m('"></template>'),
+ Za = m("\x3c!--$--\x3e"),
+ $a = m('\x3c!--$?--\x3e<template id="'),
+ ab = m('"></template>'),
+ bb = m("\x3c!--$!--\x3e"),
+ cb = m("\x3c!--/$--\x3e"),
+ db = m("<template"),
+ eb = m('"'),
+ fb = m(' data-dgst="');
+m(' data-msg="');
+m(' data-stck="');
+const gb = m("></template>");
+function hb(a, b, c) {
+ a.write($a);
+ if (null === c) throw Error(h(395));
+ a.write(c);
+ return !!a.write(ab);
+}
+const ib = m('<div hidden id="'),
+ jb = m('">'),
+ kb = m("</div>"),
+ lb = m('<svg aria-hidden="true" style="display:none" id="'),
+ mb = m('">'),
+ nb = m("</svg>"),
+ ob = m('<math aria-hidden="true" style="display:none" id="'),
+ pb = m('">'),
+ qb = m("</math>"),
+ rb = m('<table hidden id="'),
+ sb = m('">'),
+ tb = m("</table>"),
+ ub = m('<table hidden><tbody id="'),
+ vb = m('">'),
+ xb = m("</tbody></table>"),
+ yb = m('<table hidden><tr id="'),
+ zb = m('">'),
+ Ab = m("</tr></table>"),
+ Bb = m('<table hidden><colgroup id="'),
+ Cb = m('">'),
+ Db = m("</colgroup></table>");
+function Eb(a, b, c, d) {
+ switch (c.insertionMode) {
+ case 0:
+ case 1:
+ return (
+ a.write(ib),
+ a.write(b.segmentPrefix),
+ (b = d.toString(16)),
+ a.write(b),
+ !!a.write(jb)
+ );
+ case 2:
+ return (
+ a.write(lb),
+ a.write(b.segmentPrefix),
+ (b = d.toString(16)),
+ a.write(b),
+ !!a.write(mb)
+ );
+ case 3:
+ return (
+ a.write(ob),
+ a.write(b.segmentPrefix),
+ (b = d.toString(16)),
+ a.write(b),
+ !!a.write(pb)
+ );
+ case 4:
+ return (
+ a.write(rb),
+ a.write(b.segmentPrefix),
+ (b = d.toString(16)),
+ a.write(b),
+ !!a.write(sb)
+ );
+ case 5:
+ return (
+ a.write(ub),
+ a.write(b.segmentPrefix),
+ (b = d.toString(16)),
+ a.write(b),
+ !!a.write(vb)
+ );
+ case 6:
+ return (
+ a.write(yb),
+ a.write(b.segmentPrefix),
+ (b = d.toString(16)),
+ a.write(b),
+ !!a.write(zb)
+ );
+ case 7:
+ return (
+ a.write(Bb),
+ a.write(b.segmentPrefix),
+ (b = d.toString(16)),
+ a.write(b),
+ !!a.write(Cb)
+ );
+ default:
+ throw Error(h(397));
+ }
+}
+function Fb(a, b) {
+ switch (b.insertionMode) {
+ case 0:
+ case 1:
+ return !!a.write(kb);
+ case 2:
+ return !!a.write(nb);
+ case 3:
+ return !!a.write(qb);
+ case 4:
+ return !!a.write(tb);
+ case 5:
+ return !!a.write(xb);
+ case 6:
+ return !!a.write(Ab);
+ case 7:
+ return !!a.write(Db);
+ default:
+ throw Error(h(397));
+ }
+}
+const Gb = m(
+ 'function $RS(a,b){a=document.getElementById(a);b=document.getElementById(b);for(a.parentNode.removeChild(a);a.firstChild;)b.parentNode.insertBefore(a.firstChild,b);b.parentNode.removeChild(b)};$RS("'
+ ),
+ Hb = m('$RS("'),
+ Ib = m('","'),
+ Jb = m('")\x3c/script>'),
+ Kb = m(
+ 'function $RC(a,b){a=document.getElementById(a);b=document.getElementById(b);b.parentNode.removeChild(b);if(a){a=a.previousSibling;var f=a.parentNode,c=a.nextSibling,e=0;do{if(c&&8===c.nodeType){var d=c.data;if("/$"===d)if(0===e)break;else e--;else"$"!==d&&"$?"!==d&&"$!"!==d||e++}d=c.nextSibling;f.removeChild(c);c=d}while(c);for(;b.firstChild;)f.insertBefore(b.firstChild,c);a.data="$";a._reactRetry&&a._reactRetry()}};$RC("'
+ ),
+ Lb = m('$RC("'),
+ Mb = m('","'),
+ Nb = m('")\x3c/script>'),
+ Ob = m(
+ 'function $RX(b,c,d,e){var a=document.getElementById(b);a&&(b=a.previousSibling,b.data="$!",a=a.dataset,c&&(a.dgst=c),d&&(a.msg=d),e&&(a.stck=e),b._reactRetry&&b._reactRetry())};$RX("'
+ ),
+ Pb = m('$RX("'),
+ Qb = m('"'),
+ Rb = m(")\x3c/script>"),
+ Sb = m(","),
+ Tb = /[<\u2028\u2029]/g;
+function Ub(a) {
+ return JSON.stringify(a).replace(Tb, (a) => {
+ switch (a) {
+ case "<":
+ return "\\u003c";
+ case "\u2028":
+ return "\\u2028";
+ case "\u2029":
+ return "\\u2029";
+ default:
+ throw Error(
+ "escapeJSStringsForInstructionScripts encountered a match it does not know how to replace. this means the match regex and the replacement characters are no longer in sync. This is a bug in React"
+ );
+ }
+ });
+}
+const Vb = Symbol.for("react.element"),
+ Wb = Symbol.for("react.portal"),
+ Xb = Symbol.for("react.fragment"),
+ Yb = Symbol.for("react.strict_mode"),
+ Zb = Symbol.for("react.profiler"),
+ $b = Symbol.for("react.provider"),
+ ac = Symbol.for("react.context"),
+ bc = Symbol.for("react.server_context"),
+ cc = Symbol.for("react.forward_ref"),
+ dc = Symbol.for("react.suspense"),
+ ec = Symbol.for("react.suspense_list"),
+ fc = Symbol.for("react.memo"),
+ gc = Symbol.for("react.lazy"),
+ hc = Symbol.for("react.scope"),
+ ic = Symbol.for("react.debug_trace_mode"),
+ jc = Symbol.for("react.legacy_hidden"),
+ kc = Symbol.for("react.cache"),
+ lc = Symbol.for("react.default_value"),
+ mc = Symbol.iterator;
+function nc(a) {
+ if (null == a) return null;
+ if ("function" === typeof a) return a.displayName || a.name || null;
+ if ("string" === typeof a) return a;
+ switch (a) {
+ case Xb:
+ return "Fragment";
+ case Wb:
+ return "Portal";
+ case Zb:
+ return "Profiler";
+ case Yb:
+ return "StrictMode";
+ case dc:
+ return "Suspense";
+ case ec:
+ return "SuspenseList";
+ case kc:
+ return "Cache";
+ }
+ if ("object" === typeof a)
+ switch (a.$$typeof) {
+ case ac:
+ return (a.displayName || "Context") + ".Consumer";
+ case $b:
+ return (a._context.displayName || "Context") + ".Provider";
+ case cc:
+ var b = a.render;
+ a = a.displayName;
+ a ||
+ ((a = b.displayName || b.name || ""),
+ (a = "" !== a ? `${"ForwardRef"}(${a})` : "ForwardRef"));
+ return a;
+ case fc:
+ return (
+ (b = a.displayName || null), null !== b ? b : nc(a.type) || "Memo"
+ );
+ case gc:
+ b = a._payload;
+ a = a._init;
+ try {
+ return nc(a(b));
+ } catch (c) {
+ break;
+ }
+ case bc:
+ return (a.displayName || a._globalName) + ".Provider";
+ }
+ return null;
+}
+const oc = {};
+function pc(a, b) {
+ {
+ a = a.contextTypes;
+ if (!a) return oc;
+ const c = {};
+ for (const d in a) c[d] = b[d];
+ return c;
+ }
+}
+let F = null;
+function G(a, b) {
+ if (a !== b) {
+ a.context._currentValue = a.parentValue;
+ a = a.parent;
+ const c = b.parent;
+ if (null === a) {
+ if (null !== c) throw Error(h(401));
+ } else {
+ if (null === c) throw Error(h(401));
+ G(a, c);
+ }
+ b.context._currentValue = b.value;
+ }
+}
+function qc(a) {
+ a.context._currentValue = a.parentValue;
+ a = a.parent;
+ null !== a && qc(a);
+}
+function rc(a) {
+ const b = a.parent;
+ null !== b && rc(b);
+ a.context._currentValue = a.value;
+}
+function sc(a, b) {
+ a.context._currentValue = a.parentValue;
+ a = a.parent;
+ if (null === a) throw Error(h(402));
+ a.depth === b.depth ? G(a, b) : sc(a, b);
+}
+function tc(a, b) {
+ const c = b.parent;
+ if (null === c) throw Error(h(402));
+ a.depth === c.depth ? G(a, c) : tc(a, c);
+ b.context._currentValue = b.value;
+}
+function H(a) {
+ const b = F;
+ b !== a &&
+ (null === b
+ ? rc(a)
+ : null === a
+ ? qc(b)
+ : b.depth === a.depth
+ ? G(b, a)
+ : b.depth > a.depth
+ ? sc(b, a)
+ : tc(b, a),
+ (F = a));
+}
+const I = Object.assign,
+ uc = {
+ isMounted() {
+ return !1;
+ },
+ enqueueSetState(a, b) {
+ a = a._reactInternals;
+ null !== a.queue && a.queue.push(b);
+ },
+ enqueueReplaceState(a, b) {
+ a = a._reactInternals;
+ a.replace = !0;
+ a.queue = [b];
+ },
+ enqueueForceUpdate() {},
+ };
+function vc(a, b, c, d) {
+ var e = void 0 !== a.state ? a.state : null;
+ a.updater = uc;
+ a.props = c;
+ a.state = e;
+ var f = { queue: [], replace: !1 };
+ a._reactInternals = f;
+ var g = b.contextType;
+ a.context = "object" === typeof g && null !== g ? g._currentValue : d;
+ g = b.getDerivedStateFromProps;
+ "function" === typeof g &&
+ ((g = g(c, e)),
+ (e = null === g || void 0 === g ? e : I({}, e, g)),
+ (a.state = e));
+ if (
+ "function" !== typeof b.getDerivedStateFromProps &&
+ "function" !== typeof a.getSnapshotBeforeUpdate &&
+ ("function" === typeof a.UNSAFE_componentWillMount ||
+ "function" === typeof a.componentWillMount)
+ )
+ if (
+ ((b = a.state),
+ "function" === typeof a.componentWillMount && a.componentWillMount(),
+ "function" === typeof a.UNSAFE_componentWillMount &&
+ a.UNSAFE_componentWillMount(),
+ b !== a.state && uc.enqueueReplaceState(a, a.state, null),
+ null !== f.queue && 0 < f.queue.length)
+ )
+ if (
+ ((b = f.queue),
+ (g = f.replace),
+ (f.queue = null),
+ (f.replace = !1),
+ g && 1 === b.length)
+ )
+ a.state = b[0];
+ else {
+ f = g ? b[0] : a.state;
+ e = !0;
+ for (g = g ? 1 : 0; g < b.length; g++) {
+ var l = b[g];
+ l = "function" === typeof l ? l.call(a, f, c, d) : l;
+ null != l && (e ? ((e = !1), (f = I({}, f, l))) : I(f, l));
+ }
+ a.state = f;
+ }
+ else f.queue = null;
+}
+const wc = { id: 1, overflow: "" };
+function xc(a, b, c) {
+ var d = a.id;
+ a = a.overflow;
+ var e = 32 - J(d) - 1;
+ d &= ~(1 << e);
+ c += 1;
+ var f = 32 - J(b) + e;
+ if (30 < f) {
+ const g = e - (e % 5);
+ f = (d & ((1 << g) - 1)).toString(32);
+ d >>= g;
+ e -= g;
+ return { id: (1 << (32 - J(b) + e)) | (c << e) | d, overflow: f + a };
+ }
+ return { id: (1 << f) | (c << e) | d, overflow: a };
+}
+const J = Math.clz32 ? Math.clz32 : yc,
+ zc = Math.log,
+ Ac = Math.LN2;
+function yc(a) {
+ a >>>= 0;
+ return 0 === a ? 32 : (31 - ((zc(a) / Ac) | 0)) | 0;
+}
+function Bc(a, b) {
+ return (a === b && (0 !== a || 1 / a === 1 / b)) || (a !== a && b !== b);
+}
+const Cc = "function" === typeof Object.is ? Object.is : Bc;
+let K = null,
+ Dc = null,
+ L = null,
+ M = null,
+ N = !1,
+ O = !1,
+ P = 0,
+ Q = null,
+ R = 0;
+function S() {
+ if (null === K) throw Error(h(321));
+ return K;
+}
+function Ec() {
+ if (0 < R) throw Error(h(312));
+ return { memoizedState: null, queue: null, next: null };
+}
+function Fc() {
+ null === M
+ ? null === L
+ ? ((N = !1), (L = M = Ec()))
+ : ((N = !0), (M = L))
+ : null === M.next
+ ? ((N = !1), (M = M.next = Ec()))
+ : ((N = !0), (M = M.next));
+ return M;
+}
+function Gc() {
+ Dc = K = null;
+ O = !1;
+ L = null;
+ R = 0;
+ M = Q = null;
+}
+function Hc(a, b) {
+ return "function" === typeof b ? b(a) : b;
+}
+function Ic(a, b, c) {
+ K = S();
+ M = Fc();
+ if (N) {
+ var d = M.queue;
+ b = d.dispatch;
+ if (null !== Q && ((c = Q.get(d)), void 0 !== c)) {
+ Q.delete(d);
+ d = M.memoizedState;
+ do (d = a(d, c.action)), (c = c.next);
+ while (null !== c);
+ M.memoizedState = d;
+ return [d, b];
+ }
+ return [M.memoizedState, b];
+ }
+ a = a === Hc ? ("function" === typeof b ? b() : b) : void 0 !== c ? c(b) : b;
+ M.memoizedState = a;
+ a = M.queue = { last: null, dispatch: null };
+ a = a.dispatch = Jc.bind(null, K, a);
+ return [M.memoizedState, a];
+}
+function Kc(a, b) {
+ K = S();
+ M = Fc();
+ b = void 0 === b ? null : b;
+ if (null !== M) {
+ const a = M.memoizedState;
+ if (null !== a && null !== b) {
+ a: {
+ var c = a[1];
+ if (null === c) c = !1;
+ else {
+ for (let a = 0; a < c.length && a < b.length; a++)
+ if (!Cc(b[a], c[a])) {
+ c = !1;
+ break a;
+ }
+ c = !0;
+ }
+ }
+ if (c) return a[0];
+ }
+ }
+ a = a();
+ M.memoizedState = [a, b];
+ return a;
+}
+function Jc(a, b, c) {
+ if (25 <= R) throw Error(h(301));
+ if (a === K)
+ if (
+ ((O = !0),
+ (a = { action: c, next: null }),
+ null === Q && (Q = new Map()),
+ (c = Q.get(b)),
+ void 0 === c)
+ )
+ Q.set(b, a);
+ else {
+ for (b = c; null !== b.next; ) b = b.next;
+ b.next = a;
+ }
+}
+function Lc() {
+ throw Error(h(394));
+}
+function Mc() {
+ throw Error(h(393));
+}
+function T() {}
+const Nc = {
+ readContext: function (a) {
+ return a._currentValue;
+ },
+ useContext: function (a) {
+ S();
+ return a._currentValue;
+ },
+ useMemo: Kc,
+ useReducer: Ic,
+ useRef: function (a) {
+ K = S();
+ M = Fc();
+ const b = M.memoizedState;
+ return null === b ? ((a = { current: a }), (M.memoizedState = a)) : b;
+ },
+ useState: function (a) {
+ return Ic(Hc, a);
+ },
+ useInsertionEffect: T,
+ useLayoutEffect: function () {},
+ useCallback: function (a, b) {
+ return Kc(() => a, b);
+ },
+ useImperativeHandle: T,
+ useEffect: T,
+ useDebugValue: T,
+ useDeferredValue: function (a) {
+ S();
+ return a;
+ },
+ useTransition: function () {
+ S();
+ return [!1, Lc];
+ },
+ useId: function () {
+ var a = Dc.treeContext;
+ var b = a.overflow;
+ a = a.id;
+ a = (a & ~(1 << (32 - J(a) - 1))).toString(32) + b;
+ const c = U;
+ if (null === c) throw Error(h(404));
+ b = P++;
+ a = ":" + c.idPrefix + "R" + a;
+ 0 < b && (a += "H" + b.toString(32));
+ return (b = a + ":");
+ },
+ useMutableSource: function (a, b) {
+ S();
+ return b(a._source);
+ },
+ useSyncExternalStore: function (a, b, c) {
+ if (void 0 === c) throw Error(h(407));
+ return c();
+ },
+ getCacheForType: function () {
+ throw Error(h(248));
+ },
+ useCacheRefresh: function () {
+ return Mc;
+ },
+};
+let U = null;
+const Oc =
+ aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentDispatcher;
+function Pc(a) {
+ console.error(a);
+ return null;
+}
+function V() {}
+function Qc(a, b, c, d, e, f, g, l, k) {
+ const n = [],
+ r = new Set();
+ b = {
+ destination: null,
+ responseState: b,
+ progressiveChunkSize: void 0 === d ? 12800 : d,
+ status: 0,
+ fatalError: null,
+ nextSegmentId: 0,
+ allPendingTasks: 0,
+ pendingRootTasks: 0,
+ completedRootSegment: null,
+ abortableTasks: r,
+ pingedTasks: n,
+ clientRenderedBoundaries: [],
+ completedBoundaries: [],
+ partialBoundaries: [],
+ onError: void 0 === e ? Pc : e,
+ onAllReady: void 0 === f ? V : f,
+ onShellReady: void 0 === g ? V : g,
+ onShellError: void 0 === l ? V : l,
+ onFatalError: void 0 === k ? V : k,
+ };
+ c = W(b, 0, null, c, !1, !1);
+ c.parentFlushed = !0;
+ a = Rc(b, a, null, c, r, oc, null, wc);
+ n.push(a);
+ return b;
+}
+function Sc(a, b) {
+ const c = a.pingedTasks;
+ c.push(b);
+ 1 === c.length && queueMicrotask(() => Tc(a));
+}
+function Rc(a, b, c, d, e, f, g, l) {
+ a.allPendingTasks++;
+ null === c ? a.pendingRootTasks++ : c.pendingTasks++;
+ const k = {
+ node: b,
+ ping: () => Sc(a, k),
+ blockedBoundary: c,
+ blockedSegment: d,
+ abortSet: e,
+ legacyContext: f,
+ context: g,
+ treeContext: l,
+ };
+ e.add(k);
+ return k;
+}
+function W(a, b, c, d, e, f) {
+ return {
+ status: 0,
+ id: -1,
+ index: b,
+ parentFlushed: !1,
+ chunks: [],
+ children: [],
+ formatContext: d,
+ boundary: c,
+ lastPushedText: e,
+ textEmbedded: f,
+ };
+}
+function X(a, b) {
+ a = a.onError(b);
+ if (null != a && "string" !== typeof a)
+ throw Error(
+ `onError returned something with a type other than "string". onError should return a string and may return null or undefined but must not return anything else. It received something of type "${typeof a}" instead`
+ );
+ return a;
+}
+function Y(a, b) {
+ var c = a.onShellError;
+ c(b);
+ c = a.onFatalError;
+ c(b);
+ null !== a.destination
+ ? ((a.status = 2), a.destination.close(b))
+ : ((a.status = 1), (a.fatalError = b));
+}
+function Uc(a, b, c, d, e) {
+ K = {};
+ Dc = b;
+ P = 0;
+ for (a = c(d, e); O; ) (O = !1), (P = 0), (R += 1), (M = null), (a = c(d, e));
+ Gc();
+ return a;
+}
+function Vc(a, b, c, d) {
+ const e = c.render();
+ var f = d.childContextTypes;
+ if (null !== f && void 0 !== f) {
+ const l = b.legacyContext;
+ var g = l;
+ if ("function" !== typeof c.getChildContext) d = g;
+ else {
+ c = c.getChildContext();
+ for (const a in c)
+ if (!(a in f)) throw Error(h(108, nc(d) || "Unknown", a));
+ d = { ...g, ...c };
+ }
+ b.legacyContext = d;
+ Z(a, b, e);
+ b.legacyContext = l;
+ } else Z(a, b, e);
+}
+function Wc(a, b) {
+ if (a && a.defaultProps) {
+ b = I({}, b);
+ a = a.defaultProps;
+ for (const c in a) void 0 === b[c] && (b[c] = a[c]);
+ return b;
+ }
+ return b;
+}
+function Xc(a, b, c, d, e) {
+ if ("function" === typeof c)
+ if (c.prototype && c.prototype.isReactComponent) {
+ e = pc(c, b.legacyContext);
+ var f = e;
+ var g = c.contextType;
+ f = new c(d, "object" === typeof g && null !== g ? g._currentValue : f);
+ vc(f, c, d, e);
+ Vc(a, b, f, c);
+ } else if (
+ ((f = pc(c, b.legacyContext)),
+ (e = Uc(a, b, c, d, f)),
+ (g = 0 !== P),
+ "object" === typeof e &&
+ null !== e &&
+ "function" === typeof e.render &&
+ void 0 === e.$$typeof)
+ )
+ vc(e, c, d, f), Vc(a, b, e, c);
+ else if (g) {
+ d = b.treeContext;
+ b.treeContext = xc(d, 1, 0);
+ try {
+ Z(a, b, e);
+ } finally {
+ b.treeContext = d;
+ }
+ } else Z(a, b, e);
+ else if ("string" === typeof c) {
+ e = b.blockedSegment;
+ f = Ua(e.chunks, c, d, a.responseState, e.formatContext);
+ e.lastPushedText = !1;
+ g = e.formatContext;
+ e.formatContext = Ca(g, c, d);
+ Yc(a, b, f);
+ e.formatContext = g;
+ switch (c) {
+ case "area":
+ case "base":
+ case "br":
+ case "col":
+ case "embed":
+ case "hr":
+ case "img":
+ case "input":
+ case "keygen":
+ case "link":
+ case "meta":
+ case "param":
+ case "source":
+ case "track":
+ case "wbr":
+ break;
+ default:
+ e.chunks.push(Va, c, Wa);
+ }
+ e.lastPushedText = !1;
+ } else {
+ switch (c) {
+ case jc:
+ case ic:
+ case Yb:
+ case Zb:
+ case Xb:
+ Z(a, b, d.children);
+ return;
+ case ec:
+ Z(a, b, d.children);
+ return;
+ case hc:
+ throw Error(h(343));
+ case dc:
+ a: {
+ c = b.blockedBoundary;
+ e = b.blockedSegment;
+ f = d.fallback;
+ d = d.children;
+ g = new Set();
+ const l = {
+ id: null,
+ rootSegmentID: -1,
+ parentFlushed: !1,
+ pendingTasks: 0,
+ forceClientRender: !1,
+ completedSegments: [],
+ byteSize: 0,
+ fallbackAbortableTasks: g,
+ errorDigest: null,
+ },
+ k = W(a, e.chunks.length, l, e.formatContext, !1, !1);
+ e.children.push(k);
+ e.lastPushedText = !1;
+ const n = W(a, 0, null, e.formatContext, !1, !1);
+ n.parentFlushed = !0;
+ b.blockedBoundary = l;
+ b.blockedSegment = n;
+ try {
+ if (
+ (Yc(a, b, d),
+ n.lastPushedText && n.textEmbedded && n.chunks.push(Da),
+ (n.status = 1),
+ Zc(l, n),
+ 0 === l.pendingTasks)
+ )
+ break a;
+ } catch (r) {
+ (n.status = 4),
+ (l.forceClientRender = !0),
+ (l.errorDigest = X(a, r));
+ } finally {
+ (b.blockedBoundary = c), (b.blockedSegment = e);
+ }
+ b = Rc(a, f, c, k, g, b.legacyContext, b.context, b.treeContext);
+ a.pingedTasks.push(b);
+ }
+ return;
+ }
+ if ("object" === typeof c && null !== c)
+ switch (c.$$typeof) {
+ case cc:
+ d = Uc(a, b, c.render, d, e);
+ if (0 !== P) {
+ c = b.treeContext;
+ b.treeContext = xc(c, 1, 0);
+ try {
+ Z(a, b, d);
+ } finally {
+ b.treeContext = c;
+ }
+ } else Z(a, b, d);
+ return;
+ case fc:
+ c = c.type;
+ d = Wc(c, d);
+ Xc(a, b, c, d, e);
+ return;
+ case $b:
+ e = d.children;
+ c = c._context;
+ d = d.value;
+ f = c._currentValue;
+ c._currentValue = d;
+ g = F;
+ F = d = {
+ parent: g,
+ depth: null === g ? 0 : g.depth + 1,
+ context: c,
+ parentValue: f,
+ value: d,
+ };
+ b.context = d;
+ Z(a, b, e);
+ a = F;
+ if (null === a) throw Error(h(403));
+ d = a.parentValue;
+ a.context._currentValue = d === lc ? a.context._defaultValue : d;
+ a = F = a.parent;
+ b.context = a;
+ return;
+ case ac:
+ d = d.children;
+ d = d(c._currentValue);
+ Z(a, b, d);
+ return;
+ case gc:
+ e = c._init;
+ c = e(c._payload);
+ d = Wc(c, d);
+ Xc(a, b, c, d, void 0);
+ return;
+ }
+ throw Error(h(130, null == c ? c : typeof c, ""));
+ }
+}
+function Z(a, b, c) {
+ b.node = c;
+ if ("object" === typeof c && null !== c) {
+ switch (c.$$typeof) {
+ case Vb:
+ Xc(a, b, c.type, c.props, c.ref);
+ return;
+ case Wb:
+ throw Error(h(257));
+ case gc:
+ var d = c._init;
+ c = d(c._payload);
+ Z(a, b, c);
+ return;
+ }
+ if (sa(c)) {
+ $c(a, b, c);
+ return;
+ }
+ null === c || "object" !== typeof c
+ ? (d = null)
+ : ((d = (mc && c[mc]) || c["@@iterator"]),
+ (d = "function" === typeof d ? d : null));
+ if (d && (d = d.call(c))) {
+ c = d.next();
+ if (!c.done) {
+ const e = [];
+ do e.push(c.value), (c = d.next());
+ while (!c.done);
+ $c(a, b, e);
+ }
+ return;
+ }
+ a = Object.prototype.toString.call(c);
+ throw Error(
+ h(
+ 31,
+ "[object Object]" === a
+ ? "object with keys {" + Object.keys(c).join(", ") + "}"
+ : a
+ )
+ );
+ }
+ "string" === typeof c
+ ? ((d = b.blockedSegment),
+ (d.lastPushedText = Ea(
+ b.blockedSegment.chunks,
+ c,
+ a.responseState,
+ d.lastPushedText
+ )))
+ : "number" === typeof c &&
+ ((d = b.blockedSegment),
+ (d.lastPushedText = Ea(
+ b.blockedSegment.chunks,
+ "" + c,
+ a.responseState,
+ d.lastPushedText
+ )));
+}
+function $c(a, b, c) {
+ const d = c.length;
+ for (let e = 0; e < d; e++) {
+ const f = b.treeContext;
+ b.treeContext = xc(f, d, e);
+ try {
+ Yc(a, b, c[e]);
+ } finally {
+ b.treeContext = f;
+ }
+ }
+}
+function Yc(a, b, c) {
+ const d = b.blockedSegment.formatContext,
+ e = b.legacyContext,
+ f = b.context;
+ try {
+ return Z(a, b, c);
+ } catch (g) {
+ if (
+ (Gc(),
+ "object" === typeof g && null !== g && "function" === typeof g.then)
+ ) {
+ {
+ c = g;
+ const d = b.blockedSegment,
+ e = W(
+ a,
+ d.chunks.length,
+ null,
+ d.formatContext,
+ d.lastPushedText,
+ !0
+ );
+ d.children.push(e);
+ d.lastPushedText = !1;
+ a = Rc(
+ a,
+ b.node,
+ b.blockedBoundary,
+ e,
+ b.abortSet,
+ b.legacyContext,
+ b.context,
+ b.treeContext
+ ).ping;
+ c.then(a, a);
+ }
+ b.blockedSegment.formatContext = d;
+ b.legacyContext = e;
+ b.context = f;
+ H(f);
+ } else
+ throw (
+ ((b.blockedSegment.formatContext = d),
+ (b.legacyContext = e),
+ (b.context = f),
+ H(f),
+ g)
+ );
+ }
+}
+function ad(a) {
+ const b = a.blockedBoundary;
+ a = a.blockedSegment;
+ a.status = 3;
+ bd(this, b, a);
+}
+function cd(a, b, c) {
+ var d = a.blockedBoundary;
+ a.blockedSegment.status = 3;
+ null === d
+ ? (b.allPendingTasks--,
+ 2 !== b.status &&
+ ((b.status = 2), null !== b.destination && b.destination.end()))
+ : (d.pendingTasks--,
+ d.forceClientRender ||
+ ((d.forceClientRender = !0),
+ (a = void 0 === c ? Error(h(432)) : c),
+ (d.errorDigest = b.onError(a)),
+ d.parentFlushed && b.clientRenderedBoundaries.push(d)),
+ d.fallbackAbortableTasks.forEach((a) => cd(a, b, c)),
+ d.fallbackAbortableTasks.clear(),
+ b.allPendingTasks--,
+ 0 === b.allPendingTasks && ((d = b.onAllReady), d()));
+}
+function Zc(a, b) {
+ if (
+ 0 === b.chunks.length &&
+ 1 === b.children.length &&
+ null === b.children[0].boundary
+ ) {
+ const c = b.children[0];
+ c.id = b.id;
+ c.parentFlushed = !0;
+ 1 === c.status && Zc(a, c);
+ } else a.completedSegments.push(b);
+}
+function bd(a, b, c) {
+ if (null === b) {
+ if (c.parentFlushed) {
+ if (null !== a.completedRootSegment) throw Error(h(389));
+ a.completedRootSegment = c;
+ }
+ a.pendingRootTasks--;
+ 0 === a.pendingRootTasks &&
+ ((a.onShellError = V), (b = a.onShellReady), b());
+ } else
+ b.pendingTasks--,
+ b.forceClientRender ||
+ (0 === b.pendingTasks
+ ? (c.parentFlushed && 1 === c.status && Zc(b, c),
+ b.parentFlushed && a.completedBoundaries.push(b),
+ b.fallbackAbortableTasks.forEach(ad, a),
+ b.fallbackAbortableTasks.clear())
+ : c.parentFlushed &&
+ 1 === c.status &&
+ (Zc(b, c),
+ 1 === b.completedSegments.length &&
+ b.parentFlushed &&
+ a.partialBoundaries.push(b)));
+ a.allPendingTasks--;
+ 0 === a.allPendingTasks && ((a = a.onAllReady), a());
+}
+function Tc(a) {
+ if (2 !== a.status) {
+ var b = F,
+ c = Oc.current;
+ Oc.current = Nc;
+ var d = U;
+ U = a.responseState;
+ try {
+ const b = a.pingedTasks;
+ let c;
+ for (c = 0; c < b.length; c++) {
+ {
+ var e = a,
+ f = b[c];
+ const d = f.blockedSegment;
+ if (0 === d.status) {
+ H(f.context);
+ try {
+ Z(e, f, f.node),
+ d.lastPushedText && d.textEmbedded && d.chunks.push(Da),
+ f.abortSet.delete(f),
+ (d.status = 1),
+ bd(e, f.blockedBoundary, d);
+ } catch (t) {
+ if (
+ (Gc(),
+ "object" === typeof t &&
+ null !== t &&
+ "function" === typeof t.then)
+ ) {
+ const a = f.ping;
+ t.then(a, a);
+ } else {
+ f.abortSet.delete(f);
+ d.status = 4;
+ {
+ var g = f.blockedBoundary,
+ l = t;
+ const a = X(e, l);
+ null === g
+ ? Y(e, l)
+ : (g.pendingTasks--,
+ g.forceClientRender ||
+ ((g.forceClientRender = !0),
+ (g.errorDigest = a),
+ g.parentFlushed && e.clientRenderedBoundaries.push(g)));
+ e.allPendingTasks--;
+ if (0 === e.allPendingTasks) {
+ const a = e.onAllReady;
+ a();
+ }
+ }
+ }
+ } finally {
+ }
+ }
+ }
+ }
+ b.splice(0, c);
+ null !== a.destination && dd(a, a.destination);
+ } catch (k) {
+ X(a, k), Y(a, k);
+ } finally {
+ (U = d), (Oc.current = c), c === Nc && H(b);
+ }
+ }
+}
+function ed(a, b, c) {
+ c.parentFlushed = !0;
+ switch (c.status) {
+ case 0:
+ var d = (c.id = a.nextSegmentId++);
+ c.lastPushedText = !1;
+ c.textEmbedded = !1;
+ a = a.responseState;
+ b.write(Xa);
+ b.write(a.placeholderPrefix);
+ a = d.toString(16);
+ b.write(a);
+ return (b = !!b.write(Ya));
+ case 1: {
+ c.status = 2;
+ var e = !0;
+ d = c.chunks;
+ let f = 0;
+ c = c.children;
+ for (let g = 0; g < c.length; g++) {
+ for (e = c[g]; f < e.index; f++) b.write(d[f]);
+ e = fd(a, b, e);
+ }
+ for (; f < d.length - 1; f++) b.write(d[f]);
+ f < d.length && (e = !!b.write(d[f]));
+ return e;
+ }
+ default:
+ throw Error(h(390));
+ }
+}
+function fd(a, b, c) {
+ var d = c.boundary;
+ if (null === d) return ed(a, b, c);
+ d.parentFlushed = !0;
+ if (d.forceClientRender)
+ (d = d.errorDigest),
+ b.write(bb),
+ b.write(db),
+ d && (b.write(fb), (d = x(d)), b.write(d), b.write(eb)),
+ b.write(gb),
+ ed(a, b, c);
+ else if (0 < d.pendingTasks) {
+ d.rootSegmentID = a.nextSegmentId++;
+ 0 < d.completedSegments.length && a.partialBoundaries.push(d);
+ {
+ var e = a.responseState;
+ const b = e.nextSuspenseID++;
+ e = m(e.boundaryPrefix + b.toString(16));
+ }
+ d = d.id = e;
+ hb(b, a.responseState, d);
+ ed(a, b, c);
+ } else if (d.byteSize > a.progressiveChunkSize)
+ (d.rootSegmentID = a.nextSegmentId++),
+ a.completedBoundaries.push(d),
+ hb(b, a.responseState, d.id),
+ ed(a, b, c);
+ else {
+ b.write(Za);
+ c = d.completedSegments;
+ if (1 !== c.length) throw Error(h(391));
+ fd(a, b, c[0]);
+ }
+ return !!b.write(cb);
+}
+function gd(a, b, c) {
+ Eb(b, a.responseState, c.formatContext, c.id);
+ fd(a, b, c);
+ return Fb(b, c.formatContext);
+}
+function hd(a, b, c) {
+ var d = c.completedSegments;
+ let e = 0;
+ for (; e < d.length; e++) id(a, b, c, d[e]);
+ d.length = 0;
+ a = a.responseState;
+ d = c.id;
+ c = c.rootSegmentID;
+ b.write(a.startInlineScript);
+ a.sentCompleteBoundaryFunction
+ ? b.write(Lb)
+ : ((a.sentCompleteBoundaryFunction = !0), b.write(Kb));
+ if (null === d) throw Error(h(395));
+ c = c.toString(16);
+ b.write(d);
+ b.write(Mb);
+ b.write(a.segmentPrefix);
+ b.write(c);
+ return (b = !!b.write(Nb));
+}
+function id(a, b, c, d) {
+ if (2 === d.status) return !0;
+ var e = d.id;
+ if (-1 === e) {
+ if (-1 === (d.id = c.rootSegmentID)) throw Error(h(392));
+ return gd(a, b, d);
+ }
+ gd(a, b, d);
+ a = a.responseState;
+ b.write(a.startInlineScript);
+ a.sentCompleteSegmentFunction
+ ? b.write(Hb)
+ : ((a.sentCompleteSegmentFunction = !0), b.write(Gb));
+ b.write(a.segmentPrefix);
+ e = e.toString(16);
+ b.write(e);
+ b.write(Ib);
+ b.write(a.placeholderPrefix);
+ b.write(e);
+ return (b = !!b.write(Jb));
+}
+function dd(a, b) {
+ try {
+ var c = a.completedRootSegment;
+ if (null !== c && 0 === a.pendingRootTasks) {
+ fd(a, b, c);
+ a.completedRootSegment = null;
+ var d = a.responseState.bootstrapChunks;
+ for (c = 0; c < d.length - 1; c++) b.write(d[c]);
+ c < d.length && b.write(d[c]);
+ }
+ const da = a.clientRenderedBoundaries;
+ let p;
+ for (p = 0; p < da.length; p++) {
+ const c = da[p];
+ d = b;
+ var e = a.responseState,
+ f = c.id,
+ g = c.errorDigest,
+ l = c.errorMessage,
+ k = c.errorComponentStack;
+ d.write(e.startInlineScript);
+ e.sentClientRenderFunction
+ ? d.write(Pb)
+ : ((e.sentClientRenderFunction = !0), d.write(Ob));
+ if (null === f) throw Error(h(395));
+ d.write(f);
+ d.write(Qb);
+ if (g || l || k) {
+ d.write(Sb);
+ var n = Ub(g || "");
+ d.write(n);
+ }
+ if (l || k) {
+ d.write(Sb);
+ var r = Ub(l || "");
+ d.write(r);
+ }
+ if (k) {
+ d.write(Sb);
+ var t = Ub(k);
+ d.write(t);
+ }
+ if (!d.write(Rb)) {
+ a.destination = null;
+ p++;
+ da.splice(0, p);
+ return;
+ }
+ }
+ da.splice(0, p);
+ const ea = a.completedBoundaries;
+ for (p = 0; p < ea.length; p++)
+ if (!hd(a, b, ea[p])) {
+ a.destination = null;
+ p++;
+ ea.splice(0, p);
+ return;
+ }
+ ea.splice(0, p);
+ b.flush();
+ const fa = a.partialBoundaries;
+ for (p = 0; p < fa.length; p++) {
+ a: {
+ e = a;
+ f = b;
+ var Qa = fa[p];
+ const c = Qa.completedSegments;
+ for (g = 0; g < c.length; g++)
+ if (!id(e, f, Qa, c[g])) {
+ g++;
+ c.splice(0, g);
+ var wb = !1;
+ break a;
+ }
+ c.splice(0, g);
+ wb = !0;
+ }
+ if (!wb) {
+ a.destination = null;
+ p++;
+ fa.splice(0, p);
+ return;
+ }
+ }
+ fa.splice(0, p);
+ const ha = a.completedBoundaries;
+ for (p = 0; p < ha.length; p++)
+ if (!hd(a, b, ha[p])) {
+ a.destination = null;
+ p++;
+ ha.splice(0, p);
+ return;
+ }
+ ha.splice(0, p);
+ } finally {
+ b.flush(),
+ b.flush(),
+ 0 === a.allPendingTasks &&
+ 0 === a.pingedTasks.length &&
+ 0 === a.clientRenderedBoundaries.length &&
+ 0 === a.completedBoundaries.length &&
+ b.end();
+ }
+}
+function jd(a, b) {
+ if (1 === a.status) (a.status = 2), b.close(a.fatalError);
+ else if (2 !== a.status && null === a.destination) {
+ a.destination = b;
+ try {
+ dd(a, b);
+ } catch (c) {
+ X(a, c), Y(a, c);
+ }
+ }
+}
+function kd(a, b) {
+ try {
+ const c = a.abortableTasks;
+ c.forEach((c) => cd(c, a, b));
+ c.clear();
+ null !== a.destination && dd(a, a.destination);
+ } catch (c) {
+ X(a, c), Y(a, c);
+ }
+}
+const ld = {
+ type: "direct",
+ pull: void 0,
+ cancel: void 0,
+ [Symbol.toStringTag]: "ReactDOMServerReadableStreamSource",
+};
+function md(a) {
+ let b = !1,
+ c;
+ if (a.onAllReady) {
+ let d = a.onAllReady;
+ a.onAllReady = () => {
+ c ? (jd(a, c), (c = void 0)) : (b = !0);
+ d();
+ d = void 0;
+ };
+ } else
+ a.onAllReady = () => {
+ c ? (jd(a, c), (c = void 0)) : (b = !0);
+ };
+ Tc(a);
+ return Object.create(ld, {
+ pull: {
+ value: (d) => {
+ b ? ((c = void 0), jd(a, d)) : (c = d);
+ },
+ },
+ cancel: {
+ value: () => {
+ kd(a);
+ },
+ },
+ });
+}
+function nd(a, b) {
+ a = md(a);
+ b = b && Number.isFinite(b) && 0 < b ? b : 2048;
+ return new ReadableStream(a, { highWaterMark: b });
+}
+export const renderToReadableStream = function (a, b) {
+ let c;
+ try {
+ const d = Qc(
+ a,
+ Aa(
+ b ? b.identifierPrefix : void 0,
+ b ? b.nonce : void 0,
+ b ? b.bootstrapScriptContent : void 0,
+ b ? b.bootstrapScripts : void 0,
+ b ? b.bootstrapModules : void 0
+ ),
+ Ba(b ? b.namespaceURI : void 0),
+ b ? b.progressiveChunkSize : void 0,
+ b ? b.onError : void 0,
+ b ? b.onAllReady : void 0,
+ void 0,
+ (a) => {
+ c && c.cancel(a).catch(() => {});
+ },
+ b
+ );
+ c = nd(d, b && b.progressiveChunkSize);
+ const e = b && b.signal;
+ if (e) {
+ const a = () => {
+ kd(d);
+ e.removeEventListener("abort", a);
+ };
+ e.addEventListener("abort", a);
+ }
+ return Promise.resolve(c);
+ } catch (d) {
+ c && c.cancel(d).catch(() => {});
+ if (b.onShellError) b.onShellError(d);
+ return Promise.reject(d);
+ }
+};
+export const version = "18.1.0";
diff --git a/packages/bun-landing/ssr.tsx b/packages/bun-landing/ssr.tsx
new file mode 100644
index 000000000..cb1c6c429
--- /dev/null
+++ b/packages/bun-landing/ssr.tsx
@@ -0,0 +1,28 @@
+import React from "react";
+import { file, serve } from "bun";
+
+import { renderToReadableStream } from "./react-dom-server.bun.production.min";
+
+import liveReload from "bun-livereload";
+import { join } from "path";
+
+async function fetch(req: Request) {
+ if (req.url.endsWith("favicon.ico")) {
+ return new Response("", { status: 404 });
+ }
+
+ if (!req.url.includes(".")) {
+ const { default: Page } = await import("./page.jsx");
+ return new Response(await renderToReadableStream(<Page />), {
+ headers: {
+ "Content-Type": "text/html",
+ },
+ });
+ }
+
+ return new Response(file(join(import.meta.dir, new URL(req.url).pathname)));
+}
+
+serve({
+ fetch: liveReload(fetch),
+});
diff --git a/packages/bun-landing/tsconfig.json b/packages/bun-landing/tsconfig.json
new file mode 100644
index 000000000..180b266a1
--- /dev/null
+++ b/packages/bun-landing/tsconfig.json
@@ -0,0 +1,10 @@
+{
+ "compilerOptions": {
+ "jsx": "react",
+ "lib": ["ESNext"],
+ "module": "esnext",
+ "target": "esnext",
+ "moduleResolution": "node",
+ "types": ["bun-types"]
+ }
+}
diff --git a/src/bun.js/WebKit b/src/bun.js/WebKit
-Subproject a06260772abc4a9e9a984cc3654f44e0b9872b1
+Subproject 7e7774dabf1c2d94fe3604defb3c54a4c989c3b
diff --git a/src/bun.js/bindings/ZigGlobalObject.cpp b/src/bun.js/bindings/ZigGlobalObject.cpp
index 1e73da3ed..138267cd6 100644
--- a/src/bun.js/bindings/ZigGlobalObject.cpp
+++ b/src/bun.js/bindings/ZigGlobalObject.cpp
@@ -1487,6 +1487,29 @@ JSC_DEFINE_HOST_FUNCTION(functionConcatTypedArrays, (JSGlobalObject * globalObje
return flattenArrayOfBuffersIntoArrayBuffer(globalObject, arrayValue);
}
+extern "C" uint64_t Bun__readOriginTimer(void*);
+
+JSC_DECLARE_HOST_FUNCTION(functionPerformanceNow);
+
+JSC_DEFINE_HOST_FUNCTION(functionPerformanceNow, (JSGlobalObject * globalObject, JSC::CallFrame* callFrame))
+{
+ auto* global = reinterpret_cast<GlobalObject*>(globalObject);
+ // nanoseconds to seconds
+ uint64_t time = Bun__readOriginTimer(global->bunVM());
+ double result = time / 1000000000.0;
+ return JSValue::encode(jsNumber(time));
+}
+
+JSC_DECLARE_HOST_FUNCTION(functionBunNanoseconds);
+
+JSC_DEFINE_HOST_FUNCTION(functionBunNanoseconds, (JSGlobalObject * globalObject, JSC::CallFrame* callFrame))
+{
+ auto* global = reinterpret_cast<GlobalObject*>(globalObject);
+ // nanoseconds to seconds
+ uint64_t time = Bun__readOriginTimer(global->bunVM());
+ return JSValue::encode(jsNumber(time));
+}
+
JSC_DECLARE_HOST_FUNCTION(functionConcatTypedArraysFromIterator);
JSC_DEFINE_HOST_FUNCTION(functionConcatTypedArraysFromIterator, (JSGlobalObject * globalObject, JSC::CallFrame* callFrame))
@@ -1663,10 +1686,10 @@ void GlobalObject::finishCreation(VM& vm)
init.set(prototype);
});
- m_JSHTTPResponseControllerPrototype.initLater(
- [](const JSC::LazyProperty<JSC::JSGlobalObject, JSC::JSObject>::Initializer& init) {
- auto* prototype = createJSSinkControllerPrototype(init.vm, init.owner, WebCore::SinkID::HTTPResponseSink);
- init.set(prototype);
+ m_JSHTTPResponseController.initLater(
+ [](const JSC::LazyProperty<JSC::JSGlobalObject, JSC::Structure>::Initializer& init) {
+ auto* structure = createJSSinkControllerStructure(init.vm, init.owner, WebCore::SinkID::HTTPResponseSink);
+ init.set(structure);
});
m_JSHTTPSResponseControllerPrototype.initLater(
@@ -1675,6 +1698,13 @@ void GlobalObject::finishCreation(VM& vm)
init.set(prototype);
});
+ m_performanceObject.initLater(
+ [](const JSC::LazyProperty<JSC::JSGlobalObject, JSC::JSObject>::Initializer& init) {
+ JSC::JSObject* object = JSC::constructEmptyObject(init.owner, init.owner->objectPrototype(), 1);
+ object->putDirectNativeFunction(init.vm, init.owner, JSC::Identifier::fromString(init.vm, "now"_s), 1, functionPerformanceNow, NoIntrinsic, 0);
+ init.set(object);
+ });
+
m_processEnvObject.initLater(
[](const JSC::LazyProperty<JSC::JSGlobalObject, JSC::JSObject>::Initializer& init) {
auto jsClass = reinterpret_cast<Zig::GlobalObject*>(init.owner)->m_dotEnvClassRef;
@@ -1878,6 +1908,9 @@ void GlobalObject::addBuiltinGlobals(JSC::VM& vm)
putDirectCustomAccessor(vm, JSC::Identifier::fromString(vm, "process"_s), JSC::CustomGetterSetter::create(vm, property_lazyProcessGetter, property_lazyProcessSetter),
JSC::PropertyAttribute::CustomAccessor | 0);
+ putDirect(vm, JSC::Identifier::fromString(vm, "performance"_s), this->performanceObject(),
+ 0);
+
putDirectCustomAccessor(vm, JSC::Identifier::fromString(vm, "URL"_s), JSC::CustomGetterSetter::create(vm, JSDOMURL_getter, nullptr),
JSC::PropertyAttribute::DontDelete | 0);
@@ -2036,6 +2069,12 @@ void GlobalObject::installAPIGlobals(JSClassRef* globals, int count, JSC::VM& vm
}
{
+ JSC::Identifier identifier = JSC::Identifier::fromString(vm, "nanoseconds"_s);
+ object->putDirectNativeFunction(vm, this, identifier, 1, functionBunNanoseconds, NoIntrinsic,
+ JSC::PropertyAttribute::Function | JSC::PropertyAttribute::DontDelete | 0);
+ }
+
+ {
JSC::Identifier identifier = JSC::Identifier::fromString(vm, pathToFileURLString);
object->putDirectNativeFunction(vm, this, identifier, 1, functionPathToFileURL, NoIntrinsic,
@@ -2135,6 +2174,7 @@ void GlobalObject::visitChildrenImpl(JSCell* cell, Visitor& visitor)
thisObject->m_requireMap.visit(visitor);
thisObject->m_processEnvObject.visit(visitor);
thisObject->m_processObject.visit(visitor);
+ thisObject->m_performanceObject.visit(visitor);
visitor.append(thisObject->m_readableStreamToArrayBufferResolve);
visitor.append(thisObject->m_readableStreamToText);
diff --git a/src/bun.js/bindings/ZigGlobalObject.h b/src/bun.js/bindings/ZigGlobalObject.h
index 47449321b..3832eb9c2 100644
--- a/src/bun.js/bindings/ZigGlobalObject.h
+++ b/src/bun.js/bindings/ZigGlobalObject.h
@@ -179,7 +179,7 @@ public:
JSC::Structure* HTTPResponseSinkStructure() { return m_JSHTTPResponseSinkClassStructure.getInitializedOnMainThread(this); }
JSC::JSObject* HTTPResponseSink() { return m_JSHTTPResponseSinkClassStructure.constructorInitializedOnMainThread(this); }
JSC::JSValue HTTPResponseSinkPrototype() { return m_JSHTTPResponseSinkClassStructure.prototypeInitializedOnMainThread(this); }
- JSC::JSValue JSReadableHTTPResponseSinkControllerPrototype() { return m_JSHTTPResponseControllerPrototype.getInitializedOnMainThread(this); }
+ JSC::Structure* JSReadableHTTPResponseSinkController() { return m_JSHTTPResponseController.getInitializedOnMainThread(this); }
JSC::Structure* HTTPSResponseSinkStructure() { return m_JSHTTPSResponseSinkClassStructure.getInitializedOnMainThread(this); }
JSC::JSObject* HTTPSResponseSink() { return m_JSHTTPSResponseSinkClassStructure.constructorInitializedOnMainThread(this); }
@@ -189,6 +189,8 @@ public:
JSC::JSMap* readableStreamNativeMap() { return m_lazyReadableStreamPrototypeMap.getInitializedOnMainThread(this); }
JSC::JSMap* requireMap() { return m_requireMap.getInitializedOnMainThread(this); }
+ JSC::JSObject* performanceObject() { return m_performanceObject.getInitializedOnMainThread(this); }
+
JSC::JSObject* processObject()
{
return m_processObject.getInitializedOnMainThread(this);
@@ -228,11 +230,12 @@ private:
LazyProperty<JSGlobalObject, JSObject> m_JSArrayBufferControllerPrototype;
LazyProperty<JSGlobalObject, JSObject> m_JSHTTPSResponseControllerPrototype;
- LazyProperty<JSGlobalObject, JSObject> m_JSHTTPResponseControllerPrototype;
+ LazyProperty<JSGlobalObject, Structure> m_JSHTTPResponseController;
LazyProperty<JSGlobalObject, JSObject> m_processObject;
LazyProperty<JSGlobalObject, JSObject> m_processEnvObject;
LazyProperty<JSGlobalObject, JSMap> m_lazyReadableStreamPrototypeMap;
LazyProperty<JSGlobalObject, JSMap> m_requireMap;
+ LazyProperty<JSGlobalObject, JSObject> m_performanceObject;
// LazyProperty<JSGlobalObject, WebCore::JSEventTarget> m_eventTarget;
JSClassRef m_dotEnvClassRef;
diff --git a/src/bun.js/event_loop.zig b/src/bun.js/event_loop.zig
index 95bf5456c..df6af2748 100644
--- a/src/bun.js/event_loop.zig
+++ b/src/bun.js/event_loop.zig
@@ -422,7 +422,13 @@ pub const EventLoop = struct {
if (this.tickWithCount() == 0) break;
}
- this.global.vm().releaseWeakRefs();
+ // This is JSC's event loop
+ // We don't actually use this.
+ // However, there are three uses of it in JavaScriptCore outside our control:
+ // 1. FinalizationRegistry callbacks
+ // 2. WebAssembly.instantiate
+ // 3. WebAssembly.instantiateStreaming
+ this.global.vm().doWork();
if (!ctx.disable_run_us_loop and ctx.us_loop_reference_count > 0 and !ctx.is_us_loop_entered) {
ctx.is_us_loop_entered = true;
diff --git a/src/bun.js/fs.exports.js b/src/bun.js/fs.exports.js
index 0680b3568..8eb043f69 100644
--- a/src/bun.js/fs.exports.js
+++ b/src/bun.js/fs.exports.js
@@ -119,6 +119,39 @@ function callbackify(fsFunction, args) {
});
}
+// note: this is not quite the same as how node does it
+// in some cases, node swaps around arguments or makes small tweaks to the return type
+// this is just better than nothing.
+function promisify(fsFunction) {
+ // TODO: remove variadic arguments
+ // we can use new Function() here instead
+ // based on fsFucntion.length
+ var obj = {
+ [fsFunction.name]: function (resolve, reject, args) {
+ var result;
+ try {
+ result = fsFunction.apply(fs, args);
+ args = undefined;
+ } catch (err) {
+ args = undefined;
+ reject(err);
+ return;
+ }
+
+ resolve(result);
+ },
+ };
+
+ var func = obj[fsFunction.name];
+
+ // TODO: consider @createPromiseCapabiilty intrinsic
+ return (...args) => {
+ return new Promise((resolve, reject) => {
+ func(resolve, reject, args);
+ });
+ };
+}
+
export var accessSync = fs.accessSync.bind(fs);
export var appendFileSync = fs.appendFileSync.bind(fs);
export var closeSync = fs.closeSync.bind(fs);
@@ -157,6 +190,44 @@ export var lutimesSync = fs.lutimesSync.bind(fs);
export var createReadStream = fs.createReadStream.bind(fs);
export var createWriteStream = fs.createWriteStream.bind(fs);
+export var promises = {
+ access: promisify(fs.accessSync),
+ appendFile: promisify(fs.appendFileSync),
+ close: promisify(fs.closeSync),
+ copyFile: promisify(fs.copyFileSync),
+ exists: promisify(fs.existsSync),
+ chown: promisify(fs.chownSync),
+ chmod: promisify(fs.chmodSync),
+ fchmod: promisify(fs.fchmodSync),
+ fchown: promisify(fs.fchownSync),
+ fstat: promisify(fs.fstatSync),
+ fsync: promisify(fs.fsyncSync),
+ ftruncate: promisify(fs.ftruncateSync),
+ futimes: promisify(fs.futimesSync),
+ lchmod: promisify(fs.lchmodSync),
+ lchown: promisify(fs.lchownSync),
+ link: promisify(fs.linkSync),
+ lstat: promisify(fs.lstatSync),
+ mkdir: promisify(fs.mkdirSync),
+ mkdtemp: promisify(fs.mkdtempSync),
+ open: promisify(fs.openSync),
+ read: promisify(fs.readSync),
+ write: promisify(fs.writeSync),
+ readdir: promisify(fs.readdirSync),
+ writeFile: promisify(fs.writeFileSync),
+ readlink: promisify(fs.readlinkSync),
+ realpath: promisify(fs.realpathSync),
+ rename: promisify(fs.renameSync),
+ stat: promisify(fs.statSync),
+ symlink: promisify(fs.symlinkSync),
+ truncate: promisify(fs.truncateSync),
+ unlink: promisify(fs.unlinkSync),
+ utimes: promisify(fs.utimesSync),
+ lutimes: promisify(fs.lutimesSync),
+};
+
+promises.readFile = promises.readfile = promisify(fs.readFileSync);
+
// lol
realpath.native = realpath;
realpathSync.native = realpathSync;
@@ -233,4 +304,5 @@ export default {
createReadStream,
createWriteStream,
constants,
+ promises,
};
diff --git a/src/bun.js/javascript.zig b/src/bun.js/javascript.zig
index 9ed16caf0..5c4f2ae68 100644
--- a/src/bun.js/javascript.zig
+++ b/src/bun.js/javascript.zig
@@ -258,12 +258,17 @@ pub export fn Bun__drainMicrotasks() void {
JSC.VirtualMachine.vm.eventLoop().tick();
}
+export fn Bun__readOriginTimer(vm: *JSC.VirtualMachine) u64 {
+ return vm.origin_timer.read();
+}
+
comptime {
if (!JSC.is_bindgen) {
_ = Bun__getDefaultGlobal;
_ = Bun__getVM;
_ = Bun__drainMicrotasks;
_ = Bun__queueMicrotask;
+ _ = Bun__readOriginTimer;
}
}
diff --git a/src/bun.js/javascript_core_c_api.zig b/src/bun.js/javascript_core_c_api.zig
index aa9af2b7e..82145defc 100644
--- a/src/bun.js/javascript_core_c_api.zig
+++ b/src/bun.js/javascript_core_c_api.zig
@@ -102,15 +102,31 @@ pub extern fn JSValueToNumber(ctx: JSContextRef, value: JSValueRef, exception: E
pub extern fn JSValueToStringCopy(ctx: JSContextRef, value: JSValueRef, exception: ExceptionRef) JSStringRef;
pub extern fn JSValueToObject(ctx: JSContextRef, value: JSValueRef, exception: ExceptionRef) JSObjectRef;
+const log_protection = @import("../global.zig").Environment.allow_assert;
+pub inline fn JSValueUnprotect(ctx: JSContextRef, value: JSValueRef) void {
+ const Wrapped = struct {
+ pub extern fn JSValueUnprotect(ctx: JSContextRef, value: JSValueRef) void;
+ };
+ if (comptime log_protection) {
+ const Output = @import("../global.zig").Output;
+ Output.debug("[unprotect] {d}\n", .{@ptrToInt(value)});
+ }
+ // wrapper exists to make it easier to set a breakpoint
+ Wrapped.JSValueUnprotect(ctx, value);
+}
+
pub inline fn JSValueProtect(ctx: JSContextRef, value: JSValueRef) void {
const Wrapped = struct {
pub extern fn JSValueProtect(ctx: JSContextRef, value: JSValueRef) void;
};
+ if (comptime log_protection) {
+ const Output = @import("../global.zig").Output;
+ Output.debug("[protect] {d}\n", .{@ptrToInt(value)});
+ }
// wrapper exists to make it easier to set a breakpoint
Wrapped.JSValueProtect(ctx, value);
}
-pub extern fn JSValueUnprotect(ctx: JSContextRef, value: JSValueRef) void;
pub const JSPropertyAttributes = enum(c_uint) {
kJSPropertyAttributeNone = 0,
kJSPropertyAttributeReadOnly = 2,
diff --git a/src/bun.js/webcore.zig b/src/bun.js/webcore.zig
index 0433402fc..981e15c8f 100644
--- a/src/bun.js/webcore.zig
+++ b/src/bun.js/webcore.zig
@@ -92,39 +92,3 @@ pub const Crypto = struct {
return JSC.ZigString.init(str).toValueGC(ctx.ptr()).asObjectRef();
}
};
-
-pub const Performance = struct {
- pub const Class = JSC.NewClass(
- void,
- .{
- .name = "performance",
- .read_only = true,
- },
- .{
- .now = .{
- .rfn = Performance.now,
- },
- },
- .{},
- );
-
- pub fn now(
- _: void,
- ctx: JSC.C.JSContextRef,
- _: JSC.C.JSObjectRef,
- _: JSC.C.JSObjectRef,
- _: []const JSC.C.JSValueRef,
- _: JSC.C.ExceptionRef,
- ) JSC.C.JSValueRef {
- return JSC.C.JSValueMakeNumber(
- ctx,
- @floatCast(
- f64,
- @intToFloat(
- f128,
- JSC.VirtualMachine.vm.origin_timer.read(),
- ) / std.time.ns_per_ms,
- ),
- );
- }
-};
diff --git a/src/deps/uws b/src/deps/uws
-Subproject f0ea7574ab3c642bc1c0ee4991e771c1ee164f4
+Subproject 1b46cf9ace5f55f713d55bb8c086f5878d13245
diff --git a/src/feature_flags.zig b/src/feature_flags.zig
index 6fe6da892..dc77a47e6 100644
--- a/src/feature_flags.zig
+++ b/src/feature_flags.zig
@@ -95,4 +95,4 @@ pub const simd = true;
// This change didn't seem to make a meaningful difference in microbenchmarks
pub const latin1_is_now_ascii = false;
-pub const http_buffer_pooling = false;
+pub const http_buffer_pooling = true;
diff --git a/src/js_printer.zig b/src/js_printer.zig
index 1a68c6662..945e0a382 100644
--- a/src/js_printer.zig
+++ b/src/js_printer.zig
@@ -340,8 +340,14 @@ pub fn writeJSONString(text: []const u8, comptime Writer: type, writer: Writer,
test "quoteForJSON" {
var allocator = default_allocator;
- try std.testing.expectEqualStrings("\"I don't need any quotes.\"", try quoteForJSON("I don't need any quotes.", allocator, false));
- try std.testing.expectEqualStrings("\"I need a quote for \\\"this\\\".\"", try quoteForJSON("I need a quote for \"this\".", allocator, false));
+ try std.testing.expectEqualStrings(
+ "\"I don't need any quotes.\"",
+ (try quoteForJSON("I don't need any quotes.", MutableString.init(allocator, 0) catch unreachable, false)).list.items,
+ );
+ try std.testing.expectEqualStrings(
+ "\"I need a quote for \\\"this\\\".\"",
+ (try quoteForJSON("I need a quote for \"this\".", MutableString.init(allocator, 0) catch unreachable, false)).list.items,
+ );
}
pub const SourceMapHandler = struct {
diff --git a/src/sourcemap/sourcemap.zig b/src/sourcemap/sourcemap.zig
index 22a916940..92bd6189c 100644
--- a/src/sourcemap/sourcemap.zig
+++ b/src/sourcemap/sourcemap.zig
@@ -645,7 +645,11 @@ pub const LineOffsetTable = struct {
}
if (c > 0x7F and columns_for_non_ascii.items.len == 0) {
-
+ std.debug.assert(@ptrToInt(
+ remaining.ptr,
+ ) > @ptrToInt(
+ contents.ptr,
+ ));
// we have a non-ASCII character, so we need to keep track of the
// mapping from byte offsets to UTF-16 code unit counts
columns_for_non_ascii.appendAssumeCapacity(column);
diff --git a/src/string_immutable.zig b/src/string_immutable.zig
index d4dc7c6c1..5ee958b40 100644
--- a/src/string_immutable.zig
+++ b/src/string_immutable.zig
@@ -2624,19 +2624,24 @@ pub fn indexOfNewlineOrNonASCIICheckStart(slice_: []const u8, offset: u32, compt
const cmp = @bitCast(AsciiVectorU1, (vec > max_16_ascii)) | @bitCast(AsciiVectorU1, (vec < min_16_ascii)) |
@bitCast(AsciiVectorU1, vec == @splat(ascii_vector_size, @as(u8, '\r'))) |
@bitCast(AsciiVectorU1, vec == @splat(ascii_vector_size, @as(u8, '\n')));
- const bitmask = @ptrCast(*const AsciiVectorInt, &cmp).*;
- const first = @ctz(AsciiVectorInt, bitmask);
- if (first < ascii_vector_size) {
+
+ if (@reduce(.Max, cmp) > 0) {
+ const bitmask = @ptrCast(*const AsciiVectorInt, &cmp).*;
+ const first = @ctz(AsciiVectorInt, bitmask);
+
return @as(u32, first) + @intCast(u32, slice.len - remaining.len) + offset;
}
remaining = remaining[ascii_vector_size..];
}
+
+ assert(remaining.len < ascii_vector_size);
}
- for (remaining) |char, i| {
+ for (remaining) |*char_| {
+ const char = char_.*;
if (char > 127 or char < 0x20 or char == '\n' or char == '\r') {
- return @truncate(u32, i + (slice.len - remaining.len)) + offset;
+ return @truncate(u32, (@ptrToInt(char_) - @ptrToInt(slice.ptr))) + offset;
}
}
@@ -2658,19 +2663,22 @@ pub fn indexOfNeedsEscape(slice: []const u8) ?u32 {
const cmp = @bitCast(AsciiVectorU1, (vec > max_16_ascii)) | @bitCast(AsciiVectorU1, (vec < min_16_ascii)) |
@bitCast(AsciiVectorU1, vec == @splat(ascii_vector_size, @as(u8, '\\'))) |
@bitCast(AsciiVectorU1, vec == @splat(ascii_vector_size, @as(u8, '"')));
- const bitmask = @ptrCast(*const AsciiVectorInt, &cmp).*;
- const first = @ctz(AsciiVectorInt, bitmask);
- if (first < ascii_vector_size) {
- return @as(u32, first) + @intCast(u32, slice.len - remaining.len);
+
+ if (@reduce(.Max, cmp) > 0) {
+ const bitmask = @ptrCast(*const AsciiVectorInt, &cmp).*;
+ const first = @ctz(AsciiVectorInt, bitmask);
+
+ return @as(u32, first) + @truncate(u32, @ptrToInt(remaining.ptr) - @ptrToInt(slice.ptr));
}
remaining = remaining[ascii_vector_size..];
}
}
- for (remaining) |char, i| {
+ for (remaining) |*char_| {
+ const char = char_.*;
if (char > 127 or char < 0x20 or char == '\\' or char == '"') {
- return @truncate(u32, i + (slice.len - remaining.len));
+ return @truncate(u32, @ptrToInt(char_) - @ptrToInt(slice.ptr));
}
}
@@ -2762,10 +2770,10 @@ pub fn indexOfNotChar(slice: []const u8, char: u8) ?u32 {
if (comptime Environment.isAarch64 or Environment.isX64) {
while (remaining.len >= ascii_vector_size) {
const vec: AsciiVector = remaining[0..ascii_vector_size].*;
- const cmp = vec != @splat(ascii_vector_size, char);
- const bitmask = @ptrCast(*const AsciiVectorInt, &cmp).*;
- const first = @ctz(AsciiVectorInt, bitmask);
- if (first < ascii_vector_size) {
+ const cmp = @splat(ascii_vector_size, char) != vec;
+ if (@reduce(.Min, @bitCast(AsciiVectorU1, cmp)) > 0) {
+ const bitmask = @ptrCast(*const AsciiVectorInt, &cmp).*;
+ const first = @ctz(AsciiVectorInt, bitmask);
return @as(u32, first) + @intCast(u32, slice.len - remaining.len);
}
@@ -2773,11 +2781,10 @@ pub fn indexOfNotChar(slice: []const u8, char: u8) ?u32 {
}
}
- while (remaining.len > 0) {
- if (remaining[0] != char) {
- return @truncate(u32, (slice.len - remaining.len));
+ for (remaining) |*current| {
+ if (current.* != char) {
+ return @truncate(u32, @ptrToInt(current) - @ptrToInt(slice.ptr));
}
- remaining = remaining[1..];
}
return null;