In this book, you will learn design patterns, performance and rendering patterns for building high-quality web applications using modern JavaScript and React. Patterns are time-tested templates for writing code. They can be really powerful, whether you're a seasoned developer or beginner, bringing a valuable level of resilience and flexibility to your codebase.
Whether it's better user-experience, developer-experience or just smarter architecture, the patterns in “Learning Patterns” can be a valuable consideration for any modern web application.
Does contain some good tips for web performance scattered throughout. In fact, I would say it's more focused on patterns for addressing web performance rather than web app architecture more generally.
There wasn't much structure to how each pattern was introduced. For example; drawbacks are not explored in depth for many of the listed patterns. Some patterns had good examples, but others were too abstract or contrived to be useful for learning.
When I initially picked up this ebook to read, I expected almost another book that just went through design patterns with examples. Well I got that for the first half the book, but then it got good.
After you get through things like the Singleton, Facade and Flyweight patterns, the authors start talking about rendering and performance patterns. This is most likely where this book will have the most impact for the greater community.
They go through how the browsers weight parts of the process and show how to code split etc. The only downside potentially is that their examples are in React and Next.js for most of the latter parts of the book, which might not be as useful for people not using those frameworks.
Otherwise, I'll be keeping a copy of the PDF handy as I continue to write web apps!
It's a great book for Frontend Engineers and interested ones who seek to learn about latest web performance optimization trends. It delves deep into Design Patterns in JavaScript, and Rendering patterns, mostly around React/Next.js ecosystem.
The book is available online on patterns.dev webpage, where I actually read it. I skipped Vue part, since at the moment it is not relevant for me, so my feedback and impression is regarding the other parts I have already highlighted.
You can learn a lot on how you can construct your application and in which type of application which rendering techniques can be applied. You will also learn different techniques how to make Core Web Vitals metrics such as FCP (Fast Content Paint) and LCP (Largest Content Paint) fast enhancing overall UX.
The only minus I would say was how the book was structured on the website. If you just go one by one, sometimes there are references from chapters that are yet to come, but overall it's not a big issue and.
Caveat first: this book pobably is not the best for beginners to learn JS patterns, and it doesn't have many examples for each pattern. And lots of examples are in React/Next
However, as someone who has done frontend for over a year now, there were so many lightbulb moments as I read through the book that I wouldn't have had if I read it a year and a half ago.
It's a great resource to learn about different patterns and performance improvements that can be made on web applications. It discusses trade-offs of different approaches and displays examples for most of them. It is more focused on performance and optimization techniques than design patterns, and it expects the reader to have previous knowledge of Javascript. I'll be keeping it around as a reference book.
“Singletons are classes which can be instantiated once, and can be accessed globally. This single instance can be shared throughout our application, which makes Singletons great for managing global state in an application.”
“With a Proxy object, we get more control over the interactions with certain objects. A proxy object can determine the behavior whenever we’re interacting with the object, for example when we’re getting a value, or setting a value.”
“JavaScript provides a built-in object called Reflect, which makes it easier for us to manipulate the target object when working with proxies.”
“Proxies are a powerful way to add control over the behavior of an object. A proxy can have various use-cases: it can help with validation, formatting, notifications, or debugging”
“Overusing the Proxy object or performing heavy operations on each handler method invocation can easily affect the performance of your application negatively. It’s best to not use proxies for performance-critical code.”
“Provider Pattern. Make data available to multiple child components”
“The prototype pattern is a useful way to share properties among many objects of the same type. The prototype is an object that’s native to JavaScript, and can be accessed by objects through the prototype chain.”
“when we try to access a property that’s not directly available on the object, JavaScript recursively walks down all the objects that __proto__ points to, until it finds the property!”
“The Object.create method lets us create a new object, to which we can explicitly pass the value of its prototype.”
“Object.create is a simple way to let objects directly inherit properties from other objects, by specifying the newly created object’s prototype. The new object can access the new properties by walking down the prototype chain.”
“With the observer pattern, we can subscribe certain objects, the observers, to another object, called the observable. Whenever an event occurs, the observable notifies all its observers”
It definitely gave me a compilation of blog posts vibe. The second half of the book was almost entirely about NextJS or SSR and performance. I wasn't really expecting a book on performance and optimization. I really want to be able to design great React apps and be able to make improvements to existing code; I did get some of that.
Great information on Hooks vs. Class components and HOCs, Context API, which gives me the 3 stars.
The second half of the book did not feel like it is applicable to me. My last project at work, I was making a React app that was not meant to be SEO-friendly. So what exactly was the point of reading all of that?
I was hoping for more about React architecture, and that's why this book is not very good imo. A good 2.5 or 3 stars.