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:
- Security
- Performance
- Compatibility
- …and many more.
To upgrade, first find the commit in **Bun's WebKit fork** (not Bun!) between when we last upgraded and now.
```bash
$ cd src/bun.js/WebKit # In the WebKit directory! not bun
$ git checkout $COMMIT
```
This is the main command to run:
```bash
$ git pull https://github.com/WebKit/WebKit.git main --no-rebase --allow-unrelated-histories -X theirs
```
Then, you will likely see some silly merge conflicts. Fix them and then run:
```bash
# You might have to run this multiple times.
$ rm -rf WebKitBuild
# Go to Bun's directory! Not WebKit.
cd ../../../../
make jsc-build-mac-compile
```
Make sure that JSC's CLI is able to load successfully. This verifies that the build is working.
You know this worked when it printed help options. If it complains about symbols, crashes, or anything else that looks wrong, something is wrong.
```bash
src/bun.js/WebKit/WebKitBuild/Release/bin/jsc --help
```
Then, clear out our bindings and regenerate the C++<>Zig headers:
```bash
make clean-bindings headers builtins
```
Now update Bun's bindings wherever there are compiler errors:
```bash
# It will take awhile if you don't pass -j here
make bindings -j10
```
This is the hard part. It might involve digging through WebKit's commit history to figure out what changed and why. Fortunately, WebKit contributors write great commit messages.
sts
Unnamed repository; edit this file 'description' to name the repository.
* use WTF to join registry strings
* show dependency error messages, better join error
We actually report errors when enqueuing dependencies now. I also made
the join URLs error message read better. It'd be cleaner to handle it
all in one place, but there's currently no way to propagate the data up.
* starting on registry URL tests
* added more registry URL tests
* [install] prevent optional/peer deps from failing builds
Couldn't get the peer dependency test to work, but the code is there.
* ran prettier
* changed error note to use realname, updated tests
* ran prettier again...