Hacker News new | past | comments | ask | show | jobs | submit login
Real-Time Web Apps with Zero Lines of JavaScript (instawork.com)
33 points by adamstep on Oct 7, 2019 | hide | past | favorite | 15 comments



Wow Adam! I owe you a drink! I have been looking for something like intercooler + sse / mercure. What a great example of NoJS!

I thought I was stuck with just amp (https://amp.dev) as an option. Please ignore the nitpickers saying it is technically not zero lines of js.

If the app can be developed without writing js, it can be considered nojs. The list here (http://markapp.io) is based on that principle.

Please please keep on chronicling your adventures. So many questions but I will take the weekend to explore properly.


I totally agree, the benefit of NoJS comes from not needing to write custom code in order to implement a feature. Thanks for the link to that list of other NoJS libraries. If you have any questions about Intercooler, please leave a comment on the post.


So you use JavaScript libraries to avoid writing JavaScript to use a JavaScript browser API?


That's right. By including the Intercooler.js library, we don't need to write custom JS when developing features in our web app. We can take full advantage of JS APIs like AJAX and EventSource by only adding declarative HTML attributes to our markup.


That's exactly right.

It's also pretty hilarious.

I said a while ago: "The irony is that I had to learn a lot of javascript in order to never have to write any javascript again."


I think this kind of approach is really underrated. I remember from playing around with Rails that you can do very similar things quite easily.

It's not a popular approach at the moment, but I do feel like there is validity to it.

Kudos for taking the road less travelled.


So this is being done just for the sake of not writing JS?

I don't see how this will be in any way better or more maintanalbe. Also it means writing more Django/Jinja templates.


These articles might help:

http://intercoolerjs.org/2016/01/18/rescuing-rest.html

http://intercoolerjs.org/2016/05/08/hatoeas-is-for-humans.ht...

Apps written in this manner (when properly decomposed) are very maintainable and often markedly simpler than a client-server SPA model. It isn't a popular approach right now, but that's OK. We are all independent thinkers here on HackerNews, right?


Like I mentioned in the article, our main motivation is increased productivity. By avoiding JS for feature development, we write fewer lines of code and ship faster. Better maintainability comes from a smaller codebase and no duplication of business logic between the frontend and backend.


Less JS is always better, but if you're using Intercooler.js, are you really creating an app with "zero lines of JS"?


It's true we include Intercooler.js and jQuery in our web app. What I meant is that as developers working on our web app, we don't need to write JS to implement new features. All of the logic happens in the Django codebase.


You don't have to write any JS at all to leverage Intercooler.js and JQuery?

At least Milady de Winter had the courtesy to be attractive when she tried to bullshit me and my buddies back in the day.


That's right, check out https://intercoolerjs.org/docs.html for a primer on how it works. Interactions and AJAX requests are declared using HTML attributes, the responses are server-rendered and swapped on the frontend.


Very cool Adam.

You are officially the worlds expert on using server sent events in intercooler. ;)


Thanks! There's so much potential there, we're excited to push the limits.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: