Skip to content

v0.10.0 (Beta 21.05.2021)

Compare
Choose a tag to compare
@mpscholten mpscholten released this 21 May 17:25
· 2889 commits to master since this release

This is another release before our major version 1 :) It comes packed with a lot of small improvements and bug fixes 🚀

Major Changes

  • Auto Index Creation:
    The Schema Designer will now automatically create an index when creating a column that has a foreign key constraint.

    E.g. when adding user_id column to a projects table, the schema designer will also automatically create an index on the user_id column. This speeds up queries with conditions on the user_id column, typically like query @Project |> filterWhere (#userId, currentUserId) |> fetch. In case you don't want an index for specific reasons, you can always manually remove the index again from your Schema.sql.

  • Debounce File Changes:
    Switching git branches triggers a lot of file changes on the IHP dev server. To avoid long reload times the dev server is debouncing file changes now.

  • New Functions: currentAdmin and currentAdminOrNothing:
    Like currentUser, but works when you also have a admins table next to your normal users table.

  • Cache Busting:
    Sometimes problems are caused when your users still have an old version of your JS or CSS files inside their browsers cache. To avoid this you typically append a hash to the url of your JS or CSS file.

    IHP now provides an assetPath view helper to deal with this:

        [hsx|
            <script={assetPath "/app.js"}/>
            <link rel="stylesheet" href={assetPath "/app.css"}/>
        |]

    The paths will look like this "/app.js?v=9be8995c-7055-43d9-a1b2-43e05c210271".

    IHP will set the asset version from the IHP_ASSET_VERSION env variable. This should be set to e.g. your git commit hash in production. In development you don't need to specify this environment variable. If you run on IHP Cloud, it works out of the box.

  • Built-in Background Jobs Dashboard:
    @zacwood9 added a new very cool dashboard to schedule and manage your IHP background jobs without manually writing lots of CRUD code.
    Check the new Guide section to get started

  • Code of Conduct:
    The IHP community now follows the Guidelines for Respectful Communication by the Haskell Foundation.

  • Improved Form Customization:
    We added a new formForWithOptions and also a shortcut formForWithoutJavascript to allow advanced form configuration. This specifically addresses the issue that previously there was no way to disable the javascript form submission for a specific form. Check out the new guide section to learn more.

  • New Function: filterWhereNot
    Like filterWhere but negated:

    projectsByUser :: UserId -> IO [Project]
    projectsByUser userId = do
        otherProjects <- query @Project
                |> filterWhereNot (#userId, userId)
                |> fetch
        -- Query: `SELECT * FROM projects WHERE user_id != <userId>`
        return otherProjects
  • New Function: modifyJust
    Like modify, but only modifies the value if it's not Nothing.

    let pauseDuration = now `diffUTCTime` pausedAt
    
    floorTimer <- floorTimer
            |> modifyJust #startedAt (addUTCTime pauseDuration)
            |> updateRecord

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..