Our work on Hanami 2.2 continues, and today we’re very happy to offer a release candidate. This is our last stop before 2.2.0, which we plan to release this time next week!
In this release, we’ve continued to refine our new database layer:
- You can now configure gateways (introduced in beta2) with a hash of
connection_options. - Config from matching gateways in parent slices is applied to gateways in child slices, allowing you to configure shared gateways in one place only.
Hanami::Structinstances provide a convenient#to_jsonmethod.- A DatabaseCleaner setup is generated in new apps, to keep your test database in a predictable state between RSpec tests.
- When running
hanami dbCLI commands in development mode, they will automatically apply to your test database as well, to keep it in sync and ready for your tests. - A sample
config/db/seeds.rbis generated in new apps. - The
db seedCLI command prints a notice if it does not find expected seed files. - Generated migrations include a
change doblock, ready for your migration code. - The default database URL for MySQL databases works out of the box for MySQL as installed by Homebrew.
We’ve enhanced more of our CLI experience:
- You can set the Hanami env for all CLI commands by passing an
--envor-eoption, which is much nicer than prefixing command with aHANAMI_ENV=environment variable (which still works, mind you). - The
generate actionandgenerate sliceCLI commands provide a--skip-routeoption generatesubcommands are available only if the counterpart gem is bundled (e.g.generate actionwill only appear if you have hanami-controller bundled).- IRB is now the default engine for
hanami console.
Lastly, we’ve been readying dry-operation for its debut:
- Fixed an issue where failures were not handled correctly inside
transactionblocks - Automatically integrate operations with the ROM setup available in Hanami apps, so
transactionblocks are available with no boilerplate required.
We need your help!
This is our last release before 2.2.0, so now more than ever, we need your help with testing, especially if you want to work with databases. With this release, we believe we’ve now covered every essential aspect of database configuration and usage. Please put this to the test!
We’ve already updated our getting started guides to walk you through your first Hanami 2.2 app, database layer included. Please give this a try, then let us know how you go.
What’s next? 2.2.0.
We’re aiming to release 2.2.0 next week, and complete our epic journey towards the Hanami 2 full stack vision. Mark the date!
What’s included?
Today we’re releasing the following gems:
- hanami v2.2.0.rc1
- hanami-assets v2.2.0-rc.1 (npm package)
- hanami-assets v2.2.0.rc1
- hanami-cli v2.2.0.rc1
- hanami-controller v2.2.0.rc1
- hanami-db v2.2.0.rc1
- hanami-reloader v2.2.0.rc1
- hanami-router v2.2.0.rc1
- hanami-rspec v2.2.0.rc1
- hanami-utils v2.2.0.rc1
- hanami-validations v2.2.0.rc1
- hanami-view v2.2.0.rc1
- hanami-webconsole v2.2.0.rc1
For specific changes in this release, please see each gem’s own CHANGELOG.
How can I try it?
> gem install hanami --pre
> hanami new my_app
> cd my_app
> bundle exec hanami dev
Contributors
Thank you to these fine people for contributing to this release!
- Adam Lassek
- Anderson Saunders — congrats on your first contributions, Anderson!
- François Beausoleil — congrats on your first contributions, François!
- Krzysztof Piotrowski
- Kyle Plump
- Seb Wilgosz
- Tim Riley
A special thank you also to Ernesto Tagwerker for making a DatabaseCleaner release for us, and Rémy Coutable for making a Guard release for us.
Thank you
Thank you as always for supporting Hanami! We can’t wait to hear from you about this release! 🌸