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

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 89
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

The Fight For The Main Thread

Smashing Magazine

You know, have a plan for it and write code that’s mindful about adding extra weight to the page. But not everything about performance happens directly at the code level, right? I’d say many — if not most — sites and apps rely on some number of third-party scripts where we might not have any influence over the code.

Google 90
article thumbnail

Gone Floating Labels And Green Lighthouse Scores

Smashing Magazine

Also, if you have released an open-source tool and would love to draw more attention to it, please let us know as well and we’d love to have you presenting your project here in the magazine as well. Workflow & Code. Workflow, Code. Workflow, Code. Workflow, Code. Workflow, Code. Workflow, Code.

Mobile 140
article thumbnail

Next.js Wildcard Subdomains

Smashing Magazine

With 100s of real-life examples , guidelines and best practices that you can apply right away. In code, that looks like this: export async function getServerSideProps(context) { let wildcard = context.req.headers.host.split(".")[0]; The live version is available at [link] and the source code can be found at [link].

Servers 83
article thumbnail

It’s A (Front-End Testing) Trap! Six Common Testing Pitfalls And How To Solve Them

Smashing Magazine

Well, it’s simply an apt allegory when it comes to dealing with tests in a code base. These traps might feel like an unexpected ambush when you’re working on a code base, especially when doing so for a long time. They test units of code together, looking at their interaction. Integration tests have a broader scope.

Testing 120
article thumbnail

Signals For Customizing Website User Experience

Smashing Magazine

Approximately two-thirds of Indian mobile Chrome users of Smashing Magazine have this setting turned on, for example. For Smashing Magazine, that involved dropping some of our web fonts. And Is It Used? Again, I talked about this that previous article , and the answer is a resounding yes! Data Saver. Network Signals.

Website 103