Beta 13.11.2020
It's friday the 13th, a good day for the next release of IHP: v13112020 🎉 This release changes a couple of important things in IHP, so plan a bit more time again to upgrade your apps.
Major Changes
-
Config/Config.hs has a new format: We rebuild the whole configuration management to remove some very bad hacks and to allow for more flexibility in the future.
-
Custom 404 Page: You can now customize the 404 Page used by IHP. Just create a new file at
static/404.html
. IHP will automatically render this instead of the default IHP error page. See the docs for details. -
Custom CSS Frameworks: You can now override the CSS classes used by e.g. IHP forms. By default it uses bootstrap, but you can switch to
tailwind
(which is supported out of the box, but you need to add the<link>
tags manually to your header in Layout.hs) or even use a custom CSS framework. -
ViewContext has been removed: You might have seen that ViewContext thing in your views. It's been replaced with
ControllerContext
to simplify the whole action lifecycle. -
New Migration System: There's a new migration system for migrating your production or staging database. There's also a new code generator for migrations. Check the Guide for
Migrations
to learn more. -
Improved Support for JSON Requests: Useful when building APIs with IHP. Instead of sending a form body you can now also send a json body when you set the
Content-Type: application/json
header from your API client. You can use the familiarparam
functions to access the json values: -
Documentation for Modals: It was always missing, when the docs are missing it feels like the feature isn't there at all :D Now you can finally use modals everywhere. Check the new Modal documentation in the Guide.
action UsersAction = do users <- query @User |> limit (param @Int "limit") |> fetch render UsersView { .. }
This action could be called from curl like this:
curl --header 'Content-Type: application/json' --data '{"limit": 50}' --request POST http://localhost:8000/Users
Other Changes
- A lot of new test cases have been added to make sure IHP is stable
- The haskell-language-server configration is now read from the
Makefile
again instead of being hardcoded - isDevelopment and isProduction functions have been changed to simplify their use
- The
ModelControllerMap
type family has been removed - The
ViewApp
type family has been removed - The
checkboxField
function now actually uses the user-specifiedlabelClass
- The
mime-mail-ses
packages has been updated in the IHP package set. The previously provided package definition was broken - Fixed mail generator using hard coded ConfirmationMail name
- Constraints in the Schema.sql are sorted by name now to avoid large git diffs when adding new columns
- renderPolymorphic has been simplified
sqlQuery
andsqlExec
now also log the executed sql queries like createRecord or updateRecord do- When you set
data-turbolinks-preload='false'
on a link it's not preloaded anymore - The documentation now specifies how to preselect a value in a
selectField
input - Integer and Int params in requests can be negative now
- JSONB can be selected in the Schema Designer now
- Fixed BINARY not interpreted as BYTEA in the schema designer
- Removed lambda symbol in the welcome view. This caused encoding issues
- The dev server now ensure that
build/ihp-lib
exists. If the symlink is missing, it will be created. This makes the dev environment more reliable
Updating
See the UPGRADE.md for upgrade instructions.
If you have any problems with updating, let us know on the IHP forum. Or join our new slack.
📧 To stay in the loop, subscribe to the IHP release emails. Or follow digitally induced on twitter..
📅 The next release is expected to be released on 27.11.2020.