olebedev / go-starter-kit

[abandoned] Golang isomorphic react/hot reloadable/redux/css-modules/SSR starter kit
Other
2.82k stars 359 forks source link

Disable SSR #83

Closed leanderme closed 7 years ago

leanderme commented 7 years ago

Hi,

thanks for making this. I've used this repo as inspiration and incoporated all the logic. However, as the client side app grows in complexity, SSR becomes an issue. For this reason, I've already followed your advice on how to turn of SSR by using:

func noJsRender(c echo.Context) error {
    return c.Render(http.StatusOK, "react.html", Resp{
        UUID: c.Get("uuid").(*uuid.UUID).String(),
    })
}

The app runs fine in development by running make serve but fails at building due to various issues with external libraries (the use of reserved words etc). This can't be fixed manually and I like to entirely get rid of the SSR logic.

I haven't yet understood how react.go handles the JS vms pool. To be honest, I blindly used that code.

Any help to resolve my confusion is greatly appreciated!

leanderme commented 7 years ago

Figured it out, sorry for reaching out. For anyone facing the same issue: Very (!) hacky but I just immediately returned the vm of the newJSVM func.