Repository navigation
feat: the port to React, TypeScript and Vite, with its checks - #7
Conversation
ADR-0002 item 1. `site/` becomes the Vite project of D7: React 19 with the Rust React Compiler, `sqzer` 0.3.0 from npm served from the page's own origin, the Content-Security-Policy written once in `vite.config.ts` with jsDelivr gone. The worker, its client and the message types are in `src/shared/api/sqzer/`, and the search is an XState machine with the worker as a callback actor. The page behaves as it did. ADR-0004, proposed: the worker outlives a search, as on `main`, and slices are merged into `src/pages/compress/` until something is reused. A worker per search, as ADR-0002 D10 had it, made a change of quality on a held image take 0.95 s where `main` takes 0.37 s. `check.yml`, `pages.yml` and `dependabot.yml` still name `site/`: items 2 to 4 of ADR-0002. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Comments Outside DiffThese findings could not be posted inline.
|
ADR-0002 items 2 to 4. The `browser` job runs `tsc` over two strict projects, oxlint with its type-aware rules and the React Compiler rules of `eslint-plugin-react-hooks`, `oxfmt --check`, Steiger, Vitest in browser mode and the Playwright suite, the last two in Chromium and Firefox. `/selftest/` is `decode-any.test.ts`, on the page and in a worker, and `.github/check.mjs` is `tests/e2e/page.spec.ts`: one JPEG through the built page, a change of format during a search, the policy, and every request on the page's own origin. The search machine and the controls have tests of their own. `pages.yml` builds and uploads `dist/`. Dependabot watches the root, with the development tooling grouped. `.vscode/` has the settings for the same tools. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Its implicit role is `status`, so the explicit `role` and `aria-live` go, and `jsx-a11y/prefer-tag-over-role` is back on. The stylesheet gives it the block and the margin the paragraph had. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
ADR-0002 item 5. `CLAUDE.md`, `README.md`, `CONTRIBUTING.md` and the PR template describe the project as it is now: pnpm, the layout under `src/`, `pnpm check`, the policy in `vite.config.ts`. The README's "Checking a browser" section goes with `/selftest/`. `SECURITY.md` drops jsDelivr from the scope, and the bug form asks for the version in the footer where it asked for the self-test. Items 5 and 7 of ADR-0002 are ticked. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…r own Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
ADR-0003 D7 and its item 5. Vite lists the licences of what the page's bundle carries, React and XState among them, and a small plugin adds `sqzer`, which is in the worker's bundle and so not on that list. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
What and why
All of ADR-0002's action items.
site/becomes the Vite project of D7, the page behaves as it did, the checks of D6 run in thebrowserjob, and the docs describe the project as it is now.sqzer0.3.0 from npm, bundled into the worker, the wasm served from the page's own origin. The footer's version comes from the package at build time.vite.config.tsand lands after the charset in the builtindex.html. jsDelivr is gone from it.src/shared/api/sqzer/. The search is an XState machine insrc/pages/compress/model/, with the worker as a callback actor.pages.ymlbuilds and uploadsdist/. Dependabot watches the root, withsqzeron its own and the development tooling grouped.It also adds ADR-0004, accepted, for two things that differ from ADR-0002.
The worker outlives a search. D10 ends the worker with every search. I built that first and measured it against
main:The worker now lives as long as the machine's
openstate and keeps the decoded image. Cancelling is re-enteringopen, which ends the worker, and that's still the only way an encode is cancelled.Slices are merged until something is reused. Steiger's
fsd/insignificant-sliceflags every slice with one user, and with one route that's all of them. So the code sits insrc/pages/compress/underui,modelandlib.The checks
/selftest/issrc/shared/api/sqzer/decode-any.test.ts, on the page and in a worker..github/check.mjsistests/e2e/page.spec.ts. The fixtures moved totests/fixtures/.securitypolicyviolationor a request to another origin..oxlintrc.json, each with its reason next to it.Changes in behaviour
mainthat case stays at "Reading".alttexts of the two pictures lose the word "image":jsx-a11y/img-redundant-alt.licenses.txt, which the build writes: the licences of everything the bundle carries,sqzerin the worker included (ADR-0003 D7 and its item 5).<output>, whose implicit role isstatus, where it was a<p role="status" aria-live="polite">. It looks the same.Docs
CLAUDE.md,README.md,CONTRIBUTING.mdand this template describe pnpm, the layout undersrc/,pnpm checkand the policy invite.config.ts. The README's "Checking a browser" section goes with/selftest/.SECURITY.mddrops jsDelivr from the scope. The bug form asks for the version in the footer where it asked for the self-test.Browsers tried
Headless Chromium and Firefox from Playwright 1.63.0, locally and in CI. Before the suites existed, one script ran against the page on
mainand against the built port, and both printed the same statuses, summaries and output sizes for:Safari isn't tried.
New dependencies
All at exact versions, with
pnpm-lock.yamlfrom pnpm 12.8.1.Checklist
.github/check.mjspasses locally, or CI shows it green: it'spnpm checknow/selftest/, if one changed: the checks moved to Vitest unchangeddocs/adr/README.mdand its entry in.greptile/files.json, if there is oneContent-Security-Policyis unchanged, or the PR says why it had to change:cdn.jsdelivr.netleavesscript-srcandconnect-src, as ADR-0002 D2 decided🤖 Generated with Claude Code