This is super interesting, I hope you upload more videos like this implementing architecture and good practices
@Deus-lo-Vuilt20 күн бұрын
Like and sub
@sayedaliaqamousavi906424 күн бұрын
The best tutorials. All comes from years of awesome work experience. 👏
@GBCisPeak24 күн бұрын
video editing nice and clear 👍
@caczus25 күн бұрын
Don't you think it is possible to try to have a structure that allows more colocation? I think in that case it would be easier and more straightforward to navigate the repository: for example, if I need to make changes or check some details of the "user," I know that I will find everything within the "user" folder, from the "infrastuctural" parts down to the "domain" parts
@muthukumar60426 күн бұрын
Hey can you teach how to setup vite like you setup repo
@romanpisani815727 күн бұрын
As an intern, until now I was confused by why the queries were all react hooks and how it worked. Thank you for this amazing video, perfect timing!!!
@lampshade543727 күн бұрын
I don't know how much attention you get on these, but I really look forward to each one you make! Like, seriously great content man. You don't see this sort of stuff anywhere else :)
@profydev26 күн бұрын
@@lampshade5437 thanks so much for the feedback. It’s not too much attention to be honest. There might be one more video coming in the series. Not sure yet. But I really appreciate your nice words
@tomershechner27 күн бұрын
Amazing series
@feeyz6638Ай бұрын
Is there a reason why you used the class based approach for dependency injection in the video compared to the pull request where you have just passed the api as a dependency to each service function? IMO the approach in the video looks cleaner. Im just curious what your thoughts were about that. This video series is really amazing. Thanks for that :)
@profydev29 күн бұрын
@@feeyz6638 there were a few problems when passing the class based service functions as dependencies to the replyToShout function. I’d have to call the bind function for each of those methods which felt annoying. Finally a comment on Reddit pushed to the other more functional implementation
@allaithbitar1199Ай бұрын
Keep it up 👏🏻
@xiiEJRAMАй бұрын
The traceability is bad here and not all the logic need to be extract to domain layer
@codinginflowАй бұрын
Nice video! Are you German?
@profydevАй бұрын
@@codinginflow yes, thanks
@codinginflowАй бұрын
@@profydev Me too!
@devvvvvvvvvvvvАй бұрын
2:45 - I disagree about using refs to access the dom in 2024. Ref access was Reacts way of hiding their performance issues back in the day. But dom access is fine now. 10 years later good grief.
@pizzaitaliana9835Ай бұрын
Great video as always mate! Keep up the good work. Thanks 👍
@sayedaliaqamousavi9064Ай бұрын
Another awesome video tutorial for the ones who are seeking how to become clean coder. I love clean coding videos and security practices in coding. ❤
@mrlectusАй бұрын
Pleas make video for unit testing
@ReuelTeodoroАй бұрын
This is not in the playlist
@profydevАй бұрын
Thanks, I added it now
@t1nytimАй бұрын
I think another disadvantage is, when you get into increasingly difficult scenarios, it leads to more and more abstraction. And so it becomes harder to come up with a function signature that upon reading explains what's happening. Because it's so abstract from the layers doing the work, there could be 20 different ways to achieve what your function is stating it does. And I don't think turning your function name into a sentence changes that either. Where when you work under locality of behavior, your what and how should be in the same place, and so it becomes easier to figure that out.
@mrlectusАй бұрын
is domain the same as services?
@snivelsАй бұрын
Do you keep your react query useQuery hooks and data fetching functions in the infrastructure layer or domain layer? Amazing video, like others have said you're actually explaining things have meaning to people and teach people good principles.
@profydevАй бұрын
@@snivels thanks a lot for the feedback. I added the fetch functions to the infrastructure layer as they connect the app with external systems like rest APIs. The query hooks are an interesting question though. Putting framework code (here react hooks) into the infrastructure layer feels wrong because it makes that layer dependent on the framework. At the same time you probably have one query hook per endpoint and thus endpoints and query hooks are tightly connected. In the next episode I delay that decision by adding the query hooks to a separate “application layer”. But I don’t really like that approach and will refactor everything to reflect feature folders. Then I’ll add the query hooks to the infrastructure layer. Here’s the code for the next episode in case you’re interested: github.com/jkettmann/react-architecture/pull/15 About the domain layer: it should be isolated from infrastructure code like data fetching and independent of frameworks like react. So you would neither put query functions nor query hooks there. When it comes to the domain layer you can always ask yourself: “if I wanted to exchange react for something else could I leave the domain layer untouched?” If you can answer with yes then you already did a lot of things right 🙂
@ZiaCodesАй бұрын
Please continue these kinda videos, especially naming the variables, functions, pages, components, like infoPanel, infoContainer, infoWrapper, infoParent, infoBox etc for example if I'm using infoPanel, and I need a similar component name so what should I name it from above list? That would help
@nickolakiАй бұрын
Would you not prefer a class for the User here rather than a file with methods etc.
@profydevАй бұрын
@@nickolaki Classes don’t work well with react because it requires immutability for state updates. In general classes offer nice encapsulation but here simple functions do the job as well
@RJRobinsonXАй бұрын
These videos are amazing. I very much enjoy your calm explanations. Solid work!
@profydevАй бұрын
@@RJRobinsonX thanks a lot for the feedback
@idohadad3039Ай бұрын
I can only speak for myself, but after having a go at projects, this type of videos are much more helpful than most of the web dev content I've seen. Thanks!
@user-yz2mv8kn4xАй бұрын
learning alot from these series. I find these refactoring videos extremely helpful and insightful compared to alot of tutorials (everyone coded up in one go with minimal explanation). understanding why you made these choices and the tradeoffs involved was invaluable and will definitely apply to my own projects and work. Thank you so much for your amazing lessons
@profydevАй бұрын
@@user-yz2mv8kn4x thanks for the feedback. I really appreciate it
@ericsiddiq7634Ай бұрын
Very nice content ❤
@joseeavrАй бұрын
question, isn't bad practice naming react components in kebab case?
@profydevАй бұрын
You mean kebab case for file names? No that's not bad practice. In fact it has advantages over e.g. PascalCase when you or your teammates are on Mac: x.com/kentcdodds/status/1249870276688371713
@BenjaminAboladeАй бұрын
How can we access the code ?
@profydevАй бұрын
@@BenjaminAbolade here it is. Check the PRs for the code changes for each video/article. github.com/jkettmann/react-architecture
@BenjaminAboladeАй бұрын
Just the perfect video for all react developers at all levels. Nice work. Waiting to see more great content.
@marlonsabijon1500Ай бұрын
Boom... subscribed!
@benjamincardona5444Ай бұрын
I like the video however one thing to point out. That is not dependency injection, it's dependency inversion 😅 Dependency injection applies dependency inversion by dynamically injecting the implementations (or so i've been told). I cannot wait to see the vertical slice transformation. As of now the only difference i see is that we've moved from traditional react architecture to clean architecture and the layers are always the headache for any type of application. Rare content BTW
@poncho678Ай бұрын
Great stuff!
@kanz831021Ай бұрын
thank you for all your efforts. These kind of videos are really rare. keep making these invaluable content!
@SalmanKhan-lx9kpАй бұрын
Next level stuff, loved it. Thanks a lot.
@omarbsoul8419Ай бұрын
Thanks for this content, I have one question, introducing classes would violate the functional programming nature of react, no?
@malachihabib9068Ай бұрын
Great content, can't wait for the full course!
@javiervazquezfernandez1872Ай бұрын
My confirmation bias is right now over 9000!! I love that you are not aiming for a silver bullet but always explaining pros and cons
@kaluczadzsiАй бұрын
Do more junior refactor videos!!❤
@ibraheemhaseeb3660Ай бұрын
Damn, imagine watching these videos, joining a company as junior dev and writing such code what he wrote after refactoring.
@najlepszyinformatyk1661Ай бұрын
2:30 Wait and where is the problem? From my viewpoint, there is no problem with testing whatsoever, because by testing in this manner, we can relay that it works as expected. Otherwise we test implementation details which can lead to the cost to maintain such tests if implementation details change even if the underlying behavior stays the same.
@profydevАй бұрын
In this case we have a couple of scenarios that basically lead to the same result: an error message shown in the form. If we’d test these scenarios with integration tests we’d have to use the same setup logic (e.g. clicking a button to open the dialog, filling out the form, submitting the form, and checking the error message). The only difference would be the API requests and responses. With the logic extracted into a function we can unit test each of these scenarios (which is faster and probably simpler). Then we only need one integration test that verifies that the error message is indeed shown in the UI
@najlepszyinformatyk1661Ай бұрын
@@profydevfor the first part of the answer - you can abstract the repeated test logic to a function and reuse it across test cases
@WoWUndadАй бұрын
"how would i test this component" well id press ctrl+s npm run dev , and check it, duh?
@HDChifАй бұрын
omg I hate clean archtitecture. makes such a messy code in FE applications
@pieg.6689Ай бұрын
I've seen the code in the github, but i don't think there's an example how to use validation schema like zod with form like react-hook form. Do you have plan to make this in later course?
@buza_meАй бұрын
Why do you need a custom hook though? 06:29 Is it important for you to have a new function everywhere you use the hook? It does not take any arguments, it can just be a function of type "export const doReplyToShout = (input) => replyToShout(input, dependencies)". It would make the file clean.
@profydevАй бұрын
The reason I used a hook is to make it compatible with react query. But you’re right on this case we could use your approach which would keep it independent of react
@buza_meАй бұрын
@@profydev I see, you're building it for a future video. I guess if you have some of those as hooks you may as well make every one a hook just for consistency, it makes sense.
@hakanutkuozdemir1407Ай бұрын
I think overall it is a good refactor. But I did not understand the need to create a custom hook. Why not create a new function with the dependencies passed?
@profydevАй бұрын
The reason I used a hook is to make it compatible with react query. But you’re right in this case we could just use a function
@sachingadhari98Ай бұрын
High quality content mate. Could you also make some content on architecting pagination components.