Skip to content

Commit

Permalink
chore: remove deprecation of onLoadingComplete temporarily
Browse files Browse the repository at this point in the history
  • Loading branch information
styfle committed Oct 18, 2023
1 parent 07c434d commit c1bcbe6
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 28 deletions.
10 changes: 0 additions & 10 deletions packages/next/src/shared/lib/get-img-props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ export type ImageProps = Omit<
placeholder?: PlaceholderValue
blurDataURL?: string
unoptimized?: boolean
/**
* @deprecated Use `onLoad` instead.
* @see https://nextjs.org/docs/app/api-reference/components/image#onload
*/
onLoadingComplete?: OnLoadingComplete
/**
* @deprecated Use `fill` prop instead of `layout="fill"` or change import to `next/legacy/image`.
Expand Down Expand Up @@ -527,12 +523,6 @@ export function getImgProps(
}
}

if (onLoadingComplete) {
warnOnce(
`Image with src "${src}" is using deprecated "onLoadingComplete" property. Please use the "onLoad" property instead.`
)
}

for (const [legacyKey, legacyValue] of Object.entries({
layout,
objectFit,
Expand Down
9 changes: 0 additions & 9 deletions test/integration/next-image-new/app-dir/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,15 +357,6 @@ function runTests(mode) {
() => browser.eval(`document.getElementById("msg9").textContent`),
'loaded 1 img9 with dimensions 400x400'
)

if (mode === 'dev') {
const warnings = (await browser.log('browser'))
.map((log) => log.message)
.join('\n')
expect(warnings).toMatch(
/Image with src "(.*)" is using deprecated "onLoadingComplete" property/gm
)
}
})

it('should callback native onLoad with sythetic event', async () => {
Expand Down
9 changes: 0 additions & 9 deletions test/integration/next-image-new/default/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -358,15 +358,6 @@ function runTests(mode) {
() => browser.eval(`document.getElementById("msg9").textContent`),
'loaded 1 img9 with dimensions 400x400'
)

if (mode === 'dev') {
const warnings = (await browser.log('browser'))
.map((log) => log.message)
.join('\n')
expect(warnings).toMatch(
/Image with src "(.*)" is using deprecated "onLoadingComplete" property/gm
)
}
})

it('should callback native onLoad with sythetic event', async () => {
Expand Down

0 comments on commit c1bcbe6

Please sign in to comment.