use semicolon && add speed insights

This commit is contained in:
sjwie 2024-02-07 18:55:23 +09:00
parent e44f57abb1
commit 3a0b8ed7ea
6 changed files with 23 additions and 15 deletions

View File

@ -1,5 +1,5 @@
{ {
"semi": false, "semi": true,
"singleQuote": false, "singleQuote": false,
"trailingComma": "all", "trailingComma": "all",
"useTabs": false, "useTabs": false,

View File

@ -1,12 +1,12 @@
"use client" "use client";
import Image from "next/image" import Image from "next/image";
import Link from "next/link" import Link from "next/link";
import { useRef, useState } from "react" import { useRef, useState } from "react";
import { DrawIoEmbed, DrawIoEmbedRef } from "react-drawio" import { DrawIoEmbed, DrawIoEmbedRef } from "react-drawio";
export default function Home() { export default function Home() {
const [imgData, setImgData] = useState("") const [imgData, setImgData] = useState("");
const drawioRef = useRef<DrawIoEmbedRef>(null) const drawioRef = useRef<DrawIoEmbedRef>(null);
return ( return (
<main className="flex min-h-screen flex-col items-center justify-between p-24"> <main className="flex min-h-screen flex-col items-center justify-between p-24">
<div className="z-10 max-w-5xl w-full items-center justify-between font-mono text-sm lg:flex"> <div className="z-10 max-w-5xl w-full items-center justify-between font-mono text-sm lg:flex">
@ -40,12 +40,12 @@ export default function Home() {
ref={drawioRef} ref={drawioRef}
onExport={(data) => { onExport={(data) => {
console.log(`onExport executed: console.log(`onExport executed:
${JSON.stringify(data, null, 2)}`) ${JSON.stringify(data, null, 2)}`);
setImgData(data.data) setImgData(data.data);
}} }}
onClose={(data) => { onClose={(data) => {
console.log(`onClose executed: console.log(`onClose executed:
${JSON.stringify(data, null, 2)}`) ${JSON.stringify(data, null, 2)}`);
}} }}
/> />
</div> </div>
@ -58,5 +58,5 @@ export default function Home() {
/> />
)} )}
</main> </main>
) );
} }

View File

@ -1,3 +1,4 @@
import { SpeedInsights } from "@vercel/speed-insights/next";
import type { Metadata } from "next"; import type { Metadata } from "next";
import { Inter } from "next/font/google"; import { Inter } from "next/font/google";
import "./globals.css"; import "./globals.css";
@ -16,6 +17,7 @@ export default function RootLayout({
}>) { }>) {
return ( return (
<html lang="en"> <html lang="en">
<SpeedInsights />
<body className={inter.className}>{children}</body> <body className={inter.className}>{children}</body>
</html> </html>
); );

View File

@ -1,5 +1,5 @@
import Image from "next/image" import Image from "next/image";
import Link from "next/link" import Link from "next/link";
export default function Home() { export default function Home() {
return ( return (
@ -118,5 +118,5 @@ export default function Home() {
</a> </a>
</div> </div>
</main> </main>
) );
} }

View File

@ -9,6 +9,7 @@
"lint": "next lint" "lint": "next lint"
}, },
"dependencies": { "dependencies": {
"@vercel/speed-insights": "^1.0.9",
"next": "14.1.0", "next": "14.1.0",
"react": "^18", "react": "^18",
"react-dom": "^18", "react-dom": "^18",

View File

@ -298,6 +298,11 @@
resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406" resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406"
integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ== integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==
"@vercel/speed-insights@^1.0.9":
version "1.0.9"
resolved "https://registry.yarnpkg.com/@vercel/speed-insights/-/speed-insights-1.0.9.tgz#ad748c238c4ed58b32cc8a398f28abe507dabd53"
integrity sha512-f+XFP0O+aZ4Olj9h+BitkB1b4NJQaxtyCb69wWuDxytJHY6Pa4QtZPdBUftHOcajUCHRVeq062fk3MKXKtjNVQ==
acorn-jsx@^5.3.2: acorn-jsx@^5.3.2:
version "5.3.2" version "5.3.2"
resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937"