I went through the place-my-order sample app. However the app I would like to create is not the normal web app. The entire application will by zipped up, downloaded to a samsung monitor and run locally on its tweaked, internal monitor, thus allowing the monitor to run off-line as well as better performance. The only server interaction it will have is to download a json document describing the content and styling for the monitor. Also (for now) it is entirely read-only.
So, since I haven’t seen any examples or discussions about some of the issues I face, I have a list of questions:
-
All of the examples I have seen in donejs use component-based modules. While this is great if those modules have a UI aspect (like the restaurant modules in pmo), what about modules that are there to do back-end processes or utilities? For example, I want to create a module to handle parsing the original json doc into objects holding data to render different content/styling on the page (like for css, text, images), I have a module to download the image and video files, one to interact with the local file system, etc. What is the best way to handle such modules in donejs?
-
How do I include 3rd party libraries that are not in the npm registry? What if they are bower components? What if I just have the actual js?
-
I see can-connect has a local store to cache subsequent find requests. Does that store persist or is it only for the duration of the session? What if I want to override the local store and force a refresh from the server? For example, the original json doc downloaded 1st time the app is used and the parsed objects need to be saved locally (localStorage or IndexedDB), so the app can load them right away next time the monitor is turned on. After the page is loaded, I want to ping the server for any updates to doc while the monitor was off.
-
the doc can contain multiple presentations of content to be shown at different times during the day (day-parting). So what I want is, based on a scheduler (another non-UI module), to switch the viewModel from the current presentation to the new one. I was thinking of using can.route to switch between presentations (similar to the restaurant-slug in pmo). Does that sound like the way to go or is there a better way?
-
In pmo, the slug changes were tied to can-connect, but as mentioned, I am not connecting to a server to get this data, rather to locally saved objects. Would I be able to wire can-connect to pull the data (and store the data) locally or do I need to fall back to the more traditional load into a can.Map/List approach and go from there?
-
Since styling is not known until runtime, I can’t create static stylesheets. Rather the parser returns a css string that it compiled from the doc, and my plan was to save it as a .css file and then inject a link tag in the page (with a different .css file for each presentation). Then on subsequent page loads, it would just read from the .css file like a normal web page. Or I could just inject it into the template in a style tag. How can I get this to work with the stache template? Would a dynamic binding on can-import tag work? Just inject into the page after loading with jQuery? Is this something steal could handle? Another suggestion?
Okay, I know this is a lot and am not looking for anyone to “write” my app. I just have a lot of unknowns about donejs.
Thank you just for reading this far,
Dovid