vole
Clone
Read only, no credentials:
https://rodent.software/vole.git
Write over SSH with a registered key:
git clone ssh://git@rodent.software:2222/vole.git
A free and open-source forge that lives in your Git repo.
Remove the merge confetti and canvas-confetti
8032d15aa32facad8f21fad931187520ee81c02b · Keenan Nemetz · 6d ago · parent ac541b26
Remove the merge confetti and canvas-confetti A landing no longer celebrates: the request page is the result, and the vendored library, its loader, and the ?merged=1 flag existed only for the burst. Dropping the flag means a landing redirects to the plain request page. Remove the asset, its license, the NOTICE entry, the loader and its test, and the comments that described them.
server/ui_test.go −37
| @@ -428,43 +428,6 @@ func TestSelfHostedFontsAreEmbedded(t *testing.T) { | |||
| 428 | 428 | } | |
| 429 | 429 | } | |
| 430 | 430 | ||
| 431 | // The celebration library is a static asset like any other, but it is not in the | ||
| 432 | // shell: the shell would make every page load fetch it. app.js names it, and names | ||
| 433 | // it once, so the only request is the one a landing asks for. | ||
| 434 | func TestConfettiIsFetchedOnlyForALanding(t *testing.T) { | ||
| 435 | t.Parallel() | ||
| 436 | f := newFixture(t) | ||
| 437 | f.publish(f.repo) | ||
| 438 | code, body := f.get("/static/confetti.browser.js") | ||
| 439 | if code != 200 { | ||
| 440 | t.Fatalf("/static/confetti.browser.js = %d", code) | ||
| 441 | } | ||
| 442 | if !strings.Contains(body, "canvas-confetti v1.9.3") { | ||
| 443 | t.Fatalf("the vendored script is not canvas-confetti 1.9.3:\n%s", body[:min(len(body), 200)]) | ||
| 444 | } | ||
| 445 | code, app := f.get("/static/app.js") | ||
| 446 | if code != 200 { | ||
| 447 | t.Fatalf("/static/app.js = %d", code) | ||
| 448 | } | ||
| 449 | if n := strings.Count(app, "/static/confetti.browser.js"); n != 1 { | ||
| 450 | t.Fatalf("app.js names the confetti asset %d times, want 1", n) | ||
| 451 | } | ||
| 452 | // The library's default export offloads to a Web Worker built from a blob: | ||
| 453 | // URL, and default-src 'self' blocks it; the canvas is transferred to the | ||
| 454 | // blocked worker first, so the burst silently draws nothing. Only a real | ||
| 455 | // browser can see that, so what this test can hold is the choice that avoids | ||
| 456 | // it: our own instance, on the main thread. | ||
| 457 | if !strings.Contains(app, "useWorker: false") { | ||
| 458 | t.Fatalf("app.js does not create a main-thread confetti instance:\n%s", app) | ||
| 459 | } | ||
| 460 | for _, page := range []string{"/", "/r/" + f.repo + "/requests"} { | ||
| 461 | if code, html := f.get(page); code != 200 { | ||
| 462 | t.Fatalf("%s = %d", page, code) | ||
| 463 | } else if strings.Contains(html, "confetti") { | ||
| 464 | t.Fatalf("%s loads the celebration from the shell:\n%s", page, html) | ||
| 465 | } | ||
| 466 | } | ||
| 467 | } | ||
| 468 | 431 | func TestRunsPageListsQueuedWork(t *testing.T) { | |
| 469 | 432 | t.Parallel() | |
| 470 | 433 | f := newFixture(t) | |