Releases: digitallyinduced/ihp
Beta 21.08.2020
It's time for the next release of IHP: v21082020 🎉
Major Changes
- Numeric Primary Keys Supported: IHP now allows numeric (
Serial
in Postgres-speak) primary keys. Previously only UUIDs have been supported. UUIDs will still be the default. This feature makes it more simple to use IHP with existing databases and services. - nl2br: A new view helper has been added in this release. With
nl2br
you can transform\n
linebreaks to<br>
line breaks. Likeget #body post |> nl2br
:) - HTML Comments: HSX now supports HTML comment syntax.
<!-- 🚀 -->
. This has been added after someone asked for comment syntax on Stack Overflow. This was actually the first IHP-related stack overflow question we've come across.
Other Changes
ParamReader Float
andInputValue Float
instances have been added for better dealing with Float values- A bug has been fixed causing the code generator not generating input fields in freshly-generated controllers views
- We've improved CI workflows to avoid build errors on master (thanks to @ruhatch for fixing the master :))
- Improved Json support by adding a generic
ToJson
instance for IHP record Ids - Documentation on how to disable the layout for a single view has been added
- Documentation on how to change the start page of a IHP app has been added
- We've improved the error messages. In the wiki we've described our error message design goals.
- Fixed a bug with
findLibDir
causing trouble with production deployments - Fixed controller code generator generating view
import
statements twice - Fixed deleting a column still left over the assigned foreign key constraint
- Fixed query box in Data tool not working due to javascript bug
- Fixed a bug with nullable has many relationships causing a type error in
Generated.Types
- Fixed deleteRecord not working with records that have a fetched relationship
- Improved HSX error messages when dealing with invalid attribute names and fixed missing attribute names for SVGs
- Documentation on how to refactor your database (renaming columns, etc.) has been added
- Enums now have a
ParamReader
instance by default. This makes it easier to work with enums in forms.
Updating
To update the IHP version of your project, open default.nix
and change the git commit in line 4 to the following:
rev = "0bb881e0febdf5fb8db939a6c5eb481c76a1b332";
After that run the following command to update your project:
nix-shell -j auto --cores 0 --run 'make -B .envrc'
In case nix starts rebuilding IHP (might take a while), make sure cachix is set up as expected:
cachix use digitallyinduced
Now you can start your project as usual with ./start
.
If you have any problems with updating, let us know on the brand new IHP forum.
📧 To stay in the loop, subscribe to the IHP release emails. Or follow digitally induced on twitter..
📅 The next release is expected to be released on 04.09.2020.
Beta 07.08.2020
It's time for the next release of IHP: v07082020 🎉 Since the last release we have merged 67 commits by 10 contributors.
Major Changes
- Improved Error Pages:
- We've redesigned the error page design for compile-time and type errors.
- Additionally we now link to the GitHub wiki for specific exceptions for better error explanations.
- Exceptions thrown during routing will also now be shown in the browser (previously only a generic
Something went wrong
was shown). - File paths in the error messages can now be clicked in the browser to open them in your code editor. Use the env vars
IHP_EDITOR
orEDITOR
to specify your editor.
- New Function: deleteAll: With
deleteAll
all records of a table can be deleted. - New Function: forEachWithIndex: Small helper, like
forEach
but with an index
Other Changes
ihp-new
now has a--help
flag- the
dateField
helper now uses adatetime-local
input instead ofdatetime
- Issues with Code Generation pluralization have been fixed. In the process a lot of tests have been added to make sure that the code generation will not break again in the future.
- The
renderPlain
function now sets theContent-Type
header totext/plain
- A new docu section
Editors & Tooling
has been added - The Schema Designer got some small design changes for better usability. Some redundant buttons have been removed in favor of the right click context menu.
ihp-new
is using nix in a more efficient way- The request logger middleware can now be customized and disabled
- deleteRecords now doesn't print the ids when more than 10 records are deleted
- Tables now can have a composite
UNIQUE
constraint - Typos have been fixed
Updating
To update the IHP version of your project, open default.nix
and change the git commit in line 4 to the following:
rev = "c9cb949ae820776dfa3a8785a592ec22fe615276";
After that run the following command to update your project:
nix-shell -j auto --cores 0 --run 'make -B .envrc'
In case nix starts rebuilding IHP (might take a while), make sure cachix is set up as expected:
cachix use digitallyinduced
Now you can start your project as usual with ./start
.
If you have any problems with updating, let us know on Gitter.
📧 To stay in the loop, subscribe to the IHP release emails. Or follow digitally induced on twitter..
📅 The next release is expected to be released on 21.08.2020.
Beta 24.07.2020
It's time for the next release of IHP: v24072020 🎉 Since the last release we have merged 85 commits by 8 contributors..
Major Changes
- Improved DEFAULT support in createRecord: Previously
createRecord
was always using the sql default value when a column had a default value defined in the database schema. This means that callingproject |> set #name "My new project" |> createRecord
would do aINSERT INTO projects (id, name, user_id) VALUES (DEFAULT, DEFAULT, ...);
instead of using the givenMy new project
name for the project. The sql default value is now only used when it's not overriden. Thanks to @ruhatch 🎉 - updateRecord only updates changes fields: Previously
updateRecord
was always doing anUPDATE
query where it was setting all fields. Now theUPDATE
query will only update columns that have been changed using|> set #someField someValue
on the record. Thanks to @ruhatch 🎉 - Inline JS and CSS in HSX: Previously code like
[hsx|<style>h1 { color: blue}</style>|]
would trigger a parser error. This is now fixed and the inline<style>
tag is rendered as expected. Same with the<script>
tag. - Void tags like
<br>
,<input>
,<hr>
supported in HSX: Previously void tags (tags without a closing tag</tag>
) needed to be written in xhtml style (<br />
instead of<br>
). By @ruhatch - Troubleshooting Guide: Our GitHub Wiki got a new section on Troubleshooting. This might help people to find solutions to IHP problems faster when googling the error message.
Minor Changes
- In rendered date times the string
Uhr
(german for "time") has been removed (by @nghamilton) - Optional param functions like
paramOrNothing
now returnNothing
when the param parser fails to parse an empty string (by @nghamilton) - Code Generators offer a select box to chose the application when working with multiple applications in a single project
- Previously when a form was submitted in IHP, but the server rendered a server error, the error page was not shown to the user. This is fixed now.
- Fixed controller generator generating code without table fields when there is an "_" in the table name
- New documentation section: How to update IHP?
- The IHP setup process has now improved support for dealing with
PATH
variables that have spaces in thePATH
string. This improves the situation a lot for windows users. Thanks @adithyaov 🎉 - The api docs have been improved: The haddock quickjump index is now working as expected :)
- HSX now works with HTMX and Ionicons (by @ruhatch)
- Lots of grammar and spelling mistakes have been fixed in the documentation (by @chrislf)
- Missing InputValue and ParamReader instances for Day type have been added
- A new function
includes
has been added toIHP.HaskellSupport
as an alias forelem
- A new function
didChangeRecord
has been added that returnsTrue
when a record has unsaved changes - A new function
didChange #someField someRecord
has been added that returnsTrue
when a field of record has unsaved changes
Updating
To update the IHP version of your project, open default.nix
and change the git commit in line 4 to the following:
rev = "75ea02f8520f4fe1ca02ddfa6901dda8ca246955";
After that run the following command to update your project:
nix-shell -j auto --cores 0 --run 'make -B .envrc'
In case nix starts rebuilding IHP (might take a while), make sure cachix is set up as expected:
cachix use digitallyinduced
Now you can start your project as usual with ./start
.
If you have any problems with updating, let us know on Gitter.
📧 To stay in the loop, subscribe to the IHP release emails. Or follow digitally induced on twitter..
📅 The next release is expected to be released on 07.08.2020.
Beta 10.07.2020
This is the third beta release of IHP and also the first release since IHP has been released to the public around two weeks ago.
Since the last release we have merged 180 commits.
Major Changes
- IHP is web-scale now: Support for
<marquee>
and<blink>
tags have been added to HSX (previously HSX reported an error as these tags weren't on the tag whitelist) 🚀 - Code Generator Updates:
- You can now generate views from the code generator. Previously views could only be generated via the controller code generator or by manually adding them.
- Apps like
Web
orAdmin
can now be generated via the web dev tooling. Previously this was only possible from the terminal usingnew-application
. - The action generator now has a checkbox to also generate a view for the action.
- The IHP authentication functions have been fixed and improved to be easier to get started with. There's certainly a lot more to do to make auth easier :-)
- More sql types supported: Using
REAL
andDATE
previously crashed the code generator. This has been fixed now.BIGINT
,TIMESTAMP WITHOUT TIME ZONE
,VARCHAR
, andNUMERIC
are supported now. TheSchema.sql
parser now also knows about certain aliases (e.g.Int
andInteger
are the same in postgres). - Improved Dev Server on Linux: The dev server is now faster and more stable on linux by not using the
-fexternal-interpreter
flag ofghci
. This also fixed a major bug causing the use of sessions to fail in linux development mode. - The dev server now displays all apps available in your project: Previously only the
Web
application was available. When you have other apps like e.g.Admin
orApi
, they will also be shown in the sidebar.
Minor Changes
- Timestamps can be edited via the Schema Designer again. Previously changing a timestamp column via the schema editor has created a syntax error in the Schema.sql file aa4d2926e4301a24ee82b5a4f06102c1fbae9cf0
- Fixed that
.envrc
keeps growing every time you regenerate it. This has been fixed by @madjar 💯 0dfc77159087454fc3b5f892d14cfc234c83d840 - The function
isWeekend
has been renamed totodayIsWeekend
. A new pureisWeekend day
has been added. Thank you @hendi 👍 00757e593318b704a0f41d288fa337e7d9e3afd7 - The
ihp-new
command now checks thatgit
andmake
are available before creating a project - Creating a new column like
date_started_at
ordate_of_birth
in the SchemaDesigner now automatically pre-selectsDATE
as the sql type. By @hendi - The sql parser now supports qualified table names like
public.my_table
- A bug causing
NULL
not being accepted as thenull
sql value has been fixed. - Values of type
Double
can now be used together withfill @'["myField"]
- The first-time generation of the postgres database is more robust now
- When using the
Update DB
,Push To Db
orDump DB
buttons in the Schema Designer, any errors will now be reported to the user - Fixed using IHP scripts not working with a binary version of IHP
- Added
orderByAsc
as an aliasorderBy
- When using a database column name which is a haskell keyword, the generated haskell code will now be suffixed with
_
. Given an sql column likeof
, you have to access the field in your haskell code likerecord |> get #of_
- The dev server now opens the app in the browser in an async way, resulting in faster startup when running
./start
. You can also customize the open command by usingexport IHP_BROWSER=my_custom_browser
. - Snake-caps table names have previously caused the generated haskell code to be broken when used in certain ways. This has been fixed by @ruhatch 🎉
Open Controller
is only shown in the Context Menu of the Schema Designer when the controller exists.Generate Controller
is now only shown when the controller doesn't exist.
Documentation
- The
curl
call to install nix in the installation guide has been fixed by @akashche :) - An incorrect app link and a few typos have been fixed by @Dansvidania 👍
- The
entr
file watcher used for rebuilding the docu locally has been added to the IHP nix-shell - A note on a few edge cases on
Installing IHP on Windows
has been added - A note on installing
curl
,make
andgit
has been added to theInstalling IHP on Linux
section - A new recipe
Using IHP with Visual Studio Code / VSCode
has been added - @waddlaw has fixed a bit of outdated docu :)
- @stianlagstad fixed a small typo
- @nghamilton fixed the documentation on building "beautiful" urls with the IHP router
Community Content
Dario Oddenino started a very cool video series on IHP:
Trying the Integrated Haskell Platform web framework 1/3
Trying IHP part2/3 #ihp #haskell
Trying the Integrated Haskell Platform 3/3
Updating
To update the IHP version of your project, open default.nix
and change the git commit in line 4 to the following:
rev = "fb652b7f96278d3c4607123d3e37a6e0e9c6d5a7";
After that run the following command to update your project:
nix-shell -j auto --cores 0 --run 'make -B .envrc'
In case nix starts rebuilding IHP (might take a while), make sure cachix is set up as expected:
cachix use digitallyinduced
Now you can start your project as usual with ./start
.
If you have any problems with updating, let us know on Gitter.
📧 To stay in the loop, subscribe to the IHP release emails. Or follow digitally induced on twitter..
📅 The next release is expected to be released on 24.07.2020.
Beta 22.06.2020
This release marks the second beta release. Since the last release two weeks ago, around 90 commits have been merged.
Here is a change log of the most important changes:
- Clean Dev Server Output: The dev server is now outputting the output of the app server instead of printing all it's debug log lines. You can enable outputting the debug log messages by setting an env var
DEBUG=1
, seeCONTRIBUTING.md
for details. - Documentation Improvements:
- We added instantclick.js to the documentation to have super fast response times.
- Added
Authentication
andAuthorization
, a section onEnums
, a new section ondatabase relationships
- Windows Support: Windows is now a supported platform via Linux Subsystem for Windows
- NixOS Support: Some cross-platform issues have been fixed and IHP now works smooth also on NixOS. Thanks to @jeyj0 💯
- HEAD requests supported: We broke support for HEAD requests a couple of months ago. This is now supported again. By default all actions that
- Database Update Workflow improved: The buttons
Push to DB
andDB to Fixtures
have been merged into a singleUpdate DB
button which avoid accidentally deleting your local db state.
Smaller Changes
- The
getRequest
function used in controller actions is now just calledrequest
- Improved NixOS support: We added some help to the documentation on what you need to do to resolve certain errors when setting up IHP.
- We added links to this github repo, gitter, the newsletter, etc. to the documentation navigation.
- Improved handling for sql keywords: Keywords are escaped now when generating sql code.
- ihp-new uses
git
from nix instead of expecting it to be installed for fetching the ihp-boilerplate repo - All hspec tests have a new central
Main.hs
- The old
NewX
alias for a recordX
has been removed. This was a leftover to support old ihp based project at digitally induced. We have now updated the corresponding projects so the alias could be removed. - When creating a new column starting with
is_
, the type will automatically switch toBOOLEAN
- In the Schema Designer, the Function
Show Generated Code
now also works for enums (previously it only worked with tables). - Fixed a bug which causes the dev server to crash when too many file change events are triggered (e.g. when using the code generator)
Updating
To update the IHP version of your project, open default.nix
and change the git commit in line 4 to the following:
rev = "18e9540d52ef96f1191ca7357704f0ef8081588d";
After that run the following command to update your project:
nix-shell -j auto --cores 0 --run 'make -B .envrc'
Now you can start your project as usual with ./start
.
If you have any problems with updating, let us know on Gitter.
📧 To stay in the loop, subscribe to the IHP release emails. Or follow digitally induced on twitter..
📅 The next release is expected to be released on 10.07.2020.
Beta 09.06.2020
This release marks the first beta release. From now on, there is a new IHP release every two weeks on Friday. Therefore the next release is scheduled for Friday 26.06.2020. While in beta, IHP releases will be named after the date they are released on, e.g. v09062020 for today.
In future release notes we’ll describe what new features and improvements have been built and what changes need to made in your application to be able to update.
To update the IHP version of your project, open default.nix and change the git commit in line 4 to the following:
rev = "19e4d96f5bd43c0bfc0333a19a10470615a6f4a0";
06.03.2020
v06032020 Fixed crash
02.03.2020
02032020 Imrpvoed ghci comfig
28.02.2020
v28022020 updated lockable module