feat: Ask all vite-aim servers to forget the import map#31
Merged
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.
- Also fixed a race condition by eliminating the use of Promise.all() for "overall done" state
…up the interval on unmount
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #22.