Development
Latest Updates on This Site
A small-scale reconstruction.
I upgraded from Remix to React Router 7, switched to Magic Link login, and added Map Mode. I boosted performance and refactored the CMS to SvelteKit with AI endpoints and gpt-5; Unsplash uploads are automatic.
- #Frontend
- #Remix
- #ReactRouter7
- #SvelteKit
- #CMS
- #AI
- #Performance
16
It’s been over half a year since my last post. No special reason—my urge to express myself just waned. Plus, I’ve been busy with my own stuff and haven’t been in the mood to write.
But I’m the kind of person who, once I get into a certain state, tends to keep it going.
If I’ve been exercising consistently during a period, I really want to work out; if I haven’t been exercising during a period, I don’t want to.
Starting this year, I began trying to use AI’s Agent mode to assist with programming. Combined with new requirements for a contract project from the previous month, I kept writing code for a while, which put me into a “want to write code” state. So besides contributing some code to an open-source Chrome extension, I also added many new features to this site’s CMS and frontend, fixed some long-standing bugs, and optimized performance.
Frontend
Upgrade
The site you’re looking at was previously built with Remix. But since last year, the features originally planned for Remix 3 were merged into React Router 7, so if you want to upgrade from Remix 2.x, you have to switch to React Router 7. Fortunately, Remix itself is a framework built on React Router, so the upgrade wasn’t difficult. It was almost just a matter of changing some settings, and the upgrade went smoothly.
Login
I removed the email/password login and switched to Magic Link by email. The original purpose of adding login was to curb malicious comments—comments from users who aren’t logged in require review before they’re shown—but I later realized that hardly anyone comments...
Another feature I want is “visible after login.” For articles on certain political topics, only logged-in users can view them. It’s not particularly useful, but it prevents them from being indexed by search.
Map Mode
This is another feature I’ve long wanted to build, but I never started because it was too complex. With AI’s help, I actually built it in a single evening this time.
Performance Optimization
Then there are some performance optimizations, such as on-demand importing of JS files and lazy loading. Although the site was already fast, these changes have only a slight effect on the actual experience.
CMS
The bigger refactor is in the CMS—the so-called “backend”—with a ton of new features added this time.
First was upgrading dependencies: Svelte was upgraded to 5. In this version Svelte introduces the rune syntax, so I switched all previous reactive data usage to the new syntax.
Removing the dependency on standalone workers
The CMS has many functions that need to run at the edge, including various AI features and uploading images to R2 and extracting EXIF data. When I built the CMS last year, for ease of development and testing, I put these pieces of logic into standalone workers and deployed them separately.
This time I moved those functions into the CMS project as SvelteKit server endpoints. I have to say I spent a long time debugging.
Previously, the site’s various API keys and configuration information were stored in KV. I didn’t think that was necessary, so I moved that data into the database.
Upgrading the AI model
Upgraded from the original gpt-4o to 5. Since starting with gpt-5 the old completion method can no longer be used and you need to switch to responses. This was also the main reason I decided to refactor those worker functions.
Automatic Unsplash upload
This is also a feature I wanted from the start. Now uploading images from Unsplash is as simple as browsing and clicking within the editor.
Now the blog is almost exactly what I envisioned. My only concern is that, so far, the project’s complexity is still within my control and understanding. Whether I’ll still have the willingness to keep improving it in the future, and whether AI can avoid creating a big ball of mud, is a question mark.