Upgrading nuxt-og-image 4 to 5
Breaking4.2.0 → 5.1.13Breaking1New1Changed3Fixed30Other1
BreakingUpgrade verdict
1 breaking change.
In plain terms
- Require Nuxt v3.16 - (b0483).
Must act 1 item needs code or config changes
Adds mocked-exports ^0.1.1.
Drops @unhead/ssr.
Installs 152 packages in all (was 180).
What you must change
Breaking1
Require Nuxt v3.16 - (b0483).
API changes
Generated by DepDelta from published .d.ts files. Not mixed with prose notes.
- removed:
export * from './dist/content'
- changed:
const renderer: Renderer | { __unenv__: true } | undefined → const renderer: Renderer | { __mock__: true } | undefined
- changed:
const renderer: Renderer | { __unenv__: true } | undefined → const renderer: Renderer | { __mock__: true } | undefined
- added:
const cssInline: { inline: (css: string, html: string) => string } - added:
default function init(): Promise<void> - added:
function inline(css: string, html: string): string
- removed:
type OgImageSchema = TypeOf<typeof schema> - changed:
const schema: zod.ZodObject<{ ogImage: zod.ZodOptional<zod.ZodObject<{ url: zod.ZodOptional<zod.ZodString>; component: zod.ZodOptional<zod.ZodString>; props: zod.ZodRecord<z… → const schema: z.ZodObject<{ ogImage: z.ZodOptional<z.ZodObject<{ url: z.ZodOptional<z.ZodString>; component: z.ZodOptional<z.ZodString>; props: z.ZodRecord<z.ZodString, z.Zo… - changed:
function asOgImageCollection<T extends ZodRawShape>(collection: Collection<T>): Collection<T> → function asOgImageCollection<T>(collection: Collection<T>): Collection<T> - added:
const ogImageSchema: z.ZodOptional<z.ZodObject<{ url: z.ZodOptional<z.ZodString>; component: z.ZodOptional<z.ZodString>; props: z.ZodRecord<z.ZodString, z.ZodAny> }, 'strip', z.Zod…
- changed:
property ModuleOptions.googleFontMirror?: true | string → property ModuleOptions.googleFontMirror?: string - added:
const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false> - added:
export = _default
- added:
const _default: typeof __VLS_export - added:
default _default
- added:
const _default: typeof __VLS_export - added:
default _default
- added:
const _default: typeof __VLS_export - added:
default _default
- added:
const _default: typeof __VLS_export - added:
default _default
- added:
const _default: typeof __VLS_export - added:
default _default
- added:
const _default: typeof __VLS_export - added:
default _default
- added:
const _default: typeof __VLS_export - added:
default _default
- added:
const _default: typeof __VLS_export - added:
default _default
- added:
const _default: typeof __VLS_export - added:
default _default
- removed:
function normaliseOptions(_options: DefineOgImageInput): OgImageOptions | OgImagePrebuilt - changed:
function createOgImageMeta(src: string | null, input: OgImageOptions | OgImagePrebuilt, resolvedOptions: OgImageOptions, ssrContext: NuxtSSRContext): void → function createOgImageMeta(src: string, input: OgImageOptions | OgImagePrebuilt, ssrContext: NuxtSSRContext): void - added:
function getOgImagePath(pagePath: string, _options?: Partial<OgImageOptions>): string - added:
function resolveComponentName(component: OgImageOptions['component'], fallback: string): OgImageOptions['component'] - added:
function setHeadOgImagePrebuilt(input: OgImagePrebuilt): void - added:
function useOgImageRuntimeConfig(): OgImageRuntimeConfig
- changed:
function ogImageCanonicalUrls(nuxtApp: NuxtApp): void → function ogImageCanonicalUrls(nuxtApp: NuxtSSRContext['nuxt']): void - changed:
function routeRuleOgImage(nuxtApp: NuxtApp): void → function routeRuleOgImage(nuxtApp: NuxtSSRContext['nuxt']): void
- added:
default empty
- added:
default proxy
- removed:
function getExtension(path: string): string - removed:
function isInternalRoute(path: string): boolean - removed:
function normaliseFontInput(fonts: InputFontConfig[]): ResolvedFontConfig[] - removed:
function separateProps(options: OgImageOptions | undefined, ignoreKeys?: string[]): { props: Record<string, any> } - removed:
function toBase64Image(data: string | ArrayBuffer): string - removed:
function withoutQuery(path: string): string
- changed:
function useChromiumRenderer(): Promise<import('../../types').Renderer> → function useChromiumRenderer(): Promise<import('../../types.js').Renderer> - changed:
function useSatoriRenderer(): Promise<import('../../types').Renderer> → function useSatoriRenderer(): Promise<import('../../types.js').Renderer>
- changed:
const assets: import('unstorage').Storage<import('unstorage').StorageValue> → const assets: import('unstorage').Storage<any>
- changed:
const _default: import('../../../../types').SatoriTransformer | import('../../../../types').SatoriTransformer[] → const _default: import('../../../../types.js').SatoriTransformer | import('../../../../types.js').SatoriTransformer[]
- changed:
const _default: import('../../../../types').SatoriTransformer | import('../../../../types').SatoriTransformer[] → const _default: import('../../../../types.js').SatoriTransformer | import('../../../../types.js').SatoriTransformer[]
- changed:
const _default: import('../../../../types').SatoriTransformer | import('../../../../types').SatoriTransformer[] → const _default: import('../../../../types.js').SatoriTransformer | import('../../../../types.js').SatoriTransformer[]
- changed:
const _default: import('../../../../types').SatoriTransformer | import('../../../../types').SatoriTransformer[] → const _default: import('../../../../types.js').SatoriTransformer | import('../../../../types.js').SatoriTransformer[]
- changed:
const _default: import('../../../../types').SatoriTransformer | import('../../../../types').SatoriTransformer[] → const _default: import('../../../../types.js').SatoriTransformer | import('../../../../types.js').SatoriTransformer[]
- added:
const _default: import('../../../../types.js').SatoriTransformer | import('../../../../types.js').SatoriTransformer[] - added:
default _default
- changed:
const _default: import('../../../../types').SatoriTransformer | import('../../../../types').SatoriTransformer[] → const _default: import('../../../../types.js').SatoriTransformer | import('../../../../types.js').SatoriTransformer[]
- changed:
function applyEmojis(ctx: OgImageRenderEventContext, island: NuxtIslandResponse): Promise<any> → function applyEmojis(ctx: OgImageRenderEventContext, island: NuxtIslandResponse): Promise<string | boolean>
- changed:
const _default: any → const _default: import('nitropack').NitroAppPlugin
- changed:
const _default: any → const _default: import('nitropack').NitroAppPlugin
- changed:
const _default: any → const _default: import('nitropack').NitroAppPlugin
- changed:
const _default: import('h3').EventHandler<import('h3').EventHandlerRequest, Promise<{ siteConfigUrl: string; componentNames: any; runtimeConfig: import('../../types').OgImageR… → const _default: import('h3').EventHandler<import('h3').EventHandlerRequest, Promise<{ siteConfigUrl: string; componentNames: any; runtimeConfig: import('../../types.js').OgIma…
- changed:
function useOgImageBufferCache(ctx: OgImageRenderEventContext, options: { baseCacheKey: string | false; cacheMaxAgeSeconds?: number }): Promise<void | H3Error | { cachedItem: false | BufferSource; enabled: boolean; update: (image: BufferSource) => Promise<void> }> → function useOgImageBufferCache(ctx: OgImageRenderEventContext, options: { baseCacheKey: string | false; cacheMaxAgeSeconds?: number }): Promise<void | H3Error | { cachedItem: false | BufferSource; enabled: boolean; update: (image: BufferSource | Buffer | Uint8Array) => Promise<void> }>
- changed:
function withoutQuery(path: string): string → function withoutQuery(path: string): string | undefined
- changed:
function readWasmFile(input: string): Promise<Buffer> → function readWasmFile(input: string): Promise<NonSharedBuffer>
- added:
function getOgImagePath(pagePath: string, _options?: Partial<OgImageOptions>): string - added:
function useOgImageRuntimeConfig(e?: H3Event): OgImageRuntimeConfig
- removed:
export * from './pure' - removed:
function getOgImagePath(pagePath: string, _options?: Partial<OgImageOptions>): string - changed:
function generateMeta(url: string, resolvedOptions: OgImageOptions): Head['meta'] → function generateMeta(url: OgImagePrebuilt['url'] | string, resolvedOptions: OgImageOptions | OgImagePrebuilt): ResolvableMeta[] - changed:
function useOgImageRuntimeConfig(): OgImageRuntimeConfig → function useOgImageRuntimeConfig(): {} - added:
function getExtension(path: string): string - added:
function isInternalRoute(path: string): boolean - added:
function normaliseFontInput(fonts: InputFontConfig[]): ResolvedFontConfig[] - added:
function separateProps(options: OgImageOptions | undefined, ignoreKeys?: string[]): { props: Record<string, any> } - added:
function toBase64Image(data: string | ArrayBuffer): string - added:
function withoutQuery(path: string): string | undefined
- removed:
type OgImagePrebuilt = { url: string } & Pick<OgImageOptions, 'width' | 'height' | 'alt' | '_query'> - changed:
property OgImageOptions.alt?: string → property OgImageOptions.alt?: string | (() => string) | Ref<string> - changed:
property OgImageOptions.height?: number → property OgImageOptions.height?: number | (() => number) | Ref<number> - changed:
property OgImageOptions.sharp?: SharpOptions → property OgImageOptions.sharp?: SharpOptions & JpegOptions - changed:
property OgImageOptions.url?: string → property OgImageOptions.url?: string | (() => string) | Ref<string> - changed:
property OgImageOptions.width?: number → property OgImageOptions.width?: number | (() => number) | Ref<number> - changed:
property Renderer.createImage: (e: OgImageRenderEventContext) => Promise<H3Error | BufferSource | void> → property Renderer.createImage: (e: OgImageRenderEventContext) => Promise<H3Error | BufferSource | Buffer | Uint8Array | void | undefined> - changed:
property SocialPreviewMetaData.og?: Record<string, string> → property SocialPreviewMetaData.og?: Record<string, string> & { image?: string | { 'image:width'?: string | number; 'image:height'?: string | number; [key: string]: any } } - added:
index RouteRulesOgImage[key: string]: any - added:
interface OgImagePrebuilt extends OgImageOptions - added:
interface RouteRulesOgImage extends Partial<OgImageOptions> - added:
property OgImageOptions.socialPreview?: SocialPreviewMetaData - added:
property OgImageRuntimeConfig.componentDirs?: string[]
- added:
declare module '#og-image-cache' - added:
declare module '#og-image-virtual/component-names.mjs' - added:
declare module '#og-image-virtual/unocss-config.mjs' - added:
declare module '#og-image/bindings/chromium' - added:
declare module '#og-image/bindings/css-inline' - added:
declare module '#og-image/bindings/resvg' - added:
declare module '#og-image/bindings/satori' - added:
declare module '#og-image/bindings/sharp' - added:
declare module '#og-image/components' - added:
declare module '#og-image/renderers/chromium' - added:
declare module '#og-image/renderers/satori' - added:
declare module '@css-inline/css-inline-wasm'
- removed:
declare module '#og-image-cache' - removed:
declare module '#og-image-virtual/component-names.mjs' - removed:
declare module '#og-image-virtual/unocss-config.mjs' - removed:
declare module '#og-image/bindings/chromium' - removed:
declare module '#og-image/bindings/css-inline' - removed:
declare module '#og-image/bindings/resvg' - removed:
declare module '#og-image/bindings/satori' - removed:
declare module '#og-image/bindings/sharp' - removed:
declare module '#og-image/components' - removed:
declare module '#og-image/renderers/chromium' - removed:
declare module '#og-image/renderers/satori'