Repository navigation
Modernize Go uptime frontend with Vite 8, React 19 and shadcn/ui - #276
Merged
Merged
Conversation
Bring the Go uptime example in line with the TypeScript one: the same shadcn/ui frontend, text and layout, on current Vite, React, TanStack Query and Tailwind 4. Tests move from Jest/Babel to Vitest and mock fetch, since the generated client binds its methods and captures fetch at import. The built frontend stays committed and embedded with go:embed, so `encore run` serves it without Node.js. Also update encore.dev and the other Go modules, and return AlreadyExists instead of a raw Postgres error when adding a site that is already monitored. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
lennartp
approved these changes
Oct 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Brings the Go uptime example (
uptime/) in line with the TypeScript one in #275: the same frontend, text and layout, on current dependencies.Frontend
@tailwindcss/vite), TypeScript 4 → 7, and TanStack Query to the latest v5.Button,Card,InputandBadgecomponents infrontend/src/components/ui, with the neutral theme.cross-fetch/fetch-ponyfill/whatwg-fetchpolyfills.fetchwithvi.hoisted. The generated client binds its methods and capturesfetchwhen it's imported, so spying on its methods (the old Jest approach) has no effect.src/lib/client.ts. It keeps the{{ENCORE_APP_ID}}placeholder, whichencore app createreplaces with each user's app ID.dist. Without that, it picks up class names from previous builds.How it's served
frontend/distis committed and embedded withgo:embed, soencore runserves it onlocalhost:4000with no Node.js needed.npm run devinfrontend/next toencore run. It opens onlocalhost:5173and calls the API on:4000. The README documents this, and fixes the old frontend URL (/frontend/→/).Backend
encore.devv1.12.0 → v1.57.13, gorm 1.31, the gorm postgres driver 1.6 (pgx v5), and x/sync 0.23.site.Addnow returnsalready_exists("site is already being monitored") for duplicate URLs, instead of showing the raw Postgres error in the UI. A test covers it.Deploy time
Measured on Encore Cloud: one staging app, alternating between
mainand this branch, timed fromgit push encoreuntil staging served that version. The first deploy (163s, setting up databases and Pub/Sub) is excluded.mainNo meaningful change, as expected. Encore Cloud doesn't run npm for Go apps, and
frontend/distis committed prebuilt in both versions, so the frontend changes don't affect the build. The new version averages about 5s slower, which is within the run-to-run spread. If it's real, the likely cause is the newer Go modules (encore.devv1.57, gorm 1.31).Test plan
encore run, then in the browser: added sites from the form and the example buttons, ran Check, Check all now and Remove, and added a duplicate URLnpm run devon :5173 loads data from the API on :4000npm testinfrontend/passes 6/6encore test ./...passes, including the newTestAddDuplicatenpm run buildoutput matches the committeddist🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.