v0.16.0 (Beta 06.11.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
-
🍞 Breadcrumbs:
@amitaibu added a new API for defining breadcrumb navigations inside your views. This new API makes it easier to customize the breadcrumb rendering across your app, e.g. to use a tailwind css based breadcrumb instead of the default bootstrap based one.instance View ShowView where html ShowView { .. } = [hsx| {breadcrumb} <h1>Show Post</h1> <p>{post}</p> |] where breadcrumb = renderBreadcrumb [ breadcrumbLink "Posts" PostsAction , breadcrumbText "Show Post" ]
The new breadcrumb functions are automatically used when you generate new controllers or views using the code generators.
Check out the docs: https://ihp.digitallyinduced.com/Guide/view.html#breadcrumbs
-
📄 Tailwind + Pagination:
The CSS classes and HTML code of IHP's pagination can be customized now. This makes it possible to now use the pagination with tailwindcss. -
🏭 Build Improvements:
You can now runnix-build
inside your IHP project and it will build the whole project, including background workers and IHP scripts:# Optional, if you skip this the binary will not be optimized by GHC make prepare-optimized-nix-build # The actual build process nix-build
This will build a nix package that contains the following binaries:
RunProdServer
, the binary to start web serverRunJobs
, if you’re using the IHP job queue, this binary will be the entrypoint for the workers a binary for each script inApplication/Script
, e.g.Welcome
forApplication/Script/Welcome.hs
- The build contains an automatic hash for the
IHP_ASSET_VERSION
env variable, so cache busting should work out of the box.
This will make it significant easier to deploy IHP apps.
If you wondered: These build improvements are also what powers the new Experimental Deployment Process in IHP Cloud. -
💻 Helpers to Load Env Vars:
Along with the recent deployment changes, we're also making it easier to define custom config parameters based on environment variables to your app.Inside Config.hs you can now use the
env
andenvOrNothing
functions to read env variables:module Config where config :: ConfigBuilder config = do maxRetryCount <- env @Int "MAX_RETRY_COUNT" appName <- env @Text "APP_NAME" redisUrl :: Maybe Text <- envOrNothing "REDIS_URL"
-
SchemaDesigner: Support for Postgres Policies
You can now create and manage Postgres Policies inside the Schema Designer:This is still an early version and we'll extend the policy editor in future IHP versions. It's going to be used together with the new DataSync APIs soon.
-
🎨 New 404 Page
We designed a new nice looking standard 404 for IHP apps :)Check out the docs if you want to have your own custom 404 page.
Other Changes
- Add warning for direnv hook to ihp-new
- Add automatic hook installation when first installing direnv
- Fixed handling of whitespace in sql line comments
- Add "Connecting to DB via UI" docs
- Fixed tests not import IHPSchema.sql and thus failing when built-in data types are used. Fixes #1155
- Added failing test for enum is defined after use #1154
- Fixed enum sometimes only defined after usage in CREATE TABLE statements. Fixes #1154
- Support adding values to a enum in the auto-migration
- Use bracket for allocating test database
- customNotFoundResponse in Guide/recipes.markdown gets a better typeannotation - known to work for versions from ihp 0.11 up to 0.15
- Limit page size of pagination
- add imports to IHP/Guide/recipes.markdown - improves reproducibility
- Better handleof page limits in Pagination
- Move Pagination to CSS framework
- Make ihp env configurable via IHP_ENV env var
- Added a callActionWithParams
- Removed withParams, use callActionWithParams instead
- Added idToParam
- Add callJob to testing
- Made api reference header bar sticky
- Clarified forever in websocket docs
- renderNotFound uses the same approach as normal 404 errors in IHP now. Fixes #1180
- Build docs with github actions and push to s3
- Added github action to build ihp-new package
- Fixed live reloading sometimes broken after running a job in the background worker
- Fixed RLS user not having permissions to tables after it's created by IHP
- Fixed padding of table in schema designer not consistent with padding of titles
- First draft of the data sync docs
- Updated Flatpickr to v4.6.9: Fixed a browser issue that we've found in a client app at di
- Fixed 'make postgres' not working
- Extend nodeOuterHtml to all node types
- Added sendJSON to the public IHP api. Fixes #1181
- Run job queue's createNotificationTrigger inside a single transaction: This fixes jobs sometimes not being picked up directly
- Wrap AutoRefresh's trigger setup in a transaction to avoid events getting lost
- Fixed retry functionality in the job dashboard not working. Fixes #1167
- Fixed IHPSchema.sql not imported when the IHP database is created on first use in dev mode
New Contributors
- @tcmal made their first contribution in #1153
- @neongreen made their first contribution in #1193
Full Changelog: v0.15.0...v0.16.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.