Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
johnemau
commented
Oct 8, 2026
| import makeServiceWorkerEnv = require('service-worker-mock'); | ||
| declare const global: WorkerGlobalScope; | ||
| // Node 21+ defines a getter-only `navigator` that Object.assign cannot overwrite. | ||
| Reflect.deleteProperty(global, 'navigator'); |
Contributor
Author
There was a problem hiding this comment.
This is removed in
There was a problem hiding this comment.
🟡 Changes recommended
The non-Vercel production asset base generates broken URLs for assets published through assets.every.org.
1 open finding
What changed in this PR
Migrates donate-button v4 from Preact CLI to Vite 8 and standardizes the repository on Node 24.
Changes:
- Adds Vite-based v4 builds with legacy-compatible output and asset hashing.
- Updates assets and dependencies for Vite.
- Updates Node tooling, CI, and worker-test compatibility.
| File | Description |
|---|---|
.github/workflows/ci.yml |
Runs CI with Node 24. |
.tool-versions |
Selects Node 24.16.0. |
package.json |
Requires Node 24. |
packages/cloudflare-worker/test/_setup.ts |
Removes Node’s getter-only navigator before mocking. |
packages/donate-button-v4/index.html |
Adds the Vite module entry. |
packages/donate-button-v4/package.json |
Replaces Preact CLI scripts and dependencies with Vite. |
packages/donate-button-v4/preact.config.js |
Removes the obsolete Webpack configuration. |
packages/donate-button-v4/public/assets/close.svg |
Moves the close icon into Vite’s public tree. |
packages/donate-button-v4/public/assets/logo.svg |
Moves the logo into Vite’s public tree. |
packages/donate-button-v4/vite.config.mjs |
Configures output layout, target, base URL, and asset hashing. |
yarn.lock |
Records the Vite dependency graph and removes Preact CLI packages. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+16
to
+18
| base: process.env.VERCEL_URL | ||
| ? `https://${process.env.VERCEL_URL}/${VERSION_SLUG}/` | ||
| : '/', |
johnemau
force-pushed
the
john-with-claude/node-24-donate-testing-80be4e
branch
from
October 16, 2026 17:03
6e6f03b to
1431928
Compare
preact-cli 3.5.0 is archived and only builds on Node 24 through a patch that bypasses its `esm` config loader. Vite builds the same IIFE bundle to dist/donate-button/0.4 with the VERCEL_URL asset base, so the preact-cli patch, its postinstall, and preact.config.js are removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Problem: Without VERCEL_URL, `yarn build` emitted icon URLs as `/<hash>.svg`. The bundle checked into docs/ runs on third-party pages, so those URLs resolve against the host page and the crypto icons break. Root Cause: The Vite `base` fallback was `/`, while preact.config.js used `https://assets.every.org/dist/donate-button/0.4/` for non-Vercel production builds. Solution: Restore the assets.every.org base for non-Vercel builds and keep `/` for the dev server. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
johnemau
force-pushed
the
john-with-claude/node-24-donate-testing-80be4e
branch
from
October 16, 2026 22:36
7c561c0 to
d47a729
Compare
Fishbakh-N
approved these changes
Oct 27, 2026
This branch was successfully deployed
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.

Move donate-button-v4 to Vite 8 so we can drop preact-cli
Replaces
Problem
yarn buildfails on Node 22 and 24:Can't resolve 'src/autoPlayMode'.Cannot set property navigator of #<Object> which has only a getter.Root Cause
esmloader fails on Node 22+, dropping thesrc/alias.Function.prototype.applyerror.Solution
@preact/preset-vite; see docs: Add notice forcreact-preactpreactjs/preact-cli#1808.VERCEL_URL) as the asset base for production builds and/otherwise.--openssl-legacy-providerand retain the ES2015 target.navigatorbefore worker tests assignservice-worker-mockglobals.engines.node,.tool-versions, and CI to Node 24.Visual check
yarn devBoth screenshots were captured at 1280×800 after clicking "Donate".
They are byte-identical, so both columns use the same hosted image.
Build output
button.js(Vercel, gzip)~3K savings by moving from babel to rollup bundlers (preact-cli -> vite)
🤖 Generated with Claude Code