Skip to content

v0.8.0 (Beta 09.01.2021)

Choose a tag to compare

@mpscholten mpscholten released this 09 Jan 11:45
· 3743 commits to master since this release

The first release of IHP in 2021 🎉

Major Changes

  • HTTP Caching: We now set common HTTP headers for your CSS, JS and other static files. This will speed up your apps by a lot.

    • In dev mode all your files in static/ are never cached. This also fixed an issue where sometimes the browser was incorrectly caching your "old" CSS in dev mode. This is not happening anymore.
    • In production we set Cache-Control, Last-Mofified and ETag headers
    • Files in static/ are cached for 24 hours
    • Files in static/vendor/ are cached for 30days. So it's best to place all your library code here.
    • Files provided by IHP like ihp-auto-refresh.js are also cached up to 30 days
  • Mail: Support for Generic SMTP and SendGrid: Previously IHP was only working with your local sendmail or AWS SES. You can now connect SendGrid or any custom SMTP server.

  • New Docu Section: Testing

  • macOS Big Sur Support + Package Updates: We're updating the GHC version used by IHP to improve support for macOS Big Sur. This also includes updating our nixpkgs version.

    • GHC Version: 8.8.3 -> 8.10.3
    • Fixes issues with imagemagick
    • Haskell Language Server: 0.4 -> 0.7.10
    • We also changed the way nixpkgs is managed inside IHP projects, so that we can change the default nixpkgs version of your project with future IHP versions without you needing to do much work
  • CHECK Constraints: You can now use CHECK constraints inside your Schema.sql.

  • redirectBack: Use redirectBack to redirect the user back where he came from:

        action LikeAction { postId } = do
            post <- fetch postId
            post
                |> incrementField #likesCount
                |> updateRecord
    
            redirectBack

    This relies on the Referer header being set. If the header is missing the user will be redirect back to the startpage. You can also provide a custom fallback path using redirectBackWithFallback "/custom-fallback".

  • Improved router error handling in prod: In production we don't give out debugging info anymore as this is not useful for users. It's just a generic An error happend page now.

    • When a record not found error is triggered (e.g. when calling fetch with a UUID that does not exist), the 404 page will be shown instead of a generic error page like before
  • JS & CSS Bundling Disabled: All new IHP apps that are created with ihp-new will now not have the IHP CSS and JS Bundling enabled. The bundling usually causes a bad experience when deploying your app for the first time, because usually you miss some configuration in your Makefile. With the new http caching it also doesn't have that much of a performance impact.

  • Simplify Auto Refresh Setup: The auto refresh is now part of the default application setup of new IHP apps. This way you can now just call autoRefresh on your actions and don't need to spend any time on boilerplate.

  • copyFields Function: Useful to rewrite getter-setter code like this:

        -- OLD:
        let newProject = newRecord @Project
            |> set #name (get #name otherProject)
            |> set #isPublic (get #isPublic otherProject)
            |> set #userId (get #userId otherProject)
    
        -- NEW:
        let newProject = newRecord @Project
            |> copyFields @["name", "isPublic", "userId"] otherProject
  • Simplified setup of auth:

    • Auth helpers like currentUser are now part of the IHP.ControllerPrelude and IHP.ViewPrelude modules and so don't need to be added to the Application.Helper.View and Application.Helper.Controller files anymore.
    • The CurrentUserRecord is now specified in Web.Types.

Other Changes

Updating

See the UPGRADE.md for upgrade instructions.

If you have any problems with updating, let us know on the IHP forum.

📧 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 at the end of January. There's still a couple things to do before we can tag v0.9.0 which is the last release before v1.0.0 which is planned to be released early this year.