Astal icon indicating copy to clipboard operation
Astal copied to clipboard

docs: Add example for auto-reloading css

Open FjedorGaede opened this issue 1 year ago • 5 comments

While migrating to the v2 I noticed that the example from the original documentation on how to make auto-reloading of SCSS and CSS work was missing in the documentation. As I rely on it heavily and think it increases the DX alot - especially for new users - , it should be added to the documentation. The example I provided is the one that is running on my machine and works as expected. WDYT?

  • Fjedor

FjedorGaede avatar Nov 15 '24 20:11 FjedorGaede

Yes, makes sense. Added the changes.

FjedorGaede avatar Nov 16 '24 16:11 FjedorGaede

Honestly hot-reloading of both scss and typescript should be built-in ags. Interested to hear what @Aylur thinks.

For now I use fd .* -E @girs | entr -crz ags run until I find better but still simple tool. Normally I would use vite in frontend project.

danielwerg avatar Nov 16 '24 16:11 danielwerg

I'll probably write a roadmap at some point, because this is a feature I have in mind. For ags run I'm thinking of a --watch flag, but I don't think its possible to do hot module reloading like on web frameworks, at least I have no clue how it could be done, so all it would do is just restart the gjs process. However for stylesheets it is possible. I'm thinking of doing it through dbus so all consumers of Astal.Application can benefit from it.

Aylur avatar Nov 16 '24 17:11 Aylur

We can merge this in the meantime though after https://github.com/Aylur/astal/issues/95 is fixed

Aylur avatar Nov 16 '24 17:11 Aylur

@danielwerg Good points. I pushed the changes

FjedorGaede avatar Nov 24 '24 20:11 FjedorGaede

closing this because of https://github.com/Aylur/astal/pull/369

if you still feel like contributing, you can reopen this at https://github.com/Aylur/ags/

Aylur avatar Jun 28 '25 15:06 Aylur