Skip to content

Remove Echo framework, upgrade to Go 1.24 and PocketBase v0.36.2#877

Closed
Copilot wants to merge 3 commits intomainfrom
copilot/remove-echo-framework
Closed

Remove Echo framework, upgrade to Go 1.24 and PocketBase v0.36.2#877
Copilot wants to merge 3 commits intomainfrom
copilot/remove-echo-framework

Conversation

Copy link

Copilot AI commented Feb 13, 2026

Overview

Eliminates Echo v5 dependency in favor of Go stdlib and PocketBase native routing. Upgrades Go 1.22.8→1.24 and PocketBase v0.16.5→v0.36.2 (20 minor versions), handling breaking API changes in PocketBase's routing layer.

Changes

Core Dependencies

  • Removed: github.com/labstack/echo/v5
  • Upgraded: Go to 1.24.0, PocketBase to v0.36.2
  • Updated: All transitive dependencies via go mod tidy

PocketBase Server (cmd/fly.go)

Migrated from Echo-based routing to PocketBase v0.36 native router:

// Before (v0.16 + Echo)
app.OnBeforeServe().Add(func(e *core.ServeEvent) error {
    e.Router.AddRoute(echo.Route{
        Method: http.MethodGet,
        Path: "/*",
        Handler: echo.WrapHandler(assetHandler),
    })
})

// After (v0.36 native)
app.OnServe().BindFunc(func(e *core.ServeEvent) error {
    e.Router.GET("/*", apis.Static(public, true))
    e.Router.POST("/api/switcher/*", apis.WrapStdHandler(&Switcher{}))
    return e.Next()
})
  • Changed OnBeforeServe()OnServe() hook
  • Replaced echo.Route with router methods (GET, POST)
  • Use apis.Static() and apis.WrapStdHandler() for handlers
  • Fixed NewWithConfig() signature (value vs pointer)
  • Updated migratecmd.Optionsmigratecmd.Config

Standalone HTTP Server (cmd/lighting.go)

Replaced Echo with Go stdlib http.ServeMux:

// Before
e := echo.New()
e.GET("/*", echo.WrapHandler(assetHandler))
e.Start(listenAddr)

// After
mux := http.NewServeMux()
mux.Handle("/", assetHandler)
server := &http.Server{Addr: listenAddr, Handler: mux}
server.ListenAndServe()

Filesystem Utilities

  • embeddy/embedder.go: Replaced echo.MustSubFS() with stdlib fs.Sub() wrapper
  • sitemanifest/main.go: Updated codegen template to remove Echo imports

Migration Notes

PocketBase v0.36 removes Echo dependency internally. Applications using PocketBase should migrate to the new router API. The ServeEvent.Router now uses PocketBase's native router with methods like GET(), POST(), and middleware functions like apis.Static().

Original prompt

The pull request aims to remove the Echo web framework and replace it with the Go standard library, upgrading the project dependencies including PocketBase and updating to Go 1.24. There are test errors that need fixing related to the changes. This PR involves extensive refactoring of route handling, build tools, and the dependencies used in a complex Go project.

This pull request was created from Copilot chat.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits February 13, 2026 04:11
Co-authored-by: statik <983+statik@users.noreply.github.com>
Co-authored-by: statik <983+statik@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove Echo framework and update project dependencies Remove Echo framework, upgrade to Go 1.24 and PocketBase v0.36.2 Feb 13, 2026
Copilot AI requested a review from statik February 13, 2026 04:15

log.Debug().Msgf("running pocketbase with data dir %s\n", configDir)
app := pocketbase.NewWithConfig(&pocketbase.Config{
app := pocketbase.NewWithConfig(pocketbase.Config{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
pocketbase.Config is missing fields HideStartBanner, DefaultDev, DefaultEncryptionEnv, DefaultQueryTimeout, DataMaxOpenConns, DataMaxIdleConns, AuxMaxOpenConns, AuxMaxIdleConns, DBConnect (exhaustruct)

mux.Handle("/api/switcher/", &Switcher{})
mux.Handle("/api/light/", &Lighting{})

server := &http.Server{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
G112: Potential Slowloris Attack because ReadHeaderTimeout is not configured in the http.Server (gosec)

if err != nil {
panic(fmt.Errorf("failed to create sub FS: %w", err))
}
return sub
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
return with no blank line before (nlreturn)

})

app.OnBeforeServe().Add(func(e *core.ServeEvent) error {
app.OnServe().BindFunc(func(e *core.ServeEvent) error {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [golangci] reported by reviewdog 🐶
parameter name 'e' is too short for the scope of its usage (varnamelen)

@statik statik closed this Feb 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants