Re:Ask HN: What's your quarantine side project?
by raihansaputra on Friday May 15, 2020 @12:40AM
(#23188957)
I'm interested in building a site in the same way (Django + Intercooler + VanillaJS). Do you have any recommended projects/readings to look into? Or do you have any thoughts on other alternatives (StimulusJS + Turbolinks / Unpoly)?
[ Parent
| on HN ]
Re:Ask HN: What's your quarantine side project?
by mishu2 on Friday May 15, 2020 @03:56AM
(#23189921)
Hey, I think Django has some of the best documentation of any project I know (both reference and tutorials/guides):
https://docs.djangoproject.com/en/3.0/
There is some material on using Django with intercooler.js:
https://www.reddit.com/r/django/comments/5nj242/psa_intercoo...
https://engineering.instawork.com/iterating-with-simplicity-...
but in the end I did something slightly different: for actions I just have in my views:
if 'X-Ic-Request' not in request.headers:
# render full page (which includes the fragment template)
else:
# render fragment template (which Intercooler will interpolate into the page)
That way, should I get to that page by any other way (user has disabled JS, I have a link in my page because I want a full page reload), it still works fine. Hope this helps.I had a look at Unpoly, that looks very interesting and could simplify the backend code even more.
Re:Ask HN: What's your quarantine side project?
by raihansaputra on Friday May 15, 2020 @09:06AM
(#23191703)
Yeah, Django's documentation is top notch, but I haven't seen a lot about mixing Django + Intercooler. That's a cool approach to make sure the actions are always reachable. Will read these, and maybe reach out to you sometime to find out how you like Unpoly! Thanks!