From 43c1f17d1f1718d3f6d183801f00fea38f51469c Mon Sep 17 00:00:00 2001 From: Oran Simhony <42851547+oransimhony@users.noreply.github.com> Date: Sun, 31 Jul 2022 22:41:45 +0000 Subject: [PATCH] Fix: move bun, Webkit and zig urls from Jarred-Sumner to oven-sh. (#944) * Fix: move bun, Webkit and zig urls from Jarred-Sumner to oven-sh. * Fix: changed urls from types.d.ts to base bun-types repo. --- Dockerfile.devcontainer | 4 ++-- README.md | 6 +++--- docs/upgrading-webkit.md | 2 +- packages/bun-landing/page.tsx | 6 +++--- packages/bun-landing/public/index.html | 2 +- src/bun.js/api/FFI.h | 2 +- test/apps/bun-install-utf8.sh | 2 +- test/apps/bun-run-check.sh | 4 ++-- test/bun.js/ffi.test.fixture.callback.c | 2 +- test/bun.js/ffi.test.fixture.receiver.c | 2 +- zig-build/Dockerfile | 2 +- zig-build/Dockerfile.musl | 2 +- zig-build/release.sh | 2 +- 13 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Dockerfile.devcontainer b/Dockerfile.devcontainer index 5ef222db22..735b0598e0 100644 --- a/Dockerfile.devcontainer +++ b/Dockerfile.devcontainer @@ -83,12 +83,12 @@ RUN cd / && mkdir -p $BUN_RELEASE_DIR $BUN_DEPS_OUT_DIR ${BUN_DIR} ${BUN_DEPS_OU WORKDIR $GITHUB_WORKSPACE RUN cd $GITHUB_WORKSPACE && \ - curl -o zig-linux-$BUILDARCH.zip -L https://github.com/Jarred-Sumner/zig/releases/download/jul1/zig-linux-$BUILDARCH.zip && \ + curl -o zig-linux-$BUILDARCH.zip -L https://github.com/oven-sh/zig/releases/download/jul1/zig-linux-$BUILDARCH.zip && \ unzip -q zig-linux-$BUILDARCH.zip && \ rm zig-linux-$BUILDARCH.zip; RUN cd $GITHUB_WORKSPACE && \ - curl -o bun-webkit-linux-$BUILDARCH.tar.gz -L https://github.com/Jarred-Sumner/WebKit/releases/download/jul27-2/bun-webkit-linux-$BUILDARCH.tar.gz && \ + curl -o bun-webkit-linux-$BUILDARCH.tar.gz -L https://github.com/oven-sh/WebKit/releases/download/jul27-2/bun-webkit-linux-$BUILDARCH.tar.gz && \ tar -xzf bun-webkit-linux-$BUILDARCH.tar.gz && \ rm bun-webkit-linux-$BUILDARCH.tar.gz && \ cat $WEBKIT_OUT_DIR/include/cmakeconfig.h > /dev/null diff --git a/README.md b/README.md index 21eabec362..73e962120c 100644 --- a/README.md +++ b/README.md @@ -253,7 +253,7 @@ PRs adding more examples are very welcome! ### Types for bun.js (editor autocomplete) -The best docs right now are the TypeScript types in the [`bun-types`](https://github.com/oven-sh/bun-types/blob/master/dist/types.d.ts) npm package. A docs site is coming soon. +The best docs right now are the TypeScript types in the [`bun-types`](https://github.com/oven-sh/bun-types) npm package. A docs site is coming soon. To get autocomplete for bun.js types in your editor, @@ -278,7 +278,7 @@ bun add bun-types } ``` -You can also [view the types here](https://github.com/oven-sh/bun-types/blob/master/dist/types.d.ts). +You can also [view the types here](https://github.com/oven-sh/bun-types). To contribute to the types, head over to [oven-sh/bun-types](https://github.com/oven-sh/bun-types). @@ -3146,7 +3146,7 @@ Per LGPL2: > (1) If you statically link against an LGPL’d library, you must also provide your application in an object (not necessarily source) format, so that a user has the opportunity to modify the library and relink the application. -You can find the patched version of WebKit used by bun here: . If you would like to relink bun with changes: +You can find the patched version of WebKit used by bun here: . If you would like to relink bun with changes: - `git submodule update --init --recursive` - `make jsc` diff --git a/docs/upgrading-webkit.md b/docs/upgrading-webkit.md index ac14885f7c..f9194fc15d 100644 --- a/docs/upgrading-webkit.md +++ b/docs/upgrading-webkit.md @@ -1,6 +1,6 @@ # Upgrading WebKit -Bun uses [a fork](https://github.com/Jarred-Sumner/WebKit) of WebKit with a small number of changes. +Bun uses [a fork](https://github.com/oven-sh/WebKit) of WebKit with a small number of changes. It's important to periodically update WebKit for many reasons: diff --git a/packages/bun-landing/page.tsx b/packages/bun-landing/page.tsx index 52d8f3c5c5..12d688862d 100644 --- a/packages/bun-landing/page.tsx +++ b/packages/bun-landing/page.tsx @@ -509,17 +509,17 @@ export default ({ inlineCSS }) => ( diff --git a/packages/bun-landing/public/index.html b/packages/bun-landing/public/index.html index a91ac0ddea..82e8624e60 100644 --- a/packages/bun-landing/public/index.html +++ b/packages/bun-landing/public/index.html @@ -917,7 +917,7 @@ img { white-space: nowrap; width: 1px; } -

Bun is a fast all-in-one JavaScript runtime

Bundle, transpile, install and run JavaScript & TypeScript projects — all in Bun. Bun is a new JavaScript runtime with a native bundler, transpiler, task runner and npm client built-in.

Install Bun CLI v0.1.5 (beta)
macOS x64 & Silicon, Linux x64, Windows Subsystem for Linux
curl https://bun.sh/install | bash
Show script source

Server-side rendering React

HTTP requests per second (Linux AMD64)

  • bun: 48,936 requests per second
  • node: 16,288 requests per second
  • deno: 15,786 requests per second

Load a huge table

Average queries per second

  • bun: 60.24 queries per second
  • better-sqlite3: 23.28 queries per second
  • deno: 9.55 queries per second

How fast can it get? (Hashing)

Operations per second

  • bun: 13,080,444 operations per second
  • Node-API: 6,870,963 operations per second
  • deno: 5,736,247 operations per iteration
Install Bun CLI v0.1.5 (beta)
macOS x64 & Silicon, Linux x64, Windows Subsystem for Linux
curl https://bun.sh/install | bash
Show script source

Tell me more about Bun

Bun is a modern JavaScript runtime like Node or Deno. It was built from scratch to focus on three main things:

  • Start fast (it has the edge in mind).
  • New levels of performance (extending JavaScriptCore, the engine).
  • Being a great and complete tool (bundler, transpiler, package manager).

Bun is designed as a drop-in replacement for your current JavaScript & TypeScript apps or scripts — on your local computer, server or on the edge. Bun natively implements hundreds of Node.js and Web APIs, including ~90% of Node-API functions (native modules), fs, path, Buffer and more.

The goal of Bun is to run most of the world's JavaScript outside of browsers, bringing performance and complexity enhancements to your future infrastructure, as well as developer productivity through better, simpler tooling.

Batteries included

  • Web APIs like fetch, WebSocket, and ReadableStream are built-in
  • node_modules 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
  • In bun.js, every file is transpiled. TypeScript & JSX just work
  • bun supports "paths", "jsxImportSource"and more from tsconfig.json files
  • Bun.Transpiler bun's JSX & TypeScript transpiler is available as an API in Bun.js
  • use the fastest system calls available with Bun.write to write, copy, pipe, send and clone files
  • bun.js automatically loads environment variables from .env files. No more require("dotenv").config()
  • bun ships with a fast SQLite3 client built-in bun:sqlite
  • Node-API bun.js implements most of Node-API (N-API). Many Node.js native modules just work
  • bun:ffi call native code from JavaScript with bun's low-overhead foreign function interface
  • node:fs node:path bun.js natively supports a growing list of Node.js core modules along with globals like Buffer and process

How does Bun work?

Bun.js uses the JavaScriptCore engine, which tends to start and perform a little faster than more traditional choices like V8. Bun is written in Zig
Bun

Bun is a fast all-in-one JavaScript runtime

Bundle, transpile, install and run JavaScript & TypeScript projects — all in Bun. Bun is a new JavaScript runtime with a native bundler, transpiler, task runner and npm client built-in.

Install Bun CLI v0.1.5 (beta)
macOS x64 & Silicon, Linux x64, Windows Subsystem for Linux
curl https://bun.sh/install | bash
Show script source

Server-side rendering React

HTTP requests per second (Linux AMD64)

  • bun: 48,936 requests per second
  • node: 16,288 requests per second
  • deno: 15,786 requests per second

Load a huge table

Average queries per second

  • bun: 60.24 queries per second
  • better-sqlite3: 23.28 queries per second
  • deno: 9.55 queries per second

How fast can it get? (Hashing)

Operations per second

  • bun: 13,080,444 operations per second
  • Node-API: 6,870,963 operations per second
  • deno: 5,736,247 operations per iteration
Install Bun CLI v0.1.5 (beta)
macOS x64 & Silicon, Linux x64, Windows Subsystem for Linux
curl https://bun.sh/install | bash
Show script source

Tell me more about Bun

Bun is a modern JavaScript runtime like Node or Deno. It was built from scratch to focus on three main things:

  • Start fast (it has the edge in mind).
  • New levels of performance (extending JavaScriptCore, the engine).
  • Being a great and complete tool (bundler, transpiler, package manager).

Bun is designed as a drop-in replacement for your current JavaScript & TypeScript apps or scripts — on your local computer, server or on the edge. Bun natively implements hundreds of Node.js and Web APIs, including ~90% of Node-API functions (native modules), fs, path, Buffer and more.

The goal of Bun is to run most of the world's JavaScript outside of browsers, bringing performance and complexity enhancements to your future infrastructure, as well as developer productivity through better, simpler tooling.

Batteries included

  • Web APIs like fetch, WebSocket, and ReadableStream are built-in
  • node_modules 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
  • In bun.js, every file is transpiled. TypeScript & JSX just work
  • bun supports "paths", "jsxImportSource"and more from tsconfig.json files
  • Bun.Transpiler bun's JSX & TypeScript transpiler is available as an API in Bun.js
  • use the fastest system calls available with Bun.write to write, copy, pipe, send and clone files
  • bun.js automatically loads environment variables from .env files. No more require("dotenv").config()
  • bun ships with a fast SQLite3 client built-in bun:sqlite
  • Node-API bun.js implements most of Node-API (N-API). Many Node.js native modules just work
  • bun:ffi call native code from JavaScript with bun's low-overhead foreign function interface
  • node:fs node:path bun.js natively supports a growing list of Node.js core modules along with globals like Buffer and process

How does Bun work?

Bun.js uses the JavaScriptCore engine, which tends to start and perform a little faster than more traditional choices like V8. Bun is written in Zig, a low-level programming language with manual memory management.

Most of Bun is written from scratch including the JSX/TypeScript transpiler, npm client, bundler, SQLite client, HTTP client, WebSocket client and more.

Why is Bun fast?

An enormous amount of time spent profiling, benchmarking and optimizing things. The answer is different for every part of Bun, but one general theme: Zigpackage.json $BUN_BIN add react diff --git a/test/apps/bun-run-check.sh b/test/apps/bun-run-check.sh index 39c2892a7a..3f54fa26b9 100644 --- a/test/apps/bun-run-check.sh +++ b/test/apps/bun-run-check.sh @@ -3,7 +3,7 @@ # TODO: move this test to bun once we have a child_process equivalent. (killall -9 $(basename $BUN_BIN) || echo "") >/dev/null 2>&1 -# https://github.com/Jarred-Sumner/bun/issues/40 +# https://github.com/oven-sh/bun/issues/40 # Define a function (details aren't important) fn() { :; } # The important bit: export the function @@ -22,7 +22,7 @@ if (($?)); then exit 1 fi -# https://github.com/Jarred-Sumner/bun/issues/53 +# https://github.com/oven-sh/bun/issues/53 rm -f /tmp/bun-run-out.expected.txt /tmp/bun-run-out.txt >/dev/null 2>&1 $BUN_BIN run --silent argv -- foo bar baz >/tmp/bun-run-out.txt diff --git a/test/bun.js/ffi.test.fixture.callback.c b/test/bun.js/ffi.test.fixture.callback.c index 1a43a098c2..3c1a95d478 100644 --- a/test/bun.js/ffi.test.fixture.callback.c +++ b/test/bun.js/ffi.test.fixture.callback.c @@ -6,7 +6,7 @@ // clang-format off // This file is only compatible with 64 bit CPUs // It must be kept in sync with JSCJSValue.h -// https://github.com/Jarred-Sumner/WebKit/blob/72c2052b781cbfd4af867ae79ac9de460e392fba/Source/JavaScriptCore/runtime/JSCJSValue.h#L455-L458 +// https://github.com/oven-sh/WebKit/blob/72c2052b781cbfd4af867ae79ac9de460e392fba/Source/JavaScriptCore/runtime/JSCJSValue.h#L455-L458 #ifdef IS_CALLBACK #define INJECT_BEFORE int c = 500; // This is a callback, so we need to inject code before the call #endif diff --git a/test/bun.js/ffi.test.fixture.receiver.c b/test/bun.js/ffi.test.fixture.receiver.c index a6f647253c..90ef5072a1 100644 --- a/test/bun.js/ffi.test.fixture.receiver.c +++ b/test/bun.js/ffi.test.fixture.receiver.c @@ -7,7 +7,7 @@ // clang-format off // This file is only compatible with 64 bit CPUs // It must be kept in sync with JSCJSValue.h -// https://github.com/Jarred-Sumner/WebKit/blob/72c2052b781cbfd4af867ae79ac9de460e392fba/Source/JavaScriptCore/runtime/JSCJSValue.h#L455-L458 +// https://github.com/oven-sh/WebKit/blob/72c2052b781cbfd4af867ae79ac9de460e392fba/Source/JavaScriptCore/runtime/JSCJSValue.h#L455-L458 #ifdef IS_CALLBACK #define INJECT_BEFORE int c = 500; // This is a callback, so we need to inject code before the call #endif diff --git a/zig-build/Dockerfile b/zig-build/Dockerfile index e9ae9248f1..05617a54b2 100644 --- a/zig-build/Dockerfile +++ b/zig-build/Dockerfile @@ -47,7 +47,7 @@ ARG TAG "jul7" RUN --mount=type=tmpfs,target=/zig-build \ cd /zig-build && \ mkdir -p /zig-build; \ - git clone https://github.com/jarred-sumner/zig.git --depth=1; \ + git clone https://github.com/oven-sh/zig.git --depth=1; \ cd /zig-build/zig; \ cmake . -DCMAKE_BUILD_TYPE=Release && \ make -j$(nproc) && \ diff --git a/zig-build/Dockerfile.musl b/zig-build/Dockerfile.musl index e46e2d2d45..76e359116d 100644 --- a/zig-build/Dockerfile.musl +++ b/zig-build/Dockerfile.musl @@ -15,7 +15,7 @@ FROM base as zig RUN --mount=type=tmpfs,target=/zig-build mkdir /zig; \ cd /zig-build && \ mkdir -p /zig-build; \ - git clone -b jarred/zig-sloppy-with-small-structs --single-branch --depth=1 https://github.com/jarred-sumner/zig.git .; \ + git clone -b jarred/zig-sloppy-with-small-structs --single-branch --depth=1 https://github.com/oven-sh/zig.git .; \ cd /zig-build; \ cmake . -DZIG_STATIC_LLVM=ON -DLLVM_INCLUDE_DIRS=$LLVM_INCLUDE_DIRS -DCMAKE_BUILD_TYPE=Release && \ make -j$(nproc) && make install && \ diff --git a/zig-build/release.sh b/zig-build/release.sh index 7cf8dfdb8b..c879311015 100644 --- a/zig-build/release.sh +++ b/zig-build/release.sh @@ -55,4 +55,4 @@ fi docker rm $id -gh release upload $TAG $temp/$CONTAINER_NAME.zip --clobber --repo Jarred-Sumner/zig +gh release upload $TAG $temp/$CONTAINER_NAME.zip --clobber --repo oven-sh/zig