Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
67781ee3
Unverified
Commit
67781ee3
authored
Oct 18, 2023
by
Steven
Committed by
GitHub
Oct 18, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore(next/image): remove deprecation of `onLoadingComplete` temporarily (#57020)
- Temporary revert of #56944
parent
07c434d5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
28 deletions
+0
-28
get-img-props.ts
packages/next/src/shared/lib/get-img-props.ts
+0
-10
index.test.ts
test/integration/next-image-new/app-dir/test/index.test.ts
+0
-9
index.test.ts
test/integration/next-image-new/default/test/index.test.ts
+0
-9
No files found.
packages/next/src/shared/lib/get-img-props.ts
View file @
67781ee3
...
@@ -38,10 +38,6 @@ export type ImageProps = Omit<
...
@@ -38,10 +38,6 @@ export type ImageProps = Omit<
placeholder
?:
PlaceholderValue
placeholder
?:
PlaceholderValue
blurDataURL
?:
string
blurDataURL
?:
string
unoptimized
?:
boolean
unoptimized
?:
boolean
/**
* @deprecated Use `onLoad` instead.
* @see https://nextjs.org/docs/app/api-reference/components/image#onload
*/
onLoadingComplete
?:
OnLoadingComplete
onLoadingComplete
?:
OnLoadingComplete
/**
/**
* @deprecated Use `fill` prop instead of `layout="fill"` or change import to `next/legacy/image`.
* @deprecated Use `fill` prop instead of `layout="fill"` or change import to `next/legacy/image`.
...
@@ -527,12 +523,6 @@ export function getImgProps(
...
@@ -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
({
for
(
const
[
legacyKey
,
legacyValue
]
of
Object
.
entries
({
layout
,
layout
,
objectFit
,
objectFit
,
...
...
test/integration/next-image-new/app-dir/test/index.test.ts
View file @
67781ee3
...
@@ -357,15 +357,6 @@ function runTests(mode) {
...
@@ -357,15 +357,6 @@ function runTests(mode) {
()
=>
browser
.
eval
(
`document.getElementById("msg9").textContent`
),
()
=>
browser
.
eval
(
`document.getElementById("msg9").textContent`
),
'loaded 1 img9 with dimensions 400x400'
'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
()
=>
{
it
(
'should callback native onLoad with sythetic event'
,
async
()
=>
{
...
...
test/integration/next-image-new/default/test/index.test.ts
View file @
67781ee3
...
@@ -358,15 +358,6 @@ function runTests(mode) {
...
@@ -358,15 +358,6 @@ function runTests(mode) {
()
=>
browser
.
eval
(
`document.getElementById("msg9").textContent`
),
()
=>
browser
.
eval
(
`document.getElementById("msg9").textContent`
),
'loaded 1 img9 with dimensions 400x400'
'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
()
=>
{
it
(
'should callback native onLoad with sythetic event'
,
async
()
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment