-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
fix: warning for chrome devtools requests now suggests sv instead of vite plugin #13905
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
fix: warning for chrome devtools requests now suggests sv instead of vite plugin #13905
Conversation
🦋 Changeset detectedLatest commit: 5b99d16 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
No clue why this unrelated test is failing, even though I didn't even change code |
Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
if (DEV && event.url.pathname === '/.well-known/appspecific/com.chrome.devtools.json') { | ||
if (!warned_on_devtools_json_request) { | ||
console.warn( | ||
`\nGoogle Chrome is requesting ${event.url.pathname} to automatically configure devtools project settings. To serve this file, add this plugin to your Vite config:\n\nhttps://github.com/ChromeDevTools/vite-plugin-devtools-json\n` | ||
`\nGoogle Chrome is requesting ${event.url.pathname} to automatically configure devtools project settings. For more details see https://svelte.dev/docs/cli/devtools-json, or to add a plugin to generate and serve this file run:\n\nnpx sv add devtools-json\n` |
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.
the message should identify where it was created, right now it sticks out in that it is a plain log without any prefix, finding the cause involves grepping node_modules.
`\nGoogle Chrome is requesting ${event.url.pathname} to automatically configure devtools project settings. For more details see https://svelte.dev/docs/cli/devtools-json, or to add a plugin to generate and serve this file run:\n\nnpx sv add devtools-json\n` | |
`\n[sveltekit] Google Chrome is requesting ${event.url.pathname} to automatically configure devtools project settings. For more details see https://svelte.dev/docs/cli/devtools-json, or to add a plugin to generate and serve this file run:\n\nnpx sv add devtools-json\n` |
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.
this is still advertising to "just add the plugin to resolve this message". What can users do that don't want to use this feature? There's also no mention that this is connected to the chromium workspace folder feature.
It should be clear that adding this enables this feature for everyone accessing a dev-server including that via chromium - in chromium 140 there won't be a way to opt-out of this anymore.
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'd prefer not to add the log prefix. None of SvelteKit's other log messages have a prefix, so it seems really inconsistent. I think the link to svelte.dev docs is a good hint
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.
Agree. No prefix, unless we start adding a prefix to all messages that originate from Kit
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.
@dominikg great points. How about something like this? I think we can mention SvelteKit in the envelope variable name rather than log prefix
`\nGoogle Chrome is requesting ${event.url.pathname} to automatically configure devtools project settings. For more details see https://svelte.dev/docs/cli/devtools-json, or to add a plugin to generate and serve this file run:\n\nnpx sv add devtools-json\n` | |
`\nA Chromium browser is requesting ${event.url.pathname} to automatically configure devtools project settings. For more details see https://svelte.dev/docs/cli/devtools-json. This message can be disabled by installing the plugin discussed there or by setting SVELTEKIT_IGNORE_DEVTOOLS_REQUESTS=true\n` |
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.
Or at the very least make it an option that is selected by default when going through the
sv create
wizard
Just tried it again to be sure, but that's already the case!
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.
why should that option be enabled by default? this is us opting in to that behavior on the users behalf.
tbh i'd question if that plugin should even be an addon in sv, it is a general DX plugin at best and if these are ok and enabled by default, i think there's a few more we might want to add, starting with vite-plugin-inspect and vite-plugin-qrcode.
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.
Tbf I'd be completely ok with both of those
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.
Maybe inspect is a bit less useful for the general user because you need to kinda understand the build pipeline to use it
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.
The difference is that the absence of the inspect and qrcode plugins doesn't result in a confusing message. Not sure why we keep going over this
Co-authored-by: Rich Harris <hello@rich-harris.dev>
Co-authored-by: Dominik G. <dominik.goepel@gmx.de>
Co-authored-by: Dominik G. <dominik.goepel@gmx.de>
Suggest setting up the devtools config using the newly release
sv add devtools-json
command. Follow-up for #13830Relates sveltejs/cli#581
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpm changeset
and following the prompts. Changesets that add features should beminor
and those that fix bugs should bepatch
. Please prefix changeset messages withfeat:
,fix:
, orchore:
.Edits