v0.20.0
A new IHP release, containing bug fixes and productivity improvements to existing features π οΈ
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
-
βͺ Dot Notation:
IHP goes OOP-ish. Thanks to a compiler update in this release we can now make use of dot notation Γ lasomeThing.someAttribute
π-- Previously: get #title project -- Now: project.title
This also works in HSX:
[hsx| <!-- Previously: --> <div>{get #title project}</div> <!-- Now: --> <div>{project.title}</div> |]
This can especially be useful when you're dealing with nested records, e.g. when working with
fetchRelated
:[hsx| <!-- Previously: --> <div>{get #name (get #userId project)}</div> <!-- Now: --> <div>{project.userId.name}</div> |]
-
π οΈ HSX Improvements:
We've refactored HSX to fix some of the common issues, like HSX not support expressions likeallEnumValues @MyEnum
. This refactoring was needed to make dot notation work in HSX as well.[hsx| <!-- Previously failed because of the @ symbol: --> {allEnumValues @Color} <!-- Just works with IHP 0.20: --> {allEnumValues @Color} |]
-
β New Function: isActiveAction
ReturnsTrue
when the given action matches the path of the currently executed action[hsx| {isActiveAction PostsAction} |]
-
π I18n Routing:
As we're preparing I18n support for IHP apps, we've already refactored the routing to support langauge prefixes, e.g./de/
for a german site and/en/
for english.Here's an advanced code example of this in action:
instance FrontController WebApplication where ... -- the previous code assigning controllers is still required router additionalControllers = do mlocale <- optional do string "/" string "en" let router = defaultRouter additionalControllers case mlocale of Just locale -> case locale of "en" -> putContextRouter EN_UK router _ -> IHP.RouterPrelude.error "This should be unreachable" Nothing -> router
Once IHP has full i18n, you can find more on this in the documentation.
-
π€ GHC 9.2.4:
We've updated to a new major version of GHC. Previously IHP apps were using GHC 8.10.7. This improves support for M1/M2 macs and allows for dot notation.
Other Changes
- Add Guide On Using Compression Middleware.
- normalize newlines in sql functions before diffing for migration
- Fixed unique constraint with multiple columns showing up as unmigrated changes
- Use "$out/lib" as the default working directory for binaries produced with nix
- fixed design of reference checkbox in new column view
- Extracted column rename logic from Schema Designer action into Schema Operations
- Fixed table renames not updating references indexes
- use font-display swap for inter
- Splitted Lockable.isLocked into an IO and a pure function
- Run migration sql commands in a single database statement: The stateful way of doing the transaction could potentially use a different database connection from the pool. This change avoids that issue.
- HSX: Support underscores in data attribute names
- Removed outdated nix install instructions for macOS
- Fixed SchemaCompiler crashing on Set and Select statements
- diffAppDatabase should work with the configured database url instead of the hardcoded dev db
- Enabled split-sections for IHP builds for smaller binaries on linux
- Normalize spaces in sql functions
- Added failing test for parsing table names starting with public
- Fixed schema parser not correctly parsing table names starting with public
- Use 'CREATE OR REPLACE' when updating a function in a migration
- Fixed update operations in DataSync operation not removing database records from a subscription when the WHERE condition doesn't match anymore
- Fixed broken rendering of reference checkbox
- Adapted reference checkbox to new layout
- Reference Checkboxes no longer have the same id (fixes clickability)
- Add slot parameter for custom elements
- Fixes qualified identifiers in policies causing a diff in the migrations: A policy in the form
CREATE POLICY a ON t USING t.f = public.f
contains a qualified sub-expressiont.f
. When dumping this policy from pg_dump we get a unqualifiedf = public.f
condition instead. So we need to normalize the Policy to the normal formCREATE POLICY a ON t USING f = public.f
- Added missing sql keyword ALL to list of protected keywords
- fixed favicon missing
- Fixed race-condition in closing of DataSync subscription
- Improved error message when DeleteDataSubscription fails because the DataSubscription doesn't exists
- Allow mounting websocket apps that have a HTTP fallback
- Extracted DataSync message handler
- Fixed migration generator fails with a IN (..) expression in a policy
- Fixed job runners running with 2 concurrency even when it's limited to max concurrency 1
Full Changelog: v0.19.0...v0.20.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 (right at the bottom of the page). Or follow digitally induced on twitter.