Open
Conversation
PocketBase v0.23.0 introduced a major API redesign. Key changes: - Use OnServe().BindFunc() instead of OnBeforeServe().Add() - Use new router API (Go 1.22 mux patterns) instead of Echo - Use migratecmd.Config instead of migratecmd.Options - Use apis.Static() for serving embedded files - Use apis.WrapStdHandler() for wrapping http.Handler - Replace echo with stdlib net/http in lighting bridge - Replace echo.MustSubFS with io/fs.Sub in embeddy - Upgrade Go toolchain to 1.24.0 (required by PocketBase) - Remove labstack/echo/v5 dependency entirely https://claude.ai/code/session_01XWLJELDi6wxFXL95EVXoAQ
Resolve conflicts from main: - Keep dynamic Go version reading from go.mod in WORKSPACE - Keep PocketBase v0.36.1 API changes while incorporating error handling - Keep Go 1.24.0 version required by PocketBase v0.36.1 https://claude.ai/code/session_01XWLJELDi6wxFXL95EVXoAQ
statik
commented
Feb 13, 2026
|
|
||
| log.Debug().Msgf("running pocketbase with data dir %s\n", configDir) | ||
| app := pocketbase.NewWithConfig(&pocketbase.Config{ | ||
| app := pocketbase.NewWithConfig(pocketbase.Config{ |
Member
Author
There was a problem hiding this comment.
🚫 [golangci] reported by reviewdog 🐶
pocketbase.Config is missing fields HideStartBanner, DefaultDev, DefaultEncryptionEnv, DefaultQueryTimeout, DataMaxOpenConns, DataMaxIdleConns, AuxMaxOpenConns, AuxMaxIdleConns, DBConnect (exhaustruct)
| mux.Handle("GET /{path...}", assetHandler) | ||
| mux.Handle("POST /api/switcher/{path...}", &Switcher{}) | ||
| mux.Handle("POST /api/light/{path...}", &Lighting{}) | ||
| err = http.ListenAndServe(listenAddr, mux) |
Member
Author
There was a problem hiding this comment.
🚫 [golangci] reported by reviewdog 🐶
G114: Use of net/http serve function that has no support for setting timeouts (gosec)
| }) | ||
|
|
||
| app.OnBeforeServe().Add(func(e *core.ServeEvent) error { | ||
| app.OnServe().BindFunc(func(e *core.ServeEvent) error { |
Member
Author
There was a problem hiding this comment.
🚫 [golangci] reported by reviewdog 🐶
parameter name 'e' is too short for the scope of its usage (varnamelen)
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
This PR removes the Echo web framework dependency and replaces it with Go's standard library
net/httpandhttp.ServeMux. Additionally, it upgrades the project to Go 1.24.0 and updates PocketBase to v0.36.1, which includes API changes that align with this refactoring.Key Changes
Removed Echo framework: Replaced all Echo-specific code with standard library equivalents
github.com/labstack/echo/v5dependency fromgo.modand build filesecho.New()withhttp.NewServeMux()incmd/lighting.gomux.Handle()instead of Echo's route methodsecho.WrapHandler()withapis.WrapStdHandler()for PocketBase integrationUpdated Go version:
go.modtoolchain go1.24.7directivevendor.shcompatibility flag from 1.18 to 1.24Updated PocketBase:
migratecmd.Options→migratecmd.Configapp.OnBeforeServe()→app.OnServe().BindFunc()apis.Static()andapis.WrapStdHandler()pocketbase.NewWithConfig(&pocketbase.Config{})topocketbase.NewWithConfig(pocketbase.Config{})Simplified embedder:
embeddypackageecho.MustSubFS()with standardfs.Sub()in bothembeddy/embedder.goandsitemanifest/main.goCode organization:
BUILD.bazelfor consistencyImplementation Details
The refactoring maintains the same functionality while using only Go standard library for HTTP handling. The
http.ServeMuxprovides the necessary routing capabilities, and PocketBase's newer APIs (apis.Static(),apis.WrapStdHandler()) handle the integration seamlessly. All route patterns were updated to use the new Go 1.22+ syntax (e.g.,GET /{path...}instead of/*).https://claude.ai/code/session_01XWLJELDi6wxFXL95EVXoAQ