- On the frontend, use React with TypeScript. Create React App now makes it dead easy. Just do: npx create-react-app myapp --typescript - Do not use redux until you know React well. You might not need it. If you do need it, use `redux-starter-kit` offered by the core Redux team. - For backend, just use Django (or Rails). Elixir's Phoenix is also very well thought out. - If you use node: express, sequelize. Async/awai…
Ask HN: Go-to web stack today?
171–180 of 453 posts
Re: Ask HN: Go-to web stack today?
#172* Statically-typed languages like Typescripts, Kotlin, Scala, or even Java. Avoid dynamic-typed language in general * Single-page application, which means complete separation between frontend and backend. When developing locally, you have to run two servers. I prefer the traditional way but it's hard to make JS build tools (e.g. webpack) to work well. My choice is Playframework (because I know Scala well). The fronte…
Re: Ask HN: Go-to web stack today?
#173Clojure + ClojureScript * One language across the whole stack * Its approach for React makes it both easier to grasp and more correct/maintainable than its ES6 counterpart * Gradual typing for the parts that matter * The overall experience is the opposite of "Javascript fatigue" Needs some investment, cannot be denied but it pays off over the years.
Re: Ask HN: Go-to web stack today?
#174My safe enterprise monolith stack for long term maintainability and high productivity is: Backend: Django Realtime/DB: Realm + Postgres Frontend: Angular Surprised few have mentioned Angular yet. It is highly opinionated unlike React, and backed by a giant unlike Vue. Seems like a safer enterprise choice.
I’d go further and say this is a good combination for any team who want sound frameworks with out-of-the-box functionality, without having to research the ecosystem and discriminate between lots of third party modules.
Re: Ask HN: Go-to web stack today?
#175Earlier quoted context omitted.
A lot of people say that you'll know when you need it about flux implementations (redux, mobx, vuex, etc). I have a react native project that I resisted using flux (in my case, mobx) as long as possible to try this theory out. The situation I ran into that instantly told me I needed global state management was when I had an index screen for list of resources, and a edit screen for a single resource. I knew I needed g…
There are simpler ways to do global state management than redux. The scenario you described is nothing new. Redux is new. How do you think people solved this problem before Redux? Does redux have a better way of solving this old problem? How would you solve this problem in an ASP.NET or JSP application that has server-side rendering? How would you solve it in an iOS app? My point is that this is a pedestrian, every-d…
> My point is that this is a pedestrian, every-day problem that doesn't need a complicated solution.
then you should be able to answer the question below, yes?
> How do you think people solved this problem before Redux?
Re: Ask HN: Go-to web stack today?
#176Earlier quoted context omitted.
I'd say that Django is not a great fit for lambda. Lambda works best when you architect you code around it, with lots of tiny methods. Django does not encourage this way of coding (just like the other frameworks).
> Lambda works best when you architect you code around it, with lots of tiny methods as a total hobbyist: why ? deploying a django app with zappa is extremely painless... its only issue is that you still need an SQL backend, as DynamoDB isn't really an option unless you want to kiss most of djangos values goodbye. that would've been my take why you'd want to use flask... because there is very little value in django i…
Re: Ask HN: Go-to web stack today?
#177- On the frontend, use React with TypeScript. Create React App now makes it dead easy. Just do: npx create-react-app myapp --typescript - Do not use redux until you know React well. You might not need it. If you do need it, use `redux-starter-kit` offered by the core Redux team. - For backend, just use Django (or Rails). Elixir's Phoenix is also very well thought out. - If you use node: express, sequelize. Async/awai…
What do you mean by "just use"? The OP seems to have a long experience and having had used Rails recently myself as a 20 years experience web developer, all I can say is stay away if you know the way web works and not doing it as a medium team size.
You need to learn everything the rails way even if you know every moving parts of what makes a web site which can often get in the way and I can't live without googling every 30 minutes and I assume Django is similar.
Why not recommend something like Koa which is for node.js but more modern than Express, even by the same author, and with TS and async/await it works well which is my main framework these days.
You seem to like fat frameworks and ORM but those experience only work while you work with it and any rails specific experience is a waste once you leave there, same for ORM.
And why PostgreSQL by default? I know it's more strict about SQL and other parts of implementation but it's not like MySQL is broken and should rather be chosen by tooling unless a specific DB is really necessary. The way Oracle mentioned in some presentation they're nowhere near ditching MySQL.
As for editors, consider using JetBrains offerings too. Price is nothing if you're serious. VS code is good too.
Re: Ask HN: Go-to web stack today?
#178Clojure + ClojureScript * One language across the whole stack * Its approach for React makes it both easier to grasp and more correct/maintainable than its ES6 counterpart * Gradual typing for the parts that matter * The overall experience is the opposite of "Javascript fatigue" Needs some investment, cannot be denied but it pays off over the years.
* Feels lonely
Part of the reason is that libraries can be “finished” (as in, so stable that they don’t need frequent updates), so there is way less busywork and noise in the open.
Another reason is that clojure is open source but not free software, and this has affected the community. There was a big discussion lately about this, where some vocal leaders of the community complained about it: https://news.ycombinator.com/item?id=18538123
Re: Ask HN: Go-to web stack today?
#179Earlier quoted context omitted.
This is a good approach for many apps, but watch out for the thorny XSS issues you can have when mixing server-side rendering with a client-side framework which supports interpolations e.g {{ some_var }} . Rails/Django etc will correctly sanitize the rendered data for a HTML context, but they don't know that your client-side framework will execute code inside a {{ }} block, so those aren't removed - so if you render…
> but they don't know that your client-side framework will execute code inside a {{ }} block Isn't that why they added a verbatim tag?
new Vue(...config...).mount('#app')
Where #app is the selector for some server-side (Django template) rendered element (commonly, the first within the element). _This turns this entire element into a Vue template_. Now, consider your Django template has something like this to echo a comment by a user: y4ml says: {{ comment }}
If "comment" in your template context contains Vue curlies, it will be interpreted as such by Vue. So if you wanted to be annoying, your comment could contain: Hi guys, I just wanted to say {{ $&^%£&£%^% }}
Which would cause an exception during rendering (a syntax error) and cause your entire #app element to render blank.It doesn't just have possibilities for annoyance, because everything inside those curlies is actually _scope-limited Javascript execution_. Consider this in your Django template:
Search results for "{{ request.GET.q }}"
Now, if 'q' in your GET contained variable contained: {{ constructor.constructor(alert('hello y4ml')) }}
e.g.: /search/?q=%7B%7B%20constructor.constructor%28alert%28%27hello%20y4ml%27%29%29%20%7D%7D
You've just created a nasty XSS.Basically, if you're going to mix server-side and client-side rendering you must either ensure that curlies in user-supplied input are always HTML-escaped on output (DON'T do this, you're guaranteed to miss one), or you ensure that user-supplied input is never output in a Django template within an element on which Vue is mounted. The best way of ensuring the latter is to only mount it selectively where it is required, and where it's easy to validate either by eyeball or machine that no user-supplied input will be present (i.e. a 'js-VueMount' class that must ONLY contain one custom element).
Does that clarify it, or did I misunderstand your point?
(edits: missing curlies, wording clarifications)
Re: Ask HN: Go-to web stack today?
#180Earlier quoted context omitted.
There are simpler ways to do global state management than redux. The scenario you described is nothing new. Redux is new. How do you think people solved this problem before Redux? Does redux have a better way of solving this old problem? How would you solve this problem in an ASP.NET or JSP application that has server-side rendering? How would you solve it in an iOS app? My point is that this is a pedestrian, every-d…
If this is true > My point is that this is a pedestrian, every-day problem that doesn't need a complicated solution. then you should be able to answer the question below, yes? > How do you think people solved this problem before Redux?