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_id
column to aprojects
table, the schema designer will also automatically create an index on theuser_id
column. This speeds up queries with conditions on theuser_id
column, 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:
currentAdmin
andcurrentAdminOrNothing
:
LikecurrentUser
, but works when you also have aadmins
table next to your normalusers
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 newformForWithOptions
and also a shortcutformForWithoutJavascript
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
LikefilterWhere
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
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.nix
it'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
Integer
ID 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
deleteSession
andgetSessionRecordId
functions - 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..