-
Notifications
You must be signed in to change notification settings - Fork 788
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
[vite-plugin] add inspectorPort
option to plugin config
#7929
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 22061c3 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 |
A wrangler prerelease is available for testing. You can install this latest build in your project with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13463158549/npm-package-wrangler-7929 You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/7929/npm-package-wrangler-7929 Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13463158549/npm-package-wrangler-7929 dev path/to/script.js Additional artifacts:cloudflare-workers-bindings-extension: wget https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13463158549/npm-package-cloudflare-workers-bindings-extension-7929 -O ./cloudflare-workers-bindings-extension.0.0.0-v6b151cbe1.vsix && code --install-extension ./cloudflare-workers-bindings-extension.0.0.0-v6b151cbe1.vsix create-cloudflare: npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13463158549/npm-package-create-cloudflare-7929 --no-auto-update @cloudflare/kv-asset-handler: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13463158549/npm-package-cloudflare-kv-asset-handler-7929 miniflare: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13463158549/npm-package-miniflare-7929 @cloudflare/pages-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13463158549/npm-package-cloudflare-pages-shared-7929 @cloudflare/unenv-preset: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13463158549/npm-package-cloudflare-unenv-preset-7929 @cloudflare/vite-plugin: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13463158549/npm-package-cloudflare-vite-plugin-7929 @cloudflare/vitest-pool-workers: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13463158549/npm-package-cloudflare-vitest-pool-workers-7929 @cloudflare/workers-editor-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13463158549/npm-package-cloudflare-workers-editor-shared-7929 @cloudflare/workers-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13463158549/npm-package-cloudflare-workers-shared-7929 @cloudflare/workflows-shared: npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/13463158549/npm-package-cloudflare-workflows-shared-7929 Note that these links will no longer work once the GitHub Actions artifact expires.
Please ensure constraints are pinned, and |
import { expect, test } from "vitest"; | ||
|
||
test("starts a devTools inspector server on inspectorPort 9123", async () => { | ||
const inspectorJsonResponse = await fetch("http://localhost:9123/json"); |
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 am not sure about this test, it is quite nice in my opinion, but relying on port 9123 being available might cause the test in CI to be less reliable 😕
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.
No yeah.... this is not working well in CI at all... /~https://github.com/cloudflare/workers-sdk/actions/runs/13008386588/job/36280652973?pr=7929#step:5:1461
I might just need to remove it 😓
inspectorPort
option to plugin configinspectorPort
option to plugin config
794ee3e
to
0098664
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.
I'm approving this pending the decision about whether it should be enabled by default.
It does bother me that you see lots of options in chrome://inspect
and it's hard to tell which is the actual user Worker. Wrangler has a much nicer experience here that only exposes the user Worker. Do you think we should be making changes to Miniflare to improve this?
Yes, this new option is just the first step/prerequisite for having a much nicer experience later on (@penalosa had some ideas here I think), as I mentioned in the PR description this is not a solution to #7852, but more of a preliminary change that will be needed anyways and that for the time being does enable us to easily do some extra debugging when needed without needing to patch the plugin |
7632a00
to
73f917e
Compare
remove `inspectorPort` testing (which does not work well in CI)
73f917e
to
6253b6c
Compare
6253b6c
to
22061c3
Compare
@@ -4,3 +4,5 @@ export const ASSET_WORKERS_COMPATIBILITY_DATE = "2024-10-04"; | |||
// TODO: add `Text` and `Data` types (resolves /~https://github.com/cloudflare/workers-sdk/issues/8022) | |||
export const MODULE_TYPES = ["CompiledWasm"] as const; | |||
export type ModuleType = (typeof MODULE_TYPES)[number]; | |||
|
|||
export const DEFAULT_INSPECTOR_PORT = 9229; |
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.
Note: this is another instance in which a shared package in the monorepo would make sense to me, so that all packages could share the same constant for the default inspector
add an
inspectorPort
option that allows developers to start a devTools inspector serverthat allows them to debug their workers