Repository navigation
SL1: the chat app on Workers - #2
Merged
Merged
Conversation
Supabase's Slack clone example in apps/web, built by OpenNext into one Cloudflare Worker + Static Assets. The example's code is the code: the pages, the components, the styles and lib/Store.js are upstream's, with next pinned at 16.3.8 (upstream says latest) and only what the platform forces changed — the Link that wrapped an <a>, onAuthStateChange's supabase-js 2 return shape, the App component no longer named after this repository's slug, and SITE_NAME (lib/site.ts) in every page's title and on the sign-in form. next.config.ts reads the project's URL and publishable key from the committed wrangler.jsonc, so the bundle and the Worker name one project. /api/health answers only from the Worker, read-only: Auth's settings and the Data API's channels table, asked with the publishable key. tests/web covers the health check, the data layer, the Next config and the committed wrangler config. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019PcpNVpFBcbeiX3EHdXfmn
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.
What this lands
Supabase's Slack clone example in
apps/web, built by@opennextjs/cloudflareinto one Worker + Static Assets (task SL-2).The example's code is the code. The pages, components, styles,
lib/Store.js,lib/UserContext.jsandpublic/come from upstream at9eaae4c. The only changes are what the platform forces:nextpinned at 16.3.8 (upstream sayslatest), with React 19.components/Layout.js: the class moves onto<Link>. Next ≥ 13 renders the anchor itself and refuses a nested<a>.pages/_app.js:onAuthStateChangereturns{ data: { subscription } }in supabase-js 2, so upstream's unsubscribe threw on unmount.pages/_app.js: the App component is namedChatApp, because upstream's name spells this repository's slug.lib/site.ts(SITE_NAME) supplies every page's<title>and a heading on the sign-in form. This is the rebrand's seam.next.config.tsreadsNEXT_PUBLIC_SUPABASE_URLandNEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEYfrom the committedwrangler.jsonc, the fixture render ofwrangler.template.jsonc. The bundle and the Worker therefore name one project.pages/api/health.tsis new and read-only, and only the Worker can answer it. It returns 200 only when the project's Auth answers the build's key and its Data API knows thechannelstable. Before the migrations it returns 503schema: "not migrated".tests/web(vitest, 18 tests) covers the health check, the data layer against a stand-in client, the Next config and the committed wrangler config.The Supabase project and the schema land in SL2. Until then, every build inlines the fixture's placeholder project, which nothing calls.
Checked
orun validatepasses, and the lockfile resolves this workspace.pnpm typecheck,pnpm lint,pnpm testandpnpm buildare green (Worker ~1.1 MiB gzipped).Generated by Claude Code