NethermindEth / zksync-remix-plugin

Remix plugin for zkSync
MIT License
11 stars 7 forks source link

Implement version check and auto-update for zkSync Remix plugin #126

Open satyambnsal opened 1 week ago

satyambnsal commented 1 week ago

Currently, users may continue to access outdated versions of the zkSync Remix plugin due to browser caching. We need to implement a mechanism that checks for new versions and automatically fetches the latest version when available. Proposed solution:

Implement a version check system:

Store the current plugin version in a easily accessible location (e.g., a JSON file or API endpoint) On plugin initialization, compare the local version with the latest available version

Auto-update mechanism:

If a new version is detected, fetch the latest plugin files Update the local plugin files with the newly fetched version Reload the plugin to use the new version

Cache-busting strategy:

Implement a cache-busting technique (e.g., appending a version number or timestamp to file URLs) to ensure browsers always fetch the latest files

This enhancement will ensure that users always have access to the most recent version of the plugin, improving the overall user experience and reducing potential issues related to outdated versions.

varex83 commented 1 week ago

The first part is already done, so we can focus on the second one: "Auto-update mechanism"

About third one, I don't see any possible easy solutions like appending the version tag into the plugin URL since it will require updating the URL to plugin in Remix repository. I would propose trying to add some headers to the vite to avoid caching.