Releases: digitallyinduced/ihp
v0.10.0 (Beta 21.05.2021)
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_idcolumn to aprojectstable, the schema designer will also automatically create an index on theuser_idcolumn. This speeds up queries with conditions on theuser_idcolumn, typically likequery @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 yourSchema.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:
currentAdminandcurrentAdminOrNothing:
LikecurrentUser, but works when you also have aadminstable next to your normaluserstable. -
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
assetPathview 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_VERSIONenv 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 newformForWithOptionsand also a shortcutformForWithoutJavascriptto 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
LikefilterWherebut 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
Likemodify, but only modifies the value if it's notNothing.let pauseDuration = now `diffUTCTime` pausedAt floorTimer <- floorTimer |> modifyJust #startedAt (addUTCTime pauseDuration) |> updateRecord
Other Changes
- Update Foreign Key Reference When Column Is Updated
- use correct pragma in generated code
- Fixed code generator for job workers not working as expected
- Inside your project's
default.nixit's now possible to request haddock docs for your haskell packages - Added modelContext constraint to WSApp to allow easy database querying from websocket servers
- Ensure that new and updated Enum Values are non-empty and unique when added to the schema
- Add support for
IntegerID types in AutoRoute - Fixed background workers not started by dev server when doing local development
- Hide "NOTICE: relation schema_migrations already exists, skipping" notice when running migrations.
- Added Person/People Plural/Singular Support
- Abort if the dev server is started as root, running as root breaks the built-in postgres server
- Added type signature for generated index view code
- Use exception tracker in ErrorController.displayException to log handled exceptions to sentry as well
- Fixed custom 404 pages not having 404 status code
- Added common jumpToAction issue to docu
- Improved error message when not all arguments are passed to a controller action
- exampleModalLabel -> modal-title
- Added
deleteSessionandgetSessionRecordIdfunctions - HSX: boolean data-attributes now use true/false values instead of behaving like HTML boolean attributes
- Fixed auto generated ParamReader instances missing implementation for readParameterJSON
- Allow NaN in Postgres Point Type
- Fixed turbolink redirect not working as expected after form submission.
- Make the full app config from Config.hs available through FrameworkConfig.appConfig
- Allow isDevelopment/isProduction to be used in mail's to and from functions by making ?context available.
- Disable nonmoving-gc for now as it causes server crashes when running binaries in optimized mode
- Use improved nix installer on mac
- Link To Show Table In Schema
- Rename IHP.HtmlSupport Modules To IHP.HSX
- Added Trailing slash for additional apps. e.g. now href=localhost:8000/admin/ (trailing slash required). Previously link broken in IDE without a trailing slash, similar for other autogenerated and autorouted applications.
- Remove forceRedirectToPath as we now have a better way to disable JS helpers per form (see form documentation).
- Display errors before warnings inside devtools.
- Fixed code generators not finding the right table if word is not english
- 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..
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 usingputStrLnto log something. This has been replaced with a newIHP.Logmodules 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 withUUIDarguments (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
parseArgumentbefore, you need to remove that as these functions have been removed because this now works without manually configuring it. -
Database Transactions:
There's a newwithTransactionfunction 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:
Likesetbut 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: Usedistinctto remove all duplicate rows from the resultquery @Book |> distinct |> fetch -- SELECT DISTINCT * FROM books
-
New Query Function:
distinctOn: UsedistinctOnto add aDISTINCT ONto your sql query.query @Book |> distinctOn #categoryId |> fetch -- SELECT DISTINCT ON (category_id) * FROM books
-
New Query Functions:
filterWhereLikeand friends:query @Book |> filterWhereLike (#title, "%haskell%") |> fetch -- SELECT * FROM books WHERE title LIKE '%haskell%'
Additonally there's now also:
-filterWhereILike(likefilterWhereLikebut case-insensitive)
-filterWhereMatchesfilter with a postgres regex
-filterWhereIMatchescase-insensitive variant offilterWhereMatches
Other Changes
- added empty array '{}' in default-dropdown for array columns in IDE
- added support for
smallintand brought existing support forbigintandsmallintto 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 postgrescommand 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
forceRedirectToPathto 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:loadJavascript Event - didChange should not return True when the value is the same as the database value
- Fixed isActivePath not taking query string into account
getRequestBodynow 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.
v0.8.0 (Beta 09.01.2021)
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-MofifiedandETagheaders - 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.jsare also cached up to 30 days
- In dev mode all your files in
-
Mail: Support for Generic SMTP and SendGrid: Previously IHP was only working with your local
sendmailor AWS SES. You can now connect SendGrid or any custom SMTP server. -
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
-
CHECKConstraints: You can now useCHECKconstraints inside yourSchema.sql. -
redirectBack: Use
redirectBackto redirect the user back where he came from:action LikeAction { postId } = do post <- fetch postId post |> incrementField #likesCount |> updateRecord redirectBack
This relies on the
Refererheader being set. If the header is missing the user will be redirect back to the startpage. You can also provide a custom fallback path usingredirectBackWithFallback "/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 happendpage now.- When a record not found error is triggered (e.g. when calling
fetchwith a UUID that does not exist), the 404 page will be shown instead of a generic error page like before
- When a record not found error is triggered (e.g. when calling
-
JS & CSS Bundling Disabled: All new IHP apps that are created with
ihp-newwill 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 yourMakefile. 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
autoRefreshon your actions and don't need to spend any time on boilerplate. -
copyFieldsFunction: 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
-
- Auth helpers like
currentUserare now part of theIHP.ControllerPreludeandIHP.ViewPreludemodules and so don't need to be added to theApplication.Helper.ViewandApplication.Helper.Controllerfiles anymore. - The
CurrentUserRecordis now specified inWeb.Types.
- Auth helpers like
Other Changes
- Fix CanSelect Example
- Fix typo
- Fixed type error in docu for custom routing
- Improved type inference of the parseId function
- Fixed inlining behavior of
IHP.Serverthat caused GHC to take huge amounts of memory when compiling withO2optimization settings - Your application as well as the IHP Dev tools are now configured to use all available CPUs on your development computer or production server. This should make it faster.
- The HSX implementation has been refactored. It now produces more efficient haskell code, uses less memory and produces better error messages when there's a syntax error inside
{}curly braces - The
beforeLoginin the IHP Session Controller Hook System is now able to access the database. This way you can e.g. implement a login counter that goes up every time a user logs into your app. - Windows Users using WSL have been previously been reported as running Linux to our IHP Telemetry. With this release the WSL users are now showing up as WSL users.
- JS and CSS of the IHP development tooling has now moved into it's own folder
IDE. So/schema-designer.cssis now/IDE/schema-designer.css. - Improvements to the tailwind documentation
- Fixed AutoRefresh being unreliable because the old controller context was still being used
- Fixed gibberish output caused by usage of putStrLn in logQuery
- Fixed a crash when
createManywas called with an empty list (createMany []) - adds safe tail and init to prelude
- Allow custom web component tags in HSX
- Remove code in ErrorView already present in the schemaDesignerLayout function.
- The IHP Data Editor now has improved escaping
- Avoid loading global ghci config files that might cause issues to the dev server
- Enum values can contain spaces now
- Support LocalTime for dateField and dateTimeField
- Fixed missing NFData instance for Id'
- Strictness improvements
- Added missing html attributes to HSX
- re-ask whether direnv has been hooked into the shell in ihp-new script
- RunJobs compiled with O1 for memory optimization
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.
Beta 13.12.2020
Time for the next release of IHP: v20201213 🎉
Major Changes
- Job Queue: We added a new job queue system that allows you to schedule jobs that are going to be executed outside the normal request-response cycle by a job worker running in the background. Documentation for this will follow soon.

- Documentation Improvements: Lots of typos, unclear wording and outdated code samples have been fixed.
- New Function:
deleteRecordById: LikedeleteRecordbut you can pass an id instead of a full record.
Other Changes
startPagenow works with apps other thanWeb- Improvements when using haskell or sql keywords in the schema designer
- Use bytestring for sql table names everywhere. This removes inefficient transforming table names from Text to bytestring and back all the time.
- The
nonEmptyvalidator now works withId recordvalues - Fixed an SQL error caused by inserting an postgres array column
- Added
InputValue Aeson.Valueinstance, so form fields can be used with json fields - Fixed js-delete breaks when html anchor is not the leaf element
- Haskell Code generated by HSX is more efficient now
- Improved inline behavior of lots of IHP functions
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 on 08.01.2021.
Beta 27.11.2020
It's time for the next release of IHP: v20201030 🎉 This release mainly focus on improving existing functionality and making things more stable :) Since the last release we also reached an important milestone: IHP is now the second biggest haskell framework measured by GitHub stars - just 5 months after it's initial public release. The future of haskell web dev is happening right here 🚀
Major Changes
- Improved Schema Designer Error Messages: Possible errors that happen when you run
Update DBwill now be displayed in a more useful way. Previously the error message just displayed the full postgresql output in a single line. Now the error message is displayed like this:
- Tailwind Documentation: We added documentation on how to integrate
tailwindcssinto your IHP projects. You can find the guide here: https://ihp.digitallyinduced.com/Guide/tailwindcss.html - NPM Documentation: We also added a short documentation on how to work with NPM and the JS ecosystem in your IHP projects. You can find the guide here: https://ihp.digitallyinduced.com/Guide/npm.html
- IHP Telemetry: To answer questions like
How many people are running at which IHP version? What is the primary OS people are using IHP on? How many active users are working with IHP?we added Telemetry to the local dev server that runs when you call./start. The dev server reportsihpVersion,os,architectureand a anonymous project id toihp-telemetry.digitallyinduced.com. You can opt-out by setting a env varIHP_DISABLE_TELEMETRY=1 - Schema Designer:
ON DELETE SET DEFAULT: Next toON DELETE SET NULLyou can now useSET DEFAULT. - Postgres Point Type: You can now use tables that have a
POINTcolumn in IHP. The Point type is also supported inside theparamfunctions.
Other Changes
- Old references to ViewContext in the docu have been updated
- The
New MigrationGenerator now automatically creates theApplication/Migrationdirectory on first use - When
setLayoutis not called inside the application lifecycle IHP will now continue to render a view. Previously it would crash when callingrenderwithout a layout. - Fixed a bug where migration without a description would not be found by the
migratecommand - The documentation now has a more visible
Nextbutton at the bottom of the first sections. - Fixed paramOrDefault failing on empty parameters. We also added tests to make sure this won't happen again.
- The IHP version is now displayed when running the dev server in debug mode (
DEBUG=1 ./start). - Some IHP build warnings have been fixed.
- Fixed a regression where the production request logger was not used anymore in production environments by default.
- Removed the error state
Cannot start app as postgres is not ready yet. This error cannot happen anymore since we added database pools. Usually when this happens it's usually a false alarm.
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 11.12.2020.
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
ControllerContextto 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
Migrationsto 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/jsonheader from your API client. You can use the familiarparamfunctions 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
Makefileagain instead of being hardcoded - isDevelopment and isProduction functions have been changed to simplify their use
- The
ModelControllerMaptype family has been removed - The
ViewApptype family has been removed - The
checkboxFieldfunction now actually uses the user-specifiedlabelClass - The
mime-mail-sespackages 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
sqlQueryandsqlExecnow 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
selectFieldinput - 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-libexists. 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.
Beta 01.11.2020
Just a small out-of-line release. In the last version we broke the code generators, causing an issue when generating a new controller. When you get an error like Not in scope: type constructor or class ‘StaticControllerinstance’, update to this release.
Here's a full error message you get with v20201030 when generating a new controller:
Not in scope: type constructor or class 'StaticControllerinstance'
|
7 | instance AutoRoute StaticControllerinstance AutoRoute CustomersController
| ^^^^^^^^^^^^^^^^^^^^^^^^Workaround: If you don't want to update, you can easily manually fix the issue by opening Web/Routes.hs and adding a missing newline character:
You will find code like this:
instance AutoRoute StaticControllerinstance AutoRoute CustomersControllerJust add a new line before the second instance:
instance AutoRoute StaticController
instance AutoRoute CustomersControllerUpdating
First open default.nix and change the git commit in line 4 to the following:
rev = "e21f5d743104ba8b1bed185ee85fb20e064e0bef";After that run the following command to update your project:
nix-shell -j auto --cores 0 --run 'make -B .envrc'
make -B build/ihp-libNow you can start your project as usual with ./start.
Beta 30.10.2020
It's time for the next release of IHP: v20201030 🎉 This release mainly focus on improving existing functionality and making things more stable :)
Major Changes
-
Database Connection Pool: IHP now comes with a new database connection pool. This allows for better scalability and performance when dealing with many queries. It also makes IHP more reliable: In previous versions of IHP, a long running database connection might be closed by the database server when nothing happens for too long. This issue will not happen anymore with the new db connection pool.
-
Live Reloading Improvements: A bug has been fixed that caused the live reloading not to work when a file was changed. Additionally the web-based compiling status view has been rewritten to be more efficient (you can really feel that it's faster now).
-
LocalTime Support: Support for
TIMESTAMP WITHOUT TIME ZONEhas been added. It works similiar to the normal timestamp you already know from IHP, but doesn't store any Timezone information. -
Welcome Page In Project: When generating a new IHP project, the project now contains the initial welcome action as part of the project code. This allows to for more play when just starting out, because now you can just change the welcome view as you like :)
-
Basic Auth: Finally you can have basic auth prompts in IHP. You can use it like this:
instance Controller WidgetsController where beforeAction = basicAuth "sanja" "hunter2" "myapp"
This requires the user to enter
sanjawith passwordhunter2when trying to access theWidgetsController. Check the documentation for details.
Other Changes
- The nixpkgs Version used when developing on IHP itself has been updated to reflect the new nixpkgs version used since the last release in IHP apps
- Postgres Array Types can be used from the Schema Designer now. Previously this was only possible by using a code editor and manually editing the
Schema.sql INSERT, UPDATE, DELETEqueries now work in the custom sql query box inside the IHP Data Editor- We've updated the IHP Readme. Take a look in GitHub
- NixSupport/shell.nix moved to just shell.nix. Good to know when you're doing development on the framework itself
- Enums are placed before tables in the
Schema.sql. This avoids issues where aCREATE TABLEstatements uses an enum that hasn't been defined yet. - The confirmation then on delete links can be customized using
data-confirm:<a href={DeleteProjectAction} data-confirm={"Do you really want to delete" <> get #name project <> "?"}>Delete project</a> - The development-mode not found handler now gives you a hint that you might want to use
js-deletefor your link. - The Troubleshooting section has moved from the GitHub Wiki to the Guide. GitHub Wiki didn't allow for PRs.
- Most build warnings you've seen when building IHP have been fixed
- The application server will not print out the verbose development logs when running production. In production the request log will now be similiar to the log lines from apache. This ensures that e.g. security credentials are not leaked to the application log.
ihp-newnow sets the correct permissions to the.ghciwhen starting a new project. This has caused troubles in the past for some new users- The
.stylish-haskellconfig file that's part of all IHP projects by default has been updated to work again with the latest IHP version - Lots of documentation updates
Updating
First open default.nix and change the git commit in line 4 to the following:
rev = "a8030dd1e4041a0353f63d03b4ffb836cb2bd95c";After that run the following command to update your project:
nix-shell -j auto --cores 0 --run 'make -B .envrc'
make -B build/ihp-libNow you can start your project as usual with ./start.
Aside from all the code changes above we've also updated the IHP website: https://ihp.digitallyinduced.com/ :) First big refresh after IHP has been published around 4 months ago.
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 on 13.11.2020.
Beta 16.10.2020
It's time for the next release of IHP: v20201016 🎉
Major Changes
-
Haskell Language Server Support: You can now get cool IDE features by using Haskell Language Server. It works mostly out of the box after updating to this IHP version. Check out the documentation on how to get it running with your fav editor.
-
Updated NixPkgs Version: We're updating the IHP package set to a newer version. We're moving from
da7ddd822e32aeebea00e97ab5aeca9758250a40to07e5844fdf6fe99f41229d7392ce81cfe191bcfc. This means some of your dependencies might get updated. -
OFFSET Support: You can now easily use Postgres
OFFSETwith the query builder:query @User |> limit 25 |> offset 50 |> fetch
-
New Form Helper:
numberField: Similiar totextField, renders a<input type="number"/>.formFor project [hsx| {numberField #maxUsersLimit} |] -
Automatic Troubleshooting: We've created a script that checks all common issues that often go wrong when setting up IHP (like
direnvissues,.ghcipermission issues, etc.). When you cannot run your IHP app anymore, run the troubleshooting to find out possible error conditions. You can find more in the Troubleshooting section. -
Sending Emails: Support for sending mails has been added in this release. Use the new code generator to get started 🔥
Other Changes
param @Boolnow acceptstrueas a truthy value.- Session cookies can be configured in FrameworkConfig. Previously it was not possible to change any options of the session cookie.
- Session cookies are
HttpOnlyandsecure(only if app is served via https) now - The built-in SessionsController provides a new
beforeLogincallback. This can be useful to abort the login process when a user is not yet confirmed. urlTocan now be used everywhere wherepathTois used- A
stripTagsfunction has been added toHaskellSupport. This function removes all html tags from an input string. - Docu: The recipe
Uploading a user profile picturenow mentions that thepicture_urlshould benullable - Docu: Limit and Offset are documented now.
Idvalues such asId Projectnow haveOrdandHashableinstances by default- The action generator has been fixed
- Various tests have been added to test HSX, NameSupport and more
- Several issues with the
DataTool have been fixed. E.g. adding a row works again now. - Docu:
Using IHP with Emacshas been added - Docu:
Using IHP with Vimhas been added - The
textToIdfunction now also works with text primary keys. Previously it only worked with UUIDs. - The
postgresql-simpleOnlywrapper is now exported to all controllers - Improved support for using a Binary (
BYTEA) column in a table
Updating
This release requires a few more steps than usual. As we've changed the nixpkgs version, this will also require a lot of redownloading of all packages. Make sure you have good internet and can wait up to 30 minutes to complete the download. We highly suggest to make sure your coffee machine is working before starting the update.
First open default.nix and change the git commit in line 4 to the following:
rev = "49816c21d34fd7894a956bf7fd997e6ed5243acf";Open Config/nix/nixpkgs-config.nix and replace the file with this new version: https://raw.githubusercontent.com/digitallyinduced/ihp-boilerplate/81518e9b66e1e9d3bdf40affa674a7d2cd63f414/Config/nix/nixpkgs-config.nix
After that run the following command to update your project:
# Be aware that this will redownload a lot of files and take lots of time
nix-shell -j auto --cores 0 --run 'make -B .envrc'
make -B build/ihp-lib
# This step is required to get the config files for haskell-language-server
make hie.yamlNow you can start your project as usual with ./start.
Check out the docs to get started with haskell language server to get cool IDE features.
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 on 30.10.2020.
Beta 02.10.2020
It's time for the next release of IHP: v20201002 🎉
Major Changes
- Realtime UI Updates with IHP AutoRefresh: Whenever a
INSERT,UPDATEorDELETEhappens to the records used by your action IHP will rerun your action on the serverside. When the generated html looks different to the html generated on the initial page load it will send the new html to the browser using the WebSocket connection. Watch a demo on twitter or Learn more in the Auto Refresh documentation. - PGNotify Functions: A new module has been added to easily watch for changes inside the database.
- Fancy Errors Disabled in Production: The IHP error handler that tries to be helpful when something goes wrong is now disabled by default in production.
- New function: paramList: Similiar to
parambut returns a list when the input is something likeingredients=milk&ingredients=egg. Useful when working with checkboxes. - LIMIT queries: You can now add
LIMITto your sql queries easily when using the query builder:topTen <- query @Post |> orderBy #rating |> limit 10 |> fetch
- Postgres Arrays: We've added support for types such as
int[]ortext[]. These types are not visible in the web-based dev tools yet, but can be used manually when using a code editor to edit theSchema.sql. - New Terminal Command: hash-password: With this new terminal tool you can generate a password hash when setting up the IHP authentication module. It will ask your for the plaintext password and will output the password hash.
- collectionFetchRelated works with QueryBuilder: Previously
collectionFetchRelatedwas not working with certain relationships. This has been fixed and the below code will now work as expected:posts <- query @Post |> fetch >>= collectionFetchRelated #comments
Other Changes
- The image upload recipe has been extended to document how the form needs to look when doing image uploads.
- Login error messages are now Invalid credentials
- Generated.Types is imported by default in the empty Layout.hs
- The Contributing documentation now explains how to run the IHP tests
- A bug where the FrontController.hs was generated twice was fixed
- The version of morphdom used by IHP has been updated
- A new textToId function has been added to simplify conversion of text or bytestrings to db ids
- Missing documentation on fetchCount has been added
- New recipe: How to generate a random string
- New function: sqlQueryScalar similiar to sqlQuery but returns a scalar value
- Fixed scripts not working in dev mode
- Fixed awk warning when running make static/prod.js
Updating
To update the IHP version of your project, open default.nix and change the git commit in line 4 to the following:
rev = "c4d2815f064c055cd957389a4df5eab25294dba3";After that run the following command to update your project:
nix-shell -j auto --cores 0 --run 'make -B .envrc'
make -B build/ihp-libNow you can start your project as usual with ./start.
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 on 16.10.2020.
If you haven't looked already, check out the IHP Auto Refresh Demo 🚀
