Skip to content

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

Description

@webJose

Motivation

There's an issue with the AIM plug-in's logic: The resolved identifiers that were resolved using the received import map are cached by Vitte's dev server (or at least this is what I believe it is happening). Because the server has cached ID resolution with a version of the import map that is NOT the one that is about to be posted (once the page reload takes place), AIM's resolution is not happening with the new import map, so the overall result is that it feels like the override did not take place.

Proposal

Make the AIM plug-in allow the DELETE HTTP verb in its import map endpoint. This should signal the plug-in to dump the current import map and to invalidate all ID's so-far resolved using it.

Details

Implement this new work in the "Save Overrides & Reload" button of the IMO UI. The list of servers is the same list IMO used to post the import map.

The UI should make the HTTP DELETE requests to all of these Vite servers and wait until they respond. Responding will be the signal that they have cleaned up the previous import map and are now import-map-less.

Visually, the status on every server should be shown, probably using a spinner while the response is awaited, and a checkmark or X icon after receiving the result.

If we get all checkmarks, we reload without user intervention; if we get at least one X, we allow the user to choose between retry or manual reload (ignoring the issue).

While waiting for all responses from all Vite servers, a "Reload now" button should be available, where clicking it would simply reload without waiting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Fields

    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions