-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feat/use inp #7
Feat/use inp #7
Conversation
@@ -4,8 +4,10 @@ import { | |||
getFID, | |||
getLCP, | |||
getTTFB, | |||
onINP, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
INP以外も on*
にしておいた方が良かったりするかな!?
https://github.com/GoogleChrome/web-vitals/tree/next
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
これまだnextなので悩み中ですw
stableに入ってからでも良いかなと思ったりしてます
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
今読み込んでる3.0.0-beta.2はnextと同等 (versionsタブを参照)なのでbetaとして出すなら揃えちゃっていいかもなぁ。
まあどっちでも読んでも中身は一緒なんですがw
https://github.com/GoogleChrome/web-vitals/blob/next/src/deprecated.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
f1175e0
揃えました!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
INP(Interaction to Next Paint)の計測スクリプトを追加しました。
INPはFIDを拡張したもので、click, keypressなどのeventが発生してから次のpaint処理が走るまでの時間を計測します。
ユーザーのインタラクションから次のframeが表示されるまでに以下のように時間が計測されます。
指標は以下のようになっています。
web-vitalsライブラリではINPに閾値を設定できて、defaultでは40ms以下はデータを取得しないようになっています。
詳細は https://web.dev/inp/ を確認してください。
INPはまだexperimentalな仕様なので今後変わる可能性があります。
そのためstableリリースではなく、
npm version prerelease --preid=beta
としてリリースします。