v0.17.0 (Beta 14.12.2021)
A new IHP release with new features and many bug fixes 🚀
IHP is a modern batteries-included haskell web framework, built on top of Haskell and Nix. Blazing fast, secure, easy to refactor and the best developer experience with everything you need - from prototype to production.
Major Changes
-
💽 Improved Migration Workflow:
Since v0.16.0 IHP is already automatically generating a migration prefilled with the recommended changes that need to be applied to your database. Previously IHP was tracking all changes you've made in the Schema Designer and re-applied them to the migration sql file.With this release the approach has been changed to a database diffing approach: IHP will now diff the Schema.sql against your local database and generate a efficient patch to bring both in sync again.
This also affects the local dev tools. The
Update DBbutton has been removed entirely. When there are unmigrated changes locally, the Schema Designer will suggest you to generate and run a migration, like this: -
👨💻 Optional HSX Attributes:
HSX gained special handling forMaybevalues to make it easy to deal with optional attributes.You can write
let target :: Maybe Text target = Just "_blank" in [hsx|<a target={target} />|]
and it will render to:
<a target="blank" />
Using
Nothingresults in thetargetattribute not being in the output HTML:let target :: Maybe Text target = Nothing in [hsx|<a target={target} />|]
This will render to:
<a />
-
DataSync Updates:
IHP DataSync now uses React Functional Components instead of Class based approach used in previous versions::function TodoList() { const todos = useQuery(query('todos')); if (todos === null) { return <div className="spinner-border text-primary" role="status"> <span className="sr-only">Loading...</span> </div>; } return <div> {todos.map(todo => <div>{todo.title}</div>)} </div> }
Additionally this release contains many bug fixes for DataSync and large performance and usability improvements.
-
🧰 Haskell Language Server: Performance Improvements
We've updated the Haskell Language Server from 1.4.0.0 to the latest version 1.5.1.0.With HLS 1.5.1.0 the performance should be much better. If you're curious, here's a nice presentation of what has changed in HLS.
If you still have performance issues, please submit issues directly here haskell/haskell-language-server#2340
-
📫 Encrypted SMTP
When configuring the IHP Mailer to use SMTP, you can now specify the encryption by setting theencryptionfield:import IHP.Mail config :: ConfigBuilder config = do option $ SMTP { host = "smtp.myisp.com" , port = 2525 , credentials = Nothing , encryption = STARTTLS -- <-- NEW }
Other Changes
- extended sql parser to be able to reverse engineer the local db
- support encrypted SMTP (TLS or STARTTLS)
- Update TW docs to use JIT mode
- Set HOME env var during build to fix npm issues
- Fixed background workers not running when the local dev db was initlaized after the app is already started
- Fixed DynamicQueryCompiler adding too many vars in the empty case
- Fixed form input with name="action" or name="method" breaking submission. Fixes #1203
- Expand example on adding custom attributes
- Show how we pipe attributes
- Hide Pagination if only a single page
- Added VSCode + HLS troubleshooting section
- Fixed dev server thinking postgres is started while it's still in the startup phase. Fixes #1201
- Fixed postgres start event not correctly detected
- Use bytestring builder for efficiently building postgres logs
- Completed docs for DataSync
- Fixed ihp_authenticated role sometimes not having permission to access the public schema
- Delay app start until postgres is ready. Fixes #1210
- Recipes: rich text editor, highlighting :target
- change wrong message after a Job got set to retry
- fix "Run again" button on Job details view
- Added MINIMUM_REVISION env var to allow skipping old migrations
- Add troubleshooting steps for Purescript on IHP Cloud
- Support null values in DynamicQuery
- Added auto-retry to datasync connection
- Improved error handling of DataSync crud functions
- Added useQueryResult effect hook
- Fixed form submission fails for GET forms where the actions is only a relative path
- Improved error messages shown when a data sync request fails
- Fixed datasync not correctly dealing with integer values
- Validate input parameters to initIHPBackend as this is a common source of errors
- DataSubscription constructor now validates that the passed query object looks like a query object
- Add cabal update-hint in section about cabal2nix
- Fixed DataSync getting out of sync because Update events are not sent sometimes
- Added windofchange to IHP examples
- Fixed inconsistent JS spelling
- Modernize FormField's CSSframework integration
- Use native js modules for exposing DataSync functionality
- Moved DataSync js files to their own npm package
- Fixed parser not able to parse pg_dump output
- Added support for optional HSX attributes
- Fixed turbolinks not used when using the side navigation in the devtools
- Prevent changing URL on form with error
- Update HSX tag lists
- Changed default rendering behaviour of 'Maybe value' values rendered as a HSX element
- Fixed database connection allocated by DataSync sometimes not cleaned up causing the connection pool to be exhausted after a while
- SSC: use unescaping
- DataSync: Use websocket for record CRUD instead of the REST api
- Fixed form without explicit method attribute failing to send when js helpers are enabled. Fixes #1231
- Removed dependency to newtype-generics package
- Removed unused cereal-uuid dependency
- Fixed schema parser not handling qualified table names in CREATE POLICY statements
- DataSync: Renamed updateRecordById => updateRecord and deleteRecordById => deleteRecord
- Made devtool navbar darker
- ihp-new: Ask before using DigitallyInduced cachix cache
- Added PGListener module: Fixes the issue that DataSync uses too many database connection (one for each DataSubscription) when working with multiple users.
- Updated flatpickr css
- Added support for more operators in DataSync
- Fixed make sometimes deleting .envrc file
- Refactored AutoRefresh to use the new PGListener interface: The new PGListener API is less resource hungry: Previous AutoRefresh was taking one database connection per watched table from the database pool. With PGListener it's only ever using one database connection from the database pool.
- Job workers use PGListener now for more efficient job watching
- Fixed order by clause placed at wrong position by DynamicQueryCompiler
- Added test cases for spread attributes in HSX. Also fixed missing space in generated HTML of spread attributes
- Fixed aesonValueToPostgresValue not handling the object case
- Validate input arguments passed to functions of the public DataSync api: This will ease debugging when something goes wrong
- DataSync: Added support for enums
- Replaced 'RETURNING *' used in sql queries with a specific column list. Fixes #1259
- Fixed parsing of unquoted extension names in CREATE EXTENSION sql statements. Fixes #1262
- Row level security can now be used with normal IHP database operations
- Support policies with an EXISTS condition
- IHP can now suggest policies even when then user_id column is one foreign key hop away
- Fixed UNIQUE constraints on column leads to a bad migration
- Fixed migration not correctly normalising policies
- Removed DataSync fetchAndRefresh because it's leaking resources
- Fixed DataSync fetch and fetchOne broken
- Replaced DataSync watchedRecordIdsRef List with a Set based implementation which is more efficient
- DataSync: Made all fields strict
- Added a fifo queue to PGListener subscriptions: This helps guarantee that messages are processed in order while keeping high performance
- Added caching to ensureRLSEnabled to avoid recurring lookups for table RLS in DataSync
- Updated nixpkgs to get latest HLS version
Full Changelog: v0.16.0...v0.17.0
Feature Voting
Help decide what's coming next to IHP by using the Feature Voting!
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.

