Add stock base dialog prototype - #5
Conversation
Roam prototype previewsThe preview deployment is ready. Paste a URL below into Load Developer Extensions from URL in Roam: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1cd0d0687f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| export default runExtension(async () => { | ||
| let closeDialog: (() => void) | undefined; | ||
|
|
||
| closeDialog = await renderAlert({ |
There was a problem hiding this comment.
Register cleanup before awaiting the dialog
SimpleAlert.render resolves only after the alert is dismissed, so while the dialog is visible this initializer remains pending and has not returned its unload callback. If the extension is disabled or reloaded before the user clicks Close, the overlay therefore remains mounted; the resolved value also is not a dialog disposer to save in closeDialog. Mount the alert without blocking lifecycle initialization and register an actual cleanup operation immediately.
AGENTS.md reference: AGENTS.md:L18-L18
Useful? React with 👍 / 👎.
|
Initial test run. fixes in #6 |
Summary
stock-base-dialogRoam developer-extension prototyperunExtensionutility export so the production bundle calls the lifecycle wrapper correctlyWhy
This provides a minimal stock prototype for confirming that the public prototype scaffold builds, installs, and loads UI successfully in Roam.
Runtime fix
The original default import of
roamjs-components/util/runExtensionwas wrapped as a CommonJS module object in the ESM production bundle. Roam then attempted to call that object, causingTypeError: (0, at.default) is not a functionduring extension load. Importing the named export fromroamjs-components/utilemits a direct function call in the bundle.Impact
Loading the extension displays a simple success dialog with a Close button. It does not read from or write to the user's graph.
Validation
runExtensionas a functionpnpm test— 28 repository tests passed; prototype Vitest command passed with no test filespnpm buildpnpm prepare:artifacts— prepared one valid artifact set