August 25th, 2008 — General, Releases, Updates
I know that with every release I say something like, “This is a big release”, but the fact of the matter is this is a big release. Amongst the 49 tickets that make up release 0.7.0, there are two in particular that are at the core of Mack’s very existence, they are Distributed Objects and Distributed Views/Layouts.
Back on March 26th Mack 0.4.0 was released. This release brought the first of three large distributed features, Distributed Routes. With 0.7.0 Mack fully realizes it’s goal of making it easy to write fully distributed web applications. There is a very nice wiki page, on our new wiki, that shows in detail how to use the new distributed features. That page can found here. Also, don’t forget to watch the screencast of the new distributed features that can be found here.
Distributed Objects
Distributed objects allow you to easily distribute access to your library and model code amongst any of your other Mack applications. Allowing this access is as simple as requiring the mack-distributed gem, adding a few lines to your configuration, and starting the mack_ring_server binary. ‘Client’ applications just need to require the mack-distributed gem.
Distributed Views/Layouts
With distributed views and layouts you can now share the look and feel from one application with all of your applications. Configuration and use is just as easy using distributed objects.
Form and HTML Helpers
People have been requesting more HTML and form helper methods, and we’re more than happy to comply. There are whole bunch of these new methods now to help you more easily build your applications. The generators have been updated to use these new methods, to make your job even easier. There is also now support for doing Date/Time drop downs, similar to Rails and Merb.
‘Tell’ Messaging
Rails folks know ‘tell’ messaging as ‘flash’ messaging and Merb folks know it as ‘message’ messaging. We went with ‘tell’. Tell messages are cleared after any non-redirect request. They’re a great way to send a simple message down to the client.
New Wiki
With this release there is also a new wiki at, http://www.mackwiki.com. This new wiki, incidentally built using Mack 0.7.0, will house all the tutorials and how-to’s for Mack. There are a few entries from the old wiki that still need to brought over during the next day or two.
Changelog:
- [#114] Javascript link_helper
- [#112] Error generating mack application
- [#109] DataMapper 0.9.4
- [#103] Log colors for the console are now configurable per log level.
- [#102] New association method in data_factory
- [#101] Update to file upload testing (build_file -> file_for_upload, and multipart support in put)
- [#100] Inline routing parameters are being mutated
- [#99] Upgraded to facets 2.4.3
- [#98] Fixed mack-facets not being loaded before app_config files.
- [#97] Fixed sessions only working with ‘local_memory’ mode
- [#96] Distributed Views module now uses file cache
- [#92] Removed deprecated app_config.orm code.
- [#91] Fixed Mack blowing up if there is no config/initializers/gems.rb file.
- [#90] Added deprecation system.
- [#89] rake gems:* will now only display warning if any gem required is not installed (and not break)
- [#88] Implemented pending SQLite3 tests in mack-activerecord
- [#87] Refactored out common ORM code from mack-active_record and mack-data_mapper into mack-orm
- [#86] stylesheet link helper
- [#85] Refactored out Mack::ViewHelpers::HtmlHelpers into Mack::ViewHelpers::HtmlHelpers, Mack::ViewHelpers::FormHelpers and Mack::ViewHelpers::linkHelpers
- [#84] Added Mack::Distributed.lookup(url) to retrieve specific distributed services.
- [#83] Added mail_to HTML helper.
- [#82] Added ACL support to mack-distributed
- [#81] Fixed sessions working with redirects in testing
- [#80] Distributed objects present both the DRb::DRbObject inspect and the original object’s inspect when asked.
- [#79] Renamed app_config.mack.use_distributed_routes to app_config.mack.share_routes
- [#76] Move mack_ring_server to mack-distributed
- [#75] Left over mack-distributed rake tasks
- [#74] Added optional feature to disable initialization logging.
- [#73] Tests no longer use the functional/unit directories
- [#69] Added ViewHelperGenerator and ControllerHelperGenerator
- [#68] Transactional support in mack-AR
- [#67] Added test:setup tasks for active_record and data_mapper
- [#62] Removed const redefined warnings if mack-l10n is used along with mack-activerecord
- [#39] HAML 2.0.2 support
- [#28] Refactored out encryption into the mack-encryption gem.
- [#25] Added ControllerGenerator
- [#19] Added HTML form helpers
- [#15] File upload testing support (ability to do multipart form post in testing)
- [#11] Distributed Layout/Views
- [#10] Added distributed objects to mack-distributed.
- [#8] Move distributed code from mack-core to mack-more
- [#5] Added tell messaging
- gem: genosaurus 1.2.2
- gem: haml 2.0.2
- gem: addressable 1.0.4
- gem: facets 2.4.3
- gem: data_mapper 0.9.4
July 16th, 2008 — General, Releases, Updates
Well, it’s finally here, Mack 0.6.0! This release has taken a long time, but I feel that it’s definitely worth it. This has to be the best release of Mack to date. During this release the Mack dev team grew by 100%, Darsono Sutedja, previously a contributor to Mack, is now a full time Mack core team developer! Darsono has done an absolutely great job on this release, thanks Darsono. With that out of the way, let’s jump straight to the good stuff, shall we?
DataMapper 0.9.2 Support
At long last Mack supports DataMapper 0.9.2. Because previous versions of Mack used DataMapper 0.3.2, there is some upgrade work that you’ll need to do, but trust me, it’s worth it. DataMapper 0.9.2 is a gigantic leap forward from 0.3.2. If you have problems installing the data_mapper gem, make sure that you don’t have gems.datamapper.org in your source path for rubygems. You can remove it with the following command:
gem source -r http://gems.datamapper.org
RSpec Testing Support
RSpec is now the default testing framework for new Mack applications. This innovative testing framework makes it fun, and simple, to do behavior driven development. If you haven’t yet played with RSpec, I would highly recommend it. I wasn’t a big fan of ’spec’ testing prior to meeting Adam French, of DataMapper fame, and he turned me on to the joys of rspec. I think you’ll like it too, if you give it a chance.
mack-more
There is now a mack-more package. This will house all the optional gems available to the Mack framework. This include things like HAML and Markaby support, localization, etc… Use what you want, ignore the rest. This will help keep the core code clean, light, and of course, fast.
Localization/l10n Support
Darsono did a great job with the mack-localization gem. There is now optional support for internationalization in Mack applications. Check out the gem, it’s definitely worth it if you need to support multiple languages for your web application.
Much, much more!
Of course, there’s a lot more Mack than the stuff I just mentioned, there’s tons of bug fixes, some code clean up, some API changes, transactional testing support, the ability to catch specific errors in routes and have them diverted to a controller/action for handling.
There is a great wiki entry on upgrading your existing Mack project to 0.6.0 here. I highly recommend reading it whether or not you have an existing Mack application.
With this release the Mack team is also fully embracing Lighthouse. If you find bugs, or have suggestions please visit http://lighthouse.mackframework.com and log them there. You’ll also find the list of features that will eventually be added to Mack.
Changelog:
- INCOMPATIBILITY NOTICE: Moved Mack::Configuration.root to Mack.root
- INCOMPATIBILITY NOTICE: Moved Mack::Configuration.env to Mack.env
- INCOMPATIBILITY NOTICE: Mack::Configuration.* path methods no longer exist. Use mack-paths instead.
- INCOMPATIBILITY NOTICE: Dropped mack_ruby_core_extensions in favor or mack-facets
- INCOMPATIBILITY NOTICE: Mack::Controller::Base is now Mack::Controller (and it’s now a module)
- INCOMPATIBILITY NOTICE: Haml renderer is now part of mack-more.
- INCOMPATIBILITY NOTICE: Markaby renderer is now part of mack-more.
- INCOMPATIBILITY NOTICE: Changed request param’s accessor routine, from params(key) to params[key]
- INCOMPATIBILITY NOTICE: Test::Unit::TestCase is no longer the default testing framework, RSpec is. If you wish to use Test::Unit::TestCase add the following config parameter to your config/app_config/default.yml file:
mack::testing_framework: test_case
- INCOMPATIBILITY NOTICE: ENV["_mack_env"] and ENV["_mack_root"] are no longer supported, please use ENV["MACK_ENV"] and ENV["MACK_ROOT"], or just Mack.env and Mack.root
- INCOMPATIBILITY NOTICE: MACK_DEFAULT_LOGGER constant is no longer available. Please use Mack.logger instead.
- INCOMPATIBILITY NOTICE: The ApplicationHelper module is now deprecated. Please move view level helpers into Mack::ViewHelpers::* and controller helpers into Mack::ControllerHelpers::<controller_name>
- thin.ru and thin.yml are no longer needed, you may delete them.
- RSpec assertions are now automatically added.
- Added a Mack::Testing::Response class to make testing of responses easier.
- moved test_extensions to testing and added the module Testing to the files in it.
- Added a dependency on mack-more
- Added a set of Rake tasks to update existing Mack applications.
- [#30] Added Mack::Logging::Filter to filter out unwanted parameters from the logs.
- In routing you can now define a route that will catch an Exception from another controller.
- ORM will not be initialized if the app never specify which ORM to use.
- All Mack unit tests are now written using rspec-1.1.4.
- mack command now takes an optional -t flag to determine which testing framework to use–value could be test_case or rspec [default]
- new setting added to app_config: testing_framework
- gem: cachetastic 1.7.2
- gem: application_configuration 1.5.0
- gem: erubis 2.6.2
- gem: genosaurus 1.2.1
- gem: thin 0.8.2
- gem: rspec 1.1.4
June 23rd, 2008 — General
I’m sure everyone is wondering why things have been so quiet around the Mack front recently. Well, there are a couple of reasons. One, I’m on vacation in Ireland right now, so my coding time has dropped dramatically. Second, I’m still very much so patiently awaiting the 0.9.2 release of DataMapper, which the next version of Mack needs. Third, there is a lot of Mack work afoot at the moment.
The company I work has seen fit to give me a few more resources to help me make Mack the most kick ass framework out there. I’ve not got 1.5 more bodies diligently working away on Mack, with another body to hopefully be hired in the next full weeks. That will mean, within a few weeks there will be 3.5 full time bodies working on Mack! Awesome!
There are some great things that are going to be in the next build, but mostly it’ll be a nice refactoring. We’re going to splitting a bunch of stuff out of the core of Mack and putting into a mack-more package, similar to the approach Merb and DataMapper have adopted. In mack-more there will be l10n internationalization, RJS support (Prototype AND jQuery), DataMapper 0.9.x support, HAML, Markaby, PDF::Writer support, amongst others. It’ll be nice. Trust me.
We hope to have the next release out within the first or second week of July, of course, this really depends on when the DataMapper release can get out there. Once we get this release out, we can really focus on some extremely kick ass new features. Stay tuned!
May 21st, 2008 — General, Releases, Updates
Finally, Mack 0.5.5 is released! In addition to some great bug fixes, there is now a new rendering engine, support for automatic mime-types, the ability to register new mime-types, Markaby and Haml support, and much much more! It’s a great release.
To find out more about the new rendering engine check out these two posts:
http://www.mackframework.com/2008/05/20/the-new-rendering-engine/
http://www.mackframework.com/2008/05/20/055-adding-pdfwriter-plugin-support-tutorial/
Changelog:
- INCOMPATIBILITY NOTICE: Ripped apart the ENTIRE rendering engine and rewrote it from the ground up. This means that wherever you are using ‘render’ calls in your views and controllers need to be changed. The new format is render(type, value, options). Examples: render(:action, :show), render(:url, “http://www.mackframework.com”), etc…
- INCOMPATIBILITY NOTICE: Files named *.xml.erb need to be changed to *.xml.builder to use the Builder::XmlMarkup library. If you leave the .erb extension on there the file will be run through Erubis.
- INCOMPATIBILITY NOTICE: <%= @content_for_layout %> is now <%= yield_to :view %>
- Added Markaby support.
- Added Haml support.
- Added content_for and yield_to methods in views.
- Erubis compiled templates are now cached for increased performance.
- Added render(:inline) and render(:template) support.
- Refactored, and reorganized some files to clean up the gem.
- Fixed bug with cookies not merging with configured app_config parameters.
- Added mime-types. The ‘Content-Type’ header is now being set based on the format that is requested. Default is text/html.
- Fixed r.defaults in routes so they are always the last routes to be checked, no matter where they are placed in the routes definitions.
- render(:url) now recognizes ‘local’ urls and tries to run them through the app, mimicking most headers from the original request.
- Added ‘options’ banners to the mack and mack_ring_server binaries.
- gem: genosaurus 1.1.8
- gem: mack_ruby_core_extensions 0.1.28
- gem: markaby 0.5.0
- gem: mack-data_mapper 0.5.5
May 20th, 2008 — General
In the latest version of Mack the rendering engine has been completely re-written from the ground up. With this comes some new features, some incompatibility, and most importantly, extensibility. Let’s jump on in and see what we can expect with this release.
Incompatibility
- Gone is <%= @content_for_layout %> in layouts. In is <%= yield_to :view %>.
- Gone is render(options_hash) in controllers/views. In is render(type, value, options_hash)
Examples:
render(:action => :new) is now render(:action, :new)
render(:url => “http://www.mackframework.com”, :parameters => {:message => “hi”}) is now render(:url, “http://www.mackframework.com”, :parameters => {:message => “hi”})
- Gone is *.xml.erb. In is *.xml.builder
Let’s quickly talk about how these incompatibilities have come about. First there were several bugs that needed to be addressed with the rendering engine. For example, if you set an instance variable in a view, it wasn’t available in the layout. That’s a pain if you want to do things like programatically set the page title. There were also ‘hacks’ used to do things like render xml using the Builder::XmlMarkup library. It wasn’t clean, but it worked. Finally, the rendering engine itself wasn’t that extensible. All of that has now changed.
Render Me Softly
In the new rendering engine there are two parts to the system, Mack::Rendering::Type::* objects and Mack::Rendering::Engine::* objects. Let me explain the difference.
Mack::Rendering::Type::*
A type is something like :action, :text, :inline, :url, etc… That is the type of thing you want to do. I want to render an action. I want to render a url, etc… There are classes for each of these types, and you can easily add your own. These types do all sorts of work before they pass it off to an engine, if need be. For example, in the case of Mack::Rendering::Type::Partial the render method does the work of inserting an ‘_’ in the appropriate place, so the file can found.
<%= render(:partial, "users/form") %> # => "users/_form"
Once that happens it tries to find an engine to process the partial.
Mack::Rendering::Engine::*
An engine does the actual work of rendering the io, with the binding of the Mack::Rendering::ViewTemplate object, it’s been given by the results of the render method in the Mack::Rendering::Type::* object. Engine examples would be, Erubis (ERB), Markaby, Haml, and Builder::XmlMarkup, all of which are included with Mack in this release. New engines can easily be plugged in and registered with the system.
Coming soon a tutorial on adding PDF::Writer support using the new system.