diff --git a/HISTORY.md b/HISTORY.md index f22a8e9c..11405bbd 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -19,6 +19,12 @@ Developers are not forced to upgrade if they don't really need it. Upgrade whene **How to upgrade**: Open your command-line and execute this command: `go get github.com/kataras/iris/v12@latest` and `go mod tidy -compat=1.20`. +# Next + +Change applies to `master` branch. + +- Remove [ace](https://github.com/eknkc/amber) template parser support, as it was discontinued by its author more than five years ago. + # Sa, 11 March 2023 | v12.2.0 This release introduces new features and some breaking changes. @@ -41,7 +47,7 @@ All new features have been tested in production and seem to work fine. Fixed all - Add `Context.Render` method for compatibility. - Support of embedded [locale files](https://github.com/kataras/iris/blob/master/_examples/i18n/template-embedded/main.go) using standard `embed.FS` with the new `LoadFS` function. -- Support of direct embedded view engines (`HTML, Blocks, Django, Handlebars, Pug, Amber, Jet` and `Ace`) with `embed.FS` or `fs.FS` (in addition to `string` and `http.FileSystem` types). +- Support of direct embedded view engines (`HTML, Blocks, Django, Handlebars, Pug, Jet` and `Ace`) with `embed.FS` or `fs.FS` (in addition to `string` and `http.FileSystem` types). - Add support for `embed.FS` and `fs.FS` on `app.HandleDir`. - Add `iris.Patches()` package-level function to customize Iris Request Context REST (and more to come) behavior. @@ -306,7 +312,7 @@ func main() { - Fix Response Recorder `Clone` concurrent access afterwards. - Add a `ParseTemplate` method on view engines to manually parse and add a template from a text as [requested](https://github.com/kataras/iris/issues/1617). [Examples](https://github.com/kataras/iris/tree/master/_examples/view/parse-template). -- Full `http.FileSystem` interface support for all **view** engines as [requested](https://github.com/kataras/iris/issues/1575). The first argument of the functions(`HTML`, `Blocks`, `Pug`, `Amber`, `Ace`, `Jet`, `Django`, `Handlebars`) can now be either a directory of `string` type (like before) or a value which completes the `http.FileSystem` interface. The `.Binary` method of all view engines was removed: pass the go-bindata's latest version `AssetFile()` exported function as the first argument instead of string. +- Full `http.FileSystem` interface support for all **view** engines as [requested](https://github.com/kataras/iris/issues/1575). The first argument of the functions(`HTML`, `Blocks`, `Pug`, `Ace`, `Jet`, `Django`, `Handlebars`) can now be either a directory of `string` type (like before) or a value which completes the `http.FileSystem` interface. The `.Binary` method of all view engines was removed: pass the go-bindata's latest version `AssetFile()` exported function as the first argument instead of string. - Add `Route.ExcludeSitemap() *Route` to exclude a route from sitemap as requested in [chat](https://chat.iris-go.com), also offline routes are excluded automatically now. diff --git a/README.md b/README.md index 4c4c96f4..dde82ada 100644 --- a/README.md +++ b/README.md @@ -187,7 +187,7 @@ Some of the features Iris offers: * Builtin support for ngrok to put your app on the internet, the fastest way * Unique Router with dynamic path as parameter with standard types like :uuid, :string, :int... and the ability to create your own * Compression -* View Engines (HTML, Django, Amber, Handlebars, Pug/Jade and more) +* View Engines (HTML, Django, Handlebars, Pug/Jade and more) * Create your own File Server and host your own WebDAV server * Cache * Localization (i18n, sitemap) diff --git a/README_PT_BR.md b/README_PT_BR.md index de1d3b40..df94d769 100644 --- a/README_PT_BR.md +++ b/README_PT_BR.md @@ -184,7 +184,7 @@ Alguns dos recursos que o Iris Web Framework oferece: * Suporte integrado para ngrok para colocar seu aplicativo na internet da maneira mais rápida * Router único com caminho dinâmico como parametro com tipos padrões como :uuid, :string, :int... e a habilidade de criar o seu próprio router * Compressão -* View Engines (HTML, Django, Amber, Handlebars, Pug/Jade e mais) +* View Engines (HTML, Django, Handlebars, Pug/Jade e mais) * Cria seu próprio Servidor de Arquivo e hospeda seu próprio servidor WebDAV * Cache * Localização (i18n, sitemap) diff --git a/README_ZH_HANT.md b/README_ZH_HANT.md index 8fcbe8b6..c1e5eea7 100644 --- a/README_ZH_HANT.md +++ b/README_ZH_HANT.md @@ -195,7 +195,7 @@ Iris 提供了至少這些功能: - 內建 ngrok 支援,讓您可以把 app 以最快速的方式推上網際網路 - 包含動態路徑、具唯一性的路由,支援如 :uuid、:string、:int 等等的標準類型,並且可以自己建立 - 壓縮功能 -- 檢視 (View) 算繪引擎 (HTML、Django、Amber、Handlebars、Pug/Jade 等等) +- 檢視 (View) 算繪引擎 (HTML、Django、Handlebars、Pug/Jade 等等) - 建立自己的檔案伺服器,並寄存您自己的 WebDAV 伺服器 - 快取 - 本地化 (i18n、sitemap) diff --git a/_benchmarks/view/README.md b/_benchmarks/view/README.md index 90fc7cdb..209e4c6a 100644 --- a/_benchmarks/view/README.md +++ b/_benchmarks/view/README.md @@ -1,26 +1,27 @@ # View Engine Benchmarks -Benchmark between all 8 supported template parsers. +Benchmark between all 7 supported template parsers. -Amber, Ace and Pug parsers minifies the template before render. So, to have a fair benchmark, we must make sure that the byte amount of the total response body is exactly the same across all. Therefore, all other template files are minified too. +Ace and Pug parsers minifies the template before render. So, to have a fair benchmark, we must make sure that the byte amount of the total response body is exactly the same across all. Therefore, all other template files are minified too. ![Benchmarks Chart Graph](chart.png) -> Last updated: Oct 1, 2020 at 12:46pm (UTC) +> Last updated: Mar 17, 2023 at 10:31am (UTC) ## System | | | |----|:---| -| Processor | Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz | -| RAM | 15.85 GB | -| OS | Microsoft Windows 10 Pro | +| Processor | 12th Gen Intel(R) Core(TM) i7-12700H | +| RAM | 15.68 GB | +| OS | Microsoft Windows 11 Pro | | [Bombardier](https://github.com/codesenberg/bombardier) | v1.2.4 | -| [Go](https://golang.org) | go1.15.2 | +| [Go](https://golang.org) | go1.20.2 | +| [Node.js](https://nodejs.org/) | v19.5.0 | ## Terminology -**Name** is the name of the template engine used under a particular test. +**Name** is the name of the framework(or router) used under a particular test. **Reqs/sec** is the avg number of total requests could be processed per second (the higher the better). @@ -38,19 +39,18 @@ Amber, Ace and Pug parsers minifies the template before render. So, to have a fa | Name | Language | Reqs/sec | Latency | Throughput | Time To Complete | |------|:---------|:---------|:--------|:-----------|:-----------------| -| [Amber](./amber) | Go |125698 |0.99ms |44.67MB |7.96s | -| [Blocks](./blocks) | Go |123974 |1.01ms |43.99MB |8.07s | -| [Django](./django) | Go |118831 |1.05ms |42.17MB |8.41s | -| [Handlebars](./handlebars) | Go |101214 |1.23ms |35.91MB |9.88s | -| [Pug](./pug) | Go |89002 |1.40ms |31.81MB |11.24s | -| [Ace](./ace) | Go |64782 |1.93ms |22.98MB |15.44s | -| [HTML](./html) | Go |53918 |2.32ms |19.13MB |18.55s | -| [Jet](./jet) | Go |4829 |25.88ms |1.71MB |207.07s | +| [Jet](./jet) | Go |248957 |500.81us |88.26MB |4.02s | +| [Blocks](./blocks) | Go |238854 |521.76us |84.74MB |4.19s | +| [Pug](./pug) | Go |238153 |523.74us |85.07MB |4.20s | +| [Django](./django) | Go |224448 |555.40us |79.61MB |4.46s | +| [Handlebars](./handlebars) | Go |197267 |631.99us |69.96MB |5.07s | +| [Ace](./ace) | Go |157415 |792.53us |55.83MB |6.35s | +| [HTML](./html) | Go |120811 |1.03ms |42.82MB |8.29s | ## How to Run ```sh -$ go install github.com/kataras/server-benchmarks@latest -$ go install github.com/codesenberg/bombardier@latest +$ go install github.com/kataras/server-benchmarks@master +$ go install github.com/codesenberg/bombardier@master $ server-benchmarks --wait-run=3s -o ./results ``` diff --git a/_benchmarks/view/ace/views/layouts/main.ace b/_benchmarks/view/ace/views/layouts/main.ace index b1e74baa..9453acad 100644 --- a/_benchmarks/view/ace/views/layouts/main.ace +++ b/_benchmarks/view/ace/views/layouts/main.ace @@ -3,6 +3,6 @@ html head title {{.Title}} body - {{ yield . . }} + {{ yield . }} footer = include partials/footer.ace . diff --git a/_benchmarks/view/amber/main.go b/_benchmarks/view/amber/main.go deleted file mode 100644 index 4b63f684..00000000 --- a/_benchmarks/view/amber/main.go +++ /dev/null @@ -1,29 +0,0 @@ -package main - -import "github.com/kataras/iris/v12" - -func main() { - app := iris.New() - // By default Amber engine minifies the template before render. - app.RegisterView(iris.Amber("./views", ".amber")) - - app.Get("/", index) - - app.Listen(":8080") -} - -func index(ctx iris.Context) { - data := iris.Map{ - "Title": "Page Title", - "FooterText": "Footer contents", - "Message": "Main contents", - } - - // On Amber this is ignored: ctx.ViewLayout("layouts/main") - // Layouts are only rendered from inside the index page itself - // using the "extends" keyword. - if err := ctx.View("index", data); err != nil { - ctx.HTML("