Skip to content

Commit aee04a1

Browse files
committed
docs: add migration guide
1 parent 299511d commit aee04a1

File tree

3 files changed

+554
-137
lines changed

3 files changed

+554
-137
lines changed

README.md

Lines changed: 3 additions & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,7 @@
77

88
## Status: Beta
99

10-
The codebase has been completely refactored with TypeScript. Some major changes:
11-
12-
- Fully migrated to Vue 3
13-
- Extract `@vuepress/cli` from `vuepress` package
14-
- Extract `@vuepress/client` from `@vuepress/core` package
15-
- Extract `@vuepress/plugin-palette` from `@vuepress/core` package - stylus is no longer the default CSS pre-processor, and the way of styles customization should be determined by theme
16-
- Extract `@vuepress/bundler-webpack` from `@vuepress/core` package and migrate to webpack 5
17-
- Provide `@vuepress/bundler-vite` for [Vite](https://vitejs.dev/) support
18-
19-
The migration guide has not finished yet. For now you can check out the breaking changes list below as reference.
10+
For users from VuePress v1, please check out the [migration guide](https://vuepress2.netlify.app/guide/migration.html).
2011

2112
## Documentation
2213

@@ -26,128 +17,6 @@ https://vuepress2.netlify.app
2617

2718
See [Contributing Guide](https://github.com/vuepress/vuepress-next/blob/main/docs/contributing.md).
2819

29-
## Breaking Changes
30-
31-
Temporarily record some breaking changes here.
32-
33-
### Core
34-
35-
#### User config
36-
37-
- `shouldPrefetch` -> the default value is changed to `false`
38-
- `patterns` -> `pagePatterns`
39-
- `extraWatchFiles` -> removed, watch files manually in `onWatched` hook
40-
- `evergreen` -> the default value is changed to `true`
41-
- `markdown`
42-
- `markdown.lineNumbers` -> `markdown.code.lineNumbers`, and the default value is changed to `true`
43-
- `markdown.slugify` -> removed
44-
- `markdown.pageSuffix` -> removed
45-
- `markdown.externalLinks` -> `markdown.links.externalAttrs`
46-
- `markdown.toc` -> changed
47-
- `markdown.plugins` -> removed
48-
- `markdown.extendMarkdown` -> removed
49-
- `markdown.extractHeaders` -> changed
50-
- All webpack related configs are moved to `bundlerConfig` (with `@vuepress/bundler-webpack`)
51-
- `postcss` -> `bundlerConfig.postcss`
52-
- `stylus` -> `bundlerConfig.stylus`
53-
- `scss` -> `bundlerConfig.scss`
54-
- `sass` -> `bundlerConfig.sass`
55-
- `less` -> `bundlerConfig.less`
56-
- `chainWebpack` -> `bundlerConfig.chainWebpack`
57-
- `configureWebpack` -> `bundlerConfig.configureWebpack`
58-
59-
#### Conventional files and directories
60-
61-
- `.vuepress/enhanceApp.js` -> `.vuepress/clientAppEnhance.{js,ts}`
62-
- `.vuepress/components` -> will not auto register components, and you need to register your components manually in `.vuepress/clientAppEnhance.{js,ts}`
63-
64-
#### Permalink patterns
65-
66-
- `:i_month` -> removed
67-
- `:i_day` -> removed
68-
- `:minutes` -> removed (undocumented in 1.0)
69-
- `:seconds` -> removed (undocumented in 1.0)
70-
- `:regular` -> `:raw`
71-
72-
#### Stylus Palette system
73-
74-
The stylus palette system of VuePress v1 (i.e. `styles/palette.styl` and `styles/index.styl`) is extracted to `@vuepress/plugin-palette`.
75-
76-
Theme authors can use their own way for users to configure styles (not be limited with stylus).
77-
78-
#### Frontmatter
79-
80-
- `meta` -> `head`, which uses the same type with `siteConfig.head`
81-
82-
For example:
83-
84-
```yaml
85-
head:
86-
- - meta
87-
- name: foo
88-
content: bar
89-
- - link
90-
- rel: canonical
91-
href: foobar
92-
- - script
93-
- {}
94-
- console.log('hello from frontmatter');
95-
```
96-
97-
Has the same structure with:
98-
99-
```js
100-
// .vuepress/config.js
101-
module.exports = {
102-
// ...
103-
head: [
104-
['meta', { name: 'foo', content: 'bar' }],
105-
['link', { rel: 'canonical', href: 'foobar' }],
106-
['script', {}, `console.log('hello from frontmatter');`],
107-
],
108-
// ...
109-
}
110-
```
111-
112-
#### Plugin API
113-
114-
- `ready` -> `onPrepared`
115-
- `updated` -> `onWatched`
116-
- `generated` -> `onGenerated`
117-
- `additionalPages` -> removed, use `app.pages.push(createPage())` in `onInitialized` hook
118-
- `clientDynamicModules` -> removed, use `app.writeTemp()` in `onPrepared` hook
119-
- `enhanceAppFiles` -> `clientAppEnhanceFiles`
120-
- `globalUIComponents` -> `clientAppRootComponentFiles`
121-
- `clientRootMixin` -> `clientAppSetupFiles`
122-
- `extendMarkdown` -> `extendsMarkdown`
123-
- `chainMarkdown` -> removed
124-
- `extendPageData` -> `extendsPageData`
125-
- `extendsCli` -> removed
126-
- `configureWebpack` -> removed
127-
- `chainWebpack` -> removed
128-
- `beforeDevServer` -> removed
129-
- `afterDevServer` -> removed
130-
131-
#### Theme API
132-
133-
- `.vuepress/theme` -> won't be used as theme implicitly if the path exists, and set the path explicitly via `theme` option.
134-
135-
- `extend` -> `extends`
136-
137-
You can still inherit a parent theme with `extends: 'parent-theme'`, which will extends the plugins, layouts, etc.
138-
139-
However, the `@theme` and `@parent-theme` aliases are not available now.
140-
141-
### CLI
142-
143-
- `eject` command -> removed
144-
- `-c, --cache [cache]` -> `--cache <cache>` - the shorthand `-c` is not for `cache` option, and the value of `cache` option is not optional
145-
- `--no-cache` -> `--clean-cache`
146-
147-
### Default Theme
20+
## License
14821

149-
- `<CodeGroup />`, `<CodeBlock />` -> `<CodeGroup />`, `<CodeGroupItem />`
150-
- `<Badge />`
151-
- `$badgeErrorColor` -> `$badgeDangerColor`
152-
- `type` prop only accepts `tip`, `warning` and `danger`
153-
- Default theme config has changed a lot. Please refer to the documentation.
22+
[MIT](https://github.com/vuepress/vuepress-next/blob/main/LICENSE)

0 commit comments

Comments
 (0)