Skip to content
⚠️ This article was written in 2021. Some content may be outdated.

2022 Frontend Technology Outlook: React 18, Vue 3 Default, and the Vite Era

2021 was a year of accelerated restructuring across the frontend ecosystem: Vue 3 completed its ecosystem, Angular 12/13 finished the Ivy migration, and Vite went from an emerging tool to a mainstream choice. Standing at the end of 2021, let's predict what will happen in 2022.

React 18: Concurrent Rendering Is Here ​

React 18 released its Alpha in June 2021, and the stable version is expected in early 2022. The most important change is concurrent rendering — React can interrupt rendering to prioritize more urgent updates:

jsx
// React 18 新特性:useTransition
function SearchPage() {
  const [query, setQuery] = useState("");
  const [results, setResults] = useState([]);
  const [isPending, startTransition] = useTransition();

  const handleSearch = (e) => {
    const value = e.target.value;
    setQuery(value); // 立即更新输入框(高优先级)

    startTransition(() => {
      // 标记为低优先级,可被中断
      setResults(performHeavySearch(value));
    });
  };

  return (
    <>
      <input value={query} onChange={handleSearch} />
      {isPending ? <Spinner /> : <ResultList results={results} />}
    </>
  );
}

Other new React 18 APIs:

  • useDeferredValue: like startTransition, but for values rather than functions
  • useId: generates a stable unique ID (SSR-hydration safe)
  • Suspense list ordering (SuspenseList)
  • Streaming SSR (renderToPipeableStream)

Vue 3 Becomes the Default ​

In Q1 2022, Vue 3 will become the default version installed by npm install vue (today it's still Vue 2). This means:

bash
# 2022 年之后
npm install vue   # 安装 Vue 3(目前会安装 Vue 2)
npm install vue@2  # 明确指定 Vue 2

Vue 3's ecosystem filled in its last few missing pieces in 2021:

  • Pinia became the recommended state-management solution (replacing Vuex)
  • Vue Router 4 stabilized
  • Nuxt 3 Beta released (built on Vue 3 + Vite)

Vite Becomes the Go-To Build Tool ​

After Vite 2 shipped in 2021, adoption rose sharply. In 2022 it is expected to become the first choice for new projects:

javascript
// vite.config.ts
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import react from "@vitejs/plugin-react";

export default defineConfig({
  plugins: [vue()], // 或 react()
  build: {
    rollupOptions: {
      output: {
        // 自动代码分割
        manualChunks: {
          vendor: ["vue", "vue-router", "pinia"],
        },
      },
    },
  },
});

Vite vs Webpack cold-start comparison (medium project):

Webpack 5(with cache):~6s
Vite:~300ms

原因:Vite 开发模式不打包,直接利用浏览器原生 ESM

Rise of Meta-Frameworks ​

2022 will be the breakout year for meta-frameworks:

FrameworkBased onStatus (early 2022)
Next.js 12ReactProduction-stable, #1 market share
Nuxt 3Vue 3 + ViteRC stage
SvelteKitSvelteBeta
RemixReactOpen-sourced Nov 2021
AstroFramework-agnosticBeta

Remix deserves special attention — it rethinks how data loading works:

typescript
// Remix 的 loader 函数:在服务端运行,数据直接注入组件
export async function loader({ params }) {
  const post = await db.post.findUnique({ where: { id: params.id } });
  return json(post);
}

export default function Post() {
  const post = useLoaderData();  // 自动是服务端数据
  return <article>{post.content}</article>;
}

TypeScript Continues to Penetrate Deeper ​

TypeScript's downloads grew about 60% year over year in 2021; for 2022 we expect:

  • Vue 3's official docs to go fully TypeScript
  • the satisfies operator (TS 4.9 draft, for more precise type checking)
  • more frameworks to treat TypeScript as a first-class citizen

Summary ​

The main theme of frontend in 2022 is maturity — React 18's concurrent rendering, Vue 3's complete ecosystem, Vite becoming standard, and the divergence of meta-frameworks. The seeds planted in 2021 (Vite, SolidJS, Remix) will bear fruit in 2022. For frontend developers, the most worthwhile investments are: a deep understanding of concurrent rendering, familiarity with the Vite ecosystem, and taking TypeScript type design seriously. Here's to writing better code in 2022.

MIT Licensed