Skip to content

feat: Ask all vite-aim servers to forget the import map#31

Merged
webJose merged 4 commits into
mainfrom
JP/aim-delete-im
Jul 11, 2026
Merged

feat: Ask all vite-aim servers to forget the import map#31
webJose merged 4 commits into
mainfrom
JP/aim-delete-im

Conversation

@webJose

@webJose webJose commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Closes #22.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.ts into a new src/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.

Comment thread src/lib/Imo/ServerActionProgress.svelte
Comment thread src/lib/Imo/ServerActionProgress.svelte Outdated
Comment thread src/lib/Imo/DeleteAndReload.svelte
Comment thread src/lib/Imo/TimerMessage.svelte Outdated
Comment thread src/shared/common.ts
Comment thread src/private-types.ts
webJose added 3 commits July 10, 2026 20:39
- Also fixed a race condition by eliminating the use of Promise.all() for "overall done" state
@webJose
webJose merged commit 7ca5259 into main Jul 11, 2026
1 check passed
@webJose
webJose deleted the JP/aim-delete-im branch July 11, 2026 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ask @collagejs/vite-aim to delete the import map before reloading due to override changes

2 participants