4 ms·
That's if you use your template library to emulate React. What jQuery brings to the table is that you can sprinkle in a few selectors, event listeners and ajax
by bigmanwalter 10y ago
That's if you use your template library to emulate React. What jQuery brings to the table is that you can sprinkle in a few selectors, event listeners and ajax calls, then you have no need for a shadow dom.
The minimal transform is usually trivial to implement by hand:
var message = $('.widget__message'),
title = $('.widget__title'),
button = $('.widget__button');
button.on('click', () => {
$.get('/api/widget/1', response => {
title.text(response.text);
message.text(response.message);
});
});
Not only is this technique significantly more flexible than react, there's no magic about it so it's far easier to reason about when things aren't working.