Using done-sir with the in-depth tutorial app structure

I am busy with my firsts donejs app. I based it on what I learned execution the “in-depth” tutorial and it’s main file is almost identical to the in-depth app.js.

The docs for done-ssr do not obviously relate to the in-depth structure. Is there a guide anywhere that would help me?

It appears to me that I might need to write an uber ssr managing app that refers to app.js. Is that right?

This is kind of important because, even at this hello world stage, my app is giving me nasty ‘flash of unformatted content’.

The trouble seems to be that css should be loaded first as you, in all probability, know. However, the way the application is structured means that the css is loaded too late.

I think the latest stealjs training video actually mentions this… unfortunately I cannot check here at work since videos are not permitted but perhaps you can find it. This could give you some ideas.

As an interim workaround you could load your css in <head> section of the relevant html file. Perhaps others have a more elegant solution but irrespective of how it is done that css better be loading first :slight_smile:

I guess I was inaccurate when I said it was unstyled. It’s only sort of like that.

I have a line in my index.stache file that is:


When it loads, it shows like this:

… for most of a second. (On my dev system with unbundled code, it’s more like ten seconds. It worries me a little about how long things are going to take when this app gets complicated.)

Compromise found.

It turns out that view.stache is partly escaped. I’m not sure exactly how it differentiates between “

” and " ", but, I made a helper that used

return can.stache.safeString(‘blah   blah’)

and that makes it so that the ampersands do not get written into the document until the escaping is changed.

this is a bug

i made a PR in can-simple-dom.

@tqwhite you are using canjs 2.3.X ? can you try to replace the ‘simple-dom’ in package.json


"can-simple-dom": "can-simple-dom": "github:canjs/can-simple-dom#19-encode-entities",

and try it again.
pls remove the can-simple-dom folder from node_modules first.