Active-CSS / active-css

The epic event-driven browser language for UI with functionality in one-liner CSS. Over 100 incredible CSS commands for DOM manipulation, ajax, reactive variables, single-page application routing, and lots more. Could CSS be the JavaScript framework of the future?
https://activecss.org
Other
42 stars 7 forks source link

Add an "after reactive-update" syntax #275

Closed bob2517 closed 7 months ago

bob2517 commented 2 years ago

Using after stack as a means of running something after the reactive variables have done their updating doesn't work. It needs to be a bit bigger than this in order to allow the event stack to slot into the correct place in the flow.

The workaround appears to be "after 10ms". This would have "after reactive-update" as an alternative syntax. It does sound a bit weird as a solution internally and I don't like it at all, so it needs a proper investigation to find out what exactly is happening in the flow. The variable updates happen asynchronously for performance reasons, so making var updates synchronous is probably not the best solution if it can be helped. Ideally though, this would be perfect because everything would then flow without needing an "after" event at all. But I'm worried this may bring in render jerkiness - it may not though.

Meanwhile, the workaround appears to work, but may not work in all scenarios. Marking this as an enhancement rather than a bug, as this is coming up as a new use case.

This ties into issue https://github.com/Active-CSS/active-css/issues/274

bob2517 commented 7 months ago

Closing for now - I don't have a real-world application for this yet.