Earlier quoted context omitted.
Optimizing for community size and simplicity for an outsider.
Thanks for the answer! I'm probably personally leaning towards using Playwright for future projects, reading that. I believe Playwright may be passing Cypress in community size, and simplicity is subjective. They both look quite similar, from this outsider's perspective.
Ask HN: Help me pick a front-end framework
81–90 of 181 posts
Re: Ask HN: Help me pick a front-end framework
#82If you want something that has tons of help, e.g. in stackoverflow, I'd recommend React. The next best framework seems to be Next.JS, that will come after React. React has no performance issues at all, only for those who don't understand keys and how rendering works, or how to separate API calls for an async data flow. Hot take, but imho, typescript is overrated, I can tell you how many times I had a TypeError on pro…
Re: Ask HN: Help me pick a front-end framework
#83- Forget Typescript. That’s for library code.
- Just use React.
- MobX or Redux for state management
- React Router for routing
- Chakra/Tailwind et. al for components and CSS-in-JS
- Auth0 for auth and you’ve got a full front end stack
Madness averted. Thank me later.
Re: Ask HN: Help me pick a front-end framework
#84Re: Ask HN: Help me pick a front-end framework
#85Earlier quoted context omitted.
Angular markets itself as a tricycle but comes with a manual in which the first chapter after the introduction instructs you to swap out your wheels for jet engines. The learning curve and hidden complexity is absolutely insane and I would only recommend choosing Angular in extreme cases where you actually need to break the sound barrier. Source: I maintain a complex Angular SPA since AngularJS/2.
Yeah, this description doesn't sit with me very well, either. I fully support the argument that Angular is not a good choice because React is more popular and has a larger pool of developers, but not that it is more complex. I too would like to hear about what complexities you are encountering and if they are incidental or necessary complexities.
This reads like too much cool aid.
Angular is an entirely application stack, “choices made for you”. uses dependency injection out of the box, has a complex module system (eg. How you used to have import Material components one by one). It’s observables all the way down.
How can you argue that’s not complex? It’s super complex.
I mean, let’s just take an example, say, making a library… https://angular.io/guide/creating-libraries
Now let’s look at https://kit.svelte.dev/docs/packaging
Quite the difference.
I’m a modest fan of angular because it produces good stuff… but not because it’s simple or easy to learn.
You get good solid engineering outcomes with it.
Re: Ask HN: Help me pick a front-end framework
#86I'm going to assume that you are talking about a desktop-based webapp that is also responsive, and not a native app.
I have 10+ years of experience doing front-end, with probably over a dozen React packages self-published in npm, and also tried making a rich text editor ~6 years back[1]. I actually recommend starting with no framework at all (please read on).
Creating a rich text editor might be the hardest thing you can do in "normal" front-end (excluding some more advanced "frontend" fields like 3D or games). You can either manipulate raw cursors, which will be very tricky because I'm not even sure you have access to all the right APIs (specially on mobile), or you can attempt to use Contenteditable, which is a hell of its own[2].
"All problems start with caret placing and multi browser support" [3]
That said, I believe 90% of the complexity of your app will be here, around the actual interaction with the or that you will be using. For that, no framework will really help you, at all. So my recommendation is to first get that working, which will take weeks/months and probably thousands of lines of code, and then worry about placing the little hovering boxes in their place (the "UI"), which is like 30-40 lines of JS/CSS[4].
Once you have this core interaction working, you can also wrap it in your preferred frontend framework for other people to easily use it.
[1] https://github.com/franciscop/modern-editor
[2] https://answerly.io/blog/my-pain-developing-a-wysiwyg-editor...
Re: Ask HN: Help me pick a front-end framework
#87- If you care about SSR then definitely either NextJS or remix.run
- If SSR is not the priority then STAY AWAY FROM REACT. Creating the complicated UIs in react is easy, but refactoring is hard. React on a big project is like point free code with ramda or lodash/fp. you write code, compose and everything is working and then you realize you missed something, so you go back and check your entire UI is a chain of many smaller, intertwined components and it's too late to refactor now. Hooks and global state management (redux) is another huge mess
- So if not react then what? That you will have to evaluate yourself.
- Vue is notoriously popular in open source community, and have often proven to be a reliable framework, especially with Vue3 you get benefits of performance + DX both. whats wrong with vue? Lots of `this` usage, vue specific directives, directives are not expressions but strings.
- Angular is worst of all. bad docs, bad DX, extremely bloated. OOP oriented, I would stay away.
- Svelte? yeah it's like Vue + React child. A lot less intuitive than either. plus community is smaller than any other framework. what you get is only and only performance, comparable to Vue.
What stack I would use: - SolidJS (haven't used it, always wanted to try)
- If you are going with nextjs/remix/react Mantine-UI for components
- If you are going with React (CSR), chakraui with custom CSS. Good DX.
- Graphql + a lot of typescript ecosystem for large amount of codegen. the less you type it yourself the better
Re: Ask HN: Help me pick a front-end framework
#88If you expect to start from scratch several times, I encourage you to separate your logic from your views. Whatever framework you decide to try, make it as thing a layer as possible, and put as much code and functionality as possible in framework-agnostic, plain JS files. In this way, adding, removing, or changing your frontend framework becomes much simpler. They had a more straightforward role in your system ("when…
Quickly realised there was gonna be a lot of grappling with Svelte as the complexity grew: figuring out what component structure to use for passing data around efficiently and ergonomically, passing events between components, using Svelte stores for global state and figuring out how to update and subscribe to them from non-Svelte code, etc.
Now the Svelte code is a thin wrapper and the app can run headless. I feel like it would genuinely be fairly easy to plug a totally different UI onto it.
Each Svelte component basically stores copies of the state it's interested in, subscribes to events from the objects it's interested in, and calls methods on those objects in response to events. This comes with a bit of extra boilerplate vs. more tightly integrating the UI logic with Svelte but the almost complete lack of cognitive overhead in this part of the code is well worth it.
Re: Ask HN: Help me pick a front-end framework
#89As a non-web developer who needed to learn a framework that "just works" for a hobby project, I suggest Svelte. It was very easy to set up (I had previously had yelling and cursing matches with Angular). Typescript integration is one little script away (and that script is included with the skeleton project every tutorial tells you to use). Making a UI that "just works" is stupid simple. It's intuitive- easy to throw…
Typescript is already supported when you set it up using the documented "npm create svelte@next".
It has cool routing, backend etc but even if you don't care about any of it, you get free hot reloads. And with the new version, you can create it as if it was your average svelte app, just avoiding + in file names and using +page.svelte as your main entry point.
For styles, if you care about styling a bit more than default styles (mvp.css or bulma/bootstrap/similar), I'd recommend using tailwind's better clone windicss, which has great svelte integration (including editor extensions for autocomplete and highlight), and writing styles is quicker than using normal css.
You can also use scss/sass/similar in style blocks, you only need to install node-sass and set "scss"/"sass" as the lang of the style block.