[explorer] show DO object names where possible#13133
Conversation
🦋 Changeset detectedLatest commit: 01c5756 The changes in this PR will be included in the next version bump. 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 |
|
Codeowners approval required for this PR:
Show detailed file reviewers |
Changeset ReviewSummaryAll changesets look good Detailed Reviewreject-v8-coverage-provider.md
c3-frameworks-update-13276.md, c3-frameworks-update-13275.md, c3-frameworks-update-13278.md, c3-frameworks-update-13279.md, c3-frameworks-update-13274.md
tender-dryers-ask.md
email-service-commands.md
use-formatConfigSnippet-in-dev-compat-date.md
dependabot-update-13241.md, dependabot-update-13305.md
all-fans-march.md
calm-beers-help.md
good-falcons-remain.md
images-chainable-handle.md
c3-node-version-check.md
|
|
Now I have a thorough understanding of the changes. Let me analyze the key issue I spotted: The main concern is in
Actually, thinking more carefully: Let me think about the performance issue more carefully. The DO instances are being woken up anyway in production to serve requests, and this is a local dev explorer tool. The concern is less critical in a local dev context. However, the name is already being persisted to SQLite - why not just read it directly from the SQLite file on disk instead of waking up every DO? Actually, reading the SQLite file from disk would bypass the DO isolation. The current approach using stubs is the "correct" way to interact with DO storage. And since this is local dev only, the performance is acceptable. Let me check one more thing - whether the Looking at lines 277-279 of return {
id,
name,
hasStoredData: true,
};When Let me also check the The Let me also verify the Wait, but there's another issue. In the Overall the PR looks well-structured. The only actionable concern I see is the performance implication of waking up every DO on list, but given this is a local dev tool and the page is limited to 50, it's pragmatically acceptable. Let me check if there's anything else. Looking at the One thing I notice: the Let me do one final check on whether the In the constructor (line 34), But wait - I'm satisfied this PR is well-implemented. No bugs, no security issues, no backward compatibility concerns. The approach is sound for a local dev tool. LGTM |
create-cloudflare
@cloudflare/kv-asset-handler
miniflare
@cloudflare/pages-shared
@cloudflare/unenv-preset
@cloudflare/vite-plugin
@cloudflare/vitest-pool-workers
@cloudflare/workers-editor-shared
wrangler
commit: |
e53d6e5 to
658ea88
Compare
0334d95 to
6a1341c
Compare
this is only ever something miniflare makes up, the namespace id is never stored in the wrangler config
6a1341c to
25ae0b8
Compare
|
Codeowners approval required for this PR:
Show detailed file reviewers |
workers-devprod
left a comment
There was a problem hiding this comment.
Codeowners reviews satisfied
e83c361 to
01c5756
Compare
DOs can be instantiated with a name (idFromName), with an existing id (idFromString) or with a new random id (newUniqueId). When idFromName is used, ctx.id.name is set inside the DO; name cannot be known if initialised with the other methods.
We already wrap user DOs for the local explorer. This PR adds a bit to the constructor that stores a map of object name to hex ID in an internal table
__miniflare_do_name. Then, when we list DO objects, we can get the DO name if available and list this alongside the ids.I've also added a bit to the UI that can find a specific DO by name/id, instead of having to find the listing in the table, which is useful if you have lots of DO instances.
A picture of a cute animal (not mandatory, but encouraged)