DEV Community

Discussion on: Would You Use Vanilla JavaScript (No Framework) On a Project?

Collapse
 
joelbonetr profile image
JoelBonetR 🥇 • Edited

React is not a framework, it's a lib and thats a huge point to choose the tech stack for a project. If you talk just about frameworks you can change React for Angular in the sentence.

Answering the question yes, I used vanilla JS sometimes if the project suits (i.e. my portfolio).
Let me quote myself from a comment I just wrote on another post:

For the same features and behavior, the complexity is always the same and every time you add more features you add more complexity as well. The question is not if it's complex or not, the question is where do you want the complexity to be.

Do you re-upload the podcasts to youtube? I think it's more fun to watch the faces along the hearing of voices 😂

Collapse
 
mikehtmlallthethings profile image
Mikhail Karan

I think there's a lot of arguments between React being a framework or a lib, I think it can for sure be treated as both depending on how you use it.

I've gotten so fast at developing with something like Svelte that even for a small website I usually reach for it 😅

We don't upload video of us yet to youtube. It's something we are looking into though!

Collapse
 
joelbonetr profile image
JoelBonetR 🥇 • Edited

I'll take a try to the podcast then :)

By the other hand, the rule of thumb for something being a FW or a lib is IoC (inversion of control, a concept where general application flow is inverted), which is achieved by using a service locator pattern, dependency injection pattern, contextualized lookup or a couple of techniques more, depending on the tool.

In Angular or Vue, is Angular or Vue who's calling your code to interpret and do whatever they need to do.

In React you're the one telling React what to render ReactDOM.render(<App />, document.getElementById('app')); plus in React's homepage hero it states clearly "A JavaScript library for building user interfaces"

There are some wrappers to apply IoC to React Apps (check this one) that serves more the purpose on adding dependency injection capabilities to avoid issues
i.e.

  • With Redux having to import it everywhere which is a nonsense.
  • Passing props through components that don't use them (breaking SOLID)*
  • Other issues that can be either a bad app design decision or anything else.

I never needed it though but knowing that it exists is nice just in case 😂 just to clarify, adding a third party lib to handle IoC and DI inside a React App doesn't make it a framework, still it's not part of the core API.

Best regards, and please, ping me if you upload things to youtube 😁