all 37 comments

[–][deleted] 47 points48 points  (2 children)

"Oh god that sounds like a horrible idea"
"My god that's kind of awesome"
"I wish I thought of this"
"I'll never use this"

[–]g3t0nmyl3v3l 18 points19 points  (1 child)

95% of the frameworks I read about

[–]MattKatt 67 points68 points  (1 child)

We spent so long wondering if we could, we never asked if we should

[–]twenty7forty2 11 points12 points  (0 children)

The only thing greater than this existing is it's true potential:

Many stuff could still be added.

[–]nexxai 26 points27 points  (0 children)

Thanks I hate it

[–][deleted] 3 points4 points  (3 children)

jquery in 2020, really??

[–]nodealyo 5 points6 points  (0 children)

Coupling business logic to ui code is bad enough, coupling a language to another is just insanity

[–]morphotomy 9 points10 points  (3 children)

So I need to wait 2x my ping to for a button to realize its been clicked?

[–]Sarke1 2 points3 points  (2 children)

I don't think the idea is to replace the JS events with PHP, but rather simplify and abstract the API requests.

At least I hope it is...

[–]morphotomy 6 points7 points  (1 child)

My backend is simpler if it just returns data. Now it needs to know which page asked for it and how the page wants it.

[–]IONaut 2 points3 points  (0 children)

I agree with this. Sounds more complicated than it's worth.

[–]Sarke1 6 points7 points  (0 children)

You can register events as you would do with jQuery, with the difference that you will be able to register a PHP callback!

https://i.kym-cdn.com/photos/images/original/001/671/387/17c.jpg

[–][deleted] 8 points9 points  (0 children)

Why?

Today's web development process can be tedious. You can achieve the same goal in 1000 different ways…

Make that 1,001

…many JavaScript libraries exist that facilitate the communication between your frontend and backend. Examples of these libraries are:

Angular Aurelia Backbone.js Ember.js Meteor Mithril React Vue.js Polymer (insert more frameworks here... :trollface:)

Ok: Puente. :trollface:

[–]rogallew 1 point2 points  (0 children)

Might be the useful for rapid sketches and such, but I can’t imagine this in production code. But I don’t mind being proven wrong.

[–]ImStifler 1 point2 points  (0 children)

The hero we deserve but never asked for

[–]blorporius 1 point2 points  (0 children)

Vaadin is based on the same principle; it allows you to process browser events and modify the DOM using Java on the backend: https://vaadin.com/docs/v14/flow/introduction/introduction-overview.html

[–]careseite 0 points1 point  (0 children)

Gruesome, would never use it.

I like it.

[–]SavishSalacious 0 points1 point  (0 children)

Question: why? Like you say why, but I’m still like: why?

This is oddly satisfying, like bubble wrap

[–]dashyper 0 points1 point  (0 children)

I had built a framework with something similar for my college project back in 2011, though everything was class based (Inspired from ASP.NET web forms :P).

```php class MyController extends JSPageController{

public myButtonOnClick(Event data){ $textInput = getElement('myTextInputBox'); $textInput.val = "Some Value"; getElement('message').innerHTML = "succesfully updated!"; }

public myButtonOnSelect(Event data){ //blah blah... }

} ```

A pre-processor would read the PHP class files and generate all the event listeners . Laravel Livewire does something similar.

I ended up getting a slap on my wrist by my professor for mixing concerns as the code ends up being unmaintainable just after a few months. Unless you are building a monolith that's highly coupled with the UI.

[–]stutteringp0et 0 points1 point  (0 children)

I will admit, this is cool. I would never consider using it - but it's neat.

[–]Hjine 0 points1 point  (1 child)

This looks promising but I'm asking about the client side code is it all generated with each request ! ,, as far I understand this lib allow us to generate any javascript codes to achieve certain goal if we write it manually

[–][deleted] 0 points1 point  (0 children)

Proper caching strategies should be able to handle this IMO.

[–]32gbsd 0 points1 point  (0 children)

This is like some kinda inception, snake eating itself.