v0.9.0 (Beta 26.02.2021)
A lot has been done since the last IHP release in january. With v0.9 we're now getting closer to the first major version of IHP 🎉
Major Changes
-
Use the new GHC Garbage Collector: We now use the new non-moving GC which has been added in recent GHC versions. This avoids long GC pauses when it's time to free some memory. This will improve the production performance.
-
New Logging module:
IHP was previously usingputStrLn
to log something. This has been replaced with a newIHP.Log
modules that provides a unified logging solution for the full framework. The logger supports custom formatters and also custom log destinations (e.g. logging to a file instead of stdout/stderr).Check the full documentation here: https://ihp.digitallyinduced.com/Guide/logging.html
-
New Plugins: ihp-sentry and ihp-zip
Add error reporting to your IHP apps with ihp-sentry
Provides easy zip file downloads with ihp-zip
Check the plugin's README for details on how to install them.If you're thinking about making your own IHP plugin, consider using these as the starting point :)
-
Custom WebSocket Servers:
We now opened up the IHP WebSocket interface so that you can write your own WebSocket servers.Check out the new Guide on WebSockets: https://ihp.digitallyinduced.com/Guide/websockets.html
-
AutoRoute Improvements:
In previous IHP versions AutoRoute by default only worked withUUID
arguments (and Id types likeId Post
). If you have a controller likedata HelloWorldController = HelloAction { name :: Text }
where you have a text parameter, you would have to configure AutoRoute manually usingparseArgument
. Also when we you had an action with two different types likeHelloAction { userId :: Id User, name :: Maybe Text }
this was not supported by AutoRoute.The type-magic has been reengineered and now it works with all types especially different types. If you have used
parseArgument
before, you need to remove that as these functions have been removed because this now works without manually configuring it. -
Database Transactions:
There's a newwithTransaction
function to run sql statements inside a single database transaction:withTransaction do company <- newRecord @Company |> createRecord user <- newRecord @User |> set #companyId (get #id company) |> createRecord company <- company |> setJust #ownerId (get #id user) |> updateRecord
Check out the Guide for details: https://ihp.digitallyinduced.com/Guide/database.html#transactions
-
New Function:
setJust
:
Likeset
but wraps the value in aJust
. Across a lot of IHP code bases we spotted a pattern like|> set #field (Just(value))
. The(Just ..)
is basically just syntactical noise and makes the value expression kind of more complicated:-- BEFORE project |> set #userId (Just (get #id user)) -- AFTER project |> setJust #userId (get #id user)
-
New Query Function:
distinct
: Usedistinct
to remove all duplicate rows from the resultquery @Book |> distinct |> fetch -- SELECT DISTINCT * FROM books
-
New Query Function:
distinctOn
: UsedistinctOn
to add aDISTINCT ON
to your sql query.query @Book |> distinctOn #categoryId |> fetch -- SELECT DISTINCT ON (category_id) * FROM books
-
New Query Functions:
filterWhereLike
and friends:query @Book |> filterWhereLike (#title, "%haskell%") |> fetch -- SELECT * FROM books WHERE title LIKE '%haskell%'
Additonally there's now also:
-filterWhereILike
(likefilterWhereLike
but case-insensitive)
-filterWhereMatches
filter with a postgres regex
-filterWhereIMatches
case-insensitive variant offilterWhereMatches
Other Changes
- added empty array '{}' in default-dropdown for array columns in IDE
- added support for
smallint
and brought existing support forbigint
andsmallint
to the schema designer - Fixed a bug where IHP Telemetry was not correctly detecting windows if it was running in WSL2
- Column types are now categorized in the schema designer
- Added postgres inet type
- Added support for CREATE INDEX statements in Schema.sql
- Support X-Real-IP header in logs
- Simplified query builder by replacing GADT with a more boring data structure
- Moved fetch family of functions from IHP.QueryBuilder to a new IHP.Fetch
- Ignore Globally Installed Packages When Loading GHCI
- Added more SVG elements to hsx whitelist
- Allow hsx to parse spaces in closing tags
- Fix type generation fails if empty enum is given.
- Fixed buggy space stripping in HSX
- Add
make postgres
command to start only the postgres server - Fixed race condition caused by auto refresh updates during form submission
- Fixes Job generator always generating to Web
- Added jobs documentation
- the data tool now has pagination
- Added
forceRedirectToPath
to work around JS issues - Support Multi-column Indexes
- Added setTitle and pageTitle for a standard <title> management
- Added logging of database query times.
- Introduce Custom
ihp:load
Javascript Event - didChange should not return True when the value is the same as the database value
- Fixed isActivePath not taking query string into account
getRequestBody
now works for JSON requests as well- Table indexes are shown in the schema designer now
- Enabled link preloading by default again, it got lost in a previous release
- Forms: added support for autofocus
- Many more small improvements to the Guide and API docs
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 available in march.