Smashing Newsletter #292: JavaScript, Bundlers, Frameworks

With vanilla JavaScript snippets, bundlers, on migrating JavaScript to TypeScript, and how to choose a JavaScript framework. Issue #292 Tue, March 16, 2021 View in the browser 

Smashing Newsletter

G’day Friends,

If you are writing JavaScript every day, perhaps you’ll find a couple of useful JavaScript gems in this newsletter issue. We’ve collected some useful resources for you to keep close — whether you are new to JavaScript, or found your way through the trenches of legacy code over the decades.

Not many things are always right or wrong in the JavaScript universe. What’s the right bundler for your project? What’s the right JavaScript framework (if you need one)? Where do you start when migrating to TypeScript? Plus, nobody has ever complained about reliable JavaScript-one-liners for tedious regular tasks. So, let’s dive in!

Ah, and just before we head there, perhaps take a look at our upcoming React Performance Masterclass, along with a few other friendly online workshops on front-end & UX on everything from web performance to design systems. Or perhaps kindly forward it to your friends — we’d sincerely appreciate it.

Happy JavaScripting!
— Vitaly (@smashingmag)


1. What’s The Right Bundling Tool?

Most of us use one or the other bundler for our assets, but is it fast and flexible enough? Does it support features that other bundlers can do? And does it actually matter? Well, it might. Tooling.Report runs a suite of build tool tests — configuration files created to specifically handle a feature — and evaluates how well bundlers deal with these particular issues. The configuration files are tested in Browserify, Parcel, Rollup and Webpack.

What’s The Right JavaScript Bundle?

But perhaps even more useful is a comparison table of all bundlers, highlighting whether some of the features that you might be looking for are actually available in the bundlers. You can dive into code-splitting features, hashing, importing modules, transformations, output module formats and how non-JavaScript resources are managed. A fantastic little reference tool that’s worth keeping nearby. And it would be fantastic to see new bundlers such as Snowpack and Vite joining the report as well. (vf)


2. Picking The Right JavaScript Framework

Just like with bundlers, there are plenty of options when choosing a new framework. But do you need one? And if so, how do you pick the right one? Sacha Greif’s 12-Points-Checklist highlights 12 things to keep in mind when evaluating any new JavaScript library. Most notably, features, performance, learning curve, compatibility and track record.

Picking The Right JavaScript Framework

Perf-Track tracks framework performance at scale. It basically tracks the performance in terms of Core Web Vitals for Angular, React, Vue, Polymer, Preact, Ember, Svelte and AMP — on mobile and on desktop. The data set is currently still from 2020, but it gives us some insights into how well sites with these frameworks perform in the wild. For example, React with Gatsby perform better than the ones created with Create React app.

Tim Kadlec also conducted some research around that, comparing jQuery, Vue.js, Angular and React. The end result: the current crop of frameworks isn’t doing enough to prioritize less powerful devices and help to close the gap between desktop and mobile. These figures might give you at least some context to make a more informed decision. (vf)


From our sponsor

Do More For Clients. Expand Time With GoDaddy Pro, Free

Do More For Clients. Expand Time With GoDaddy Pro, Free
Boost efficiency and grow your business with GoDaddy Pro, a free set of site, client and project management tools. Manage and monitor all your clients’ sites from a single place, no matter where they’re hosted.


3. this vs. that

The deep knowledge of a subject really lies in understanding subtle differences between alternate ways of solving the same problem. How is nodeName different from tagName? How are the two increment operators different, e.g. ++value and value++? this vs. that is a friendly reference site for sorting out just this kind of questions.

this vs. that

The growing little repository by Phuoc Nguyen explains differences between properties and functions for JavaScript and TypeScript, as well as DOM, HTML and CSS. Also, Phuoc has released Single-Line-Of-Code, a repository of JavaScript utilities for everything around arrays, date and time, DOM manipulations, functions, numbers and objects. And if you need more snippets of vanilla JavaScript, we’ve got your back, too. (vf)


4. Upcoming Front-End & UX Workshops

JavaScript is awesome, and we can get better at it by learning together! So as it happens, we have a React Performance Masterclass with Ivan Akulov as well as a Dynamic CSS Masterclass workshop with Lea Verou coming up in a few weeks.

Smashing Online Events

Our workshops are packed with practical examples, video recordings and friendly Q&A sessions. Each and every workshop has been a truly smashing experience with wonderful folks from all over the world. There are still some early-birds left, with a lil’ friendly discount. Perhaps you’d like to join us and recommend to others — just sayin’! ;-)


5. JavaScript Operator Lookup

Let’s be honest, it can be hard to wrap one’s head around JavaScript operators, especially if you still have issues remembering which one does what exactly and need to make sense of all those ampersands, dashes, equal signs, and other glyphs that cross your way in JavaScript code. Josh W. Comeau built a little tool that helps you make sense of them all — for good.

Operator Lookup

The Operator Lookup lets you enter a JavaScript operator or pick one of the 50 provided operators to learn more about it. For every operator, Josh gives a brief explanation of what it does and shows how it is used in a code example. A friendly tool that makes operators feel a lot less daunting. (cm)


From our sponsor

Managing Apple Devices At Your Business Is Easier Than Ever

ad-jamf.png
Jamf Now is a one-stop, ultra-secure, couldn't-be-easier way to manage your team's Apple devices from one central platform that makes management tasks simple and affordable, so businesses can support their users; no IT experience required. Create your free account today!2030.gif?opens=1


6. Strategies For Migrating To TypeScript

Have you ever played with the thought of migrating your code base from JavaScript to TypeScript? If you rely on unreliable JavaScript libraries, have a large number of contributors, or a code base that has become difficult to maintain, the switch might be well worth it. But where to begin?

Strategies for migrating to TypeScript

Stephen Harfield has published a simple 10-mins read for migrating to TypeScript, a strategy to smoothly and efficiently migrate over to Typescript, including how to deal with styled components and how to move from JSX to TSX.

Axel Rauschmayer summarized three strategies for migrating to TypeScript. The first supports a mix of JavaScript and TypeScript files for your code base, so that you can switch more and more files to TypeScript bit by bit. Alternatively, you can continue to use plain JavaScript but you add type information via JSDoc comments until everything is fully typed.

Finally, for large projects, when migration may produce too many errors, snapshot-testing the TypeScript errors may be an option. A great overview to help find the strategy that best matches your project’s needs. (cm)


7. The JavaScript Developer’s Reading List

From books to videos to blog posts, the number of learning materials for web developers is huge, and while this variety is a great thing, it can also make it hard to decide which resources are actually worth your time. The JavaScript Developer’s Reading List makes your decision at least a bit easier.

The JavaScript Developer's Reading List

The reading list features hand-picked books and articles for JavaScript developers, broken down by technology/stack or concept. React and GraphQL are covered, Node.js, and Vue.js, just like design patterns in JavaScript, core concepts, software architecture, data structure, algorithms, and even soft skills. If you know of a resource that you feel is missing, you are welcome to contribute it to the list. Handy! (cm)


From our sponsor

Build In-Demand Skills In Northwestern’s Online MS In Information Design And Strategy

Work at the Intersection of Data, Design and Technology. Earn your master’s degree online at Northwestern Information Design and Strategy.
Earn your master’s degree online.


8. New On Smashing Job Board


9. Our Current Most Popular Articles


That’s All, Folks!

Wow, you’ve made it this far! We hope you’ve found at least one useful, practical tidbit that will help you get better at what you do. As you see, there are so many talented folks out there working on so many brilliant projects, and we’d sincerely appreciate it if you could help spread the word and give them all the credit they deserve!

Thank you so much for reading and for your support in helping us keep the web dev and design community strong with our newsletter. See you next time!


This newsletter issue was written and edited by Cosima Mielke (cm), Vitaly Friedman (vf) and Iris Lješnjanin (il).


Sent to truly smashing readers via Mailchimp.
We sincerely appreciate your kind support. You
rock.

Follow us on Twitter Join us on Facebook

unsubscribe update preferences view in your browser


Older messages

New Live Workshops On Front-End & Design

Thursday, March 4, 2021

Live workshops on web performance, design systems, CSS with Lea Verou, Harry Roberts, Stephanie Eckles and Dan Mall. From front-end to design, to help your boost your skills online. Live workshops on

Smashing Newsletter #290: Email Productivity and Meetings

Tuesday, March 2, 2021

From email productivity to better code reviews, consistent color schemes and better scheduling. Issue #290 • Tue, March 2, 2021 • View in the browser Smashing Newsletter Ahoy Dear Friends, We all want

Smashing Newsletter #289: Front-End Accessibility

Tuesday, February 23, 2021

With accessible modals, tabs, autocomplete, icons, keyboard navigation and user preferences. Issue #289 • Tue, Feb. 23, 2021 • View in the browser 💨 Smashing Newsletter Howdy, Building accessible pages

Smashing Newsletter #288: Useful Little CSS/JS Helpers

Tuesday, February 16, 2021

With VS Code Settings sync, responsive debugging and blurred image placeholders. Don't forget to share your thanks and appreciation, dear folks! Issue #288 • Tue, Feb. 16, 2021 • View in the

Smashing Newsletter #287: Interface Design Edition

Tuesday, February 9, 2021

With useful Figma and Sketch Plugins, interface design tools, web typography helpers and generative doodles. Issue #287 • Tue, Feb. 9, 2021 • View in the browser 💨 Smashing Newsletter Meow, There were

You Might Also Like

9 Trends From Milan We Can’t Stop Thinking About

Thursday, April 25, 2024

View in your browser | Update your preferences ADPro Even More From Milan Design Week Each year, the design world convenes in Milan—and that applies to us at AD, too. For the third year running, our

Subframe, Attributes vs Properties, Front End Handbook, aspect-ratio, GenAI

Thursday, April 25, 2024

The 5 best design links, every day. Curated by a selection of great editors. Email not displaying properly? View browser version. Sidebar April 25 2024 Subframe subframe.com Subframe is a design-to-

Ritmo, Climate Change, Icons & Typefaces, Click Wheel JS, CarPlay

Wednesday, April 24, 2024

The 5 best design links, every day. Curated by a selection of great editors. Email not displaying properly? View browser version. Sidebar April 24 2024 Meet Ritmo, Musixmatch's cross-platform

Why Jake Arnold Doesn’t Text Clients

Tuesday, April 23, 2024

View in your browser | Update your preferences We've had a remodel! From now on, you'll be hearing from AD PRO in your inbox twice a week—once with a deep dive into trends to watch and subjects

The secret ingredient to media success

Tuesday, April 23, 2024

PR tips from our founder Nora Wolf In this month's edition is all about *the most important* element of successful media outreach—photography. You may have some photos, but if the backgrounds are

#453: Design Systems

Tuesday, April 23, 2024

Design system generator, types of design systems and how to consolidate design systems. Issue #453 • Apr 23, 2024 • View in the browser Smashing Newsletter Buổi tối vui vẻ Smashing Friends, Ah, design

👨‍🏫 Striking Educational Website Designs + 🏆 Challenge Updates

Tuesday, April 23, 2024

Your UpLabs Design Updates Await! Let's Get Going! 🎨 Firstly, let's congratulate Mariana Gameiro, the winner of our latest 👩‍💻 SheCodes Website Redesign Challenge! Congratulations!! Secondly,

Code Connect, JS Naked Day, Shape of AI, Product Design, CSS Grid Level 3

Tuesday, April 23, 2024

The 5 best design links, every day. Curated by a selection of great editors. Email not displaying properly? View browser version. Sidebar April 23 2024 The Right Code for Your Design System figma.com

Accessibility Weekly #393: When Security and Accessibility Clash

Monday, April 22, 2024

April 22, 2024 • Issue #393 View this issue online or browse the full issue archive. Featured: When security and accessibility clash: Why are banking applications so inaccessible? "While using

Bézier Curves, CSS Motion Extraction, CSS Testing, CSS Theming, Women Who Code

Monday, April 22, 2024

The 5 best design links, every day. Curated by a selection of great editors. Email not displaying properly? View browser version. Sidebar April 22 2024 Flattening Bézier Curves and Arcs minus-ze.ro