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.