Uh oh!
There was an error while loading. Please reload this page.
feat: Ask all vite-aim servers to forget the import map - #31
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends @collagejs/imo to proactively request import-map deletion from discovered/allowed Vite dev servers before reloading the app, and refactors the IMo runtime entry to a separate implementation module while adding UI pieces to show server-action progress.
Changes:
- Track discovered dev-server origins in session storage and add helpers to filter “involved” (allowed) servers.
- Add a “delete import map then reload” flow in the widget UI, including progress and countdown messaging.
- Extract the IMo runtime logic from
src/imo/imo.tsinto a newsrc/imo/imo-impl.ts.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| vite.config.ts | Passes a new importMapTimeout option into the Vite CSS plugin configuration. |
| src/shared/storage-keys.ts | Adds a session-storage key for discovered Vite servers and includes it in the “vite-servers” delete path. |
| src/shared/common.ts | Adds helpers to read discovered servers from session storage and compute the allowed/excluded server sets. |
| src/private-types.ts | Introduces HttpOrigin branded string type used for server-origin handling. |
| src/lib/Imo/TimerMessage.svelte | New timer-driven message component used for delayed reload behavior. |
| src/lib/Imo/Spinner.svelte | New loading indicator used in server-action progress UI. |
| src/lib/Imo/ServerActionProgress.svelte | New component to display per-server POST/DELETE progress and results. |
| src/lib/Imo/ImoDialog.svelte | Refactors dialog to use DialogContent and switch to DeleteAndReload flow on save. |
| src/lib/Imo/DialogContent.svelte | Extracted tabbed content (Current/Original/Dev Servers) from ImoDialog. |
| src/lib/Imo/DeleteAndReload.svelte | New component that issues DELETE requests to involved servers and reloads (or prompts) based on results. |
| src/lib/Imo/CurrentImportMap.svelte | Trims override input values and preserves existing replacement text when editing/accepting. |
| src/imo/imo.ts | Simplifies entrypoint to call main() from the new implementation module. |
| src/imo/imo-impl.ts | New implementation module; now persists discovered servers to session storage and shares filtering logic. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Also fixed a race condition by eliminating the use of Promise.all() for "overall done" state
…up the interval on unmount
Uh oh!
There was an error while loading. Please reload this page.
Closes#22.