Skip to content

Beta 13.11.2020

Compare
Choose a tag to compare
@mpscholten mpscholten released this 13 Nov 21:55
· 3777 commits to master since this release

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 familiar param 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

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.