惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

F
Full Disclosure
WordPress大学
WordPress大学
小众软件
小众软件
Cloudbric
Cloudbric
AWS News Blog
AWS News Blog
腾讯CDC
量子位
人人都是产品经理
人人都是产品经理
大猫的无限游戏
大猫的无限游戏
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
Vulnerabilities – Threatpost
Scott Helme
Scott Helme
Hugging Face - Blog
Hugging Face - Blog
博客园_首页
C
CXSECURITY Database RSS Feed - CXSecurity.com
The Hacker News
The Hacker News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
IT之家
IT之家
Jina AI
Jina AI
Attack and Defense Labs
Attack and Defense Labs
S
SegmentFault 最新的问题
Simon Willison's Weblog
Simon Willison's Weblog
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
T
Tailwind CSS Blog
Last Week in AI
Last Week in AI
博客园 - 【当耐特】
Google Online Security Blog
Google Online Security Blog
美团技术团队
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Visual Studio Blog
罗磊的独立博客
L
LINUX DO - 最新话题
博客园 - Franky
博客园 - 叶小钗
Apple Machine Learning Research
Apple Machine Learning Research
The Last Watchdog
The Last Watchdog
J
Java Code Geeks
AI
AI
C
Cisco Blogs
酷 壳 – CoolShell
酷 壳 – CoolShell
C
Cyber Attacks, Cyber Crime and Cyber Security
Cisco Talos Blog
Cisco Talos Blog
博客园 - 三生石上(FineUI控件)
雷峰网
雷峰网
Help Net Security
Help Net Security
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
云风的 BLOG
云风的 BLOG
I
Intezer
S
Securelist

Luca Cavallin

AI Engineering for Developers | Blog AI Engineering for Developers Platform Engineering End-to-End | Blog Google Cloud Networking 101: The Comprehensive TLDR | Blog Google Cloud Networking 101: The Comprehensive TLDR Containers Are Not Automatically Secure | Blog Containers Are Not Automatically Secure Watery Stone Beacon | Photography Blue Iceman Suture | Photography Hidden Emerald Pool | Photography Autumn Chapel Pinnacles | Photography A Tour of eBPF in the Linux Kernel: Observability, Security and Networking | Blog A Tour of eBPF in the Linux Kernel: Observability, Security and Networking Shared Violet Pulse | Photography Kubernetes Networking from Packets to Pods | Blog An Overview of Network Protocols | Blog An Overview of Network Protocols A Quick Journey Into the Linux Kernel | Blog A Quick Journey Into the Linux Kernel OpenTelemetry: A Guide to Observability with Go | Blog I'm on the Cillers Podcast Talking About Tech and Hackathons | Blog Yet Another List of Random Opinions on Writing Readable Code and Other Rants | Blog My post about Istio is now on the Istio blog too! | Blog Tropical Jungle Escape | Photography The Istio Service Mesh for People Who Have Stuff to Do | Blog Dreamy Cartoonscape Windmill | Photography Twilight Windmill Reflections | Photography Notes I took while reading "Applied Machine Learning and AI for Engineers" and "Introducing MLOps" | Blog Things I've Learned About Terraform That I Keep Telling People About | Blog Analyzing Unsplash Photo Performance with Python | Blog Analyzing Unsplash Photo Performance with Python I am a Top Mentor on MentorCruise! 🎉 | Blog CI/CD Observability on GitHub Actions and the Role of OpenTelemetry | Blog CI/CD Observability on GitHub Actions and the Role of OpenTelemetry Silent Water Sentinel | Photography Three Early Crosses | Photography Fiery Twilight Trails | Photography Forested Folds Flowing | Photography Majestic Snowbound Spire | Photography Shrouded Winter Peaks | Photography Space Cat Pillar | Photography I am a CNCF (Cloud Native Computing Foundation) Ambassador! | Blog Curved Valley Mist | Photography Highly Independent Tree | Photography Misty Morning Plateau | Photography Sick Shadows Fading | Photography Half Moon Blossom | Photography Serene Pedestal Swinging | Photography Sunset Clouds Reeling | Photography Aerial Nose Parking | Photography How to Structure C Projects: These Best Practices Worked for Me | Blog How to Structure C Projects: These Best Practices Worked for Me I'm on the KubeFM Podcast Talking About "Linux Containers From Scratch" | Blog I am (again) a Google Developers Expert! | Blog How to Configure OIDC with Terraform for GitHub Enterprise Server | Blog How to Configure OIDC with Terraform for GitHub Enterprise Server Modern Frontend Development: A Tooling Overview for Engineers Revisiting the Field | Blog Meet verto.sh: Your Gateway to Open-Source Collaboration. | Blog Crafting a Clean, Maintainable, and Understandable Makefile for a C Project. | Blog Crafting a Clean, Maintainable, and Understandable Makefile for a C Project. barco: Linux Containers From Scratch in C. | Blog barco: Linux Containers From Scratch in C. How to Create a Release With Multiple Artifacts From a GitHub Actions Workflow Using the Matrix Strategy | Blog How to Create a Release With Multiple Artifacts From a GitHub Actions Workflow Using the Matrix Strategy How Databases Store and Retrieve Data with B-Trees | Blog How Databases Store and Retrieve Data with B-Trees Concurrency in Go: Goroutines, Channels, Mutexes, and More | Blog Concurrency in Go: Goroutines, Channels, Mutexes, and More Club Cloud 2021: Cloud Engineering Panel Discussion | Blog Club Cloud 2021: Cloud Engineering Panel Discussion | Blog How to Prepare for the Google Cloud Engineer Associate Certification Exam | Blog How to Prepare for the Google Cloud Engineer Associate Certification Exam | Blog What is Google Cloud Deploy? | Blog What is GitOps? | Blog Club Cloud Stories #2 - News from Around the Cloud | Blog Club Cloud Stories #2 - News from Around the Cloud | Blog Club Cloud Stories #1 - The First Episode with Antoni Tzavelas & Mark van Holsteijn | Blog Club Cloud Stories #1 - The First Episode with Antoni Tzavelas & Mark van Holsteijn | Blog Quiet Oak Shining | Photography How to Read Firestore Events with Cloud Functions and Golang | Blog How to Read Firestore Events with Cloud Functions and Golang | Blog Google Cloud Pub/Sub vs NATS: An Easy-to-Understand Comparison | Blog Google Cloud Pub/Sub vs NATS: An Easy-to-Understand Comparison | Blog How to Deploy a Multi-cluster Service Mesh on GKE with Anthos | Blog How to Deploy a Multi-cluster Service Mesh on GKE with Anthos | Blog How to Safely Store Secrets in Terraform Using Cloud KMS | Blog How to Safely Store Secrets in Terraform Using Cloud KMS | Blog Designing Serverless Applications on AWS - Jacco Kulman and Luca Cavallin @ End2End LIVE | Blog Designing Serverless Applications on AWS - Jacco Kulman and Luca Cavallin @ End2End LIVE | Blog How to Use Terraform Workspaces to Manage Environment-based Configuration | Blog Puffy Steel Spreading | Photography How to Deploy ElasticSearch on GKE using Terraform and Helm | Blog How to Deploy ElasticSearch on GKE using Terraform and Helm | Blog Summer Windmills Spinning | Photography How to Optimize PHP Performance on Google Cloud Run | Blog How to Optimize PHP Performance on Google Cloud Run | Blog Foggy Boats Rusting | Photography How I Prepared for the Google Cloud Associate Cloud Engineer Exam | Blog How I Prepared for the Google Cloud Associate Cloud Engineer Exam | Blog Winter Kids Chasing | Photography
Modern Frontend Development: A Tooling Overview for Engineers Revisiting the Field
Luca Cavallin · 2023-11-25 · via Luca Cavallin

In the world of frontend development, several of tools and frameworks are available to build efficient, scalable, and interactive web applications. If you've been away from frontend development for a while, you might find the current landscape quite different from what you remember. This blog post will guide you through some of the most popular and effective technologies in modern frontend development, offering insights into their functionalities, advantages, and drawbacks. Additionally, I will include brief code examples to give you a taste of how these tools are used in practice.

The tools I included are the ones I decided to use (after a long investigation) for verto.sh, a web application I built to help developers find a new open-source project to contribute to. I hope this post will help you get up to speed with the latest frontend technologies - as someone who has been away from frontend development for a while, I know how overwhelming it can be to catch up with the latest trends.

Next.js

Next.js is a React-based framework that has gained popularity for its server-side rendering capabilities and efficient static site generation. One of its major strengths is the ease of creating SEO-friendly web pages that load quickly and improve user experience.

Pros:

  • Offers improved SEO and fast rendering.
  • Features like automatic code splitting make it efficient for complex applications.

Cons:

  • The larger bundle size may not be ideal for very simple projects.

Example: Creating a simple Next.js page:

javascript

import React from 'react';
 
export default function HomePage() {
  return <div>Welcome to my Next.js app!</div>;
}

React

React, developed by Facebook, remains a cornerstone in building interactive user interfaces. Its component-based architecture allows for reusable UI components, making it a favorite among developers for both its efficiency and flexibility.

Pros:

  • A large community and a rich ecosystem of libraries and tools.
  • Reusable components enhance development speed and maintainability.

Cons:

  • JSX can be a learning curve for newcomers.

Example: A simple React component:

javascript

import React, { useState } from 'react';
 
function Counter() {
  const [count, setCount] = useState(0);
 
  return (
    <div>
      <p>You clicked {count} times</p>
      <button onClick={() => setCount(count + 1)}>
        Click me
      </button>
    </div>
  );
}

Tailwind CSS

Tailwind CSS is a utility-first CSS framework that encourages a different approach to styling web applications. Instead of writing custom CSS, developers can use predefined classes directly in their HTML.

Pros:

  • Highly customizable and perfect for responsive design.
  • Can lead to smaller CSS file sizes.

Cons:

  • The utility-first approach can be unconventional for those used to traditional CSS.

Example: Styling with Tailwind CSS:

html

<button class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded-sm">
  Button
</button>

Framer Motion

Framer Motion is a library designed to add easy-to-implement animations to React applications. It offers a wide range of animation and gesture features, which can greatly enhance the user experience of your application.

Pros:

  • Simplifies the process of adding complex animations.
  • Provides powerful features like gesture animations.

Cons:

  • It might be excessive for simple projects or transitions.

Example: Animating a component with Framer Motion:

javascript

import { motion } from 'framer-motion';
 
export default function MyComponent() {
  return <motion.div animate={{ scale: 2 }}>Hello World</motion.div>;
}

TypeScript

TypeScript extends JavaScript by adding static types. Developed and maintained by Microsoft, it's been widely adopted for its ability to improve the maintainability and scalability of large codebases.

Pros:

  • Enhances code quality and readability.
  • Early detection of bugs and errors.

Cons:

  • Has a learning curve, especially for developers not familiar with static typing.

Example: Defining a TypeScript interface:

typescript

interface User {
  name: string;
  age: number;
}
 
const user: User = {
  name: 'Alice',
  age: 25,
};

GraphQL

GraphQL is a powerful query language for your API, offering a more efficient, powerful, and flexible alternative to REST.

Pros:

  • It allows clients to request exactly the data they need, reducing over-fetching.
  • Strong type system which can help validate queries.

Cons:

  • The initial learning curve and setup can be more complex than traditional REST APIs.

Example: A simple GraphQL query:

graphql

{
  user(id: "1") {
    name
    email
  }
}

In this example, the client specifies exactly what information is needed, which can greatly optimize data transfer, especially in applications with complex data requirements.

Jest

Jest is a delightful JavaScript testing framework, known for its simplicity and integration with React and other modern JavaScript frameworks.

Pros:

  • Minimal configuration is required to get started.
  • Offers a robust set of features like snapshot testing and test coverage.

Cons:

  • Advanced mocking and testing scenarios might require additional setup.

Example: Writing a simple test with Jest:

javascript

test('adds 1 + 2 to equal 3', () => {
  expect(1 + 2).toBe(3);
});

This example demonstrates a basic Jest test, validating that our arithmetic operation performs as expected. Jest makes it straightforward to write and manage tests, ensuring your codebase remains reliable and bug-free.

Cypress

Cypress is a next-generation front-end testing tool built for the modern web. It's a more developer-friendly tool for writing end-to-end tests.

Pros:

  • Tests are run in a real browser, providing more accurate results.
  • Offers a rich, interactive test runner that makes debugging easier.

Cons:

  • Can be slower for large test suites and is more resource-intensive.

Example: Basic Cypress test for a login page:

javascript

describe('Login Test', () => {
  it('successfully logs in', () => {
    cy.visit('/login');
    cy.get('input[name=username]').type('user');
    cy.get('input[name=password]').type('password');
    cy.get('form').submit();
    cy.url().should('include', '/dashboard');
  });
});

In this example, Cypress is used to simulate a user logging into a web application, demonstrating its power in creating realistic, user-like interactions for testing your applications thoroughly.

Prettier & ESLint

In the less-than-straightforward world of frontend development, it's super important to keep your code clean and consistent. That's where Prettier and ESLint come in. Think of Prettier as your personal stylist for code, tidying up your code's look so you can focus on the nuts and bolts of functionality. Then there's ESLint – it's like having a wise mentor who points out mistakes and keeps you on the right path, ensuring your JavaScript and JSX are top-notch. When you blend Prettier and ESLint in your toolkit, it's like having a dynamic duo that keeps your code looking good and working great, saving you heaps of time in code reviews and debugging. They're pretty much lifesavers in the frontend dev world!

Summary

On our tour of modern frontend development, we've discovered a cool mix of tools that make building awesome web apps a breeze. React and Next.js are the backbone, giving life to our user interfaces. Tailwind CSS and Framer Motion spice things up with style and animations. TypeScript keeps everything tight and tidy, while GraphQL is a great choice for modern data fetching. For testing, Jest and Cypress are our go-to for making sure everything works like a charm. Prettier and ESLint help keep our code looking sharp. Together, these tools are your ticket to top-notch, state-of-the-art web development in 2023.