Skip to content

Commit

Permalink
latest
Browse files Browse the repository at this point in the history
Former-commit-id: 1086d4f
  • Loading branch information
Jarred-Sumner committed Sep 2, 2021
1 parent 1b894ad commit d009e02
Show file tree
Hide file tree
Showing 41 changed files with 4,691 additions and 1,922 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,6 @@ bun-mimalloc
examples/lotta-modules/bun-yday
examples/lotta-modules/bun-old
examples/lotta-modules/bun-nofscache

src/node-fallbacks/out/*
src/node-fallbacks/node_modules
13 changes: 12 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@

bun: bun-prod-native bun-prod-wasi bun-prod-wasm
bun: vendor bun-prod-native bun-prod-wasi bun-prod-wasm

vendor: api node-fallbacks runtime_js fallback_decoder mimalloc picohttp jsc

api:
peechy --schema src/api/schema.peechy --esm src/api/schema.js --ts src/api/schema.d.ts --zig src/api/schema.zig

node-fallbacks:
cd src/node-fallbacks; npm install; npm run --silent build

fallback_decoder:
esbuild --target=esnext --bundle src/fallback.ts --format=iife --platform=browser --minify > src/fallback.out.js

runtime_js:
esbuild --target=esnext --bundle src/runtime/index.ts --format=iife --platform=browser --global-name=BUN_RUNTIME --minify > src/runtime.out.js; cat src/runtime.footer.js >> src/runtime.out.js

jsc: jsc-build jsc-bindings
jsc-build: jsc-build-mac jsc-copy-headers
jsc-bindings:
Expand Down
23 changes: 10 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,33 +104,30 @@ Unlike many other bundlers, `Bun` only bundles `node_modules`. This is great for

# Not implemented yet



# Building from source

Estimated: 30-60 minutes :(

You'll want to start downloading two things at once:
Compile Zig:

```bash
git clone https://github.com/jarred-sumner/zig && git checkout jarred/zig-sloppy-with-small-structs
git clone https://github.com/jarred-sumner/zig
cd zig
git checkout jarred/zig-sloppy-with-small-structs
cmake . -DCMAKE_PREFIX_PATH=$(brew --prefix llvm) -DZIG_STATIC_LLVM=ON -DCMAKE_BUILD_TYPE=Release && make -j 16
```

```bash
git submodule update --init --recursive --progress --depth=1
```
Note that `brew install zig` won't work. Bun uses a build of Zig with a couple patches.

Next, compile Zig.
You'll want to make sure `zig` is in `$PATH`. The `zig` binary wil be in the same folder as the newly-cloned `zig` repo. If you use fish, you can run `fish_add_path (pwd)`.

On a Mac, that looks like this:
In `bun`:

```bash
cmake . -DCMAKE_PREFIX_PATH=$(brew --prefix llvm) -DZIG_STATIC_LLVM=ON -DCMAKE_BUILD_TYPE=Release && make -j 16
git submodule update --init --recursive --progress --depth=1
```

Note that `brew install zig` won't work. Bun uses a build of Zig with a couple patches.

You'll want to make sure `zig` is in `$PATH`. The `zig` binary wil be in the same folder as the newly-cloned `zig` repo. If you use fish, you can run `fish_add_path (pwd)`.
You

Now go back to the folder with `Bun`'s repository.

Expand Down
2 changes: 0 additions & 2 deletions examples/hello-next/bun-framework-next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@
"author": "",
"license": "ISC",
"dependencies": {
"buffer": "^6.0.3",
"path-browserify": "^1.0.1",
"react-is": "^17.0.2"
}
}
7 changes: 1 addition & 6 deletions examples/hello-next/bun-framework-next/renderDocument.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -417,12 +417,7 @@ export async function render({
(DocumentNamespace && DocumentNamespace.default) || NextDocument.default;
// Document.Html.prototype.getScripts = getScripts;
// }
console.log(
"next",
typeof NextDocument.default,
"doc",
typeof NextDocument.default.renderDocument
);

const callMiddleware = async (method: string, args: any[], props = false) => {
let results: any = props ? {} : [];

Expand Down
Loading

0 comments on commit d009e02

Please sign in to comment.