Frequently Asked Questions

General

What makes Joshfire different from other JavaScript frameworks ?

Joshfire's #1 goal is to be multi-device in the widest possible sense: web, mobiles, tablets, desktops, Node.js, connected TVs, even headless devices are supported. Write once, run everywhere. It's the first open source framework based on open standards to integrate this cross-platform goal so deep in its design.

Developers

I've downloaded the Joshfire framework archive, extracted it, but the examples won't run

The current archive contains symbolic links, which some operating systems such as Windows have trouble dealing with.
This issue will be fixed in a near future update.
Currently, to overcome this, you should copy the joshfire/lib directory within the examples folders, and rename it joshfire.
You should now have a joshfire/examples/helloworld/joshfire/ folder, mirroring the joshfire/lib/ one.
If you encountered this bug on an unix-based system, or if the aboved instructions didn't fix it, please contact our support

I've added a new file in an adapter but when I try to require it, only the base class gets loaded.

This is probably because you forgot to run fab bootstraps to rebuild the list of modules provided by the adapter.

I got an Uncaught Error: Mismatched anonymous require.def modules after adding my dependencies

Check that you do have a Joshfire.require(...); entry in your file, not only Joshfire.define(...);

Are there CSS themes ?

The framework does not currently ship with pre-made designs other that the ones in the examples, which are however usually a good starting point.

How do I access my app instance variable ?

It depends on where you are :

Do you use CoffeeScript ?

No because we want to keep the entry barrier as low as possible for most people. That said, you can obviously write CoffeeScript apps using the framework (please contribute an example!)

What template engine do you use ?

By default we use underscore.js templates which should be enough for most needs. However you can include your favorite template engine by adding it in a vendor/ directory of your application and including it.

Object-oriented ? MVC ?

The framework uses mixins and simple inheritance internally (with the underscore.js library) and it is recommended to do the same in your applications.

Joshfire provides a pretty neat implementation of the MVC pattern: tree.ui and tree.data files allow you to describe separately the interface, the underlying data, and the relationships between them.

I want to throw custom errors in order to debug properly.

You could use the standard throw new TypeError() but:

You should rather use the pub/sub mechanism at the app level with the keyword 'error'.


try {
	// something risky here
} catch (e) {
	return app.publish('error', 
		{	message:'samsungtv VideoMediaElement : no URL given',
			number:21,
			origin:'adapters/samsungtv/ui/video.mediaelement' 
		});
}

You should at least provide a message property containing both the error and the object it comes from. Adding the pathfile and an error number is recommanded for debugging purpose.