- 40
- 255 608
Profy dev
เข้าร่วมเมื่อ 17 มิ.ย. 2021
You're an aspiring Junior React dev but lack real-life experience? Start working like the pros. Build professionally designed projects for your portfolio. Use the workflows of real-world teams. Get one step ahead of other candidates
Path To A Clean(er) React Architecture (Part 8) - React-Query
Step 8 in the React architecture cleanup:
How does React-Query fit into the architecture that we created in the past weeks?
Blog post: profy.dev/article/react-architecture-tanstack-query
Source code: github.com/jkettmann/react-architecture/pull/15
How does React-Query fit into the architecture that we created in the past weeks?
Blog post: profy.dev/article/react-architecture-tanstack-query
Source code: github.com/jkettmann/react-architecture/pull/15
มุมมอง: 3 123
วีดีโอ
Path To A Clean(er) React Architecture (Part 7) - Domain Logic [incl source code]
มุมมอง 4.1K4 หลายเดือนก่อน
Step 7 in the React architecture cleanup (source code below): Ever wondered where to put all the small functions that often end up in utility files? The domain layer might be the answer. Source code before: github.com/jkettmann/react-architecture/tree/81378b16b13f0ff916498e276979a99353f67604 Source code after: github.com/jkettmann/react-architecture/tree/step-7-domain-logic Source code changes:...
Path To A Clean(er) React Architecture (Part 6) - Business Logic Separation
มุมมอง 9K4 หลายเดือนก่อน
Step 6 in the React architecture cleanup: Ever wondered where to put business logic if not a component, custom hook, or a utility function? This might provide a solid approach: profy.dev/article/react-architecture-business-logic-and-dependency-injection
Path To A Clean(er) React Architecture (Part 5) - Infrastructure Services & Dependency Injection
มุมมอง 4.5K5 หลายเดือนก่อน
Step 5 in the React architecture cleanup: In complex React apps testing logic close to the server can be difficult. Dependency injection in combination with infrastructure services can help us here. Here’s the blog post including a course waitlist: profy.dev/article/react-architecture-infrastructure-services-and-dependency-injection
Path To A Clean(er) React Architecture - Domain Entities & DTOs
มุมมอง 12K5 หลายเดือนก่อน
Step 4 in the React architecture cleanup: Separate server API and UI code by introducing DTOs and domain entities. This isolates the API response data structures in the API layer while promoting shared data models in the rest of the application. Here’s the blog post including a course waitlist: profy.dev/article/react-architecture-domain-entities-and-dtos
Path To A Clean(er) React Architecture - API Layer & Data Transformations
มุมมอง 12K6 หลายเดือนก่อน
Step 3 in the architecture cleanup: Move transformations of API data to a shared API layer. This hides the complexity of the response data structures decoupling API and UI code. Here’s the blog post including a course waitlist: profy.dev/article/react-architecture-api-layer-and-data-transformations
Path To A Clean(er) React Architecture - API Layer & Fetch Functions
มุมมอง 6K6 หลายเดือนก่อน
Step 2 in the architecture cleanup: Extract fetch functions to a shared API layer to hide implementation details like - request method - response type definitions - endpoint paths or - handling of URL parameters from the UI code and simplify the components. Blog post: [profy.dev/article/react-architecture-api-layer-and-fetch-functions](profy.dev/article/react-architecture-api-client)
Path To A Clean(er) React Architecture - A Shared API Client
มุมมอง 7K6 หลายเดือนก่อน
Discover the foundational steps towards a clean React architecture by centralizing API requests with a shared API client. Learn how to streamline your codebase for maintainability and scalability. Blog post: profy.dev/article/react-architecture-api-client
React useEffect & object dependencies - 4 approaches to avoid unnecessary executions
มุมมอง 1.2K7 หลายเดือนก่อน
React’s useEffect hook can lead to tricky situations. If you’re not careful it can cause unnecessary executions of the effect or even infinite re-renders. Especially when using objects as dependencies. Here are 4 approaches that avoid unnecessary executions. Blog post: profy.dev/article/react-useeffect-with-object-dependency
React Code Review - Unraveling A Tightly Coupled Component & Mixed Responsibilities
มุมมอง 1.1K8 หลายเดือนก่อน
In this video, we dive into a code review for a React Job Simulator student project, focusing on the tight coupling of a Filter component to its parent component. In a quick refactoring, you can see how these components are untangled. The changes aren't huge but the result is a clean separation of concerns. Don't forget to check out the React Job Simulator for hands-on practice in a realistic w...
React Riddles: The Mysterious Case of the Untracked Clicks
มุมมอง 778ปีที่แล้ว
Embark on a thrilling debugging adventure in 'React Riddles', where elusive icons play hide-and-seek with our tracking events. Can you solve the puzzle? Project to follow along: stackblitz.com/github/jkettmann/react-riddles-tracking-hook?file=src/user.tsx,src/use-tracking.ts Blog post: profy.dev/article/react-riddles-tracking 00:00 - Intro 00:22 - The mystery 00:37 - Rough Explanation 01:02 - D...
Refactoring A Junior’s React Code - Reduced Complexity With A Single Source Of Truth
มุมมอง 5Kปีที่แล้ว
Link to the article: profy.dev/article/react-junior-code-review-and-refactoring-2 The initial code: github.com/profydev/prolog-app/blob/refactoring-session-2-base/features/issues/components/filters/filters.tsx The final code: github.com/profydev/prolog-app/pull/36/files 00:00 - Intro 00:06 - The Feature To Be Reviewed: A Filter Bar 00:21 - The Code: Overview 01:58 - Code Review: The filters var...
Refactoring A Junior’s React Code - 43% Less Code With A Better Data Structure
มุมมอง 105Kปีที่แล้ว
Find the blog post to this video including the complete code here: profy.dev/article/react-junior-code-review-and-refactoring-1 Find a detailed guide to debugging React with VS Code here: profy.dev/article/debug-react-vscode 00:00 - Intro 00:08 - Demo of the app 00:35 - Code Review: Overview 01:28 - Code Review: Data Structure 02:18 - Code Review: Unnecessary State 02:43 - Code Review: Directly...
How To Debug React Apps With VS Code - Boost Your Debugging Productivity
มุมมอง 27K2 ปีที่แล้ว
For a detailed text-based step-by-step tutorial with screenshots visit profy.dev/article/debug-react-vscode To get the source code and a fully set up repository that's used in this tutorial visit bit.ly/3BNOwZL 00:00 - First Marker 00:22 - Create launch config 01:19 - Run Chrome via VS Code 01:37 - Example bug to be fixed 02:02 - Open the source code in VS Code via the error message 02:08 - Set...
Advanced React Challenge - Refactor a header to fit the existing codebase and test it with Cypress
มุมมอง 6772 ปีที่แล้ว
In a previous video (th-cam.com/video/vcWKcn1X_Ew/w-d-xo.html) I worked on a React coding challenge. I built a pixel-perfect header based on Figma designs. The implementation was rather simple though. In this video I refactor the header, extract components, use the existing styled-components theme, and add a Cypress test. I wouldn’t expect this of a Junior candidate but it might be interesting ...
React Coding Challenge - Build a header based on designs as job interview preparation
มุมมอง 9282 ปีที่แล้ว
React Coding Challenge - Build a header based on designs as job interview preparation
React Job Simulator: How It Works In A Nutshell
มุมมอง 8432 ปีที่แล้ว
React Job Simulator: How It Works In A Nutshell
How To Work With Designs & Create Pixel-Perfect CSS As A React Developer
มุมมอง 2.1K2 ปีที่แล้ว
How To Work With Designs & Create Pixel-Perfect CSS As A React Developer
Codebase Tour Of An Advanced React / Next.js Project
มุมมอง 3.2K2 ปีที่แล้ว
Codebase Tour Of An Advanced React / Next.js Project
Why Cypress Is A Great Tool For React Devs Who Are New To Testing
มุมมอง 5082 ปีที่แล้ว
Why Cypress Is A Great Tool For React Devs Who Are New To Testing
Epic 1 - Session 2: Building a sidebar navigation with React & Storybook
มุมมอง 1.1K2 ปีที่แล้ว
Epic 1 - Session 2: Building a sidebar navigation with React & Storybook
Epic 1 - Session 1: Building a sidebar navigation for a React app with Storybook
มุมมอง 2.2K2 ปีที่แล้ว
Epic 1 - Session 1: Building a sidebar navigation for a React app with Storybook
Planning: How Professional Developer Teams Plan & Estimate Features
มุมมอง 3.3K2 ปีที่แล้ว
Planning: How Professional Developer Teams Plan & Estimate Features
A Professional Git Workflow: Trunk-Based Development Walkthrough
มุมมอง 21K2 ปีที่แล้ว
A Professional Git Workflow: Trunk-Based Development Walkthrough
Setup: How to set up a repo for a professional React app with CI, GitHub Actions & commit hooks
มุมมอง 2K2 ปีที่แล้ว
Setup: How to set up a repo for a professional React app with CI, GitHub Actions & commit hooks
Setup: How to set up a professional React project using a popular tech stack
มุมมอง 8K2 ปีที่แล้ว
Setup: How to set up a professional React project using a popular tech stack
Junior React Resume & Portfolio Review - Abhishek
มุมมอง 1.2K3 ปีที่แล้ว
Junior React Resume & Portfolio Review - Abhishek
React project for your portfolio - Reddit Analytics Demo
มุมมอง 1.8K3 ปีที่แล้ว
React project for your portfolio - Reddit Analytics Demo
Waiting for next❤
We need more videos like this, sir
Great video, thanks! One question I have is that I’m surprised that the react-query docs and this video don’t abstract the queryFn into one reusable function that can take the path and request options (and using axios.request and specifying the method in the request options) instead of creating a new api request function for every new hook (e.g. getMe, getUser, etc). Is this because these guides want to keep it relatively simple or is there a downfall to that kind of architecture (ie abstracting the request into one function)?
This is absolute gold. Waiting for the course
Who loves hearing him say, 'The solution?'
good tips, I'm gonna apply them to my projects
perfect video. may i ask share your code github link?
@@v_juoh you can find the code here. Check the PRs for a step by step refactoring github.com/jkettmann/react-architecture
Thank you very much!! This is amazing, is there a book or good resources for understand more about clean React Architecture?
This is actually really good. I have seen tons of tutorials, but none of them actually go over how to structure your application, best practices, refactor, etc. It would be nice that for a course to start from scratch to advanced for both beginners and experts. He actually go overs the bad first and then refactors it. It's a little rush, but if this guy can create a course from scratch to advanced in react, he would be an awesome teacher. I have not seen this.
There is a library called react-ioc which can be useful to reduce some of the stuff in react... Do take a look
I wonder why using a Map instead of a Set to store checkedByIds , since it’s just a list of unique strings?
@@bensonding1703 I migrated the blog post to using a set after realizing this. Unfortunately you can’t just change the video that easily 😬 But you’re completely right of course
@@profydev Got it. Thank you! really nice video
didn't know we were doing tbd. nice vid.
looking foward to the course
Thank you, nice video I liked it
This is super interesting, I hope you upload more videos like this implementing architecture and good practices
Like and sub
The best tutorials. All comes from years of awesome work experience. 👏
video editing nice and clear 👍
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
yes, that's called a feature-based structure, and hopefully a next video on it comes out soon
Hey can you teach how to setup vite like you setup repo
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!!!
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 :)
@@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
Really nice content
@@profydev I'll be honest - I haven't spent much time with the videos yet (everything I've seen is great, but I learn more through reading), but the blog series is incredible! It matches up nearly perfectly with how I've come to prefer to write my React applications, but with a clear and logical presentation of arguments that I never would have been able to match. I've been linking your series (including this youtube series and the accompanying github repo) to everyone I know who works in React. I'd love to see your proposed feature-based folder refactor! Seriously, massive kudos on the work and care you put into all of this.
Amazing series
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 :)
@@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
Keep it up 👏🏻
The traceability is bad here and not all the logic need to be extract to domain layer
Nice video! Are you German?
@@codinginflow yes, thanks
@@profydev Me too!
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.
Great video as always mate! Keep up the good work. Thanks 👍
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. ❤
Pleas make video for unit testing
This is not in the playlist
Thanks, I added it now
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.
is domain the same as services?
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.
@@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 🙂
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
Would you not prefer a class for the User here rather than a file with methods etc.
@@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
These videos are amazing. I very much enjoy your calm explanations. Solid work!
@@RJRobinsonX thanks a lot for the feedback
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!
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
@@SSan-n3q thanks for the feedback. I really appreciate it
Very nice content ❤
question, isn't bad practice naming react components in kebab case?
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
How can we access the code ?
@@BenjaminAbolade here it is. Check the PRs for the code changes for each video/article. github.com/jkettmann/react-architecture
Just the perfect video for all react developers at all levels. Nice work. Waiting to see more great content.
Boom... subscribed!
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
Great stuff!
thank you for all your efforts. These kind of videos are really rare. keep making these invaluable content!
Next level stuff, loved it. Thanks a lot.
Thanks for this content, I have one question, introducing classes would violate the functional programming nature of react, no?