Hi Gage,
there is no way for a compiler function to delay the fragment insertion
into the DOM. You can do async things in a compiler, but the element
will be rendered in the current execution task.
Maybe your compiler could hide the element (or show some "decrypting..."
indicator) and show it when done?
Clever idea with using a custom transition function to delay the page
rendering. At the point the transition function starts both the old and
new fragment are already in the DOM (moved into the same position to
shared elements overlay each other exactly). Your function could check
if the new fragment contains encrypted elements. If yes it would hide
the new fragment and delay the transition until your decrypting compiler
emits an decryption:done event or similar.
Best regards
Henning
Am 16.04.2021 um 23:34 schrieb Gage Peterson:
>
> I tried to look around the code to see how things are done but sadly I'm
> not super familiar with CoffeeScript. Is there a way to make a function
> that will compile a piece of HTML /before/ it's rendered? More or less
> pause the page transition till some async thing happens?
>
> I know that's a weird thing to do but I'm trying to implement end-to-end
> encryption but I hate constantly seeing the decrypting state every time
> you visit a page. I was thinking I could use transitions to pause the
> page rendering till after the HTML has been replaced with the decrypted
> state, but I'm not sure that'll work.
>
> Tell me if this is crazy 😆
>
> --
> You received this message because you are subscribed to the Google
> Groups "unpoly" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
unpoly+un...@googlegroups.com
> <mailto:
unpoly+un...@googlegroups.com>.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/unpoly/313e2449-93e0-4a9f-a4d0-c98e5427421bn%40googlegroups.com
> <
https://groups.google.com/d/msgid/unpoly/313e2449-93e0-4a9f-a4d0-c98e5427421bn%40googlegroups.com?utm_medium=email&utm_source=footer>.