V2 Highlights

About 2 min

We strongly recommend you to switch to V2 version, as V2 version provides the following improvements.

Overview

V2 is powered by VuePress2, using Vite2 / Webpack5 and Vue3.

V2 is a full rewrite including:

  • All the components are rewritten with Composition API in Vue3
  • All the styles are migrated to Sass

Also V2 has a better performance:🚀

  • DevServer cold start time reduced by 50%
  • Build memory usage reduced by 65%
  • Build time reduced by 30%
  • Output Size reduced by 25%
  • Webpage performance up to 70%

Vue3 Changes

Vue 3 uses proxy to provide reactivity and support the brandly new composition api. THe proxy-based reactivity is a lot faster than the old-style reactivity based on setter/getter.

Also, composition api is treeshaking friendly.

VuePress2 Changes

VuePress v2 is developed with TypeScript, so it provides better TS support now.

VuePress@v2 also decouple bundler with core. VuePress v2 add supports both Webpack and Vite as bundler. Now Vite is the default bundler, while you can still choose use Webpack. You can even use Vite in dev mode to get better development experience, and use Webpack in build mode to get better browser compatibility.

VuePress@v2 is a lot more flexible than VuePress@v1, it removes siteData and siteData.pages, which greatly increase scalability (specially on large sites with lots of pages). It has a higher score on lighthouse comparing with V1 with less loaded time and higher performance.

VuePress Theme Hope Changes

VuePressThemeHope@v2 is rewriteen with composition API and it's style system is migrated from stylus to sass.

By rewriting theme and plugins with composition api, almost feature you disabled can be removed by treeshaking when bundling, so that you can get a smaller size easily.

Also, we are adding new features to VuePressThemeHope@v2.

Features

Blog

Comment

Valine and Vssue are not longer supported.

Instead, we add Giscus and Twikoo support besides Waline.

Encrypt

  • Now encrypt feature is treeshaking friendly, and encrypt checking is only done when necesary.

  • Password in frontmatter is removed

Feed

  • Feed is no longer generated by default

  • Support getter option for you to fully customize feed generation.

PhotoSwipe

We now use PhotoSwipe@v5, which is smaller in size.

PWA

  • Support update control

  • Support base appending for manifest

SEO

  • Add canoical link supopport
  • Add JSON-LD support
  • Support injecting any head tags in V2 now.

Layout

Pure Mode

The theme now supports pure mode with less fancy styles.

Code Block Theme

Now you can set different themes for code blocks in darkmode and lightmode.

Homepage

  • Features now can have icons

Page

  • Appearance update

  • TOC rebuild, now TOC automatically scrolls to the active heading

  • Support Badge, CodePen, FontIcon and PDF components

  • Outlook updated

  • They now shares same config options

  • New activeMatch option controlling whether the item should be actived.

  • New "structure" keyword support to generate Sidebar from file structure

  • Sidebar now automatically opens and scrolls to the activated item.

Markdown

The following new features are added:

Loading...