Skip to content

Releases

v14.0.1

Choose a tag to compare

@kataras kataras released this 13 Nov 17:12
0866626

Version 14 release notes and reference: https://github.com/kataras/iris/releases/tag/v14.0.0 (read this first).


In-short, all valid opened issues are fixed.

Changelog: https://github.com/kataras/iris/blob/v14.0.1/HISTORY.md#fri-13-november-2026--v1401

v14.0.0

Choose a tag to compare

@kataras kataras released this 12 Nov 15:55
a30b627

Iris v14 is the first new major version since v12. The module path is github.com/kataras/iris/v14 and it requires Go 1.27 or later.

go get github.com/kataras/iris/v14@v14.0.0
package main

import "github.com/kataras/iris/v14"

type Book struct {
	Title string `json:"title"`
}

func main() {
	app := iris.New()

	app.Get("/books/{id:uuid}", func(ctx iris.Context) {
		ctx.JSON(iris.Map{"id": ctx.Params().GetString("id")})
	})

	app.Post("/books", func(ctx iris.Context) {
		book, ok := ctx.BindJSON[Book]()
		if !ok {
			return
		}

		ctx.StatusCode(iris.StatusCreated)
		ctx.JSON(book)
	})

	app.Listen(":8080")
}

ctx.BindJSON[Book]() is a generic method, which is why v14 needs Go 1.27. It decodes the body, runs Validate() error when the type has one, and answers the client itself when either step fails.

What is new

  • iris.NewBuilder assembles an application in one compile-checked chain: CORS, compression, access logging, a health endpoint, error mapping, services and API groups.
  • Typed request binding on generic methods (ctx.BindJSON[T](), ctx.BindUpdate[T]()) replaces hand-written decode blocks.
  • rest/errors: handlers report errors and one central map turns them into canonical, machine-readable responses. Internal details go to the server log and never to the client.
  • A dependency injection container is built in and replaces hero. Constructors declare what they need, Initializer hooks run at startup and closers run at shutdown.
  • JSON runs on encoding/json/v2.
  • Thirty-one built-in middleware, API keys being the newest. Sessions, cache, i18n, versioning and websocket now live under middleware/.
  • Authentication at every scale: Basic Auth typed by your own user type, API keys, a generic JWT SDK, an identity server and an OAuth2 provider.
  • ai: renders and relays streamed model output over HTTP (text deltas, reasoning traces, tool-call fragments, usage). It is provider-agnostic and ships no vendor SDK.
  • client: an HTTP client for calling other services under the same JSON rules the server side uses.
  • Views are a middleware. middleware/view holds a one-method Engine interface. The HTML, Django, Handlebars, Jet, Pug and Ace engines moved to iris-contrib/views, and kataras/blocks works as it is.
  • Server options: app.Run(iris.ServerOptions{...}) replaces iris.Addr, iris.TLS and iris.AutoTLS. ngrok tunneling is opt-in through a blank import of core/server/ngrok.
  • MVC controllers on Go generics, in controller/mvc.

Upgrading from v12

Every removed v12 name fails at compile time, so the compiler's error list is your to-do list. MIGRATION.md maps each name to its replacement. It opens with a prompt that you can paste into a coding agent, which then does the mechanical part.

The replacements most applications meet first:

v12 v14
github.com/kataras/iris/v12 github.com/kataras/iris/v14
iris.Party, app.Party(prefix) iris.Router, app.Router(prefix)
iris.Configuration, iris.With... iris.Options
iris.Addr, iris.TLS, iris.AutoTLS app.Run(iris.ServerOptions{...})
ctx.URLParam("q") ctx.Query().Get("q")
ctx.Params().Get("id") ctx.Params().GetString("id")
ctx.Header(k, v) to set, ctx.GetHeader(k) to read ctx.SetHeader(k, v) to set, ctx.Header(k) to read
app.RegisterView(engine), ctx.View(...) app.Use(view.Handler(engine)), view.Render(ctx, ...)
hero the built-in DI container
middleware/logger middleware/accesslog
middleware/recover middleware/recovery
sessions, cache, websocket, i18n, view, versioning the same names under middleware/
mvc controller/mvc
x/errors, x/client, x/jsonx rest/errors, client, rest/types

Defaults that changed

The compiler does not flag these, so read them before you deploy:

  • Session cookies are Secure and SameSite=Lax.
  • JWT tokens are read from the Authorization header only.
  • CORS no longer advertises credentials together with a wildcard origin.
  • ctx.SetCookie replaces a cookie with the same name, path and domain, and ctx.AddCookie defaults to SameSite=Lax.
  • JSON is encoded and decoded by encoding/json/v2.

MIGRATION.md explains each one, and lists the v12 bugs whose fixes change what you observe.

v12

Nothing changes for an application that imports github.com/kataras/iris/v12. That code stays on the v12 branch, and v12.2.12 is its latest release.

Documentation

Related repositories

Found a problem? Open an issue.

v12.2.12

Choose a tag to compare

@kataras kataras released this 12 Nov 14:49
v12.2.12
71fec43

This release tags everything that landed on main since v12.2.11. From now on the v12 code lives on the v12 branch, and main moves on to v14, which has its own import path. Nothing changes for your imports: v12 is still github.com/kataras/iris/v12.

Upgrade with go get github.com/kataras/iris/v12@latest.

What's new

  • The module now requires Go 1.26 (v12.2.11 required 1.22).
  • Dependencies are at their newest versions. golang.org/x/crypto goes from v0.31.0 to v0.59.0 and golang.org/x/net from v0.26.0 to v0.62.0, which brings in their security fixes.
  • sessions/sessiondb/badger moves from badger v2 to v4. Its import is now github.com/dgraph-io/badger/v4.
  • x/jsonx: ISO8601 parses timestamps with an unconventional offset, such as 2024-05-21T18:06:07.000000-04:01:19.
  • x/jsonx: new Season bitmask type and a GetSeasonByDate(SimpleDate) helper.
  • x/errors: when a response body cannot be encoded because of a NaN value, the error reports which field holds it.
  • macro/interpreter/token: Type has a String() method. A token type prints as its name (LBRACE) instead of a number.
  • New Arabic translation of the README: README_AR.md (#2539).
  • Documentation and example links point to the v12 branch, and CI runs on it.

Known issue

Keep github.com/kataras/golog at v0.1.12 and github.com/kataras/pio at v0.0.13 (#2587). Running go get -u in your app pulls golog v0.2.0 and pio v0.0.14, and Iris v12 does not compile against them. If your build breaks after an upgrade, run go get github.com/kataras/golog@v0.1.12 github.com/kataras/pio@v0.0.13.

Full changelog: v12.2.11...v12.2.12

v12.2.11

Choose a tag to compare

@kataras kataras released this 24 Apr 22:44
08a852e

Project Update: Iris is Evolving 🌱

Dear Iris Community,

You might have noticed a recent lull in activity on the Iris repository. I want to assure you that this silence is not without reason. For the past 3-4 months, I've been diligently working on the next major release of Iris.

This upcoming version is poised to be a significant leap forward, fully embracing the Generics feature introduced in Go. We're not just stopping at Generics, though. Expect a suite of new features, enhancements, and optimizations that will elevate your development experience to new heights.

My journey with Go spans over 8 years, and with each year, my expertise and understanding of the language deepen. This accumulated knowledge is being poured into Iris, ensuring that the framework not only evolves with the language but also with the community's growing needs.

Stay tuned for more updates, and thank you for your continued support and patience. The wait will be worth it.

Warm regards,

Gerasimos (Makis) Maropoulos

Release v12.2.11

This is the last release for the version 12 family.

New Contributors

HISTORY: https://github.com/kataras/iris/blob/v12/HISTORY.md#thu-25-april-2024--v12211
Full Changelog: v12.2.10...v12.2.11

v12.2.10

Choose a tag to compare

@kataras kataras released this 18 Jan 01:17

v12.2.9

Choose a tag to compare

@kataras kataras released this 10 Jan 22:05

v12.2.8

Choose a tag to compare

@kataras kataras released this 05 Nov 20:24

What's Changed

Read at: https://github.com/kataras/iris/blob/main/HISTORY.md#sun-05-nov-2023--v1228

New Contributors

Full Changelog: v12.2.7...v12.2.8

v12.2.7

Choose a tag to compare

@kataras kataras released this 25 Sep 17:03

v12.2.5

Choose a tag to compare

@kataras kataras released this 21 Aug 17:26

What's Changed

  • Add optional Singleton() bool method to controllers to mark them as singleton, will panic with a specific error if a controller expects dynamic dependencies. This behavior is idendical to the app-driven app.EnsureStaticBindings().
  • Non-zero fields of a controller that are marked as ignored, with ignore:"true" field tag, they are not included in the dependencies at all now.
  • Re-add error log on context rich write (e.g. JSON) failures when the application is running under debug mode (with app.Logger().SetLevel("debug")) and there is no a registered context error handler at place.
  • master branch finally renamed to main. Don't worry GitHub will still navigate any master request to main automatically. Examples, Documentation and other Pages are refactored too.
  • Translate README to Vietnamese by @TrungKenbi in #2182
  • add Japanese README by @demouth in #2188
  • Remove redundant nil check by @Juneezee in #2194
  • Improve middleware/requestid test suite by @lemuelroberto in #2191
  • Bump github.com/redis/go-redis/v9 from 9.0.5 to 9.1.0 by @dependabot in #2190

New Contributors

Full Changelog: v12.2.4...v12.2.5

v12.2.4

Choose a tag to compare

@kataras kataras released this 12 Aug 04:44

What's Changed

Add new iris.WithDynamicHandler option (EnableDynamicHandler setting) to work with iris.Application.RefreshRouter method. It allows to change the entire router while your server is up and running. Handles issue #2167. Example at _examples/routing/route-state/main.go.

Full Changelog: v12.2.1...v12.2.4

⌂ 换网址