Hi Hyuchia,

Any reason why you choose aegis-framework/pandora? The framework seems to have not been worked on since 9 months ago, with almost no documentation..
I wanted to create a custom studio page, built on top of jquery & jquery-ui, i can do React.. pandora seems similar with React, bt i cant even bind a button with a simple onclick event.

it would be great if you can point the correct direction how to integrate monogatari with jquery.. maybe we can collaborate to improve this further.

Thanks

Chilly Pandora is indeed similar to React (it's meant to be) but only up to a certain level since conceptually they're quite different.

Pandora's components are "native" web components, that means, they're just fancy HTML elements plain and simple with no VirtualDom or any other abstraction layer. They also don't require any transpilation process since they're pretty much vanilla.

Adding event listeners then is exactly the same as you'd do it on vanilla JS because then again, there's (almost) no difference between them and normal elements such as p, div, form etc.

const element = document.querySelector ('my-custom-component');
element.addEventListener ('click', () => {
    // Some action
});

As part of the Aegis Framework, we already ship Artemis which can do many of the things you'd usually do with jQuery (at least on the basic DOM manipulation side) so if possible, it's best to use Aegis rather than adding yet another dependency but of course that depends on what you need as Artemis doesn't cover the full jQuery range

Using Artemis for click event listeners is fairly simple and straight forward just like with jQuery. From the example above:

$_('my-custom-component').click(() => {
    // Some action
});

As for jQuery-UI I'd certainly wouldn't recommend using it at all but that's more of a personal preference.

Aegis overall lacks a lot of documentation but just like with Monogatari, that's sadly due to lack of time on my side to actually produce it. They are indeed not updated quite often for that very reason but also because they work in their current state so there hasn't been an immediate need for changes recently.

Write a Reply...