solid-refresh icon indicating copy to clipboard operation
solid-refresh copied to clipboard

Default @refresh pragma

Open edemaine opened this issue 3 years ago • 3 comments

Could we add an option (here and the solid-vite-plugin that includes this) to specify the default @refresh pragma, for files that don't override @refresh? And I guess we'd need to give a name to the current default behavior, so you could opt back into it. Maybe /* @refresh replace */?

Motivation: The more I experience HMR (e.g. changing solid-playground), the more I find it buggy for the types of changes I make; for certain types of testing/debugging, I really want the full page reload every time. I basically don't trust the HMR results and manually reload every time. So I'd like to be able to specify a default of /* @refresh reload */.

edemaine avatar May 10 '22 16:05 edemaine

If we desire a full page reload by default, perhaps not using solid-refresh shouldn't be a problem? There isn't much difference to it.

lxsmnsyc avatar May 11 '22 02:05 lxsmnsyc

I guess I imagined a code base that had some well-behaved files, which could be marked, while the rest are assumed side-effecty. But I'd probably be fine with turning solid-refresh on/off as needed (when editing styles/text vs doing complex code edits). Is there am easy way to do that with solid-vite-plugin though?

edemaine avatar May 11 '22 02:05 edemaine

yes, with hot: false

lxsmnsyc avatar May 11 '22 07:05 lxsmnsyc