Тёмный

Experimenting with a react MVC concept (don't do this) 

Web Dev Cody
Подписаться 221 тыс.
Просмотров 31 тыс.
50% 1

Sharing some prototypes I've been playing around with when writing MVC in react.
Code with prototype: github.com/codyseibert/pizza-...
My VSCode Extensions:
- theme: material community high contrast
- fonts: Menlo, Monaco, 'Courier New', monospace
- errors: Error Lens
- extra git help: Git Lens
- tailwind css intellisense
- indent rainbow
- material icon theme
- prettier & eslint
- ES7+ React Snippets
------------
🤑 Patreon / webdevjunkie
🔔 Newsletter eepurl.com/hnderP
💬 Discord / discord
📁. GitHub github.com/codyseibert/youtube

Опубликовано:

 

3 сен 2022

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 209   
@WebDevCody
@WebDevCody Год назад
This was just an idea and experimenting with a proof of concept. Don’t do this in prod.
@andrewl2891
@andrewl2891 Год назад
Going to be lots of negative comments down here, but I think it's a cool thing to try out regardless if its a bad abstraction or not. I think there are two issues you are trying to solve, which I run into constantly when using react in the real-world (not small side projects): 1. UI testing is often pointless. I know if I click a button, react is going to run this function...What we should really be testing is the logic in our components. This approach solves that well. 2. Components in real-world projects get huge and hard to manage. Yes its possible to break down components into smaller components, but thats often challenging itself. This definitely makes components smaller and logic more readable. I tried to build something like this a while back (MMVM tho), but gave up because I convinced myself it was a bad idea. I flip flop on this often lol. At the end of the day, it comes down to preference. Cool experiment!
@WebDevCody
@WebDevCody Год назад
The one person in the comments who actually understands real life issues with react doing the defacto approach. Thanks for the comment, it gives me hope that other developers understand the complexity react often brings in large projects
@andrewl2891
@andrewl2891 Год назад
@@WebDevCody Any plans to make this code available? Would love to play around with it
@marcarlotuico5449
@marcarlotuico5449 Год назад
Totally! Experienced with creating our Saas Platform and not doing TDD was a hell experience for us.Test cases gives a good documentation
@jbacken
@jbacken Год назад
Absolutely agree. I'd say most negative comments will be from the context of relatively simple projects. Large and complex enterprise solutions are much easier to maintain leveraging abstraction patterns like this.
@WebDevCody
@WebDevCody Год назад
@@andrewl2891 added the link to the description
@carlo.casorzo
@carlo.casorzo Год назад
isolating UI loginc from the actual view is key in order to create composable, reusable testable components. I like your approach. I actually use something similar, but I will definitely use some of your ideas here to enrich mine. Thanks for sharing
@annusingh4694
@annusingh4694 Год назад
I'm loving the guided excercise style of your videos 💯
@d2vin
@d2vin Год назад
love how fast these videos come out
@ZuthTrading
@ZuthTrading Год назад
I might be missing the point but how is this different from a simple combination of useContext and useReducer? useReducer for handling complex operations and useContext for hiding the logic from the components and making whatever variable/operation you want in each component available. That is how I normally handle these kind of problems I'm wondering if the solution you came up with solves a different problem or if it's any better than my method?
@joaomendoncayt
@joaomendoncayt Год назад
Well, all this is pretty subjective. But the main point you need to focus on is the fact that he is detaching (or trying to detach) the behaviour of the component from the interface itself. Nothing else. There's no special state machine nor patterns here to understand aside from the fact that the component behaviour is being separated for it's interface markup. In my personal opinion tho, apart from the fact that you can indeed do unit testing with ease in this approach. I think this will lose it's value in more complex applications and it falls a little under the overthinking umbrella. But surely a thing that every developer out there has faced, the inherit convuluted stance on React components.
@WebDevCody
@WebDevCody Год назад
@@joaomendoncayt I agree, you never know if an approach is good until you use it to build a large scale app
@joaomendoncayt
@joaomendoncayt Год назад
@@WebDevCody for sure! I mainly do frontend and work a lot on the blockchain industry, and I've seen things I can't unsee 😅 when wallet adapters were in their really primordial phases for example... A team of like 5 - 10 people contributing to a single huge component as simple as connecting your wallet, full of hooks states derived states and so on... It gets insane to write a new line of code inside such projects... And it's pretty cool that you are trying to encapsulate that outside of the component. I'd have to try it out because you will still have to leave a couple logic on the component itself and might get akward but it's a big problem with react that needs attention for sure
@evgeny6692
@evgeny6692 Год назад
I really like this approach as an alternative to encapsulating all business logic into a custom hook (custom hooks though can easily be tested as a stand-alone thing with react-testing-hooks, which is a part of react-testing-library now). But your approach makes it even easier. This looks really like when I was writing a bit more complex functionality on front-end with just a plain javascript.But I'm not aware of state proxy though 🙈 Is it some existing library that you are using or your custom implementation? Also could you please open up a bit this state proxy thingy. From this video I understood that proxy basically makes it possible to kick in react state update logic (re-rendering) with simple assigment of a new value (=) without explicitly calling state value setter function?
@WebDevCody
@WebDevCody Год назад
Yeah the proxy thing is my own little custom hook that wraps the react state as a proxy object. The code is in the description
@friedpetrol
@friedpetrol Год назад
How about implementing a flux pattern either through redux or useContext paired with useReducer? If you have gripes with redux, zustand and jotai are great.
@WebDevCody
@WebDevCody Год назад
Because I’m not trying to solve the global app state problem. I’m solving complex component state and logic. Two different problem spaces
@andrewcathcart
@andrewcathcart Год назад
@@WebDevCody have you looked at any of the state machine libs in the react space?
@avatar4
@avatar4 Год назад
@@WebDevCody logic and state are real issue with big apps but when to make components, when to make a controller and how much should we put in a one plate for the Code like this . Just curious about that
@friedpetrol
@friedpetrol Год назад
@@WebDevCody I appreciate that, and It's something that I'm trying to solve in my own projects. The first thing that worked was redux + redux-thunk. It's definitely a lot of boilerplate but it did mean that I can set up all my setters in the action creators and I could use mapStateToProps to sort of work like a getter. It was a lot of boilerplate, but I did extract all of my logic out of my components and things just worked, which was nice. I then tried useReducer and useContext to create a similar workflow minus the boilerplate and the redux. That also worked, and it did allow me to have less boilerplate (though there was still a small amount). I'll check out your approach on a side project and give you some more substantiated thoughts.
@si_rajo
@si_rajo Год назад
thank you for this video, have you considered writing an article around the this approach? Would be much easier to navigate around the idea when it's in writing
@maxtayebwa8987
@maxtayebwa8987 Год назад
I really dig this now! Learnt so much, thank you Cody!
@quelchx
@quelchx Год назад
This is an interesting approach, just browsing the code (watching this while I'm camping to kill time) you could plug this into any JS Library or Framework (React, Vue, etc). From what I seen all your controllers don't rely on any specific hooks that are provided by a JS UI library other than the useEffect hook I saw. Like I could take that code plug it into a SolidJS based app with ease for example.
@sanjarmirakhmedov8311
@sanjarmirakhmedov8311 Год назад
But the real question is, how often you will want to do that? It's just useless abstraction for 98% of projects.
@adityatripathi1904
@adityatripathi1904 Год назад
@@sanjarmirakhmedov8311 depends really. Some companies do that often with different products. Like IaaS and PaaS companies.
@WebDevCody
@WebDevCody Год назад
It’s not a unless abstraction if the unit tests become a lot easier to implement and manage. Separating logic from views is a legit thing many developers much more experience than most react devs, such as uncle bob, Martin Fowler, actually know what they’re talking about
@tounsoo
@tounsoo Год назад
I can see it being useful for design system components to be able use those controllers to create components for mutiple frameworks
@quelchx
@quelchx Год назад
@@sanjarmirakhmedov8311 I joined a company awhile back and had to rewrite their whole application from bottom up . Maybe if I took an approach like this, say in 4 years we want to rewrite it, then it's more plugin and play. I get what your saying thought but this is a good design approach.
@dailymeow3283
@dailymeow3283 Год назад
My new way of writing react is i no more writing react, Lots of newbies now with no javascript experience or knowleadge, they learnt react, also react jobs salaries became very low
@timalk2097
@timalk2097 Год назад
same thing can be said about the entire web dev industry, salaries are lower because of the tech bubble that's dying (look at netflix and facebook stocks) + youtube taught everyone how to code + you can't compete with devs from india and pakistan ect... they'll do everything that you can do for 1/100 of your price.
@dailymeow3283
@dailymeow3283 Год назад
@@timalk2097 that's true
@AftercastGames
@AftercastGames Год назад
@@timalk2097 Well, everything but build a small, efficient, maintainable system, that is. 😉 I haven’t had great luck with offshore developers, to be honest. I usually end up having to pair them up with senior local developers anyway. Otherwise, I just get an endless supply of emails asking me if I can figure out why their code isn’t working properly.
@joe5head
@joe5head Год назад
For videos like these it would be cool to see a side-by-side comparison with the more traditional approach plus rtl
@WebDevCody
@WebDevCody Год назад
Good suggestion
@zlatkoiliev8927
@zlatkoiliev8927 Год назад
Thats all good, but what if you have some kind of state management library, like redux or zustand?!?
@WebDevCody
@WebDevCody Год назад
You could useSelector at the top of your component and pass it into the controller as an argument. That allows us to easily mock the zustand call to verify my component successfully updates the zustand store when certain events occur. You can still have the controller be passed a dispatch function and invoke dispatch from your controller if you want. Dispatch is just a function and isn’t react specific.
@fonzanedelungini
@fonzanedelungini Год назад
For me, an angular developer, this functionality looks just hilariously simple, while the code for it looks frightening.
@christianferrario
@christianferrario Год назад
That's because it's the wrong framework to use like that. React is not meant for this.
@marceloguzman646
@marceloguzman646 Год назад
@@christianferrario could u elaborate on that? what would you do instead or which framework you'd use
@fonzanedelungini
@fonzanedelungini Год назад
@@christianferrario I also would like to know why React isn't meant for this and what would you do instead?
@ajml_hnter
@ajml_hnter 2 месяца назад
@@fonzanedelungini the FLUX architecture
@GustavoRodrigues-cg7tf
@GustavoRodrigues-cg7tf Год назад
definitely an interesting and different approach. i really think this makes the code way cleaner and easier to understand.
@WebDevCody
@WebDevCody Год назад
Glad you see the benefits, not many others will
@pardipbhatti9943
@pardipbhatti9943 Год назад
Can you share the code for this pattern
@andis0311
@andis0311 Год назад
What's the point in having a function like this one: function handleOnClose() { onClose(); } Why not put the onClose call directly in JSX?
@shubhankarmaheshwari9428
@shubhankarmaheshwari9428 Год назад
This is cool. I am always looking for some MVC pattern in React. Thanks for sharing dude👍
@shubhankarmaheshwari9428
@shubhankarmaheshwari9428 Год назад
I would love if you take it as a seperate series. thanks in advance for sharing this
@elmalleable
@elmalleable Год назад
yeah you are getting into heavy dependency inversion, it is nice though, spliting up items into dependent and independent pieces and passing them as arguments really makes for some cool benefits like testing of each part separately and being able to swap out peices. Laravel comes to mind with the way it works, allowing you to declare little bits of code and then having the IOC manager inject instances with appropriate variables already passed in for you.
@WebDevCody
@WebDevCody Год назад
Yup I love dependency inversion / injection. It really makes testing easy
@magne6049
@magne6049 6 месяцев назад
what about using XState instead?
@spiridonov1
@spiridonov1 Год назад
i dont see a lot of this type of react code on my feeds. i probably wouldn't ever use something like this but its super cool and makes a lot of sense in the right use case!
@deamorta6117
@deamorta6117 Год назад
is this like replacement for react context?
@WebDevCody
@WebDevCody Год назад
No, it’s just pulling out component logic from the component. You’d still need context or state lifting when two components share state
@MiKun111
@MiKun111 Год назад
Nice approach actually. This reminds me of how my team uses MobX in company projects. We usually have stores to do business logic and then use some getter to compute the ouput values and pass them to React components to render. It also helps us do the tests easier.
@WebDevCody
@WebDevCody Год назад
yeah, I feel my approach is very close to MobX, but with my own little tweaks that make it fit my preferred way to mutate state. I could see how MobX could be very useful in achieving same thing I'm doing. Obviously my approach doesn't try to tackle the "global state" problem. This approach is just tackling "how to get testable logic out of react components". One can still use context, zustand, prop drilling, mobx for managing higher level state, all this controller function cares about is send me the dependencies I care about and I'll return methods you can use for modifying those.
@sanjarmirakhmedov8311
@sanjarmirakhmedov8311 Год назад
Using Global State for everything is also a bit of an overkill, you should better aim for local react state as much as possible, and the global state manager ideally should be your last resort. React Local State + Server/Client Sync Library Like react-query/apollo-client + React Context for trivial global state should be sufficient in 90% of the times.
@emreq9124
@emreq9124 9 месяцев назад
I dont get useControlled. First , it hasnt any hooky things in that but name has "use" prefix. Using "use" prefix should notify the developer that it is custom hook that use some effects or useMemo things inside it. Why dont we put all these function inside "useController" to the helper.ts or utils.ts. Even we can a create file that returns the whole object that you have done, but it mustnt have "use" prefix. It will still be tested seperately from the component lifecycle. I am curious about how do you assess the MVVM pattern. Have you experienced mvvm ? Can you make a video and comparison about these two pattern ?
@WebDevCody
@WebDevCody 9 месяцев назад
I haven’t thought much about this after making it
@Thanveershah
@Thanveershah Год назад
I prefer writing the logic in something like Redux or other state management libraries rather inventing my own wheel
@WebDevCody
@WebDevCody Год назад
Redux sucks, but yes you can always use a popular state management library if they check off all the boxes you’re looking for. My check boxes are just a bit different
@BroadcastYoToBe
@BroadcastYoToBe Год назад
@@WebDevCody Could you explain why, please? I've never used Redux so far but would like to know why people think it sucks.
@Krzysiekoy
@Krzysiekoy Год назад
@@BroadcastYoToBe Modern redux with redux toolkit seems totally fine to me. The boilerplate is cut so much with toolkit. Not really sure where the bad rep is coming from.
@WebDevCody
@WebDevCody Год назад
@@Krzysiekoy toolkit is also convoluted. useSlice and createAsyncThunk, extra boiler plate related to reducers in general, builder.addCase. This is the opposite of simplistic
@Thanveershah
@Thanveershah Год назад
@@WebDevCody Maybe you should take a look at your "MVC" before saying something like Redux "sucks", especially when your channel is about educating people. This is a bad influence on newbies, Even tho "redux sucks" for you, show me a job opening that doesn't ask redux or similiar state management.
@buddy.abc123
@buddy.abc123 Год назад
That's too Angular-ish for me and brings back many many bad Angular memories
@WebDevCody
@WebDevCody Год назад
Angular isn’t bad anyway. Vue does a similar approach, and svelte has a similar state management. React is the odd man out when it comes to state and forcing immutable state changes
@epicmustafa4749
@epicmustafa4749 Год назад
Still works perfectly thanks for the link!
@StoriesByDrew
@StoriesByDrew Год назад
I don't mind your approach at all, but my preference is more in between. I like to create cohesive abstract data types that are returned from hooks. Then I test against those return values. My hooks may or may not be coupled with react stuff like useState and useEffect. When testing, I treat the return values of the hook almost like the public interface of a class and only worry about testing those values. Everything else I test with React Testing Library. The drawback is that my test coverage isn't that high but at the end of the day, I've tested the majority of the critical logic and the ui.
@garrysyt8461
@garrysyt8461 Год назад
Will try it ✌️🙂
@delgadotrueba8402
@delgadotrueba8402 Год назад
is the source code uploaded to GitHub?
@WebDevCody
@WebDevCody Год назад
In description
@DaronSpence
@DaronSpence Год назад
Heya, first comment here, been lurking on your videos for a few weeks. I'm a full time Vue dev, so my perspective comes from that approach. 1. I definitely like the idea of MVC while building a UI. Ideally, I want my UI components to be as dumb as possible. A controller makes perfect sense for that and like you've discovered, testing becomes much easier. Server side, I use Laravel and it's very common to use integration tests to call an endpoint within the framework and then assert the desired effect happened. Composables in Vue can act as an isolated controller for a particular data structure, where all methods to modify state can be exposed from the hook (like in your example). This makes your data structures _composable_ with each other so you can include many types of structures within one parent component. 2. You mentioned Vue is going more towards React w/ the composition API. There is some nuance here that you might not be totally aware of. Syntactically, the "hooks" can look very similar, but under the hood, I think they are used in very different ways. The most obvious example of this is that Vue has a function called "onMounted" that does exactly what you would expect. It's reactivity model is also still different from React in that doesn't require all of the pomp-and-circumstance around when and where you can/cannot declare a state variable. It's perfectly valid to create state in an `if` statement as an example. The lifecycle is very much alive and well in Vue and developers are encouraged to use that mental model to stay organized. See: vuejs.org/api/composition-api-lifecycle.html 3. One cool thing about Vue and the Composition API, is that it doesn't need a virtual dom to work. The reactivity layer all exists in JS land and the state can be tracked/changed with no DOM. This can make testing your business logic much simpler and harkens back to the original ideas of React w/ rending the UI as function of state. UseEffect muddied those waters in a lot of ways. Check out some of the videos by ru-vid.com for some solid examples of real world testing w/ Vue 3.
@WebDevCody
@WebDevCody Год назад
I’ll have to learn more about vue. It was a pleasant experience when I used vue 2 a long time ago. You should join my discord. You are knowledgeable and there are a lot of people who might need help with vue or just coding in general. Thanks for this response, this is all good info for sure. I like how vue can easily be tested without coupling directly to react.
@ofektsoref5143
@ofektsoref5143 Год назад
Interesting aproach, though I have to say it feels a bit like overengineering it. I can only see myself writing my react code like this if i were to develop a very complex, important and reusable component. As someone developing micro-frontend apps in react, i find this just an overkill.
@frankkevy
@frankkevy Год назад
It looks like something I would want to try 👍🏾
@albiceleste101
@albiceleste101 Год назад
Interesting, I had a more simple external helper function system but this is more polished
@gnarusg8708
@gnarusg8708 Год назад
This is a really interesting idea. The compelling part for me is being able to look at the view component and guess it'd looks without having to scroll through a bunch of dubious logic.
@gnarusg8708
@gnarusg8708 Год назад
But I don't unit test so on the other token I like having everything (ui and logic) in the same component in question.
@vizunaldth
@vizunaldth Год назад
Interesting stuff, thx for sharing something different
@NavySturmGewehr
@NavySturmGewehr Год назад
Glad I stumbled on this. I'm a total noob, but I've been treating my state variables differently... props = { value(payload){ if (!payload) { return state.value} return dispatch({type: SET.VALUE, payload}); This has let me seperate the data from the logic. and the state.
@dmt15
@dmt15 Год назад
This seems like too much complication on top of the React model and different people would mess it up later anyway. If you want to use this style, better adopt Angular from the start
@AshSimmonds
@AshSimmonds Год назад
Flying in from 2002 - this was actually really easy in VBA
@sanjarmirakhmedov8311
@sanjarmirakhmedov8311 Год назад
Objectively it's overengineering, why do you need useless abstraction that are only helping to solve irrelevant problem like "avoiding using react testing library". Abstractions should have a reason to exist, not just for the sake of it. Standard composition + custom hooks to encapsulate business logic should be sufficient for almost all projects out there, except for cases where you might want to build a reusable framework agnostic package to be used in several projects with different stacks. Give me at least one real world benefit to using such approach other than "you cannot test it without installing react testing library". UPD: I have not even talked about the extra overhead of creating proxy state hook that works only with objects, and you cannot just create a primitive value state as you can with simple useState.
@WebDevCody
@WebDevCody Год назад
I disagree, I think this is fine, and being able to properly unit test your logic is necessary. RTL is an integration testing library and you have to accept the philosophy that all tests should only test at the dom level which is incorrect imo. Your model would always be an object which you’d have properties with any primitives you needed. There isn’t any performance benefit to having 10 separate useState calls, react still rerendering the entire component when any state changes. There is nothing wrong with the proxy unless you can prove it actually causes any type of noticeable slowdown. Another real world benefit, I can take this controller and throw it into any other front end JavaScript library and it will work the same as long as I just bind my components correct. That’s when you know you have true separation of concerns.
@kyleg.848
@kyleg.848 Год назад
what test ensures you bind the controller logic to the components correctly?
@elmalleable
@elmalleable Год назад
you need a vacation He was clear in the first minute that he has a few things he works on where his code is getting unmanageable. For his specific situation, he needs things to be simpler through a little bit of complex engineering. Although i wouldn't make a proxy just for one component, not even if i were playing with code but i have done it in a few places where there was duplication of controll logic and it just made sense. Testing is important based on specific problems and use cases, ask the people who decided to not fully test the sls rocket. But dont write a whole unit test for a hello world test Some test are meant for validation while others are for future guard rails that hopefully point out where you deviated from business goal while making changes.
@sanjarmirakhmedov8311
@sanjarmirakhmedov8311 Год назад
@@WebDevCody 1. Doesn't @testing-library/react-hooks solve the issue of testing the logic in isolation from the DOM? 2. Regarding the model object I have not mentioned that it can hurt performance, I meant what If I want to create a simple primitive value state without the need to create that proxy state. As I understand with this approach you are forced to use that custom proxy state, because as you are stating, you want your logic to be isolated from "React" and be testable "Without RTL" which is kinda absurd, if you look into it this way, you better abstract literally everything that you have in your app with your own layer which of course is absurd and useless in real world projects. I would rather do a full rewrite if it will ever happen in theoretical future than trying to use abstractions like these which creates unnecessary complexity and brings this weird proxy based state updates, plus you have to correctly bind all this logic into the framework, and I'm sure it won't be easy to bind it to different frameworks, you will still end-up with some hacks/workarounds that will make your and your colleagues life harder.
@shakapaker
@shakapaker Год назад
And how to use it with Next.js?
@RaZziaN1
@RaZziaN1 Год назад
You can do it the same with next js, thing is if you want to do it like guy on video just switch to angular.. way easier.
@WebDevCody
@WebDevCody Год назад
Angular is a complete different ecosystem. So no, switching to angular isn’t the same as rethinking a basic way to separate business logic from react components
@nanonkay5669
@nanonkay5669 Год назад
It's a very similar approach to mobile development where the MVVM approach is done.
@skartkamrul8230
@skartkamrul8230 Год назад
concepts finally line up in my brain and...well, who knows? Maybe I'll be able to make sotNice tutorialng now.
@shy-ok5lt
@shy-ok5lt Год назад
Thanks for the lesson. Just brought soft soft
@O_Eduardo
@O_Eduardo Год назад
I kinda feel your pain, and it's awesome to see the way you try to solve this but in my opinion it adds more indirection and more things that actually you need to know in order to make things work I guess. I think I found my way out the React complexity by breaking my components when they are getting more complex. Another thing I'm doing is to let .js files only containing the hooks and logic for that component and making the View in a separate file .jsx. So it's kind the same vision you have by breaking into MVC pattern, so my View is Jsx, the controller is the hooks in js file. The M part of MvC is the store, so I'm using the store to manage state among components and concentrating the business logic/ application logic there. I used to use an approach similar to what your doing, the problem I see is that when you set your functions inside a object you miss the composition aspect of functions, and you may be see your self fall into the same issues we have in the OOP style when we were using React Classes. In fact, for me that's the problem I see in Vue2, the fact that you might be using "this" all over your code and can't break your functions in a way to compose functionality. My advice is, use hooks for controller, jsx for view logic, and a modern and easy state manager like zustand to manage state shared in siblings components and application logic. I don't use context api because I think it's a really bad pattern, it's very easy to make your application a mess using that. I like zustand because there's no context api, it uses just an publish / subscribe pattern to directly connect you components. I wrote a library similar to zustand, because I didn't know that zustand exist at that time, that helps me to write use cases in form of actions and use it like a state managment for my React apps, check it out, it might bring some insights to you : github.com/Javiani/Oni
@WebDevCody
@WebDevCody Год назад
I think also splitting things up into smaller components causes more indirection and complexity. For example, how would we split up this modal? Would we have a SelectAll component? Then individual ToppingOptions component? You end up pulling state up anyway since they all need to read and modify a shared state. I don’t think there is as much indirection with this approach as you think, I have a separate function above the component, that’s it. It’s the same indirection if I pulled out custom hooks and defined all the functions there. My main goal is to keep useEffect and other react primitive hooks out of my logic. But yeah, I’ll check out your state library, it sounds cool. I also like zustand and I’ve used it on a side project, but I don’t think it’s the same problem I’m trying to solve using dependency injection to decouple my controller from the outside world
@jediampm
@jediampm Год назад
HI, only way you could do with mvc pattern was with react class way, it is a maybe , the react fn way forget, is impossible because the logic and the view are in the same function and you can not easily separate hooks or logic outside the function that return jsx, In react you can not apply mvc because does not exist the concept of separation of concerns like VUE, SVELTE and ANGULAR. The Similar framework to react, that let you put state and logic outside of fn that returns jsx is SolidJS ( with signals). You should try solidJS. About the feature with select all , etc, a couple month i did with Angular and Svelte at my workplace, both was easy and the funny thing is with vue i am sure would have similar good vibe.
@WebDevCody
@WebDevCody Год назад
I’m not too sure I follow because I did exactly that in this video. I separated the logic from the view. You’ll still always need some type of hook, but you can just use dependency injection to send those third party hooks to your controller which allows easier mocking under test and easier tdd
@jediampm
@jediampm Год назад
@@WebDevCody with react, things just get over complicated and messy and with hooks event worst, even you create a custom hook, just try solidjs that you will not need even to create a custom hook.
@tech3425
@tech3425 Год назад
I tried this controller style thing in my React client side components. I would create a new class instance for each functional component (that had some complex logic to be done in the handlers/effects), and then the actual methods would be on the instance. Same thing basically as your controllers. Having everything in a class instance made it clear that the public methods are called by the React Functional Component, while the private methods are used internally, and keep everything organized. Compare this to having a dozen functions inside your react component, only two of which might actually be called by the JSX. This also helped me keep stuff as a cache on the class instance itself, or even as a static property on the class definition, if I needed to. In order to implement something like this using just react you would have to mess around with refs and state. But all this logic doesn't need to intermingle with React's lifecycle stuff, and it ruins the intuitiveness of the react components. In my current job, we use a NextJS-Express stack. So a) the use-state-effect boilerplate for fetching data is gone, and b) most of the complex logic is done on the backend, which are just called via API endpoints. I believe that this is also a valid approach you could explore. Its the same style of modularization, just in a different place.
@tech3425
@tech3425 Год назад
​ @Web Dev Junkie It would be pretty cool if you made a tutorial like thing where you explained how you make this kind of proxy-controller setup. Maybe it would inspire a new style of client side react.
@asdqwe4427
@asdqwe4427 Год назад
I think that components were easier to test when we all used redux, for the most part. So why not just create a higher order component that hooks in to all the contexts that you need? I feel like that would solve a lot of the issues youre having while still being idiomatic to react developers
@WebDevCody
@WebDevCody Год назад
I always called redux the prime example of over engineering, even toolkit has tons of boilerplate. Yes redux is a tool for separating logic from views, but it’s a global store. I’m trying to solve the issue of complex component logic and state changes and make it also easy to do TDD
@asdqwe4427
@asdqwe4427 Год назад
@@WebDevCody I am definitely not saying that we should go back to redux. But a simple HOC would go a long way.
@devthagichu
@devthagichu Год назад
@@asdqwe4427 useReducer hook
@asdqwe4427
@asdqwe4427 Год назад
@@devthagichu yes, for sure. But is someone really wants to test the component separately from the state, then you could have your useReducer, useContext and all of that in a hoc. Then you’d export the component separately and test it separately.
@MascleGinger
@MascleGinger Год назад
You are making your component smaller and its cool, but useController is not a generic hook and it encapsulates your custom logic, and useProxy looks more generic but you also have custom logic there. I saw that we can use library immer to do such kind of update. And yes it's very beneficial that we can easily read our components and test the logic inside them with custom hooks which was probably mentioned in the react docs
@WebDevCody
@WebDevCody Год назад
Yeah useController was a bad name for it. It’s more of a factory function which I should have called makeController. The idea wasn’t to make it generic. It’s a very specific controller used to control this view. I don’t recall useProxyState having any custom logic, it’s a generic way to wrap an initial state variable.
@MascleGinger
@MascleGinger Год назад
@@WebDevCody useProxyState has the setCount which receives the cb function for updating the state which is specified inside useProxyState rather than passed inside it. This is the custom logic that I was talking about. The general idea as I understood is to make our components smaller, testable and more readable
@WebDevCody
@WebDevCody Год назад
@@MascleGinger ah ok, there might be a better way to not need to do this counter state update hack. Maybe I can just use a memo and pass that as initial state for the useState hook
@antidotes1999
@antidotes1999 Год назад
I think the only time reduce is good is in getting the total price. Just a small comment. Also, I saw your previous approach looked a lot like Vuejs :P Im a vuejs dev
@WebDevCody
@WebDevCody Год назад
Yeah I like vue, but also like the functional approach to react.
@Joao-nn6gn
@Joao-nn6gn Год назад
I don't know, I think super engineering stuff, maybe I don't know exactly the issue this approach it's trying to solve. I kinda need to feel it to get to know real benefits. I think this separate to much of React, I'm kinda got lost on where is React, how the component will exactly behave. But again this is something that I have to do by my self
@siravitveeravong474
@siravitveeravong474 Год назад
Much love
@devthagichu
@devthagichu Год назад
Hey I have been following you thinking so far, I thinks just by useReducer you can achieve this, pretty easily. If you add TS , it will help like lots, I get your Test argument though. I would advocate that you write REACT like react code.
@WebDevCody
@WebDevCody Год назад
I’m not a fan of immutable code, And I find reducer forces me to use immutable code with additional boiler place causing bad dx and harder to read code, but that’s just my opinion. What is react like react code? Does that mean using context? Using redux? Using custom hooks? Using class components? React is just a view engine, let’s treat it as such imo.
@devthagichu
@devthagichu Год назад
​@@WebDevCody I get you as for dx in regards to hooks more so useReducer hook, the documentation is quite clear and for redux, we can say we have come a long way... there are better docs now that address Dx, for boilerplate code, your MVC solution also comes with some boilerplate, I am keeping an eye though on your idea tho 🙂
@donnyroufs551
@donnyroufs551 Год назад
I wonder if you are going to walk against a wall with an MVC-like approach because on the front-end we might have multiple views that require the same model which means you have to be okay with sharing the same model which I think might be a problem the bigger it gets. Well, actually I don't think that. have seen it in the famous MVC frameworks like rails and laravel with SSR pages. Some people already mentioned it but I'd like to bet my money that MVVM would be a "better" approach. Anyway, glad to see I am not the only one looking for a better way of doing these kind of things. To hell with bloated frameworks!
@WebDevCody
@WebDevCody Год назад
I think in that instance we can still use zustand or context and share state between components. But we’d pull in the zustand state and pass that via dependency injection to our controllers as needed. There is also nothing preventing us from defining multiple controllers in a same view I guess. Like with all things, break the convention if it’s not working for the feature needed. Let me think on this more because I only half understand your concern. 🍻
@donnyroufs551
@donnyroufs551 Год назад
​@@WebDevCody My concern comes from sharing logic rather than data. A model is usually more than just a dumb class for data, meaning it encapsulates its behavior. So the problems I see vaguely: You have a model that needs to be used in X amount of components now you either - duplicate that model - use the same model the first one should be obvious what kind of troubles this might bring, so let's focus on the latter: - You are now giving any component the ability to mutate the state of that model (assuming we have behavior there cannot be invariants but still) - Your model might become massive, maybe you need 2 props for just that component but the model itself has like 20. - You have an iterable inside that model which is empty for that component because you don't include it in your fetch, some kind of invariant..? This is why I like MVVM because the view model knows about the model and exposes only the things that the view needs but the view does not know about the model, only the view model.
@rohan1765
@rohan1765 Год назад
My only question is, if someone is building large scale project, they will have n number of probably outsourced Devs working on it, How likely is it that a person(who has been working on react) sees this code and thinks yeah I would want to work on it?
@borislavborisov9063
@borislavborisov9063 Год назад
To be honest in terms of testing I don't really see what that brings more than simply extracting some functions for the logic and using them inside a react hook or whatever and then testing them outside of your component. I am also not sure I can buy on the idea with using value setters on the object instead of using a setState function. Part of what React gives us by providing explicit setState functions is to reduce some cognitive load on whether a value is simply being mutated or if it does trigger a re-render. So it seems to me a bit like trying to force React to act like some other frameworks like Vue.js work. One big pro to this approach I would point out is like mentioned in some of the comments a lot of the code really becomes framework/library agnostic and could possibly be plugged in different frameworks but this again comes with some downsides like having to write some extra boilerplate code for the possibility of switching frameworks and then you also need to write some plugging logic to make the new framework work with your code (and I would expect quite a few edge cases coming along the way). So when we draw the line in some cases the overall time spent to support that agnostic approach combined with the migration could end up taking more time than re-writing your whole app. Of course sometimes just re-writing your app is not that easy and can never be an option. As a conclusion - in software development pretty much everything comes with some tradeoffs. So let us know how your side projects go with this approach and what issues or benefits you see further down the line. All the best!
@WebDevCody
@WebDevCody Год назад
For sure, I think all of these frameworks have their prod and cons, and I do like the mutable approach to svelte, vue, angular. There is a ton of cognitive load around setState since it’s an async function, sometimes you need to pass a callback, it’s not intuitive and a majority of the noobies get tripped up on this fact. This is still just a prototype approach so it might end up being terrible, but I’m slowly trying to tweak it to meet my needs and figure out of this is truly a benefit or a waste of time lol
@benjaminbialy6284
@benjaminbialy6284 Год назад
It’s good to see someone experimenting with new ideas, my question is: What’s the problem with just using a few custom hooks that you can also use in other places in the project? This seems overly complex but nonetheless, love your videos
@WebDevCody
@WebDevCody Год назад
How do you suggest I use custom hooks in this scenario? What would each custom hook actually do? What logic would it contain. So instead of centralized logic for this component, split the logic it into multiple hooks? Not saying you’re wrong, I just need a concrete example to grasp your suggestion
@benjaminbialy6284
@benjaminbialy6284 Год назад
@@WebDevCody ​I think if you’re trying to strictly stick to an MVC approach it’s good but personally, I’d just have a useToggleList hook that’d own the state and fetch the data on load. Then I’d just return the state and the methods so that they can be accessed. I think this would better achieve the purpose of abstracting logic away from the component while allowing for the same logic to be reuse elsewhere in the project. It’d also mean that only one hook is needed rather than useProxy aswell. I think there’s just some unnecessary complexity that’s been added which is what I try to avoid! Looking more into it though, it doesn’t seem too bad. Being new to this way of doing things would be a factor for seeing it as being overly complex too no doubt.
@kklowd
@kklowd Год назад
I love JavaScript but every time I get into a project that gets larger and more complicated, I always wonder why not just use Java? It has typings, mvc, and is just more robust. I think of JavaScript as Java that has been completely gutted and modularized. You can add type support with typescript, and other modules/libraries as needed. It's more versatile, but less opinionated with lots of room for mistakes. I'm still navigating this new js everything era to find the answers to the downsides that all these Js frameworks still have. I like your POC but I feel like we're just going in circles with the whole JavaScript Java/C# thing
@WebDevCody
@WebDevCody Год назад
Just use typescript if you want types, and how do you build a front end with java? You’ll need JavaScript right?
@MrZiyak99
@MrZiyak99 Год назад
Hope this works out but i feel like you'd rather spend your time learning/creating something else. If react was meant to be written this way I think someone would've already come up with this and it would be more popular. Your gripe seems to be with react itself. Anyways I've seen you try this for multiple videos now so in case you do continue and i see a pattern that i personally like i will for sure let you know. Best of luck!
@WebDevCody
@WebDevCody Год назад
I don’t have a problem with react, I still think it’s the most flexible framework with the best ecosystem. My gripe is with state management and overly complex components hard to unit test the logic behind
@Synergy_World
@Synergy_World Год назад
South Africa is here playing amapiano
@shivshankarsah8457
@shivshankarsah8457 Год назад
Brain.exe Has Stopped Working
@ThanHtutZaw3
@ThanHtutZaw3 Год назад
Why MVC
@ukman1234g
@ukman1234g Год назад
If you are building an application to be JS UI framework agnostic (as of Today), this approach is fine, I guess… - but its ridiculous to think that when you look to rewrite in 5+ years, you can lift and shift logic in Controllers to a new application without significant refactoring. For example, One word, Typescript. There will always be new better tech. You cannot assume your UI works just by Testing Controller in Isolation. OK, running Controller only tests will be slightly faster to run - But Now … I have to write tests for Controller and tests for View and Controller Integration and maintain both (and those Controller tests are going to be verry brittle), how much time am I actually saving ? Unit tests are NOT the preference - Testing as close to the End User IS the preference. I'd rather not test Internal Implementation logic and test as a React UI Component with React Testing Library or other and not overengineer to build a React app whilst avoiding using React. I agree organising component logic is important for large projects - but nothing that cant be solved in the majority of cases moving logic to Custom Hook and using useReducer. Also use-immer is a thing, if immutability is your issue.
@WebDevCody
@WebDevCody Год назад
Both unit and integration testing are important. Unit Tests are usually only brittle if you wrote them poorly. In this example, I can unit test the modal, unit test the container if needed, and write a single integration test between the container and the modal to verify the modal is populated with the proper selected toppings because that’s the one point of contact those component have with each other, maybe verify a single modal save sends back values to the container, but if you have good unit tests, you can trust the integration will work fine
@ukman1234g
@ukman1234g Год назад
@@WebDevCody Brittle tests usually test things which we don’t actually care about. E.g Example from your mvc toppings test “Does initial view show correct selected toppings” Test 1: RTL - findbylabel, is cheese checkbox selected is pepperoni checkbox selected Vs Test 2: Controller Unit- Is selected topping in this shape and equal {“cheese”: true, “pepperoni”: true …} Now a new requirement comes in where I have to change the shape of selected topping to store other info: { “cheese”: { selected: true, info: “this is not vegan”}, “pepperoni”: { selected: true, info: “this is spicy”}} Given implementation is correct: Test 1 RTL will pass will pass with No updates Test 2 Controller Unit - will Fail if not updated - Now I have to update this test every change , Brittle… where is value add here?
@WebDevCody
@WebDevCody Год назад
@@ukman1234g what’s stopping us from calling a getter call isAllSelected and expect it to be true? I agree that the test shouldn’t check the model directly if possible since that will result in brittle tests, and you’re right this test in the video might be brittle if I change the structure of toppings. In my defense this was a prototype with some basic tests I didn’t think hard about
@nabinsaud4688
@nabinsaud4688 Год назад
You have to include source code too
@WebDevCody
@WebDevCody Год назад
In description now
@nabinsaud4688
@nabinsaud4688 Год назад
@@WebDevCody Thankyou Teacher
@lukemoralesTV
@lukemoralesTV Год назад
Technically, useController is wrong in its definition since it doesn’t access any react lifecycle features, therefore it’s not a hook 🤔
@WebDevCody
@WebDevCody Год назад
K, makeController?
@hamitaksln
@hamitaksln Год назад
@@WebDevCody It technically gets the controller so we can say getController.
@penguinxed
@penguinxed Год назад
maybe I can give this a try hehe
@WebDevCody
@WebDevCody Год назад
Wouldn’t hurt to just try and see if it helps any
@AftercastGames
@AftercastGames Год назад
This video and these comments just reassure me that modem web development is like working in an insane asylum. Nothing makes sense. Nothing comes anywhere close to resembling reality. The terminology is convoluted and arbitrary. I guess after 30 years of software development, you start to realize that adding complexity to a complex system doesn’t somehow cancel out the complexity. You guys have somehow taken the simplest aspect of a system, to take information that has already been provided to you, and show that information on the screen, and take information from the user, and provide that information to the system, managed to turn that into a hundred different browser DOM manipulation libraries is just stunning. Please, someone, somewhere, stop this madness. I beg you!
@WebDevCody
@WebDevCody Год назад
Not sure your argument. The reason we have these frameworks is because manipulation of the dom is unmanageable with complex business requirements. We moved away from jqueuy and vanilla js because of complexity it brings on larger applications, so now we use vue react svelte angular so that we don’t need to think about how the dom is updated.
@AftercastGames
@AftercastGames Год назад
@@WebDevCody Don’t mind me. I’m from a different era. I just want to suggest that you can choose how complicated to make your own lives, usually. If you are working within a web browser, you get JavaScript and the DOM for free. Everything else is optional, and anything you decide to add to it should probably add more benefit than cost. If it doesn’t, then you may want to consider not doing it in the future.
@mattwayne9128
@mattwayne9128 Год назад
@@AftercastGames No offense (not really), but you clearly have no idea what you're talking about. Not introducing complexity into Web applications is not a novel concept by any means. Much smarter people than you have considered this already. The modern state of Web development is to bring an experience as good as, if not better than, native applications on an OS to the end user. Expect we don't have the luxury of our apps working in an OS. The applications we create have to work in a browser. And we have to code it all out in javascript. The complexity isn't something people are just throwing in for fun. Building something as basic as an empty Facebook clone would be hell without a framework. The problems are complex, hence why the solutions are too. You also don't need to tell us that you're from a different era. Anyone who glances at your comment can smell the reek of boomer from a mile away. Do us all a favour and shut up. I've got a feeling that between the geniuses responsible for building these frameworks in the first place in response to a need, and you, some random old fart, that you're the one that needs to stop your madness and stick to your lane.
@Rust_Rust_Rust
@Rust_Rust_Rust Год назад
@@AftercastGames You have no idea what you are talking about. Sure for a simple portfolio site or blog page I would not recommend a web framework. However building a web application without a web framework is hell (I've done it before). The reason why we have web frameworks is because for web applications the dom is constantly changing and being updated and having a web framework keeps tracks of what components to actually update instead of entire web page refreshes. This is one simple reason I can think of on the top of my head without going into state management.
@AftercastGames
@AftercastGames Год назад
“The complexity isn't something people are just throwing in for fun. Building something as basic as an empty Facebook clone would be hell without a framework. The problems are complex, hence why the solutions are too.” This is precisely my point. “Facebook” isn’t a complex problem to solve. People post messages, and other people can see those messages. And 75% of that work is done on countless servers, not on the web browser. That just leaves things like formatting, editing and displaying messages, images, links and videos. Most of this is handled by the browser itself. There was a time when the web browsers had different behaviors and different functionality, but those problems have been largely resolved. Chrome is now the lowest common denominator, in terms of functionality, and modern UI designs are so flat and monochromatic that you might as well be using a black and white monitor from 1979. The web development industry is a joke. You literally have the simplest job in all of software engineering, and you’ve managed to over complicate it beyond recognition. The solution to a complex problem is breaking it up into multiple simple problems. The solution is not to invent your own complex system to hide the other complex system. It’s your choice. Throw as many libraries and tools in as you can, and then when it gets to be too much to deal with, just quit and find another job. That’s what most people do these days. The rest of us will clean up the mess that you leave behind. The system that I’m currently maintaining and adding new features to has over 18 different UI technologies the last time I counted. Every 3 months, a new UI library is introduced, and naive developers happily add it to their existing and new projects before realizing that there are unexpected issues and complexities with this new technology, just like all the rest, and start looking for a better solution. Whenever you guys settle on one set of tools for more than 6 months, then I will consider giving it a try. Until then, I’ll focus on actual business requirements and functionality that makes people more productive. It’s easy to waste time and money playing with new tools every 3 months as long as someone is willing to pay for it all. And as long as the money doesn’t run out, of course. Good luck in your career. I wouldn’t be so quick to dismiss (or push back against) people with a lot more experience that are trying to give you some helpful advice.
@nabinsaud4688
@nabinsaud4688 Год назад
Pleass make some project from scratch
@TheRamp2010
@TheRamp2010 9 месяцев назад
Does anyone else ever have to force themselves to not do it in vanilla JavaScript?
@rohitkashyap6301
@rohitkashyap6301 Год назад
then why even use react if you don't want to use react? Seems like overengineering to me. Isn't this just reinveting yet another prxoy based state management library?
@imornar
@imornar Год назад
It's cool and all, I'm just not sold on this approach
@WebDevCody
@WebDevCody Год назад
That’s fine, this is just me doing some thought experimenting anyway
@boredguy1663
@boredguy1663 Год назад
hmm I don't think it fits with the react model. I swear I seen this sort of approach before but I can't put my finger on it.
@seannewell397
@seannewell397 Год назад
I usually just mock the hooks and focus on unit testing my custom hooks and break those down into tiny testable functions where possible. The plain object+functions as a controller with the reactive model approach is a pretty nice, simple, and approachable alternative to something like redux or other state management library, and could likely be composed with those things anyways. Seems quite SOLID and Clean at first blush, my inclination is to abstract some pieces to make a generalized useController custom hook and test kit-esque style helpers. Keep coding and testing and shipping! Looks awesome.
@ChillAutos
@ChillAutos Год назад
I like to just wrap complex components in their own context and put all the business logic in there. I also like to make my components as dumb as possible.
@captainalpha4853
@captainalpha4853 Год назад
Idk why it's still complicated to me
@WebDevCody
@WebDevCody Год назад
It’s just a function that returns methods and getters. This isn’t that complex
@ahmedmoslih3335
@ahmedmoslih3335 Год назад
Blakk Bee дед меме
@RAZR_Channel
@RAZR_Channel 5 месяцев назад
MVC Adds complexity when there need be none. Separating the HTML from the logic layer is all that is practically useful... a 3rd element is excessive. McDonalds is popular too... but not a good thing...
@timalk2097
@timalk2097 Год назад
I think what you're doing is great if you work on your own but please don't do this in a project where you will onboard newbies you're going to make their life a living hell at 1st. I'm talking out of experience btw :)
@WebDevCody
@WebDevCody Год назад
Yeah this is usually in the context of side projects. On a production app I use existing libraries when possible. It still doesn’t mean the current industry approach to react component is any good imo.
@hamzachebbah1907
@hamzachebbah1907 Год назад
This is called an overengeneering my friend
@WebDevCody
@WebDevCody Год назад
It’s fun to overengineer right?
@franzekan4953
@franzekan4953 Год назад
This looks a lot like you rebuilt mobx
@WebDevCody
@WebDevCody Год назад
Kind of, without the class and this keyword
@mycomputer9211
@mycomputer9211 Год назад
Here bc of Poke
@tmthyha
@tmthyha Год назад
trying to follow along with this video confirms to me that tailwind is disgusting to look at, even in the most simple app.
@WebDevCody
@WebDevCody Год назад
Tailwind is fine, I thought the same way until I used it. I was a big sass css fanboy until I started using tailwind
@eghazaryan3335
@eghazaryan3335 Год назад
unmaintaining code look like this
@WebDevCody
@WebDevCody Год назад
No not really
@eghazaryan3335
@eghazaryan3335 Год назад
@@WebDevCody so you can use vue if you want mvc model why implement react structure to something else bad readability in my opinion
@neethujohn4255
@neethujohn4255 Год назад
tNice tutorials was really helpful on day 1 of softS for . I managed to create a whole 5 sec loop hahaha. But I am proud of myself and cannot
@vfxstudio2265
@vfxstudio2265 Год назад
Hey, Have you ever heard the name "redux" ?
@pauldewit8088
@pauldewit8088 Год назад
So your tests are now determining the pattern you now use… Bad idea testing shouldn’t dictate the way you code
@WebDevCody
@WebDevCody Год назад
Eh idk, if you have a third party dependency on your code and mocking that becomes problematic, restructuring your code to be more testable isn’t bad imo. It usually means you’ve probably isolated your app logic properly from the rest of your dependencies
@evgeniypp
@evgeniypp Год назад
“Hi, guys! I reinvented Redux!”
@WebDevCody
@WebDevCody Год назад
This is not like redux. Go read the boilerplate involved with using redux and toolkit and compare it to this.
@evgeniypp
@evgeniypp Год назад
​@@WebDevCody You're right, it not like Redux. Redux Toolkit handles tons of stuff, besides separating the logic from the view. And you just created a function with a closure that returns an object with all the logic shoved inside. Do you know that there is a structure for creating objects with binded data? It's called "class". I guess it will be in the next version of your "new favorite way" to write code 😂
@ivanbailey156
@ivanbailey156 Год назад
Because the way your mvc is setup you’re going to lose portability if you want to share some a function between multiple views. An ideal solution to the problems described in this video are: For testing: use cypress with a dedicated dev/testing env For manageability: enforce strict guidelines at the senior engineer level or where code reviews are done. Train incoming devs that if they want to have a satisfactory velocity, and merge code without friction, it will need to be concise, well named, easily understood, consistent with guidelines, etc. Otherwise they’ll have to push up a new commit, wait for the pipeline to test, and ask for another code review.
@WebDevCody
@WebDevCody Год назад
How would it lose portability? It’s a function that takes in arguments. Nothing or stopping me from having two or more controllers inside a single view with this approach right?
@sergebureau2225
@sergebureau2225 Год назад
Sorry, but as all web technology it is a MESS. It hurts to see this type of primitive code. Not your fault, it is all you have to work with.
@WebDevCody
@WebDevCody Год назад
What exactly is a mess about it?
@sergebureau2225
@sergebureau2225 Год назад
@@WebDevCody I have been programming around 30 years. Javascript is total scrap, all web development is not serious. Look at language like Scala that is 50 years in advanced compared to web languages. UI is not even close to what I had 25 years ago, pathetic.
@bigmistqke
@bigmistqke Год назад
Lol why is everyone so upset over someone playing around with a pattern. Very weird 🤷‍♂️
@bigmistqke
@bigmistqke Год назад
Abstraction isn't a solved problem. Thanks for sharing ur research.
@WebDevCody
@WebDevCody Год назад
idk man, it is very weird indeed. I guess people hate when they are introduced to a new concept that goes against what they previously learned or might do currently in practice. Just because you learned it and do it daily doesn't mean it's the most efficient or easy to understand. Think outside the box, challenge thought leaders in this industry, think for yourself.
@streeetvlooger9744
@streeetvlooger9744 Год назад
don’t tNice tutorialnk you should waste any potential
@WebDevCody
@WebDevCody Год назад
No clue what you mean
@SeibertSwirl
@SeibertSwirl Год назад
Seems like you have angered the masses in this video 😅🫠 #Triggered
Далее
Goodbye, useEffect - David Khourshid
29:59
Просмотров 495 тыс.
5 Pro-Level React Do's & Don'ts
30:06
Просмотров 174 тыс.
100+ Linux Things you Need to Know
12:23
Просмотров 108 тыс.
Stop Doing this as a React Developer
12:27
Просмотров 160 тыс.
Why I still choose next.js
19:39
Просмотров 18 тыс.