Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.x] Implement unhead for Vue 3 and its playground #1928

Draft
wants to merge 3 commits into
base: v1
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 98 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,12 @@
"prepublishOnly": "npm run build"
},
"dependencies": {
"@unhead/ssr": "^1.9.16",
"axios": "^1.6.0",
"deepmerge": "^4.0.0",
"nprogress": "^0.2.0",
"qs": "^6.9.0"
"qs": "^6.9.0",
"unhead": "^1.9.16"
},
"devDependencies": {
"@types/deepmerge": "^2.2.0",
Expand Down
147 changes: 0 additions & 147 deletions packages/core/src/head.ts

This file was deleted.

4 changes: 3 additions & 1 deletion packages/core/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Router } from './router'

export { default as createHeadManager } from './head'
export { getActiveHead } from 'unhead'
export { renderSSRHead } from '@unhead/ssr'
export type { SSRHeadPayload } from '@unhead/ssr'
export { default as setupProgress } from './progress'
export { default as shouldIntercept } from './shouldIntercept'
export * from './types'
Expand Down
7 changes: 6 additions & 1 deletion packages/core/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { AxiosProgressEvent, AxiosResponse } from 'axios'
import type { SSRHeadPayload } from '@unhead/ssr'

export type { getActiveHead } from 'unhead'
export type { renderSSRHead } from '@unhead/ssr'
export type { SSRHeadPayload } from '@unhead/ssr'

declare module 'axios' {
export interface AxiosProgressEvent {
Expand Down Expand Up @@ -194,7 +199,7 @@ export type ActiveVisit = PendingVisit &
export type VisitId = unknown
export type Component = unknown

export type InertiaAppResponse = Promise<{ head: string[]; body: string } | void>
export type InertiaAppResponse = Promise<{ head: string[]; body: string, unhead: SSRHeadPayload } | void>

declare global {
interface DocumentEventMap {
Expand Down
Loading
Loading