349 Commits

Author SHA1 Message Date
42094e3571 chore(deps): update dependency @primeuix/themes to ^1.0.3
Some checks are pending
renovate/stability-days Updates have not met minimum release age requirement
/ build-and-deploy-to-vercel (push) Successful in 3m18s
/ surge (push) Successful in 2m53s
/ playwright (push) Successful in 1m25s
/ lint-build-and-check (push) Successful in 4m48s
2025-04-16 21:46:04 +08:00
5766bb828e chore: update satellite.js to version 6.0.0 and improve position validation in calculations
All checks were successful
/ build-and-deploy-to-vercel (push) Successful in 2m54s
/ lint-build-and-check (push) Successful in 4m37s
/ surge (push) Successful in 2m48s
/ playwright (push) Successful in 1m15s
2025-04-15 17:02:52 +08:00
22e5c31f58 SortableJS.page.vue
All checks were successful
/ build-and-deploy-to-vercel (push) Successful in 6m3s
/ lint-build-and-check (push) Successful in 7m10s
/ surge (push) Successful in 5m27s
/ playwright (push) Successful in 4m17s
2025-04-15 14:17:43 +08:00
b43b076b9d chore(deps): update lint dependencies to ^0.16.6
Some checks failed
/ build-and-deploy-to-vercel (push) Successful in 2m53s
/ surge (push) Successful in 2m56s
/ playwright (push) Failing after 2m12s
/ lint-build-and-check (push) Successful in 5m27s
2025-04-14 21:49:05 +08:00
d47c02f743 chore(deps): update dependency vite to ^6.2.6
Some checks failed
/ build-and-deploy-to-vercel (push) Successful in 2m55s
/ lint-build-and-check (push) Has been cancelled
/ playwright (push) Has been cancelled
/ surge (push) Has been cancelled
2025-04-14 21:46:01 +08:00
391e4fcb85 chore(deps): update dependency unplugin-vue-components to ^28.5.0
Some checks failed
/ playwright (push) Has been cancelled
/ lint-build-and-check (push) Has been cancelled
/ build-and-deploy-to-vercel (push) Has been cancelled
/ surge (push) Has been cancelled
2025-04-14 21:45:25 +08:00
1a4a169222 chore(deps): update dependency vite-plugin-static-copy to ^2.3.1
All checks were successful
/ build-and-deploy-to-vercel (push) Successful in 3m29s
/ surge (push) Successful in 2m56s
/ playwright (push) Successful in 1m6s
/ lint-build-and-check (push) Successful in 4m47s
2025-04-09 20:18:16 +08:00
2cec135a8f chore(deps): update all non-major dependencies
Some checks failed
renovate/stability-days Updates have not met minimum release age requirement
/ playwright (push) Has been cancelled
/ surge (push) Has been cancelled
/ build-and-deploy-to-vercel (push) Has been cancelled
/ lint-build-and-check (push) Has been cancelled
2025-04-09 19:14:37 +08:00
1a7831c003 升级依赖
Some checks failed
/ build-and-deploy-to-vercel (push) Successful in 2m55s
/ lint-build-and-check (push) Successful in 4m56s
/ surge (push) Successful in 2m59s
/ playwright (push) Failing after 2m45s
2025-04-08 15:48:43 +08:00
371b7a71c9 星座图
Some checks failed
/ lint-build-and-check (push) Failing after 2m57s
/ build-and-deploy-to-vercel (push) Failing after 3m0s
/ surge (push) Successful in 2m39s
/ playwright (push) Successful in 1m2s
2025-04-07 16:56:04 +08:00
c06cc44cbd vite optimizeDeps
All checks were successful
/ build-and-deploy-to-vercel (push) Successful in 2m49s
/ playwright (push) Successful in 1m13s
/ surge (push) Successful in 2m49s
/ lint-build-and-check (push) Successful in 4m44s
2025-04-07 10:42:44 +08:00
9e8affc52d chore: 更新项目配置并添加 p5.js 粒子演示
All checks were successful
/ build-and-deploy-to-vercel (push) Successful in 3m27s
/ surge (push) Successful in 2m54s
/ playwright (push) Successful in 1m3s
/ lint-build-and-check (push) Successful in 4m51s
2025-04-06 21:38:06 +08:00
3cad491aac Merge remote-tracking branch 'origin/main'
All checks were successful
/ build-and-deploy-to-vercel (push) Successful in 2m30s
/ playwright (push) Successful in 53s
/ surge (push) Successful in 2m37s
/ lint-build-and-check (push) Successful in 4m39s
2025-04-06 03:03:17 +08:00
f77b63cb8c chore: 移除 @unocss/preset-rem-to-px 依赖 2025-04-06 03:03:07 +08:00
a42282212e chore(deps): update lint dependencies to ^0.16.4 (patch) (#175) [no ci]
This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [eslint-plugin-oxlint](https://github.com/oxc-project/eslint-plugin-oxlint) | [`^0.16.3` -> `^0.16.4`](https://renovatebot.com/diffs/npm/eslint-plugin-oxlint/0.16.3/0.16.4) | [![age](https://developer.mend.io/api/mc/badges/age/npm/eslint-plugin-oxlint/0.16.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/eslint-plugin-oxlint/0.16.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/eslint-plugin-oxlint/0.16.3/0.16.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/eslint-plugin-oxlint/0.16.3/0.16.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) |
| [oxlint](https://oxc.rs) ([source](https://github.com/oxc-project/oxc/tree/HEAD/npm/oxlint)) | [`^0.16.3` -> `^0.16.4`](https://renovatebot.com/diffs/npm/oxlint/0.16.3/0.16.4) | [![age](https://developer.mend.io/api/mc/badges/age/npm/oxlint/0.16.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/oxlint/0.16.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/oxlint/0.16.3/0.16.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/oxlint/0.16.3/0.16.4?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>oxc-project/eslint-plugin-oxlint (eslint-plugin-oxlint)</summary>

### [`v0.16.4`](https://github.com/oxc-project/eslint-plugin-oxlint/releases/tag/v0.16.4)

[Compare Source](https://github.com/oxc-project/eslint-plugin-oxlint/compare/v0.16.3...v0.16.4)

*No significant changes*

#####     [View changes on GitHub](https://github.com/oxc-project/eslint-plugin-oxlint/compare/v0.16.3...v0.16.4)

</details>

<details>
<summary>oxc-project/oxc (oxlint)</summary>

### [`v0.16.4`](https://github.com/oxc-project/oxc/releases/tag/oxlint_v0.16.4): oxlint v0.16.4

[Compare Source](https://github.com/oxc-project/oxc/compare/oxlint_v0.16.3...oxlint_v0.16.4)

#### \[0.16.4] - 2025-04-01

-   [`da6336c`](https://github.com/oxc-project/oxc/commit/da6336c) language_server: \[**BREAKING**] Remove `enable` configuration, the client should shutdown the server instead ([#&#8203;9990](https://github.com/oxc-project/oxc/issues/9990)) (Sysix)

##### Features

-   [`06e3db9`](https://github.com/oxc-project/oxc/commit/06e3db9) linter: Support `multipleFileExtensions` option for `unicorn/filename-case` ([#&#8203;10118](https://github.com/oxc-project/oxc/issues/10118)) (shulaoda)
-   [`dbe0e46`](https://github.com/oxc-project/oxc/commit/dbe0e46) linter: Support `ignore` option for `unicorn/filename-case` ([#&#8203;10107](https://github.com/oxc-project/oxc/issues/10107)) (shulaoda)

##### Bug Fixes

-   [`0a33e27`](https://github.com/oxc-project/oxc/commit/0a33e27) editor: Update `initializationOptions` for a possible restart ([#&#8203;10121](https://github.com/oxc-project/oxc/issues/10121)) (Sysix)
-   [`ac780a2`](https://github.com/oxc-project/oxc/commit/ac780a2) editor: Repair filewatchers when no custom config provided ([#&#8203;10104](https://github.com/oxc-project/oxc/issues/10104)) (Sysix)
-   [`4303ace`](https://github.com/oxc-project/oxc/commit/4303ace) editor: Dont send `didChangeConfiguration` request to the server when it is shutdown ([#&#8203;10084](https://github.com/oxc-project/oxc/issues/10084)) (Sysix)
-   [`07f2a25`](https://github.com/oxc-project/oxc/commit/07f2a25) editor: Enable regex parsing in language server ([#&#8203;10035](https://github.com/oxc-project/oxc/issues/10035)) (camchenry)
-   [`fcf7702`](https://github.com/oxc-project/oxc/commit/fcf7702) language_server: Start from a default oxlint configuration + SafeFix for nested configuration ([#&#8203;10043](https://github.com/oxc-project/oxc/issues/10043)) (Sysix)
-   [`aba3654`](https://github.com/oxc-project/oxc/commit/aba3654) linter: Span disable directive correctly on next line ([#&#8203;10141](https://github.com/oxc-project/oxc/issues/10141)) (Ulrich Stark 🦀)
-   [`2c80858`](https://github.com/oxc-project/oxc/commit/2c80858) linter: Enable multi-file analysis for nested configs ([#&#8203;10089](https://github.com/oxc-project/oxc/issues/10089)) (camchenry)

##### Performance

-   [`566be59`](https://github.com/oxc-project/oxc/commit/566be59) linter: Replace `phf_set` with `array` in `eslint/func-names` ([#&#8203;10119](https://github.com/oxc-project/oxc/issues/10119)) (shulaoda)
-   [`5e14fe9`](https://github.com/oxc-project/oxc/commit/5e14fe9) linter: Inline `PRE_DEFINE_VAR` and use `array` format ([#&#8203;10079](https://github.com/oxc-project/oxc/issues/10079)) (shulaoda)

##### Refactor

-   [`327be53`](https://github.com/oxc-project/oxc/commit/327be53) editor: `LanguageClient` can be undefined ([#&#8203;10112](https://github.com/oxc-project/oxc/issues/10112)) (Sysix)
-   [`5ec477c`](https://github.com/oxc-project/oxc/commit/5ec477c) editor: Make `onConfigChange` async ([#&#8203;10110](https://github.com/oxc-project/oxc/issues/10110)) (Sysix)
-   [`a278d73`](https://github.com/oxc-project/oxc/commit/a278d73) editor: Use warning background when the plugin is deactived ([#&#8203;10085](https://github.com/oxc-project/oxc/issues/10085)) (Sysix)
-   [`c0e5251`](https://github.com/oxc-project/oxc/commit/c0e5251) language_server: Set `null` as a default value for `configPath` ([#&#8203;10047](https://github.com/oxc-project/oxc/issues/10047)) (Sysix)
-   [`09c0ac6`](https://github.com/oxc-project/oxc/commit/09c0ac6) linter: Improve `unicorn/filename-case` ([#&#8203;10117](https://github.com/oxc-project/oxc/issues/10117)) (shulaoda)
-   [`d8e49a1`](https://github.com/oxc-project/oxc/commit/d8e49a1) linter: Compute lintable extensions at compile time ([#&#8203;10090](https://github.com/oxc-project/oxc/issues/10090)) (camchenry)
-   [`b3ec235`](https://github.com/oxc-project/oxc/commit/b3ec235) linter: Use items of `oxc_ast::ast` module directly ([#&#8203;10100](https://github.com/oxc-project/oxc/issues/10100)) (Ulrich Stark 🦀)
-   [`93e6c0b`](https://github.com/oxc-project/oxc/commit/93e6c0b) linter: Use `FormalParameter::has_modifier` to detect parameter properties ([#&#8203;10097](https://github.com/oxc-project/oxc/issues/10097)) (Ulrich Stark 🦀)

##### Testing

-   [`410b8d6`](https://github.com/oxc-project/oxc/commit/410b8d6) editor: Use debug build of the language server ([#&#8203;10083](https://github.com/oxc-project/oxc/issues/10083)) (Sysix)
-   [`500add0`](https://github.com/oxc-project/oxc/commit/500add0) editor: Add test for `oxc.fixAll` command ([#&#8203;10045](https://github.com/oxc-project/oxc/issues/10045)) (Sysix)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these updates again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yMzAuMSIsInVwZGF0ZWRJblZlciI6IjM5LjIzMC4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiXX0=-->

Reviewed-on: https://git.1-h.cc/examples/vue-ts-example/pulls/175
Co-authored-by: Renovate Bot <renovatebot@oo1.dev>
Co-committed-by: Renovate Bot <renovatebot@oo1.dev>
2025-04-06 01:44:29 +08:00
0344b51b40 chore(deps): update dependency typescript to ~5.8.3
Some checks are pending
renovate/stability-days Updates have not met minimum release age requirement
/ build-and-deploy-to-vercel (push) Successful in 2m39s
/ playwright (push) Successful in 46s
/ surge (push) Successful in 2m32s
/ lint-build-and-check (push) Successful in 4m30s
2025-04-05 21:44:17 +08:00
4ee2048ae4 fix: 在 lint-staged 中添加 oxlint 修复命令
All checks were successful
/ build-and-deploy-to-vercel (push) Successful in 2m56s
/ surge (push) Successful in 2m23s
/ playwright (push) Successful in 48s
/ lint-build-and-check (push) Successful in 4m27s
2025-04-05 16:31:42 +08:00
bd4dd95c2a chore(deps): update dependency @primeuix/themes to ^1.0.1
All checks were successful
/ build-and-deploy-to-vercel (push) Successful in 4m29s
/ lint-build-and-check (push) Successful in 5m58s
/ playwright (push) Successful in 3m15s
/ surge (push) Successful in 4m21s
2025-04-04 00:21:10 +08:00
ecd82d30a4 fix: 更新 lint-staged 配置,支持 .tsx 文件格式
Some checks failed
/ build-and-deploy-to-vercel (push) Successful in 2m47s
/ lint-build-and-check (push) Successful in 4m36s
/ surge (push) Successful in 2m44s
/ playwright (push) Failing after 11m36s
2025-04-03 15:26:27 +08:00
8198fefe91 Refactor: 重构 HCesiumManager 2025-04-03 12:35:24 +08:00
2bc762a89b feat: 更新 ESLint 配置
Some checks failed
/ surge (push) Successful in 2m34s
/ build-and-deploy-to-vercel (push) Successful in 2m46s
/ lint-build-and-check (push) Has been cancelled
/ playwright (push) Has been cancelled
2025-04-02 11:27:09 +08:00
9ed4c0bc6b chore(deps): update dependency primelocale to ^2.1.2
Some checks failed
/ build-and-deploy-to-vercel (push) Successful in 2m35s
/ lint-build-and-check (push) Successful in 4m44s
/ surge (push) Successful in 2m42s
/ playwright (push) Failing after 11m51s
2025-04-02 10:01:34 +08:00
162f9a9a13 feat: 添加 vite-plugin-checker 插件,配置 ESLint 和 Vue 类型检查
Some checks failed
/ playwright (push) Has been cancelled
/ surge (push) Has been cancelled
/ build-and-deploy-to-vercel (push) Has been cancelled
/ lint-build-and-check (push) Has been cancelled
2025-04-02 09:51:35 +08:00
8f2a77702b feat: InspiraUI
Some checks failed
/ surge (push) Successful in 2m41s
/ build-and-deploy-to-vercel (push) Successful in 2m59s
/ lint-build-and-check (push) Has been cancelled
/ playwright (push) Has been cancelled
2025-04-01 11:55:16 +08:00
32bc83e16e chore(deps): update dependency vite to ^6.2.4
Some checks are pending
renovate/stability-days Updates have not met minimum release age requirement
/ build-and-deploy-to-vercel (push) Successful in 2m31s
/ lint-build-and-check (push) Successful in 4m20s
/ surge (push) Successful in 2m30s
/ playwright (push) Successful in 5m16s
2025-03-31 18:35:50 +08:00
b16c038be9 feat: 删除 OrbPro 相关文件和依赖,清理代码库
Some checks failed
/ build-and-deploy-to-vercel (push) Successful in 2m59s
/ lint-build-and-check (push) Successful in 4m5s
/ surge (push) Successful in 2m34s
/ playwright (push) Failing after 5m1s
2025-03-31 15:15:54 +08:00
334b2485f5 feat: 添加 InspiraUI 组件和模式背景功能,更新依赖项
All checks were successful
/ build-and-deploy-to-vercel (push) Successful in 3m0s
/ lint-build-and-check (push) Successful in 4m44s
/ playwright (push) Successful in 3m18s
/ surge (push) Successful in 3m1s
2025-03-31 14:11:30 +08:00
6e18e0f737 feat: 添加 headless 测试支持和修复接口请求页面的路径
All checks were successful
/ build-and-deploy-to-vercel (push) Successful in 3m18s
/ lint-build-and-check (push) Successful in 4m16s
/ surge (push) Successful in 2m46s
/ playwright (push) Successful in 5m34s
2025-03-31 12:36:39 +08:00
5ba87212b9 feat: 添加 oxlint 配置文件并更新 lint 脚本
Some checks failed
/ build-and-deploy-to-vercel (push) Successful in 2m53s
/ lint-build-and-check (push) Successful in 4m15s
/ playwright (push) Failing after 6m44s
/ surge (push) Successful in 2m53s
2025-03-31 01:41:17 +08:00
3adafb58d5 chore: 移除不必要的 oxlint lint 脚本
Some checks failed
/ build-and-deploy-to-vercel (push) Successful in 3m2s
/ lint-build-and-check (push) Successful in 4m13s
/ surge (push) Successful in 2m58s
/ playwright (push) Failing after 5m16s
2025-03-31 00:57:16 +08:00
2fd7f2fcbc feat: 更新配置和依赖项,启用 oxc 插件,移除 cdnImport 插件
Some checks failed
/ lint-build-and-check (push) Failing after 36s
/ playwright (push) Has been cancelled
/ build-and-deploy-to-vercel (push) Has been cancelled
/ surge (push) Has been cancelled
2025-03-31 00:55:50 +08:00
0cc1730b2c feat: 更新依赖
Some checks failed
/ lint-build-and-check (push) Failing after 38s
/ build-and-deploy-to-vercel (push) Successful in 3m4s
/ playwright (push) Failing after 5m32s
/ surge (push) Successful in 2m18s
2025-03-31 00:38:50 +08:00
8d0ed93ee0 feat: 添加 InspiraUI 组件
Some checks failed
/ lint-build-and-check (push) Failing after 37s
/ playwright (push) Failing after 4m50s
/ surge (push) Successful in 2m32s
2025-03-30 23:45:01 +08:00
4b109a0829 chore(deps): 更新多个依赖项版本
All checks were successful
/ build-and-deploy-to-vercel (push) Successful in 3m3s
/ lint-build-and-check (push) Successful in 4m31s
/ surge (push) Successful in 2m46s
/ playwright (push) Successful in 4m31s
2025-03-28 09:58:16 +08:00
ba91e845d5 帮我把 @unhead/vue 的版本升级到 v2.0.2
Some checks failed
/ surge (push) Failing after 1m1s
/ playwright (push) Has been skipped
/ lint-build-and-check (push) Failing after 1m31s
---
title: Migrate Your TypeScript App To Unhead v2
description: Learn about how to migrate to TypeScript Unhead v2 from v1.
navigation:
  title: Upgrade Guide
---

## Introduction

With the release of Unhead v2, we now have first-class support for other frameworks. However, this guide will focus on
the changes that affec TypeScript users.

The high-level of Unhead v2 was to remove deprecations and remove the implicit context implementation.

### Legacy Support

Unhead v2 is mostly fully backwards compatible with Unhead v1.

While not recommended, if upgrading is not possible for you, you can change your imports to the following:

```diff [TypeScript]
-import { createServerHead, useHead } from 'unhead'
+import { createServerHead, useHead } from 'unhead/legacy'
```

This will be removed in a future minor version, so you should lock your dependencies to the version that works for you.

## Client / Server Subpath Exports

🚦 Impact Level: Critical

**⚠️ Breaking Changes:**

- `createServerHead()`{lang="ts"} and `createHead()`{lang="ts"} exports from `unhead` are removed

The path where you import `createHead` from has been updated to be a subpath export.

Please follow the updated installation instructions or simply update the import to use the subpath.

**Client bundle:**

```diff
-import { createServerHead } from 'unhead'
+import { createHead } from 'unhead/client'

// avoids bundling server plugins
createHead()
```

**Server bundle:**

```diff
-import { createServerHead } from 'unhead'
+import { createHead } from 'unhead/server'

// avoids bundling server plugins
-createServerHead()
+createHead()
```

## Removed Implicit Context

🚦 Impact Level: Critical

**⚠️ Breaking Changes:**

- `getActiveHead()`{lang="ts"}, `activeHead`{lang="ts"} exports are removed

The implicit context implementation kept a global instance of Unhead available so that you could use the `useHead()`{lang="ts"} composables
anywhere in your application.

```ts
useHead({
  title: 'This just worked!'
})
```

While safe client side, this was a leaky abstraction server side and led to memory leaks in some cases.

In v2, the core composables no longer have access to the Unhead instance. Instead, you must pass the Unhead instance to the composables.

::note
Passing the instance is only relevant if you're importing from `unhead`. In JavaScript frameworks we tie the context to the framework itself so you
don't need to worry about this.
::

::code-group

```ts [TypeScript v2]
import { useHead } from 'unhead'

// example of getting the instance
const unheadInstance = useMyApp().unhead
useHead(unheadInstance, {
  title: 'Looks good'
})
```

```ts [TypeScript v1]
import { useHead } from 'unhead'

useHead({
  title: 'Just worked! But with SSR issues'
})
```

::

## Removed `vmid`, `hid`, `children`, `body`

🚦 Impact Level: High

For legacy support with Vue Meta we allowed end users to provide deprecated properties:  `vmid`, `hid`, `children` and `body`.

You must either update these properties to the appropriate replacement, remove them, or you can use the `DeprecationsPlugin`.

**Meta tags with `vmid`, `hid`**

These are already deduped magically so you can safely remove them there.

```diff
useHead({
  meta: [{
    name: 'description',
-   vmid: 'description'
-   hid: 'description'
  }]
})
```

**Other Tags with `vmid`, `hid`**

Use `key` if you need the deduplication feature. This is useful for tags that may change from server to client
rendering.

```diff
useHead({
  script: [{
-   vmid: 'my-key'
-   hid: 'my-key'
+   key: 'my-key',
  }]
})
```

**Using `children`**

The `children` key is a direct replacement of `innerHTML` which you should use instead.

::Caution
When migrating your code ensure that you're not dynamically setting `innerHTML` as this can lead to XSS vulnerabilities.
::

```diff
useHead({
  script: [
      {
-        children: '..'
+        innerHTML: '..'
      }
   ]
})
```

**Using `body`**

The `body` key should be updated to use the Tag Position feature.

```diff
useHead({
  script: [
      {
-        body: true
+        tagPosition: 'bodyClose'
      }
   ]
})
```

**Use Deprecations Plugin**

```ts
import { createHead } from 'unhead'
import { DeprecationsPlugin } from 'unhead/plugins'

const unhead = createHead({
  plugins: [DeprecationsPlugin]
})
```

## Opt-in Template Params & Tag Alias Sorting

🚦 Impact Level: High

To reduce the bundle size and improve performance, we've moved the template params and tag alias sorting to optional plugins.

If you'd like to continue using these, please opt-in to the plugins.

```ts
import { AliasSortingPlugin, TemplateParamsPlugin } from 'unhead/plugins'

createHead({
  plugins: [TemplateParamsPlugin, AliasSortingPlugin]
})
```

## Vue 2 Support

🚦 Impact Level: Critical

Unhead v2 no longer supports Vue v2. If you're using Vue v2, you will need to lock your dependencies to the latest v1 version of Unhead.

## Promise Input Support

🚦 Impact Level: Medium

If you have promises as input they will no longer be resolved, either await the promise before passing it along or register the optional promises plugin.

**Option 1: Await Promise**

```diff
useHead({
  link: [
    {
-     href: import('~/assets/MyFont.css?url'),
+     href: await import('~/assets/MyFont.css?url'),
      rel: 'stylesheet',
      type: 'text/css'
    }
  ]
})
```

**Option 2: Promise Plugin**

```ts
import { PromisePlugin } from 'unhead/plugins'

const unhead = createHead({
  plugins: [PromisePlugin]
})
```

## Updated `useScript()`{lang="ts"}

🚦 Impact Level: High

**⚠️ Breaking Changes:**

- Script instance is no longer augmented as a proxy and promise
- `script.proxy`{lang="ts"} is rewritten for simpler, more stable behavior
- `stub()`{lang="ts"} and runtime hook `script:instance-fn` are removed

**Replacing promise usage**

If you're using the script as a promise you should instead opt to use the `onLoaded()` functions.

```diff
const script = useScript()

-script.then(() => console.log('loaded')
+script.onLoaded(() => console.log('loaded'))
```

**Replacing proxy usage**

If you're accessing the underlying API directly from the script instance, you will now need to only access it from the `.proxy`.

```diff
const script = useScript('..', {
  use() { return { foo: [] } }
})

-script.foo.push('bar')
+script.proxy.foo.push('bar')
```

**Replacing `stub()`**

If you were using stub for anything you should replace this with either custom `use()` behavior.

```diff
const script = useScript('...', {
-  stub() { return { foo: import.meta.server ? [] : undefined } }
})

+script.proxy = {} // your own implementation
```

## Tag Sorting Updated

🚦 Impact Level: :UBadge{color="success" variant="subtle" size="sm" label="Low"}

An optional [Capo.js](https://rviscomi.github.io/capo.js/) plugin was added to Unhead, in v2 we make this the default sorting behavior.

::warning
As all head tags may be re-ordered this will break any snapshot tests that you have in place and in some rare cases may lead to performance regressions.
::

You can opt-out of Capo.js sorting by providing the option.

```ts
createHead({
  disableCapoSorting: true,
})
```

## Default SSR Tags

🚦 Impact Level: Low

When SSR Unhead will now insert important default tags for you:
- `<meta charset="utf-8">`
- `<meta name="viewport" content="width=device-width, initial-scale=1">`
- `<html lang="en">`

If you were previously relying on these being left empty, you may need to either disable them by using `disableDefaultTags` or insert tags
to override them.

```ts
import { createHead, useHead } from 'unhead/server'

// disable when creating the head instance
const head = createHead({
  disableDefaults: true,
})

useHead(head, {
  htmlAttrs: {
    lang: 'fr'
  }
})
```

## CJS Exports Removed

🚦 Impact Level: Low

CommonJS exports have been removed in favor of ESM only.

```diff
-const { createHead } = require('unhead/client')
+import { createHead } from 'unhead/client'
```

## Deprecated `@unhead/schema`

🚦 Impact Level: Low

The `@unhead/schema` package is now deprecated and will be removed in a future version. You should instead import
the schema from `unhead/types` or `unhead`.

```diff
-import { HeadTag } from '@unhead/schema'
+import { HeadTag } from 'unhead/types'
```
2025-03-28 00:06:28 +08:00
a6389aee36 chore(deps): update dependency eslint-plugin-oxlint to ^0.15.15
All checks were successful
/ depcheck (push) Successful in 2m24s
/ lint-build-and-check (push) Successful in 2m33s
/ build-and-deploy-to-vercel (push) Successful in 3m19s
/ surge (push) Successful in 2m27s
/ playwright (push) Successful in 4m43s
2025-03-26 20:32:09 +08:00
a05ca276ca chore(deps): update dependency eslint-plugin-unicorn to v58
Some checks failed
/ depcheck (push) Successful in 2m22s
/ lint-build-and-check (push) Successful in 2m43s
/ playwright (push) Has been cancelled
/ surge (push) Has been cancelled
/ build-and-deploy-to-vercel (push) Has been cancelled
2025-03-26 20:29:15 +08:00
fa8d02f08d feat: 移除 size-limit 依赖及相关工作流配置
All checks were successful
/ depcheck (push) Successful in 2m39s
/ lint-build-and-check (push) Successful in 3m1s
/ build-and-deploy-to-vercel (push) Successful in 3m4s
/ playwright (push) Successful in 4m41s
/ surge (push) Successful in 2m27s
2025-03-25 11:42:13 +08:00
68406f5681 feat: 添加 size-limit 依赖
Some checks failed
/ lint-build-and-check (push) Successful in 2m31s
/ depcheck (push) Failing after 2m46s
/ build-and-deploy-to-vercel (push) Successful in 2m53s
/ surge (push) Successful in 2m32s
/ playwright (push) Successful in 3m50s
2025-03-25 10:54:13 +08:00
a8a06c589c chore(deps): update unplugin packages
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
/ lint-build-and-check (push) Successful in 2m36s
/ depcheck (push) Successful in 2m48s
/ build-and-deploy-to-vercel (push) Successful in 3m35s
/ surge (push) Successful in 2m41s
/ playwright (push) Successful in 5m31s
2025-03-24 03:14:23 +08:00
e42241ddc5 feat: unocss-preset-shadcn
All checks were successful
/ lint-build-and-check (push) Successful in 2m28s
/ depcheck (push) Successful in 2m48s
/ build-and-deploy-to-vercel (push) Successful in 2m51s
/ playwright (push) Successful in 4m3s
/ surge (push) Successful in 2m31s
2025-03-23 22:10:38 +08:00
e66dc097f7 chore: 更新 Vercel 命令为 pnpm dlx 以提高执行效率
All checks were successful
/ depcheck (push) Successful in 2m21s
/ build-and-deploy-to-vercel (push) Successful in 2m48s
/ lint-build-and-check (push) Successful in 2m49s
/ surge (push) Successful in 2m25s
/ playwright (push) Successful in 1m50s
2025-03-23 02:19:13 +08:00
7abce90d75 chore(deps): update dependency eslint-plugin-vue to v10
All checks were successful
/ depcheck (push) Successful in 2m15s
/ lint-build-and-check (push) Successful in 2m48s
/ build-and-deploy-to-vercel (push) Successful in 2m57s
/ surge (push) Successful in 2m33s
/ playwright (push) Successful in 3m26s
2025-03-23 02:08:50 +08:00
e4f2ad3110 feat: 添加构建后自动打包dist目录为zip文件的功能
All checks were successful
/ depcheck (push) Successful in 2m18s
/ build-and-deploy-to-vercel (push) Successful in 2m44s
/ lint-build-and-check (push) Successful in 2m51s
/ playwright (push) Successful in 3m21s
/ surge (push) Successful in 2m53s
引入archiver依赖,新增vite插件viteArchiverPlugin,用于在构建完成后自动将dist目录打包成zip文件。同时更新.gitignore和package.json以支持该功能。
2025-03-23 00:29:19 +08:00
d23fcd72c7 feat: 更新 Playwright 工作流以计算构建大小;添加 vite-plugin-purgecss-updated-v5 插件
Some checks failed
/ surge (push) Successful in 2m24s
/ lint-build-and-check (push) Successful in 2m37s
/ depcheck (push) Successful in 2m43s
/ build-and-deploy-to-vercel (push) Successful in 2m47s
/ playwright (push) Has been cancelled
2025-03-22 23:50:24 +08:00
9e6d526ada feat: 添加构建大小计算步骤;更新依赖项,新增 vite-plugin-singlefile 插件
All checks were successful
/ lint-build-and-check (push) Successful in 2m25s
/ depcheck (push) Successful in 2m43s
/ build-and-deploy-to-vercel (push) Successful in 3m13s
/ playwright (push) Successful in 3m11s
/ surge (push) Successful in 2m27s
2025-03-22 23:44:06 +08:00
4db3a84f61 chore(deps): update dependency prettier to v3.5.3
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
/ lint-build-and-check (push) Successful in 2m42s
/ depcheck (push) Successful in 2m48s
/ build-and-deploy-to-vercel (push) Successful in 3m16s
/ surge (push) Successful in 2m41s
/ playwright (push) Successful in 4m17s
2025-03-17 13:09:49 +08:00
01adfcd908 chore: 更新 package.json,优化依赖命令并添加 knip 工具
All checks were successful
/ lint-build-and-check (push) Successful in 2m32s
/ depcheck (push) Successful in 2m43s
/ build-and-deploy-to-vercel (push) Successful in 3m4s
/ surge (push) Successful in 2m50s
/ playwright (push) Successful in 4m35s
2025-03-16 19:36:49 +08:00
a5be55dcf7 chore(deps): update dependency @types/node to ^22.13.10
All checks were successful
/ depcheck (push) Successful in 2m8s
/ lint-build-and-check (push) Successful in 2m49s
/ build-and-deploy-to-vercel (push) Successful in 3m16s
/ surge (push) Successful in 2m37s
/ playwright (push) Successful in 4m36s
2025-03-16 17:28:13 +08:00
ffdc49ec2a chore(deps): update dependency typescript to ~5.8.2
All checks were successful
renovate/stability-days Updates have met minimum release age requirement
/ depcheck (push) Successful in 2m8s
/ lint-build-and-check (push) Successful in 2m52s
/ build-and-deploy-to-vercel (push) Successful in 3m7s
/ surge (push) Successful in 2m39s
/ playwright (push) Successful in 4m15s
2025-03-14 20:24:25 +08:00