Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
7fec0a3
Build diffr-core for wasm32-unknown-unknown
milanb17 Oct 8, 2026
b284a1a
Move file tag rules into diffr-core
milanb17 Oct 8, 2026
b01cc25
Let a host link plugins into itself through the SDK's native feature
milanb17 Oct 8, 2026
0c6762d
Add diffr-web: the engine and bundled plugins for the browser
milanb17 Oct 8, 2026
0f53ea2
Add the diffr-web page: GitHub pull requests diffed in the browser
milanb17 Oct 8, 2026
e7391f1
Deploy diffr-web to Cloudflare Workers
milanb17 Oct 8, 2026
b6e7ce9
Measure the editor font as monospace, as Review Desktop does
milanb17 Oct 8, 2026
00a460d
Light the enclosing scope when hovering a statement
milanb17 Oct 8, 2026
2945557
Light the enclosing scope when hovering a deleted row
milanb17 Oct 8, 2026
118a87d
Give diffr-web the diffr TUI's keys and fallback count
milanb17 Oct 8, 2026
80de98d
Place a scope's viewed control as it appears
milanb17 Oct 8, 2026
e7faa59
Drop the viewed checkbox's tooltip
milanb17 Oct 8, 2026
38908a7
Hide the caret's mark in each file's overview ruler
milanb17 Oct 8, 2026
b9a8bc9
Polish browser diff UI and restore diagnostic panels
milanb17 Oct 8, 2026
7a50064
Adapt browser host to the indexed cursor API
milanb17 Oct 8, 2026
15581d1
Resolve folds against the models currently in each editor
milanb17 Oct 8, 2026
ae73009
Preserve browser query error codes after lazy initialization
milanb17 Oct 8, 2026
db1fbff
Format the diffr web page's font and Vite config
claude Oct 8, 2026
d1aae54
Compile grammar lexers for wasm a step at a time
claude Oct 8, 2026
c2b30fe
Adapt browser diffs and integration expectations to current main
milanb17 Oct 9, 2026
06d57d7
Merge main into diffr web interface and retain both dependency sets
milanb17 Oct 9, 2026
ae8c534
Restore unsupported-file integration expectations from main
milanb17 Oct 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 116 additions & 0 deletions .github/workflows/diffr-web.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
on:
push:
branches: [main]
paths:
- "diffr/**"
- "apps/diffr-web/**"
# The page is built from Review Desktop's editor and review sources.
- "apps/review-desktop/code-oss/src/vs/**"
- "apps/review-desktop/code-oss/extensions/review-themes/**"
- "packages/review-protocol/**"
- ".github/workflows/diffr-web.yml"
pull_request:
paths:
- "diffr/**"
- "apps/diffr-web/**"
# The page is built from Review Desktop's editor and review sources.
- "apps/review-desktop/code-oss/src/vs/**"
- "apps/review-desktop/code-oss/extensions/review-themes/**"
- "packages/review-protocol/**"
- ".github/workflows/diffr-web.yml"
workflow_dispatch:

name: Diffr Web

permissions:
contents: read

concurrency:
group: diffr-web-${{ github.ref }}
cancel-in-progress: true

jobs:
deploy:
name: Build and deploy
runs-on: ubuntu-24.04
env:
WRANGLER: npx --yes wrangler@4.135.0
# A fork's pull request gets no secrets, so it builds without deploying.
DEPLOY: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
steps:
- name: Checkout source code
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@1.99.0
with:
targets: wasm32-unknown-unknown
# llvm-ar archives the grammars' wasm objects; clang comes with the runner.
components: llvm-tools

- name: Install wasm-bindgen
uses: taiki-e/install-action@1329c298aa20c3257846c9b2e0e55967df3e3c37 # v2
with:
tool: wasm-bindgen@0.2.129

- name: Restore diffr build
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
with:
path: |
~/.cargo/registry
~/.cargo/git
diffr/target
key: diffr-web-${{ hashFiles('diffr/Cargo.lock', 'diffr/rust-toolchain.toml') }}-${{ github.sha }}
restore-keys: diffr-web-${{ hashFiles('diffr/Cargo.lock', 'diffr/rust-toolchain.toml') }}-

- name: Setup pnpm
uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6

- name: Setup Node
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
with:
node-version-file: .nvmrc
cache: pnpm

- name: Install dependencies
run: pnpm install --frozen-lockfile --filter @dev.fast/diffr-web...

- name: Build the engine
run: pnpm --filter @dev.fast/diffr-web wasm

- name: Save diffr build
if: github.ref == 'refs/heads/main'
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
with:
path: |
~/.cargo/registry
~/.cargo/git
diffr/target
key: diffr-web-${{ hashFiles('diffr/Cargo.lock', 'diffr/rust-toolchain.toml') }}-${{ github.sha }}

# Not the repo's typecheck: it needs the engine's bindings, built above.
- name: Typecheck
run: pnpm --filter @dev.fast/diffr-web check

- name: Build the page
run: pnpm --filter @dev.fast/diffr-web build

- name: Deploy
if: env.DEPLOY == 'true' && github.event_name != 'pull_request'
working-directory: apps/diffr-web
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
run: $WRANGLER deploy

- name: Upload a preview
if: env.DEPLOY == 'true' && github.event_name == 'pull_request'
working-directory: apps/diffr-web
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
ALIAS: pr-${{ github.event.pull_request.number }}
run: |
$WRANGLER versions upload --preview-alias "$ALIAS" | tee upload.log
url=$(grep -o "https://$ALIAS-[^ ]*workers.dev" upload.log | head -1)
echo "Preview: ${url:-see the log above}" >> "$GITHUB_STEP_SUMMARY"
2 changes: 2 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
"**/dist/**",
"**/.vite/**",
"apps/review-desktop/code-oss/**",
"apps/diffr-web/src/standalone/**",
"apps/diffr-web/src/review/**",
"diffr/**",
".agent/**",
".agents/**",
Expand Down
3 changes: 3 additions & 0 deletions apps/diffr-web/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist/
src/wasm/
.wrangler/
12 changes: 12 additions & 0 deletions apps/diffr-web/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>diffr</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
32 changes: 32 additions & 0 deletions apps/diffr-web/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "@dev.fast/diffr-web",
"version": "0.0.0",
"private": true,
"description": "diffr in the browser: GitHub pull requests and comparisons diffed on the reader's machine",
"license": "MIT",
"type": "module",
"scripts": {
"wasm": "cd ../../diffr && cargo xtask build-web --out-dir ../apps/diffr-web/src/wasm",
"dev": "vite",
"build": "vite build",
"preview": "vite preview",
"check": "pnpm -w exec tsc --noEmit -p apps/diffr-web"
},
"dependencies": {
"@dev.fast/diffr": "workspace:*",
"@dev.fast/review-protocol": "workspace:*"
},
"devDependencies": {
"@types/trusted-types": "2.0.7",
"@types/wicg-file-system-access": "2023.10.7",
"@vscode/codicons": "0.0.46-21",
"@vscode/diff": "0.0.2-7",
"@vscode/tree-sitter-wasm": "0.3.1",
"@webgpu/types": "0.1.66",
"typescript": "6.0.3",
"vite": "8.0.16"
},
"engines": {
"node": ">=24 <25"
}
}
3 changes: 3 additions & 0 deletions apps/diffr-web/public/_headers
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Built assets are named by their hash, so they never change.
/assets/*
Cache-Control: public, max-age=31536000, immutable
Loading
Loading