@@ -28,7 +28,7 @@ export default defineNuxtPlugin({
2828 name : 'nuxt-hints:performance' ,
2929 setup ( ) {
3030 const nuxtApp = useNuxtApp ( )
31- nuxtApp . __hints = defu ( nuxtApp . __hints , {
31+ nuxtApp . payload . __hints = defu ( nuxtApp . payload . __hints , {
3232 webvitals : {
3333 lcp : ref ( [ ] ) ,
3434 inp : ref ( [ ] ) ,
@@ -37,9 +37,9 @@ export default defineNuxtPlugin({
3737 } )
3838
3939 nuxtApp . hook ( 'hints:webvitals:sync' , ( webvitals ) => {
40- webvitals . lcp . value = [ ...nuxtApp . __hints . webvitals . lcp . value ]
41- webvitals . inp . value = [ ...nuxtApp . __hints . webvitals . inp . value ]
42- webvitals . cls . value = [ ...nuxtApp . __hints . webvitals . cls . value ]
40+ webvitals . lcp . value = [ ...nuxtApp . payload . __hints . webvitals . lcp . value ]
41+ webvitals . inp . value = [ ...nuxtApp . payload . __hints . webvitals . inp . value ]
42+ webvitals . cls . value = [ ...nuxtApp . payload . __hints . webvitals . cls . value ]
4343 } )
4444
4545 nuxtApp . hook ( 'app:mounted' , ( ) => {
@@ -51,7 +51,7 @@ export default defineNuxtPlugin({
5151 '[web-vitals] INP Metric: ' ,
5252 metric ,
5353 )
54- nuxtApp . __hints . webvitals . inp . value . push ( metric )
54+ nuxtApp . payload . __hints . webvitals . inp . value . push ( metric )
5555 nuxtApp . callHook ( 'hints:webvitals:inp' , metric )
5656 } , {
5757 reportAllChanges : true ,
@@ -65,7 +65,7 @@ export default defineNuxtPlugin({
6565 `[web-vitals] LCP Metric: ` ,
6666 metric ,
6767 )
68- nuxtApp . __hints . webvitals . lcp . value . push ( metric )
68+ nuxtApp . payload . __hints . webvitals . lcp . value . push ( metric )
6969 nuxtApp . callHook ( 'hints:webvitals:lcp' , metric )
7070
7171 for ( const performanceEntry of metric . entries ) {
@@ -130,7 +130,7 @@ export default defineNuxtPlugin({
130130 metric ,
131131 )
132132 // Push the metric as-is; components will access entries[0] directly for element
133- nuxtApp . __hints . webvitals . cls . value . push ( metric )
133+ nuxtApp . payload . __hints . webvitals . cls . value . push ( metric )
134134
135135 for ( const entry of metric . entries ) {
136136 const performanceEntry = entry
0 commit comments