-
Notifications
You must be signed in to change notification settings - Fork 48.4k
[mcp] Add proper web-vitals metric collection #33109
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
base: main
Are you sure you want to change the base?
Conversation
import {StdioServerTransport} from '@modelcontextprotocol/sdk/server/stdio.js'; | ||
import {z} from 'zod'; | ||
import {compile, type PrintedCompilerPipelineValue} from './compiler'; | ||
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; |
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.
Looks like maybe you have some lint configuration misconfigured
@@ -29,16 +33,16 @@ const server = new McpServer({ | |||
|
|||
server.tool( | |||
'query-react-dev-docs', | |||
'Search/look up official docs from react.dev', | |||
'This tool lets you search for official docs from react.dev. This always has the most up to date information on React. You can look for documentation on APIs such as <ViewTransition>, <Activity>, and hooks like useOptimistic, useSyncExternalStore, useTransition, and more. Whenever you think hard about React, please use this tool to get more information before proceeding.', |
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.
I saw that @poteto removed "please"s from the prompts in a previous PR
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.
Yes, I accidentally got myself into merge hell for trying to do mercurial patterns but shawn saved me lol
28562dd
to
ad63721
Compare
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.
Did you try out in claude?
|
||
TEST: ${results.webVitals.inp} |
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.
what's the TEST
for?
for (const selector of selectors) { | ||
await page.click(selector); | ||
await delay(500); | ||
} |
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.
depending on the number of elements this could be pretty slow. I don't think you need to wait 500ms after every click before clicking again right?
for (const selector of selectors) { | |
await page.click(selector); | |
await delay(500); | |
} | |
await Promise.all(selectors.map((selector) => page.click(selector))); | |
await delay(500); |
Multiple things here: