You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A new IHP release with new features and many bug fixes. This release also includes the Stripe Integration and Docker support for IHP Pro and IHP Business users 🚀
Major Changes
💰 Payments with Stripe:
This version finally ships one of the most requested features, the Stripe Integration. With the new Stripe Integration you can easily deal with payments and subscriptions in your projects. If you ever wanted to build as SaaS with Haskell, today is the best day to start! 💻 Learn how to integration Stripe in the Documentation
📦 Docker Support:
Thanks to the new docker integration it's now easier than ever to ship your IHP apps into production! Learn how to deploy with Docker
🕸️ SEO Improvements:
You can now dynamically manage meta tags like <meta property="og:description" content="dynamic content"/> in your IHP apps Learn how to manage OG meta tags
🌐 HTML in Validation Error Messages:
You can now use attachFailureHtml if you want to write a custom validation logic that uses HTML in it's error message:
post
|> attachFailureHtml #title [hsx|Invalid value. <a href="https://example.com/docs">Check the documentation</a>|]
-- Link will work as expected, as it's HSX
🔍 Documentation Search:
There's now a new Agolia-based Search in the IHP Documentation Search for Something
🎨 New Design for the API Reference:
Our haddock-based API reference now has a custom CSS that gives it a stunning new look! Check out the API Reference TODO: ADD PICTURE
💽 Auto-generated Migrations:
The Schema Designer now keeps track of your changes. Whenever you generate a new migration from the Web-based Code Generator or the new-migration CLI command, it will prefill the .sql file with the steps needed to migrate.
🧰 Tooling Updates:
We've updated several packages available in your IHP development environment:
GHC: 8.10.5 -> 8.10.7
Haskell Language Server: 1.1.0.0 -> 1.4.0.0
🧪 Testing Improvements:
Test modules now are run in their own separate database. On test start IHP will create a new database and import the Application/Schema.sql. After test completion the database is deleted.
In previous IHP versions tests used the development database by default.
moduleTest.Controller.PostsSpecwhereimportNetwork.HTTP.Types.StatusimportIHP.PreludeimportIHP.QueryBuilder (query)
importIHP.Test.MockingimportIHP.FetchimportIHP.FrameworkConfigimportIHP.HaskellSupportimportTest.HspecimportConfigimportGenerated.TypesimportWeb.RoutesimportWeb.TypesimportWeb.Controller.Posts ()
importWeb.FrontController ()
importNetwork.WaiimportIHP.ControllerPreludetests::Spec
tests = aroundAll (withIHPApp WebApplication config) do
describe "PostsController"$do
it "has no existing posts"$ withContext do
count <- query @Post|> fetchCount
count `shouldBe`0
it "calling NewPostAction will render a new form"$ withContext do
mockActionStatus NewPostAction`shouldReturn` status200
it "creates a new post"$ withParams [("title", "Post title"), ("body", "Body of post")] do
response <- callAction CreatePostActionlet (Just location) = (lookup"Location" (responseHeaders response))
location `shouldBe`"http://localhost:8000/Posts"-- Only one post should exist.
count <- query @Post|> fetchCount
count `shouldBe`1-- Fetch the new post.
post <- query @Post|> fetchOne
get #title post `shouldBe`"Post title"
get #body post `shouldBe`"Body of post"
it "can show posts"$ withContext do
post <- newRecord @Post|> set #title "Lorem Ipsum"|> set #body "**Mark down**"|> createRecord
response <- callAction ShowPostAction { postId = get #id post }
response `responseStatusShouldBe` status200
response `responseBodyShouldContain`"Lorem Ipsum"-- For debugging purposes you could do the following, to-- see the HTML printed out on the terminal.
body <- responseBody response
putStrLn (cs body)
-- Create a user for our test case
user <- newRecord @User|> set #email "[email protected]"|> createRecord
-- Log into the user and then call CreatePostAction
response <- withUser user do
callAction CreatePostAction
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
A new IHP release with new features and many bug fixes. This release also includes the Stripe Integration and Docker support for IHP Pro and IHP Business users 🚀
Major Changes
💰 Payments with Stripe:
This version finally ships one of the most requested features, the Stripe Integration. With the new Stripe Integration you can easily deal with payments and subscriptions in your projects. If you ever wanted to build as SaaS with Haskell, today is the best day to start! 💻
Learn how to integration Stripe in the Documentation
📦 Docker Support:
Thanks to the new docker integration it's now easier than ever to ship your IHP apps into production!
Learn how to deploy with Docker
🕸️ SEO Improvements:
You can now dynamically manage meta tags like
<meta property="og:description" content="dynamic content"/>
in your IHP appsLearn how to manage OG meta tags
🌐 HTML in Validation Error Messages:
You can now use
attachFailureHtml
if you want to write a custom validation logic that uses HTML in it's error message:Learn more about HTML validation errors in the documentation
🔍 Documentation Search:
There's now a new Agolia-based Search in the IHP Documentation
Search for Something
🎨 New Design for the API Reference:
Our haddock-based API reference now has a custom CSS that gives it a stunning new look!
Check out the API Reference
TODO: ADD PICTURE
💽 Auto-generated Migrations:
The Schema Designer now keeps track of your changes. Whenever you generate a new migration from the Web-based Code Generator or the
new-migration
CLI command, it will prefill the.sql
file with the steps needed to migrate.🧰 Tooling Updates:
We've updated several packages available in your IHP development environment:
🧪 Testing Improvements:
Test modules now are run in their own separate database. On test start IHP will create a new database and import the
Application/Schema.sql
. After test completion the database is deleted.In previous IHP versions tests used the development database by default.
Here's an example of how controllers tests can now look like:
Inside the test you can use
withUser
to call an action as a logged in user:Other Changes
Config/client_session_key.aes
can now be set via theIHP_SESSION_SECRET
env varSELECT *
: This avoids issues when the database schema is being migratedrun-script
Migration
Pull Requests
fromLabel @"companyId"
bug by @dharmatech in Add note regarding thefromLabel @"companyId"
bug #1060matchesRegex
validator by @hendi in addmatchesRegex
validator #1074src
on<script>
tag in docs by @amitaibu in Add missingsrc
on<script>
tag in docs #1105build/Generated/Types.hs
by @amitaibu in Doc for Type errors inbuild/Generated/Types.hs
#1132New Contributors
Full Changelog: v0.14.0...v0.15.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.
This discussion was created from the release v0.15.0 (Beta 18.10.2021).
Beta Was this translation helpful? Give feedback.
All reactions