New chestnut project: Editing app-state doesn't refresh browser - clojurescript

After getting hyped by Nolen's great talks, I decided to give Clojurescript and Om a go.
Everything works as advertised - except I'm a bit surprised that editing the app-state doesn't refresh the browser like editing style.css or the Om component tree does.
I'm guessing this is intentional and that there's a good reason why editing app-state doesn't refresh the browser. However, I'm very new to ClojureScript and don't quite know where yet to go digging for the answer.
Any help/insight is appreciated!

Of course, 5 minutes after I post this question, I run across the answer.
Taken from Om's Basic Tutorial:
The reason we need to refresh the browser is because app-state is defined with defonce. This is meant to prevent each reload from resetting the state.

Related

CSS sheet not affecting the layout

first of all, I couldn't find a way to phrase my problem in one sentence, so I'll try to be more explicit in the post.
So I've been developing on VS, essentially doing web development with Razor MVC, for almost a year now and there's something that has been bugging me. On most of my projects I use a unique stylesheet in which I put all of my rules. My problem is, if I reload the page, the CSS won't apply and I have to make a change to my CSS and save it for the rest of the sheet to works. I also noticed that if I leave VS, the CSS now apply permanently. So it's not really a big issue that won't let me work properly, but still it's a bit boring to have to change a value and then hit ctrl+z each time I reload the page.
So I wanted to know if anyone had had the same problem, and if yes what was the solution; and if no, I'll listen to any idea.
Thanks for your time and have a nice day :)

What speaks against single-page apps from a user experience point of view?

I like them more and wonder why they are not more common. Explanations involving caching or SEO make sense to me, but I don't see them as directly driven by user experience considerations. In which way are traditional sites with page reloads better for the user?
Personally I think the best argument for normal page reloads from a user's perspective is that when you do that it's much harder to break many basic browser functions. In general the back/forward buttons work, bookmarking works, copying and pasting links works, history works, page titles work, getting an error page when a server call fails works, everything just works as expected. For free.
I have seen single page application implemented in a way that breaks one or more of the above more times than I can count.
It's naturally not a problem if you get it just right (and then it will in general be nicer to use), but not all sites do.
Just as an example here's a screenshot how a site that is a SPA and justifiedly so (they have a music player that you don't want to interrupt with page loads), broke a basic browser function in a way they might not even have thought of. I was trying to find a song I recently listened to but couldn't remember the exact title... but because of the SPAness the page titles weren't properly reflected in my browser history.

Chrome console keeps getting stuck in a quirky state

The console gets stuck in a state where every two page refreshes a new closed instance of my indexedDB is displayed. They are all closed except for the one on the top and everything within the application still seems to function normally, however other strange things occur when using the console.
When I click on a table within the database it shows the data, but when I try to filter or go to the next page it all disappears. I have to completely close the browser tab and then reload.
Sometimes when I enter in console commands they don't do anything, don't return anything (not even undefined), but when I refresh the page it alternative between working and not working.
Let me know if you need some more information. I haven't a clue what's causing this. I'm using the latest version of Chrome 35. Any thoughts?
Saw this once. Try a fresh install, and if that does not work, try upgrading to dev channel 37. I did both those things (for other reasons), but have not been able to reproduce the bug since. Trudging through Chromium's list of open issues or changes might also help.
Also, it looks like your question is not really about programming so it might be closed. There are other 'something.overflow' sites to post this type question.
Edit: also, regarding the disappearing issue, I actually reported this bug on Chromium. It was recently fixed!

Any Idea on on how does the HTML 5 Terminal work?

I happend to stumble upon this site
http://www.htmlfivewow.com/demos/terminal/terminal.html
It is simply amazing. I was just wondering on how is the terminal being emulated in the browser ? Can we embed the terminal in the browser and use it normally ? If so how?
i found this link which kinda enlightens the architecture http://www.htmlfivewow.com/slide33
But one thing aint clear what exactly is CRX-LEss Web app ? its completly new term , i havent herd of it before ( googling dint quite help me )
The actual presentation for the demos is from the Google I/O conference, and the talk was called HTML5: The Wow and the How. If you watch the video, they go over everything that's implemented in the terminal demo:
http://www.youtube.com/watch?v=WlwY6_W4VG8
It's very cool stuff.
A great thing about the web is that on any page you can View Source. Give it a shot. The source is well-structured and though it could be better-commented it's pretty straightforward. Even if you don't understand it in its entirety it will give you a place to start searching for the techniques used.
With JavaScript, the DOM, and <canvas> (which, I should mention, isn't used in this instance) just about anything can be created, from terminal emulators to Nintendo emulators.
A CRX-Less web app is an unzipped Chrome extension and points to the manifest.json file for the extension. It is an experimental feature and must be enabled in the chrome:flags page. https://developers.google.com/chrome/apps/docs/no_crx explains how the process works.

localStorage Isn't Accessible in Chrome's --single-process Mode

So I'm trying* to use Chromium's --single-process flag (yes, I know it's the most dangerous thing in the world, etc., no need for a lecture, thanks!) with localStorage, and for some reason, it looks like whenever Chromiums is started in single-process mode, localStorage no longer has any data accessible from it.
What's the reason behind this? And is there any way to get around it?
(If that means recompiling Chromium, let me know what I need to modify where.)
I have tried to search for some results about your issue, so I`v entered the irc (on freenode, #chromium channel) and because rsleevi don't have account I just copied our conversation:
Me:
hey, does anyone knows about Chromium's "--single-process" and localstorage bug ?
rsleevi:
<+rsleevi> That's a bit of a broad
question. But the easy answer is
"--single-process" isn't a "supported"
flag - it truly is intended for
debugging purposes only by devs. If
you're using/relying on it for general
use, then theres your problem :)
<+rsleevi> It's reasonably expected
that a number of things won't work or
won't work right in --single-process
Me:
yes I understand that is for debugging
pupposes, but I just want to know why
localStorage doesn't work well while
other stuff does :)
rsleevi:
<+rsleevi> Well, the answer is because
--single-process isn't "supported" :-) [13:58:32] <+rsleevi> The design of
new features always designs for the
multi-process scenario. If it happens
to work in --single-process,
serendipity, if not, c'est le vie
Me:
OK I understand. Just thought maybe
there is some "offical why"
rsleevi:
<+rsleevi> Generally, no, there's not
some decision "We don't want to
support X in --single-process"... It's
"X doesn't happen to work? Oh well"
<+rsleevi> If you're using
--single-process, realize that (just like the info bar says) you're running
without all the nice security
features, and your
configuration/features are expected to
regularly break or be unusable. I
really can't stress the
"not-supported" aspect enough, in the
hope that maybe I can sway you :-)
Me:
I don't know if you are a memeber on
stackoverflow, but I`m trying to help
this mate here:
localStorage Isn't Accessible in Chrome's --single-process Mode
, maybe you can answer his question (
if you are a member )
Don't want to take your copyrights :)
rsleevi:
[14:09:57] <+rsleevi> Heh. I don't
have an account, sounds like your mate
doesn't want my lecture, but the
answer is just like the info bar says
"unsupported" :-) marsbear's second
answer is right on track - it's just a
development aide [14:10:08] <+rsleevi>
that is, Chromium development, not
general webdev
I know that there isn't a fully answer here, but maybe it will help you.