v0.4.1
We worked hard the past few weeks on the new Cobalt 0.4.1 release. There is a bunch of new features that we are quite proud of. Here are the superstars of this release:
- Navigation methods: you can now pass data along the way,
- LocalStorage: you can now store anything, without caring about data type.
We also worked on the documentation wiki and rearranged the whole repositories architecture.
Send data with navigation methods
You can now send data along all your navigation calls. Just call the usual navigation method and add your data object:
cobalt.navigate.push({
page: "next.html",
data: {foo: "bar"}
});
This will navigate to the next.html page which will receive data in its onPageShown event!
cobalt.init({
debug: false,
events: {
onPageShown: function(data) {
cobalt.log('page received: ', data);
}
}
});
And yes, that's enabed for all navigation calls: push, pop, modal, replace and dismiss! Read more on the documentation page.
Store whatever in cobalt.storage
You don't have to worry about data type anymore. cobalt.storage.get
and cobalt.storage.set
are now able to store anything you put inside. From strings to objects or event dates or weird null/undefined values.
warning: this is not backward compatible. cobalt.storage.getItem
and cobalt.storage.setItem
have been deleted.
More on this in a blog article soon.
New repositories
Cobalt has been split in three GitHub organizations:
- Cobaltians: the home for cobalt core. Each platform (Web, iOS and Android) has its own sources repo so you can clone Cobalt into your project as a submodule,
- Cobaltians-Samples: The home for cobalt samples. Check out the new Sample List page,
- Cobaltians-Plugins: The home for cobalt plugins. Check out the new Plugins List page.
Other changes
- CLI has been updated to reflect repository changes and now use submodules,
- Cobalt iOS is now a framework. The way you add Cobalt to your iOS project changed a bit. Read more here,
- Controller Instantiation methods have been reworked on iOS, so you can now push a Cobalt or native controller with no Cobalt inside. If you used
getControllerForController
on iOS, you will now have to use(CobaltViewController *)cobaltControllerForController:(NSString *)controller andPage:(NSString *)page
or(UIViewController *)nativeControllerForController:(NSString *)controller
, - You can now use cobalt.registerCallback to register your own cobalt callback. it may be useful for plugins development,
- Alert button index in alert callback is now always an integer,
- Fixed some onSaveInstanceState crashes on Android,
- Fixed crashes on FragmentTransaction on Android,
- Fixed altKey handling in debugInBrowser mode on the Web side.
Contributors
Contributors for this release are GGendre, Doc1faux, Myrdhinn & Alexandre-LePoupon.
Download link.
Use the Cobalt_0.4.1.zip file below because archives created by GitHub do not include submodules content.