gavinmcfarland / plugma

Take Figma plugin development to the next level
https://plugma.dev
MIT License
55 stars 3 forks source link

Improve DX when server inactive while plugin is open and if light or dark mode changes #18

Closed gavinmcfarland closed 5 days ago

gavinmcfarland commented 2 months ago

Currently we display a message if you try to open the plugin but the development server is not active. However it would be great if a message could be displayed while you have the plugin open if the local dev server is not running.

To do this we must check the URL is active while the plugin is open. We do this before hosting the URL, but when the plugin iframe then points to the URL, the code that runs to do this is not longer loaded in the DOM. So in order to accommodate this we must have the a similar function in the code that exists on the server side. This requires a bit of refactoring to abstract the logic so that we don't have to update it in several places. While this is being done, we should also probably check if dark or light mode has been changed. This check should happen by using a poll to detect if the server is not longer active.

gavinmcfarland commented 5 days ago

Now supported in the next major release.