Is it possible to load templates at runtime?

I have a really big application, there are lots of screens involved. Different facets of the UI are available to different users depending on login.
I would prefer not to download the whole application to the client. I have had a look at I understand that the spacebars-compiler package generates htmljs which is sent to the client. Would it be possible to have this occur at runtime and cached on the client? Is there a routing system that provides this out of the box?


Did you check Template.dynamic ?

It will let you load a template on the fly, or swap it based on an event.

@mspi That’s not what he means, he means not downloading the actual template during initial load of the page.

@carbonman Although I would try to avoid it, there is a possible solution that uses files in the public (or private) folder and load them on demand:

And the 2 packages:


Thank you. I will definitely check that out. Looks like exactly what I am after.

Sorry for the slow reply, I didn’t get any email notifications for the thread. I need to work out how to do that.