Switch from direct DOM mangling to using preact to automate DOM updates by instead maintaining a virtual DOM which preact keeps in sync. Using a test jig to insert events into the HTML seems to work okay:
<script type="text/javascript">
setTimeout(()=>{
drawEvents([
{
eventId: "123",
sender: "@matthew:matrix.org",
type: "m.room.message",
content: {
body: "i am a fish",
}
},
{
eventId: "124",
sender: "@matthew:matrix.org",
type: "m.room.message",
content: {
body: "i am a fish",
}
}
], true);
}, 0);
setTimeout(()=>{
removeEvents([
{
eventId: "123",
sender: "@matthew:matrix.org",
type: "m.room.message",
content: {
body: "i am a fish",
}
},
{
eventId: "124",
sender: "@matthew:matrix.org",
type: "m.room.message",
content: {
body: "i am a fish",
}
}
]);
}, 1000);
</script>
...but it seems to be erroring from Seaglass itself. Eitherway, the point of the PR is to hopefully demonstrate that managing an HTML view in WebKit using preact might be quite painless and easy to forget about, and possibly less pain than NSAttributedString fun.
Switch from direct DOM mangling to using preact to automate DOM updates by instead maintaining a virtual DOM which preact keeps in sync. Using a test jig to insert events into the HTML seems to work okay:
...but it seems to be erroring from Seaglass itself. Eitherway, the point of the PR is to hopefully demonstrate that managing an HTML view in WebKit using preact might be quite painless and easy to forget about, and possibly less pain than NSAttributedString fun.