Releases: gofiber/fiber
v1.10.5
v1.10.0
Dear 🐻 Gophers,
Fiber v1.10.0
is finally released and it has some important changes we would like to share with you.
⚠️ Breaking Changes
- All routes will return the registered
Route
metadata instead ofApp
, chaining methods won't be possible anymore. - All template settings are replaced by the new
ctx.Settings.Templates
interface. See our updated template middleware for examples with support for8
template engines.
📚 Show syntax
type Engine struct {
templates *template.Template
}
func (e *Engine) Render(w io.Writer, name string, data interface{}) error {
return e.templates.ExecuteTemplate(w, name, data)
}
func main() {
app := fiber.New()
engine := &Engine{
// ./views/index.html
// <h1>{{.Title}}</h1>
templates: template.Must(template.ParseGlob("./views/*.html")),
}
app.Settings.Template = engine
app.Get("/hello", func(c *fiber.Ctx) {
c.Render("index", fiber.Map{
"Title": "Hello, World!",
})
})
}
ctx.Body(key ...string)
Accessing form data viaBody
is deprecated, please usectx.FormValue(key string)
instead.ctx.Cookies(key ...string)
To get the rawCookie
header, please usectx.Get("Cookies")
instead.
🔥 New
- Handler type has been added
- app.Add register handlers with a HTTP method input:
app.Add("GET", "/foo", handler)
. - app.Settings.Templates is the interface that wraps the Render function #331.
- app.Settings.DisableHeaderNormalizing Disable normalization:
conteNT-tYPE -> Content-Type
- ctx.Context() returns context.Context that carries a deadline, a cancellation signal, and other values across API boundaries. #383
🩹 Fixes
- Exact param keys in request paths are now matched as static paths #405
c.Params()
now accepting case sensitive values and keys #392- Cookies
SameSite
attribute defaults toLax
if not set c.Append()
does not append duplicates anymore on case-sensitive valuesc.SendFile("./404.html")
would overwrite previous status codes, this has been fix. #391app.Test
Would throw anEOF
error if you do not provide aContent-Length
header when passing a bodyio.Reader
with NewRequest. This is not necessary anymore, it will add the header for you if not provided.ctx.Protocol()
also checks the"X-Forwarded-Protocol"
,"X-Forwarded-Ssl"
and"X-Url-Scheme"
headers
🧹 Updates
- app.Use & app.Group now supports
/:params
&/:optionals?
inside the prefix path. - Fiber docs are now fully translated in Russian & Chinese
- Add new supporters to README's
- Update template examples in README's
- Add
./public
to Static examples in README's #411 - Add new media articles to README's Improve performance & web-based authentication
- With the help of @ReneWerner87 we produce zero garbage on matching and dispatching incoming requests. The only heap allocations that are made, is by building the key-value pairs for path parameters. If the requested route contains no parameters, not a single allocation is necessary.
🧬 Official Middlewares
- gofiber/utils
v0.0.3
- gofiber/logger
v0.1.1
- gofiber/session
v1.1.0
- gofiber/template
v1.3.0
- gofiber/websocket
v0.2.1
🌱 Third Party Middlewares
v1.9.6
🚀 Fiber v1.9.6
Special thanks to @renanbastos93 & @ReneWerner87 for optimizing the current router.
Help use translate our API documentation by clicking here
🔥 New
AcquireCtx
/ReleaseCtx
The Ctx pool is now accessible for third-party packages- Fiber docs merged Russian translations 84%
- Fiber docs merged Spanish translations 65%
- Fiber docs merged French translations 40%
- Fiber docs merged German translations 32%
- Fiber docs merged Portuguese translations 24%
🩹 Fixes
- Hotfix for interpolated params in nested routes #354
- Some
Ctx
methods didn't work correctly when called without an*App
pointer. ctx.Vary
sometimes added duplicates to the response header- Improved router by ditching regexp and increased performance by 817% without allocations.
// Tested with 350 github API routes
Benchmark_Router_OLD-4 614 2467460 ns/op 68902 B/op 600 allocs/op
Benchmark_Router_NEW-4 3429 302033 ns/op 0 B/op 0 allocs/op
🧹 Updates
- Add context benchmarks
- Remove some unnecessary functions from
utils
- Add router & param test cases
- Add new coffee supporters to readme
- Add third party middlewares to readme
- Add more comments to source code
- Cleanup some old helper functions
🧬 Middleware
- gofiber/adaptor
v0.0.1
Converter for net/http handlers to/from Fiber handlers - gofiber/session
v1.0.0
big improvements and support for storage providers - gofiber/logger
v0.0.6
supports${error}
param - gofiber/embed
v0.0.9
minor improvements and support for directory browsing
v1.9.3
🚀 Fiber v1.9.3
go get -u github.com/gofiber/fiber
Special thanks to @monzarrugh, @renanbastos93, @glaucia86, @bestgopher, @ofirrock, @jozsefsallai, @thomasvvugt, @elliotforbes, @Khaibin, @tianhongw, @arsmn, @da-z and everyone else who helped contribute to make this tag possible.
🔥 New
- API Documentation is translatable here https://crowdin.com/project/gofiber #309
c.Fresh()
Experimental, not bulletproof for production #317 #311- Full address will be printed on listening
:3000
=>0.0.0.0:3000
- New discord server https://gofiber.io/discord
- Added statuscodes
421
,103
#306 c.BodyParser()
allows duplicate query keys #316 #288- Hebrew translation README_he.md #303
- Settings.DisableStartupMessage
When set to true, it will not print out the fiber ASCII and `.. listening on ..`` message
- Settings.ETag
Enable or disable ETag header generation, since both weak and strong etags are generated using the same hashing method (CRC-32). Weak ETags are the default when enabled. - Fiber on youtube https://youtu.be/Iq2qT0fRhAA @elliotforbes
🧹 Updates
c.BodyParser()
will now ignore missing fields by default #308- Add new media links to README's
- Add
SaveFile
test #315 - Add
FormFile
test #315 - Update supporters in all README's
- Updated contributing.md #289
🧬 Middleware
- arsmn/fiber-swagger #276
- gofiber/embed
v0.0.8
- gofiber/logger
v0.0.4
🩹 Fixes
v1.9.2
Special thanks to József Sallai, Ray Mayemir, Encendre,Matthew Lee, Alireza Salary & Thomas van Vugt and everyone else who helped contribute to make this possible.
🔥 New
- New official website -> https://gofiber.io thanks for the landingpage @jozsefsallai
- README.md translated in Dutch @thomasvvugt
🧹 Updates
- API Docs moved to https://docs.gofiber.io
- Bumb fasthttp to
v1.12.0
🧬 Middleware
🗑️ Deprecated
- c.Body() is not used for form values anymore.
Use c.FormValue() to access any form value. - c.Cookies() must have a key.
If you want the raw cookie header please usec.Get("Cookies")
🗑️ Removed
- json-iterator dependency json-iterator/go#455
- travis.yml is replaced with github actions
Dependency Graph v1.9.2
v1.9.1
v1.9.0
Special thanks to József Sallai, Ray Mayemir, Encendre & Matthew Lee
🔥 New
app.Serve()
#265ctx.BodyParser()
now supports queries
🧹 Updates
🧬 Middleware
- https://github.com/gofiber/pprof gofiber/recipes#7
- https://github.com/gofiber/session #201
- https://github.com/gofiber/keyauth
- https://github.com/gofiber/jwt
- https://github.com/gofiber/redirect
🩹 Fixes
c.XHR()
is now in case sensitive- Some tests were inconsistent
Dependency Graph v1.9.0
v1.8.43
v1.8.42
v1.8.41
🔥 New
- app.Settings.ReadTimeout https://fiber.wiki/application#settings #238
- app.Settings.WriteTimeout https://fiber.wiki/application#settings #238
- app.Settings.IdleTimeout https://fiber.wiki/application#settings #238