tldr: The reason people pull it as an extern is because it does not work with advanced optimisations.
89 karma · joined February 27, 2013
tldr: The reason people pull it as an extern is because it does not work with advanced optimisations.
this technique is called pre-rendering, and yes, I am amazed people don't do it.
"PyExecJS (which just uses raw JavaScriptCore)." this seems pretty slow or can you cache the execution function. (aka you don't have to parse the js multiple times)
Our backend is jvm so we decided on closure, with this on startup we compile our templates on the server and then pass the rendering functions around pumping the data into it to render initial pages. At the same time, we compile the same templates into javascript functions which are included into our app via the closure dependency system to render on the client. This has the advantage of not having to parse and "compile" a template at the point of delivery.
This is why I think react is an excellent library, because it allows anybody to do this and brings this notion into the minds of developers who jump easily on bandwagons.
I also think that the react team are well on their way to building a library which would fair excellently under all sorts of static analysis
the downside to his reasoning is that he is tying himself to a single back end (node) if he used something like mustache he coulkd use any backend, but mustache implies parsing templates on the client. googles closure compiles to javascript functions and I am sure something like that exists for mustache and this would seem very sensical.
Converting a large string to a dom element is not expensive, it is when that dom element is added to the actual display tree when things go a bit awol, this is to be expected, redrawing any GUI costs a lot.
React is an excellent library and I am glad people use it, none of the ideas are radical however.
pre-rendering the board on the server would have solved his perceived problem immediately.
then in more detail:
layout thrashing only now a consideration? (advice use a mock dom and see what your operations do in your testing if you decide to handle dom manipulation yourself)
as a developer you only started using the profiler when?
too many http request, can be much optimised (yes i realise cdn, but ttl there can be managed nicely even for a single delivery)
css not remaned and compressed
own js badly minified
using jquery ffs!
>> anyway, perceived rendering would have solved this by the metrics solved is measured here and simply rendering on the server and giving a 500ms ttl on the cdn would have been faster + not overburden their servers. I don't know their stack so perhaps the next staement is useless: is this api with the big taskboard open aka can I have a stab at it and try to explain and proof what I am talking about.
We all however know people who got through university without ever reading an inch of their set list, wrapped in a bubble of uncaring, who could do with a jolt again, a boost to remember why they want to be alive and that money is not the only reason to be alive. For these people, recommending a good documentary is your duty. It could kickstart a moral highground for a month or so in them!
Mandela's death will do more for SA and a fair bit of southern africa than most occurrences will, and era of memberance, reading reflection, humanism will come about. for a while. My greatest grievence with Mandela simply lies in that he did not break up the tri party alliance early (trade unions, communist party and the anc which is extremely right wing in contrast) allowing them to get 60%+ votes which effectively means it is a new dictatorship. (i am sorry if 80% of the votes are prone to gerrymandering + an extremely uneducated populace i won't call it a true democracy - then again first past the post - hah!).
a great human. the meaning and writing and so indefinitely misused from now.
ps. I have also not seen a dubbed one, but it is obviously subtitled.
I can really recommend the compiler in AO mode, the type saving is insane (75% reduction in file size) and type checking is sweet
antlr "schemas" are extremely close to ebnf's (some exceptions obviously) and the compiler creation club could benefit from that. Antlr 3 is usable in a variaty of languages (although 4 is a hellavalot simpler and solves a fair bit around left recursive grammers, but non jvm support is non existent still I suspect)