How To Speed Up a WordPress (WP) Web Site
To speed up a WordPress (WP) site, you need a combination of a solid foundation (hosting, theme) and optimization techniques (caching, image compression, code minification). ...
To speed up a WordPress (WP) site, you need a combination of a solid foundation (hosting, theme) and optimization techniques (caching, image compression, code minification). ...
JavaScript frameworks and libraries are collections of pre-written JavaScript code designed to streamline and enhance web development. While both provide reusable code, their primary distinction ...
Linux is most widely used by advanced users who always want to have more control over their system. In this user are allowed to easily install and manage software packages by using a package manager ...
When scraping large amounts of information, the main problem is the risk of blocking and how to avoid it. We have already discussed that you can use captcha-solving services, proxies, or even a web ...
Solid-State Drive (SSD) is a solid-state storage device that uses integrated circuit assemblies to store data persistently, typically using flash memory. SSDs store data in semiconductor cells. where ...
To turn your web pages into graph objects, you need to add basic metadata to your page. We've based the initial version of the protocol on RDFa which means that you'll place ...
Developers today don't have a reliable metric that correlates with their user's visual rendering experience. Existing metrics such as First Paint and First Contentful Paint focus on initial ...
বর্তমান দিনে কম্পিউটার ছাড়া আমাদের এক পা এগোনো খুব কঠিন হয়ে উঠেছে।আপনি কয়েক সেকেন্ডের মধ্যে কিভাবে কম্পিউটার শিখতে ও চালাতে পারবেন সেই জন্য এই পোস্ট Ctrl + A ফাইলের সব কিছু সিলেক্ট করা (All ...
Developers today don't have a reliable metric that correlates with their user's visual rendering experience. Existing metrics such as First Paint and First Contentful Paint focus on initial ...
HTML is the core foundational standard being worked on by the WHATWG community. It is continuously maintained and supersedes HTML4, XHTML1, DOM Level 2 HTML, and all previous HTML specifications — ...
The chunks-webpack-plugin creates HTML files with entry points and chunks relations to serve your webpack bundles. It is suitable with multi-page applications that contain multiple entry points. ...
The HtmlWebpackPlugin simplifies creation of HTML files to serve your webpack bundles. This is especially useful for webpack bundles that include a hash in the filename which changes every ...
Webpack hides modules coming from folders like in your console output by default. This helps you to focus on your modules instead on your dependencies. You can display them by using the ...
At first glance, each long URL and the corresponding alias form a key-value pair. In a certain sense, a URL shortener is a giant hash table, which maps integer values to full URL strings. The integer ...
Now, Let us take a good look at the inbuilt features offered by a comprehensive chat app:1. Instant Messaging: This is the basis of your app’s success, and a basic feature of all chat apps. It ...
According to MDN, the WebSocket API is an advanced technology that makes it possible to open a two-way interactive communication session between the user's browser and a server. With the WebSocket ...
Minifying a file involves removing unnecessary formatting, whitespace, and code. Since every unnecessary piece of code adds to the size of your page, it’s important that you eliminate extra spaces, ...
HTTPS: Encrypted Connections The two are essentially the same, in that both of them refer to the same “hypertext transfer protocol” that enables requested web data to be presented on your screen. ...
The critical rendering path (CRP) looks at the sequence of steps the browser takes to receive HTML, CSS, and JavaScript bytes, as well as the techniques required to render the initial view of the web ...
First of all your computer has to interpret the signals coming through from your keyboard—each key press closes a specific electrical circuit that tells your computer the letters and symbols you’re ...
This is a classical question in an interview. We can concatenate the topics all above in this theme:Do the DNS query first, it will offer the most suitable IP address with the intelligent DNS ...
How to get-the-token-in-postman-whenever-i-use-middleware-in-my-private-routes, so I can check from back-end that my secured authenticated routes ( secured with Passport.authenticate middleware) are ...
Open a webpage ( say https://github.com/rohan-paul ) in Google Chrome and go to “View > Developer > Developer Tools” menu. You can also open the developer console by right clicking on the page ...
Aapart from GET, there are other types of HTTP methods including: HEAD POST PUT DELETE CONNECT OPTIONS TRACEWhat Does the PUT Method Do? The PUT method completely replaces whatever currently ...
1. The most fundamental difference between the two is that TCP and HTTP works at different layers, i.e, they have independent (and radically different ) tasks to perform. TCP is a transport-layer ...
The HTTP status codes are developed as per the Internet standards defined by Internet Engineering Task Force (IETF). They are classified into five different categories as below: 1xx series – ...
The HTTP status codes are developed as per the Internet standards defined by Internet Engineering Task Force (IETF). They are classified into five different categories as below: 1xx series – ...
The res object represents the HTTP response that an Express app sends when it gets an HTTP request. Source: https://www.tutorialspoint.com/nodejs/nodejs_response_object.htm res.status(code) ...
HTTP is a method for encoding and transporting data between a client and a server. It is a request/response protocol: clients issue requests and servers issue responses with relevant content and ...
Normally, we can put normal JS code and get no help from what TypeScript has to offer. In order to TS to force us to actually type our code, we need to change the ‘tsconfig.json’ file. In particular, ...
Thunks are a functional programming technique used to delay computation. Instead of performing some work now, you produce a function body or unevaluated expression (the “thunk”) which can optionally ...
Thus, in summary there are two parts to Redux-Thunk:A thunk creator, which is an action creator that returns a thunk (a.k.a. asynchronous action creators)The thunk itself, ...
How exactly does mapStateToProps know which is the state variable that I am talking about. In other words, when I have many reducers file how each component, will get its specific states from ...
mapStateToProps() is a utility which helps your component get updated state(which is updated by some other components),mapDispatchToProps() is a utility which will help your component to fire an ...
All mapStateToProps() does is, it takes a piece from the App's single state-tree i.e. the store and turn this into a component prop, so I can use it in this current component as a regular prop. ...
Basically with mapDispatchToProps I connect a Redux action to a React component. mapDispatchToProps function let's us inject certain props into the React component that can dispatch actions. ...
Flux is a pattern and Redux is a library. Flux is a fancy name for the observer pattern modified a little bit to fit React. Both Flux and Redux have actions. Actions can be compared to events (or ...
https://redux.js.org/api-reference/store#dispatch dispatch() is one of the 4 methods of redux-store. dispatch() is the method used to dispatch actions and trigger state changes to the ...
We create a store, using the createStore function. We pass it our reducer, and then use the compose function to create a single function from two other functions. It takes other middlewares and ...
And container is a component , where I am using a Redux state inside of a React component. Because note, while we have the application state in redux store, but here in this component I am again ...
Compose is used when you want to pass multiple store enhancers to the store. Store enhancers are higher order functions that add some extra functionality to the store. The only store enhancer which ...
One of the crucial thing in Redux is binding the action creators to dispatch. Without this binding firing an action creator will do nothing. Now mapDispatchToProps is not the only way of bind ...
Payload is a non-official, community accepted (de facto) naming convention for the property that holds the actual data in a Redux action object. The official documentation only states that a Redux ...
Why enclose actions returned by Redux action creators in curly braces? 1> https://medium.com/@leannezhang/curly-braces-versus-parenthesis-in-reactjs-4d3ffd33128f Curly braces { } are special ...
Reducers - Absolute BasicReducer is just a function that takes two arguments A) Action (which is just a plain JS object preferably with type property ) andB) It takes the current state of ...
If we want to link our React application with the redux store, we first have to let our app know that this store exists. This is where we come to the first major part of the react-redux library, ...
Connects a React component to a Redux store. The first argument to connect is mapStateToProps() function. What mapStateToProps() does is, it allows us to take our state (e.g. item state (from ...
In this file, you will write the functions that dispatch an action. These functions will be linked to your component props by the container’s mapDispatchToProps function. At that point, a component ...
State is used internally by components to dynamically change data. Unlike props, state can only be set within the component itself. Unlike props, state is a private feature and it strictly belongs to ...
The first thing React will do when setState is called is merge the object you passed into setState into the current state of the component. This will kick off a process called reconciliation. The end ...
Server-side rendering (SSR) typically improves SEO and performance. Server Side Rendering, also called SSR, is the ability of a JavaScript application to render on the server rather than in the ...
When simply adding React to a normal .html file and running tha .html file directly in Chrome will throw cross-origin error. So, I have run this .html file with a local web-server. How to run / ...
React Hot Loader is a plugin that allows React components to be live reloaded without the loss of state. It works with Webpack and other bundlers that support both Hot Module Replacement (HMR) and ...
PURE COMPONENT is one of the most significant ways to optimize React applications. The usage of Pure Component gives a considerable increase in performance because it reduces the number of render ...
Generally people think, an easy way to optimize a React component for performance is to make it a class, and make it extend React.PureComponent instead of React.Component. This way, the component ...
React uses synthetic events to handle events from button, input and form elements. A synthetic event is a shell around the native DOM event with additional information for React. Lets see the code ...
We need a way for the child component to tell the parent component to update without breaking one-way data flow. Since we are using local state, we need a way for the child component to tell the ...
If you need to pass a prop to a component being rendered by React Router, instead of using Routes component prop, use its render prop passing it an inline function then pass along the arguments to ...
The onchange event occurs when the value of an element has been changed. For radiobuttons and checkboxes, the onchange event occurs when the checked state has been changed. Execute a ...
We’ve all been taught that the constructor is where we initialize our instance properties, state in this case. And thats true till ES-6. However, that is no more true, for the upcoming ES.next class ...
Keys in React are utilised to identify specific Virtual DOM Elements that have changed. The classic example of usage of keys is a list. Keys are important when rendering collections of items in ...
What are the approaches to include polyfills in your create-react-app? There are approaches to include polyfills in create-react-app, Manual import from core-js: Create a file called (something ...
this.props.history.push("/") Official DocEffectively this is the most common way to implement redirect after a successful form submission. Use case in my MERN book library repoonSubmit = ...
Converting a class-based component to Functional Componentclass TableRowWrapper extends Component { render() { return <tr>{this.props.children}</tr>; } }Now the ...
The most common implementation of this is as follows to capture the change of event for typing in a form (a login form for example)handleChange(event) { this.setState ({ : ...
Very simply its passing an object as an argument to the function, but the destructuring uses only the named properties of the object.const destructuring = ({ used }) => console.log(used); ...
Without using the destructuring syntax getting multiple values out of an array can be quite cumbersome. You would do something like this:const items = ;const car = items; const bike = ...
A large part of React is this idea of having components control and manage their own state. What happens when we throw native HTML form elements (input, select, textarea, etc) into the mix? Should we ...
One simple use case for implementing this React context API Have you ever experienced the pain of trying to get state from the top of your react tree to the bottom? This pain you’re feeling is ...
React is magical, but it still can’t get around the fact that we must build a DOM for the user to see anything. Building a DOM on every page load is not really faster than old-fashioned HTTP calls ...
The virtual DOM is a tree based on JavaScript objects created with React that resembles a DOM tree. Each time you need to change something in the DOM, React employs a different algorithm that ...
Rendering a will navigate to a new location. The new location will override the current location in the history stack, like server-side redirects (HTTP 3xx) do. ...
All return values need to be wrapped in a div. This is because a component can only return one single element, and if you want more than one, you need to wrap it with another container tag. This, ...
Technical interviews may also include time where the developer is asked to look at (and probably write) some code. Hence, take a look at the code below. Can you identify two problems ?class ...
Standard way to define classclass Counter extends Component {constructor (props) { super(props)this.state = { counter: 0, }// I have ...
First off, let me express that this is generally not the way to go about things in React land. Usually what you want to do is pass down functionality to children in props, and pass up notifications ...
Lets look at the Redux Source Code https://github.com/reduxjs/redux/blob/9d3273846aa8906d38890c410b62fb09a4992018/src/combineReducers.ts#L197let hasChanged = false const nextState: ...
A cool feature that Jest has is snapshots. This takes a snapshot of your component and how it renders and then will compare that whenever doing other tests to let you know if something unexpected is ...
When writing unit tests for React, shallow rendering can be helpful. Shallow rendering lets you render a component “one level deep” and assert facts about what its render method returns, without ...
The main thing you need to understand about Styled Components is that its name should be taken quite literally. You are no longer styling HTML elements or components based on their class or HTML ...
While useReducer with its reducer is a part of how Redux works, it isn’t Redux. The useReducer function is tightly coupled to its reducer which holds also true for its dispatch function. We dispatch ...
useReducer hook accepts two arguments first argument is reducer function and second argument is initial app state then it return array with two elements - state and a dispatch function. A Reducer ...
The basic flow is like belowconst = useState(false);...setLoading(true); doSomething(); // <--- when here, loading is still false.Setting state like above is still async, so ...
Replacing componentWillUnmount with useEffect()componentWillUnmount() { console.log('will unmount'); }// Now to replicate the above, just return a function inside useEffect() which will ...
Problem - Effect re-run endlessly when using an array as a second argument for useEffect which is not the case when I use the array.length instead CodeSandbox : codesandbox.io/s/nrwq08p9zj (you can ...
The problem around dependency array I trying to wrap my head around the new hooks api of react. Specifically, I'm trying to construct the classic use case that once was the following:...
Mutations, subscriptions, timers, logging, and other side effects are not allowed inside the main body of a function component (referred to as React’s render phase). Doing so will lead to confusing ...
Fetching Hacker News hits data - The App component shows a list of items (hits = Hacker News articles). The state and state update function come from the state hook called useState that is ...
Starting with 18.0, React includes a stable implementation of React Hooks for:React DOM React Native React DOM Server React Test Renderer React Shallow RendererNote that to ...
A> When shallow comparing scalar values (numbers, strings) it compares their values. When comparing objects, it does not compare their attributes - only their references are compared (e.g. ...
Fiber, the new React reconciliation algorithm, has the ability to start and stop rendering as needed for performance benefits. One of the trade-offs of this is that componentWillMount, the other ...
First of all, from a blog post in late March 2018, it was announced that the React lifecycle methods componentWillReceiveProps, componentWillMount, and componentWillUpdate will be deprecated in a ...
First of all, from a blog post in late March 2018, it was announced that the React lifecycle methods componentWillReceiveProps, componentWillMount, and componentWillUpdate will be deprecated in a ...
componentWillMount is called before the render method is executed. It is important to note that setting the state in this phase WILL NOT TRIGGER a RE-RENDERING.componentWillMount();...
JavaScript is single threaded, that means only one statement is executed at a time. As the JS engine processes our script line by line, it uses this single Call-Stack to keep track of codes that are ...
Transform the following code with sequential execution. I want to fire second request based on one value returned by the first request. For example, the Fetch API provides an interface for making ...
Async/await is a language structure that complements promises. It allows us to work with promises with less boilerplate. For example, the following definitions are equivalent:function f() { ...
A function passed to then can also return another promise. This allows asynchronous operations to be chained together, so that they are guaranteed to happen in the correct ...
A promise is an object that wraps an asynchronous operation and notifies when it’s done. This sounds exactly like callbacks, but the important differences are in the usage of Promises. Instead of ...
Key Point - With the .then() method, we can chain our ASYNCHRONOUS calls in a SYNCHRONOUS manner. So, within the Promise block, I am converting few Asynchronous operations to Synchronous ones. And ...
And note some fundamentals of Promise - When you create a new Promise, you're really just creating a plain old JavaScript object. This object can invoke two methods, then, and catch. Both .then() and ...
Promise object is used for handling asynchronous computations which has some important guarantees that are difficult to handle with the callback method (the more old-school method of handling ...
Ans: Node.js uses a library called libuv, to bring an asynchronous event driven model to Javscript. It piggy backs on Chrome's Javascript Engine called V8 to enable the use of Javascript's call ...
localStorage and sessionStorage both extend Storage. There is no difference between them except for the intended "non-persistence" of sessionStorage. That is, the data stored in localStorage ...
Cookie-based authentication has been the default, tried-and-true method for handling user authentication for a long time. Cookie-based authentication is stateful. This means that an authentication ...
The pipe() function reads data from a readable stream as it becomes available, and writes it to a destination writable stream. It does all "reasonable" things along the way with errors, end of files, ...
If you’ll recall, Express works with a request-response cycle in which callback functions are tied to specific routes and have access to request and response objects, like so:app.get('/', ...
The very basic steps of express-session and cookie-based session management The first time a browser makes a request to our server, express session generates a unique session id 2. saves that ...
Passport is a framework, and a Node.js middleware, that is extremely flexible and modular. It allows you to work with the main authentication strategies: Basic & Digest, OpenID, OAuth, OAuth 2.0 ...
Explanation so, basically it removes all the create and start server code from your app.js and let you focus only on the application logic part. Note: If you see in package.json file you would note ...
Since version 6.3, Node.js provides a built-in DevTools-based debugger which mostly deprecates Node Inspector, see e.g. this blog post to get started. The built-in debugger is developed directly by ...
localForage improves the offline experience of your web app by using asynchronous storage (IndexedDB or WebSQL) with a simple, localStorage-like API. Official site An important step on the path ...