GitPedia
falcoframework

falcoframework/Falco

A functional-first toolkit for building brilliant ASP.NET Core applications using F#.

3 Releases
Latest: 4y ago
v3.1v3.1.0Latest
pimbrouwerspimbrouwers·4y ago·July 27, 2021
GitHub

📦 `webHost` Builder Improvements

  • In addition, many common operations have been explicitly mapped: `use_static_files`, `use_https`, `use_compression` etc.

`configuration` Builder Added

  • A thin wrapper around `ConfigurationBuilder` exposing a clean API for reading configuration values.
  • ```fsharp
  • open Falco.HostBuilder
  • [<EntryPoint>]
  • let main args =
  • let env = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT")
  • let config = configuration args {
  • add_env
  • + 4 more

Utility Additions

  • `StringUtils.stringf`
  • `StringUtils.strSplit`
  • `CookieCollectionReader`
  • `Auth.getClaimValue`
  • `Auth.hasScope`

New `Request` functionality

  • `Request.getCookie`
  • `Request.tryBindCookie`
  • `Request.streamForm`
  • `Request.tryBindFormStream`

New `Request` HttpHandler's

  • `Request.mapCookie`
  • `Request.bindCookie`
  • `Request.ifAuthenticatedWithScope`

New `Request` HttpHandler's for streaming multipart data

  • Two particular fundamental handlers have been added to the Request module, to support multipart form data streaming for large uploads which Microsoft defines large uploads as anything > 64KB.
  • `Request.bindFormStream`
  • `Request.bindFormStreamSecure`
  • `Request.mapFormStream`
  • `Request.mapFormStreamSecure`

New `Response` HttpHandler's

  • Handlers have been added to support binary responses, both inline and attachment. Both asynchronously buffer data into the response body.
  • `Response.ofBinary`
  • `Response.ofAttachment`
v3.0v3.0.0
pimbrouwerspimbrouwers·5y ago·November 28, 2020
GitHub

Additions

  • `IServiceCollection.AddFalco`
  • `IServiceCollection.AddFalco (routeOptions : RouteOptions -> unit)`
  • `IApplicationBuilder.UseFalco (endpoints : HttpEndpoint list)`
  • `IApplicationBuilder.UseFalcoExceptionHandler (exceptionHandler : HttpHandler)`
  • `QueryCollectionReader` replacing direct usage of `StringCollectionReader`
  • `HeaderCollectionReader`
  • `RouteCollectionReader`

📦 Extensions

  • `HttpRequest.GetHeader`
  • `HttpRequest.GetRouteValues`
  • `HttpRequest.GetRouteReader`

📦 Exceptions

  • `type ExceptionHandler`
  • `type ExceptionHandlingMiddleware`

📦 Host module

  • `Host.defaultExceptionHandler`
  • `Host.defaultNotFoundHandler`
  • `Host.startWebHostDefault`
  • `Host.startWebHost`
  • `IApplicationBuilder.UseHttpEndpoints (endpoints : HttpEndpoint list)`
  • replaced by `IApplicationBuilder.UseFalco (endpoints : HttpEndpoint list)`

📦 Request module

  • `Request.getHeader`
  • `Request.getRouteValues`
  • replace by `Request.getRoute`
  • `Request.tryGetRouteValue`

📦 StringCollectionReader

  • `?` dynamic operator
v2.0v2.0.0
pimbrouwerspimbrouwers·5y ago·July 12, 2020
GitHub

📦 Release Notes

  • The markup DSL is qualified instead of bare functions.
  • `Html.h1` vs `h1`
  • `Attr.class'` vs `_class`
  • Handlers considered end-to-end processors of a request.
  • Continuations are still possible by creating new `HttpHandler` function which accept another `HttpHandler` as a parameter.
  • As a result of this change, performance has increased.
  • Host setup functions have been added.
  • These functions (`startWebHost` and `startWebHostDefault`) simplify `IHost` creation.
  • + 3 more

📦 Migration Guide

  • This is a general guide on migrating v1.x.x code to v2.0.0. Both [sample apps](https://github.com/pimbrouwers/Falco/tree/master/samples) have been updated and serve as more complete references.
  • The definition of an `HttpHandler` (`HttpContext -> Task`) now resembles that of a native `RequestDelegate`
  • A new definition for any non-IO based modifications to the `HttpResponse`, called `HttpResponseModifier` with a definition of `HttpContext -> HttpContext`
  • Dealing with either the `HttpRequest` or `HttpResponse` is now achieved through the `Request` and `Response` modules respectively.
  • An example:
  • ``` f#
  • // v1.x.x
  • let notFound : HttpHandler =
  • + 54 more

📦 Markup

  • `Falco.ViewEngine` becomes `Falco.Markup`
  • Element level items now reside in a module called `Elem`. Thus `div` becomes `Elem.div`
  • ** You can import `Falco.Markup.Elem` and use without `Elem.` prefix
  • Element attributes are now reside in a module calls `Attr`. This `_class` becomes `Attr.class'`
  • ** Take note of the trailing apostrophe, which is used to delimit reserved keywords like `class`
  • Text elements now reside in a module called `Text`. Thus `raw` becomes `Text.raw`
  • ** You can import `Falco.Markup.Text` and use without `Text.` prefix
  • An example:
  • + 24 more