| ▲ | austin-cheney 14 hours ago |
| Strong disagree. Web Components are react in different clothing. You don’t need this component-based framework style architecture to write applications for the browser. I promise writing applications for the browsers is not challenging. You don’t need big frameworks or component madness that’s more of the same. |
|
| ▲ | onion2k 12 hours ago | parent | next [-] |
| You don’t need big frameworks or component madness that’s more of the same. You don't, but in any sufficiently complex app you'll end up writing a sort of 'mini framework' of your own as you abstract all the things that crop up more than a few times. That framework might be really nice at the start but it'll get more and more hacky as the project continues, especially if you're constrained by resources. Eventually you'll regret not using something standard. If there are more than a couple of developers on the project it'll be something no one really likes after a year or two. If there are more junior developers it'll be a reason for them to want to get off the team because they won't want to be a part of the 'old legacy code'. Then it'll be hard to find people who want to join. Eventually, as it gets harder to recruit people to the team because it's on a weird, legacy framework that no one knows, there'll be a big project to refactor it on to something more standard. That'll probably be React. At the same time most of the senior developers will be calling to scrap the codebase entirely and rebuild it (wrongly in almost every case, but they don't care and want a greenfield project to play with new things on.) This is a story that has played out at every large org that builds apps internally, and probably a lot of startups as they mature and need to hire more devs. You might as well skip all of it and use a standard framework from the start. |
| |
| ▲ | austin-cheney 8 hours ago | parent [-] | | This has never been true for me. I never end up writing any kind of internal framework. Instead I write libraries that solve specific problems and achieve code reuse, which are really either functions or data storage objects restricted to their own files. At least, that’s how I think about code universally, libraries, but specifically in the browser this comes up less because the problem space is much smaller. Really in the browser it’s all about organizing code around event handling and putting text on screen. Let’s not over think this. Anyways this idea of internal frameworks has always been weird to me. Nobody says this of code outside the browser, so why would they say this inside the browser? When I think about in those terms this clearly becomes a simple organizational problem and I don’t need a framework telling me how to organize things like a parent telling me to do chores. | | |
| ▲ | WA 6 hours ago | parent [-] | | What code are you using to reactively render state? Or do you write all DOM manipulations manually and just accept the problem of state explosion? | | |
| ▲ | austin-cheney 5 hours ago | parent [-] | | Here is an example: /lib/dashboard/dashboard_script.ts https://github.com/prettydiff/webserver When you aren’t using framework like components state restoration is a single function that runs only on page load. There is no state explosion and on localhost the SPA fully renders and finishes state restoration in about 105ms from http request. | | |
| ▲ | WA 3 hours ago | parent | next [-] | | Thanks, but this is a server-side thing and has nothing to do with client-side DOM manipulation?! Sure, you can put stuff on the server and do HTTP over the wire. It's oftentimes the better solution. But there are apps/tools that are rightfully an SPA (like tldraw or excalidraw for example) and can run local-first and offline in a browser. You build the entire app in JS and you'd need a bit more than vanilla Web components for that if you want to avoid client-side state explosion. | | | |
| ▲ | brazukadev 3 hours ago | parent | prev [-] | | Mate, if you are proud and happy to code this way, congratulations. That code is an absolute nightmare tho. Your eyes are trained on it so you think this is as good as an ergonomic framework. | | |
|
|
|
|
|
| ▲ | WA 11 hours ago | parent | prev | next [-] |
| React made reactivity popular. Web components don’t give you reactivity. You still tell the UI how to update based on state changes imperatively and that is annoying as hell. If you want reactivity in web components, you need a wrapper or another framework/small library. |
| |
| ▲ | spankalee 2 hours ago | parent [-] | | There are plenty of web component helper libraries that give you reactivity. Reactivity is an implementation detail. |
|
|
| ▲ | daveidol 14 hours ago | parent | prev | next [-] |
| Sure you can make a blog without a framework. But for complex applications it’s far better/easier than raw DOM manipulation or rolling your own thing. |
| |
| ▲ | zelphirkalt 7 hours ago | parent | next [-] | | Compare how many "complex applications" on the browser there are, with how many cargo culting blogs that employ react to render client side what could be static pages with text. | |
| ▲ | austin-cheney 13 hours ago | parent | prev | next [-] | | I disagree. It’s actually the same effort either way, but one of those costs substantially more to maintain and performs far slower. | | |
| ▲ | adastra22 13 hours ago | parent [-] | | It is not obvious to me which one you are talking about. | | |
| ▲ | austin-cheney 8 hours ago | parent [-] | | The framework solution will end up costing more over the life of your application due to artificial restrictions, leaky abstractions, extra dependencies, performance decreases, and more code to maintain. In most cases all of those are acceptable if the developers are less comfortable making original architectural decisions. For me that comfort is achieved through reuse and audits around data structure types through use of TypeScript. Now that ThpeScript is natively supported in Node it’s even faster still because there is no need for a build or compile step. The code just runs as is. This is also even true for code that executes only in the browser so long as it’s imported into a node module, which I do anyway to reduce the number of file requests into the browser. |
|
| |
| ▲ | netbioserror 13 hours ago | parent | prev [-] | | We should probably be making widget toolkits for the Canvas and using WebSockets for communication. DOM manipulation is a total hack-job. It's somewhat flexible, but the performance and dark-pattern cost is just too great. If you're making an interactive application, then treat it like an application and draw widgets to a canvas. | | |
| ▲ | ioseph 12 hours ago | parent | next [-] | | This is an insane take, show me a responsive button with hover state and a tooltip implemented in the canvas that outperforms a button rendered with React. | | | |
| ▲ | christophilus 13 hours ago | parent | prev | next [-] | | Accessibility suffers with that approach. | | |
| ▲ | extra88 12 hours ago | parent [-] | | It doesn't just suffer it's impossible unless you recreate the whole thing with actual HTML behind the <canvas> rendered version. |
| |
| ▲ | zelphirkalt 7 hours ago | parent | prev [-] | | Don't forget about the privacy cost associated with the canvas. If this ever becomes widespread, we will have many many sites extract browser fingerprinting information from the canvas. It would then move the game one more step towards dystopia, where we have to analyze and block certain ways of code interacting with the canvas and it might even prove impossible. And then incapable web devs will offer you no solution but canvas buttons for the login to your bank account. No, I don't think this is the way forward. |
|
|
|
| ▲ | afavour 12 hours ago | parent | prev | next [-] |
| > I promise writing applications for the browsers is not challenging. Yeah it is. I don’t like React but I’ve been doing this since the days of MooTools all the way through Backbone to the libraries we have today. Once your app reaches a certain size and/or reaches a critical mass of contributors it does get challenging and modern frameworks reduce that challenge. That can be taken way too far. Almost every time I’ve worked with Redux I’ve found it infuriatingly unnecessary. And React is far from the best framework out there. But it is a huge benefit all the same. |
| |
| ▲ | austin-cheney 8 hours ago | parent [-] | | Modern frameworks, really components and an API, solve only two business problems: division of labor and training. Knowing that you can address these problems with continuous integration around a common set of rules and requirements. With regard to application size we fortunately now have TypeScript. All you really need to scale any application is types, functions, and code reuse. |
|
|
| ▲ | ahdanggit 13 hours ago | parent | prev [-] |
| HARD AGREE! It just takes the minimal amount of discipline, and some conventions. I know it can be done because I did it, lots of people did it just a few years ago (some of those apps are STILL running today.) |