News for hackers. Stuff that matters.
Re:Frameworkless Movement by richeyryan on Wednesday March 31, 2021 @04:35AM (#26644832)
You definitely don't want to go reinventing the wheel. The problem that I find, especially in the React community is the belief that everything should be done in the framework. How do you make an API call in React? How do you change the page title in React? How do you convert a string to an integer in React? People create libraries that are closely coupled to React when 90% of what they're trying to achieve could be a plain Javascript module. This isn't just React, its most of the frontend Javascript frameworks.

I think the idea here isn't to abandon frameworks entirely but to use them judiciously and appreciate what can live outside the framework as much as what the framework already gives you:

"Nonetheless, we believe that a framework, when chosen, should be used responsibly throughout the life of the project. Continuously remind yourself that every tool has some kind of tradeoff.

Frameworkless means that you must give the right importance to the technological decision making and realize that the choice to develop a project or a single feature with no dependence on a framework is a real possibility!"

Re:Frameworkless Movement by pcl on Wednesday March 31, 2021 @04:42AM (#26644875)
> “ Frameworkless means that you must give the right importance to the technological decision making and realize that the choice to develop a project or a single feature with no dependence on a framework is a real possibility!”

The thing is, following normal English rules “frameworkless” means “without frameworks”. It’s good to see that the authors know this, but sad to see that they are so blatantly tapping into confusing terminology right there in their pitch.

I get it that this has been a bit of a trend (“serverless”, anyone?), but the fact that others do it isn’t a great excuse.

Hey, they could even riff on the theme while staying true to the language by going with “Lessframework Movement”.

Re:Frameworkless Movement by richeyryan on Wednesday March 31, 2021 @04:57AM (#26644962)
I agree with you. I clicked the link being ready to object and leave a comment and found that it was much more in line with my opinions than the title would suggest.

Literally the title isn't what the concept says it is. I think there is an element of marketing at play with it. Some of the alternatives seem tentative. Perhaps the Framework Skeptic Movement is better?

Like Scully in the X-Files, which I've been re-watching lately, you don't go in blind wanting to believe things are as they seem but you look for the evidence and if there is no better explanation then yeah maybe it was a man with a regeneration gene that can't be killed. Maybe relying on the framework is the best way forward.

Re:Frameworkless Movement by yellowapple on Wednesday March 31, 2021 @06:38AM (#26645583)
I mean, it's the same idea behind stainless steel - i.e. steel that stains less, rather than being entirely impervious to staining.

Whether most people will catch onto that is still a relevant concern.

Re:Frameworkless Movement by void_mint on Wednesday March 31, 2021 @04:59AM (#26644981)
> he problem that I find, especially in the React community is the belief that everything should be done in the framework. How do you make an API call in React? How do you change the page title in React? How do you convert a string to an integer in React? People create libraries that are closely coupled to React when 90% of what they're trying to achieve could be a plain Javascript module. This isn't just React, its most of the frontend Javascript frameworks.

This matches my experience as well. It feels kinda wild - lots of other areas have taught to separate concerns as much as possible, meaning React would just be a View layer that renders content but is unrelated to the rest of the application. In reality, everything seems to get stuffed into React, such that React becomes your entire application.

Re:Frameworkless Movement by richeyryan on Wednesday March 31, 2021 @05:59AM (#26645349)
"React would just be a View layer that renders content but is unrelated to the rest of the application"

This is how I treat it. React or more generally the view handles form state and stuff like modal visibility. Things that a user can interact with so to speak.

I have a lib folder that which is the library of my business logic. Concepts related to our domain, analytics, validation, captchas etc. Some of it is shared between client and server, some of it is specific to either.

Then I have my data layer. From my experience a lot of the data handling is interacting nodes (or stores) that can update asynchronously and react to each other. I use Effector (https://effector.dev) to declaratively map all this.

For example when a user submits their details it triggers the recaptcha check which if successsful triggers the saving of a user and the creation of a lead and once we have a lead token we navigate to the next page in the flow.

Handling logic like that in React can really complicate components and the primitives in React aren't really well suited to it. So I found Effector and its been great. The added bonus is it makes the React components responsible for one thing, which is capturing user interaction. They capture events and forward them into Effector. The React code is clean and if I want to drastically change the UI or alter the flow everything is loosely coupled.

Overall I'm quite skeptical of anything that reinforces this all in one approach to things. I appraise the pitched value and figure out how it can be achieved in a more separate way. The answers might not be immediately obvious and it might not be as easy to get started but I feel the overall result has been great so far.

Re:Frameworkless Movement by void_mint on Wednesday March 31, 2021 @01:27PM (#26650202)
I haven't worked in React (or frontend) in a long time, but your response is similar to how I have/would try to think about those problems. It seemed (when I was paying attention to React) that thinking was less common and most tools pushed you away from it? Which also kind of pushed me away from React as a tool.
Re:Frameworkless Movement by richeyryan on Thursday April 01, 2021 @03:54AM (#26657732)
React and frontend in general has a new starters problem. Its a lot of people's first interaction with tech. For better or worse I feel a lot of library maintainers and community aim to cater to the beginner.

On one hand it makes things accessible and lets people get their start in the way I could mess around with CSS on MySpace or other people could copy code out of computer magazines.

On the other hand, it leads to what we might call the PHP problem. Lots of low skill, low experience developers influencing what solutions and approaches become conventional.

I've found people in the community that share my general outlook and I follow what they're doing. I also act as my own compass, letting my experience and the lessons I've learned from other ecosystems like Clojure and OCaml guide my approach. I'm at a stage in my career where I'm leading projects and can lay out the full vision. The developers I work with seem to appreciate the value in my approach and the problems I'm solving so its working out for now.

I'm also gently trying to advocate on here and on Reddit and write blog posts to show how this stuff can be done. I don't think it will change the direction of the community but it at least clarifies what I think and why I think it.

Re:Frameworkless Movement by neolog on Wednesday March 31, 2021 @04:57AM (#26644958)
"How do I add two integers together with Twisted?"

https://stackoverflow.com/questions/7313761/how-do-i-add-two...

Re:Frameworkless Movement by bshimmin on Wednesday March 31, 2021 @06:23AM (#26645505)
What a bizarre thing - that question is actually a thought experiment (or something) by the author of Twisted!
Re:Frameworkless Movement by richeyryan on Wednesday March 31, 2021 @04:58AM (#26644972)
Nice, I appreciate the example from another ecosystem.
Re:Frameworkless Movement by pruski on Wednesday March 31, 2021 @07:24AM (#26645861)
But it’s a problem with bad developers, not a framework.

On the other hand, think of the code those guys could write without a proper “framework”