Senior Frontend Developer
VAHNSenior Frontend Developer
MercorFounder
Buzztales Technologies Pvt. Ltd.Fullstack Developer
Preleaf TechnologyFrontend Developer
Noon AcademyFrontend Developer
56 SecureReact
tailwind css
CSS3 & CSS5
Javascript
HTML
CSS
ReactJS
NextJs
Git
React Native
Figma
Node.js
Pubnub
Hi. So, like, I have around 6 years of experience as a front end developer. Uh, mostly work with, um, TextText, React, Next. Js, React Native, JavaScript, along with HTML and CSS, SaaS. Uh, also worked on TypeScript as well, like, uh, and I worked with around 3 different startups, including health care, uh, security, and the ad tech industry.
So, basically, uh, maintaining high code quality in a team working with, like, uh, TypeScript and React involves, like, a combination of best practice tools and process. And, like, uh, some of the best practices are, like, uh, consistent coding standard by using linting and code formatting, like and apart from that, like, we are we can use, uh, TypeScript best best practice, like, uh, strict typing, type annotation. Apart from that, we can use component designing, so, like, functional component, uh, with hooks, like, uh, with hooks, over class component and, like, uh, again, reusability, like, creating a design component to be reusable and modular. Apart from that, we can use, like, prop types, like using of types TypeScript interface or types of component or props around. Apart from that, we can you you apart from that, like, uh, there is state management, like using hooks, uh, context APIs, and, like, like, uh, using hooks like use state and use reducer. Apart from that, like, we can use multiple tools, which includes, like, uh, ESLinting, uh, quality tools, uh, like, for linking JavaScript and TypeScript code. We can use Prettier for code formatting. We can use TypeScript, the lint, although depreciate, uh, like, uh, it is deprecated, but it might still be used in legacy projects. Apart from that, uh, we can use a testing framework like Jest and React testing library. Apart from that, uh, we can use apart from that, like, code review is important. Like, creating a PR PR PRs, like, implementing a robust code review process using PRs. Ensure that every piece of the code is reviewed by at least 1 other team member. Apart from that, uh, we can use, like, code review checklist. Use like, you like, use checklist to ensure consistency in reviews. Apart from that, there there might be multiple processes like, uh, CI pipeline, uh, continuous learning. Apart from that, we can create a documentation as well for the new, uh, employers to get used to the code standards. Apart from that, we can use code metrics, which track codes quality metrics, like, such as, like, test coverage, code complexity, and, uh, bug counts using tools like SonarQ.
So So, basically, handling theming in React application using, like, SaaS involves, like, organizing your styles effectively and leveraging the power of SaaS variables and mixins. So they can be multiple steps. So, like, first step can be, like, uh, we can install, like, SAUCE into the React application, like using Yarn Yarn add SAUCE or NPM install SAUCE. Apart from that, we can, uh, use, uh, like, uh, like, we can create a, uh, create a structure for saus files. A common structure might include directories for base style component and. Uh, so apart from that, uh, we can define variables like in, uh, like variables dot XCS is defined and which have basics variables like primary color, secondary color, uh, text color backgrounds. Apart from that, we can define specific variables to be within a different file structures, uh, for different like, let's assume light. Uh, there there might be 2 different mode, light mode and dark mode theme. So creating that into different variable files, Then we can use variables specific for different components. Then we can create a main stylesheet that is and inside that main stylesheet, we can add all the variables and component, uh, theming. And and apart from that, uh, we can dynamically create theming inside the React, and we can implement, uh, all our code, uh, by using classes in the React application.
So basically, to structure a GitLab cid or CICD pipeline, uh, for a React project, like, that efficiently handles multiple features, branches, staging, and production environment, you need to, like, uh, set up your dot GitLab CIML file to define different stages and jobs for your pipelines. So first is to, like, set up an environment, like defining your environment variable in the GitLab UI under the project setting, uh, for each environment staging and production. This can include API keys and database URLs. Then we can create dot gitlab, uh, CIY, uh, yml, uh, file. So, like, creating this file in the root root project, uh, with, like, necessary, like, staging and jobs. Like, first stage is install name, test, build, deploy, and then we can use variable not no d node, uh, like, uh, ENB file, like production or uh, local. Apart from that, uh, we can use catch, uh, part file, which is more module files. Apart from that, we can install, like, stages, script, linting, test building. Like, apart from that, we can, uh, create a deploy staging file, like, state deployment environment, uh, with different staging and the URL and, like, creating multiple deployment sections. Apart from that, like, uh, detailing explanation, like, like, uh, like, first is in stages. And apart from that, we can, like, ensure that only authorized personnel can deploy to the production by protecting the main branches and the production environment, like, while going to GitLab project setting and, like, uh, protecting garages and operations, uh, using environment. Uh, and apart from that, we can monitor and maintain regular like, regularly monitor your pipeline as to ensure that jobs are executing and expected setup notification for pipeline failure and review, uh, the c I CID CICD configuration periodically for improvement. Apart from that, we can create 1 more staging file, uh, for the deployment command. Like, uh, in the end, there's this, uh, set coming shows that your React project is built, tested, and deployment, uh, uh, like, efficiently across multiple environment, allowing for smooth features, development, and reliable production releases. I just, uh, like, all these edges, the deployments for the specific deployment and infrastructure practices.
So basically, when designing a scalable architecture for level system design consideration, like, to keep in mind. Uh, these consideration will help ensure that, uh, your application can handle increased load and complexity over time. So first is, like, component architecture. So, like, uh, creating a reusable, uh, component, like design the app component to be usable and modular. This will make it easier to manage and scale the application. Apart from that, like, choosing an appropriate state management solution, like Example Redux, MobX. Uh, there is also context API in, uh, React that can handle complex states and logic and scale, uh, with your application. Apart from that, we can use performance optimization as well, like, uh, code splitting. Like, use React's built in code splitting and lazy loading features to reduce the initial load time load time of your application. Apart from that, we can use caching implementing, like, uh, implementing caching strategies, like if, uh, HTTP caching, uh, server workers to reduce, uh, redundant data fetching and improve performance. Apart from that, like, uh, we can consider using, uh, server side rendering, like, uh, with the next years, uh, to improve the initial load time and SEO of, uh, of the application. Apart from that, we can use static site generation for, like, uh, part of your site that don't change frequently considered, like, static site generation, uh, to pre prerender pages at a real time. Apart from that, uh, we can, like, uh, create an architect for the back end handling. Like, uh, apart from that, we can use, uh, scalability and load balancing. Like, load balancer use load balancer to distribute incoming traffic across multiple instances of, uh, application. Auto scaling, like implementing auto scaling policies to automatically add or remove instant base on a traffic pattern. Uh, we can use, like, deployment, uh, and CICD, uh, pipeline, uh, for the same. And apart from that, we can use, like, monitoring and logging.
So basically, testing complex React component that heavily rely on life cycle method can be generated. So just along with the React, uh, testing library or, like, in line, provide a powerful combination for effectively testing these component. So firstly is, like, uh, set up the testing environment, uh, which includes, like, installing of Jest and other, uh, libraries. Uh, then we need to configure Jest, like, in like, ensuring your package. Json include the necessary Jest configuration or create a Jest dot config JS file. Apart from that, uh, we can then identify and isolate life cycle method, like identifying the life cycle method used to your component, component will mount, component will update component will unmount and isolate that logic within them if possible. This can make component easier to test. Apart from that, like, write in a test for each, like, certain method, like, uh, testing component did component component did mount, like, u mocks to simulate API calls or other side effects, verify that component state or props are set up correctly, uh, then we can use, like, testing component, uh, data update, like use mocks, choose in loads, speed, uh, like, uh, prop changes or state changes. Uh, then we can use, like, component will unlock, like, verify cleanups, actions, and clearing, uh, timers removing even these things, can be tested here. Apart from that, we can use, like, uh, React testing libraries. So the testing, uh, library is recommended for testing React component. I encourage, uh, testing the component behavior rather than its implementation details. So, uh, uh, then we can use, like, uh, mocks and spies, like, uh, mock API call using jest.mocks to mock API call other other asynchronous operation. We can use spies. Uh, so basically, just dot spy on, the spy on, lifecycle method, or other, uh, uh, functions to ensure that they are called as expected. Uh, so they might be, like, side effects. Like, you know, that any side effect, like, uh, state API calls are tested thoroughly, like, uh, statement and state updates. Like, check that state updates correctly after life cycle metrics are all DOM updates. Verify that DOM's updates correctly based on the state changer and ensure that any clean attraction, uh, performed correctly.
Looking at this task method, will you So, basically, and symbol in SCSS is known as the parent selector. Like and it is a power tool a power tool for creating more complex and dynamic styles. Like, it allows you to reference the parent selector within a nested block and making it possible to create our nested styles, pseudo classes and, like, uh, more. So here, like, in button, so whenever we hover over, uh, button class, uh, then and, uh, hover color background color get changes without blue. And So if we use another button over inside container, uh, so the button which is at the bottom, uh, will be selected. So 2 buttons with 2 classes, like, uh, with the same name only work in CSS.
So handy data data stream. Can you know what will happen in this type of data? And the data is called a bit null. Or undefined. I mean, how do you factor this to handle such cases? Yeah. Instead of each. So data data function, uh, like, uh, if we call data for handle data function, so there is an argument, which is data, which can, uh, like, uh, be passed as string null and undefined. So that's not a case. Like, uh, there won't be an any error sending data into it, but, like, when we are consoling, uh, consoling the data, so we are calling a dot trim file function. So if there is no like, there's no function defined. Uh, so if there is no function defined, uh, so we can use We can use, like, our operator, uh, and, uh, give it, uh, error or something like that.
So, like, uh, ensuring that, uh, the mandibility of maintainability of CSS styles in large, React application, uh, which using, like, requires a structural approach and, uh, the best practices. Uh, so the pattern or approach to help achieve this is, uh, like, uh, organizing your styles with the CSS, uh, architecture. So, basically, using CSS architecture like, uh, b, uh, e and, like, block element modifier, scalable modular architecture, or inverted triangles like ITCSS can help, uh, can help maintain a clear, uh, like, a clear, readable, uh, CSS. Uh, then we can use then we can use, like, proper variables and component defining proper variable and component defining, uh, and proper structuring of SCSS files and then, uh, calling it all into the single, uh, source of truth file, like main.scss files and maintaining all the code into that particular file, uh, we can define each, uh, component based uh, component based SCS styling. And then we can, uh, specifically, like, create a structure folder structure, uh, for specific page pages based, uh, SCSS files to handle, uh, or handle, uh, handle scenarios specific to that sing singular page. Apart from that, we can use, uh, like, uh, like, uh, for different routes and pages, we can use 1 parent element. Inside that parent element, we can handle specific, uh, page based styling, uh, which can be, uh, helpful in maintaining, uh, which can be help helpful in maintaining, uh, large scales, uh, without, uh, any uh, reusable, like, reusable component across, uh, across the application.
So what setting are you working? So, basically, creating a custom dependencies, like, uh, for things which are easy to maintain and easy to create, creating code splitting. Apart from that, uh, using lazy loading and using less dependencies, Like, for specific depending, we can create a custom, uh, custom library or, like, a custom component, like, so if we do not need anything inside, uh, unlike, uh, in the if we are downloading depend dependency, there might be multiple things which we are not needed. So creating a specific bundle, uh, like, uh, custom component.