article thumbnail

A New Pattern For The Jamstack: Segmented Rendering

Smashing Magazine

You are now “Head of Performance” at Repairing Magazine, the most serious competitor to Smashing Magazine. Repairing Magazine has a very peculiar business model. Repairing Magazine user interface relies on a modern JavaScript library, React. Let’s focus on a scenario very useful for blog owners: handling paid content.

Cache 113
article thumbnail

Improving JavaScript Bundle Performance With Code-Splitting

Smashing Magazine

Improving JavaScript Bundle Performance With Code-Splitting. Improving JavaScript Bundle Performance With Code-Splitting. It’s a common misconception that the code which is produced by the framework build tools (Webpack, for example) is fully optimized and cannot be improved upon any further. The answer lies in code-splitting.

Code 88
Insiders

Sign Up for our Newsletter

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Trending Sources

article thumbnail

Understanding Weak Reference In JavaScript

Smashing Magazine

The output of the code above would be the following: WeakMap {{…} => 'done'} man = null; console.log(human). The object is retained in memory and can be accessed with the following code: console.log(human[0]). let human = new WeakMap(): // Create an object, and assign it to a variable called man. It keeps the object in memory.

Cache 115
article thumbnail

React Children And Iteration Methods

Smashing Magazine

In this article, we’ll look at a React utility React.Children.toArray which lets us prepare the children prop for inspection and iteration, some of its shortcomings and how to overcome them — through a small open-source package, to keep our React code function the way it is deterministically supposed to behave, keeping performance intact.

article thumbnail

Cookieless Alternative To Embed HTML, CSS And JS Code Snippets

Smashing Magazine

Cookieless Alternative To Embed HTML, CSS And JS Code Snippets. Cookieless Alternative To Embed HTML, CSS And JS Code Snippets. At the same time, we want to have an interactive website with comments, polls, videos, code examples, and many more. Deploy the code example with your favorite hosting provider (e.g. Get Started.

Code 109
article thumbnail

A New Way To Reduce Font Loading Impact: CSS Font Descriptors

Smashing Magazine

Smashing Magazine, like most publishers, makes use of web fonts and the below screenshot shows the difference between the initial render (with the fallback fonts), and the final render (with the web fonts): Smashing Magazine article with fallback font and with full web fonts. Large preview ). Large preview ).

article thumbnail

Creating A Magento PWA: Customizing Themes vs. Coding From Scratch

Smashing Magazine

Creating A Magento PWA: Customizing Themes vs. Coding From Scratch. Creating A Magento PWA: Customizing Themes vs. Coding From Scratch. One of the reasons for that is because a PWA has the same code base. So unlike the case with native applications, the progressive web app needs to be coded only once. Alex Husar.

Code 73