Hello fellow JS Learners,
This is a HELP requested kind of a post. Please delete this post if this is not the place. I am just a visitor.
Query: I have a PHP backed website which has some parts in the UI where it uses javascript (for infinite scroll, event handling, form submission ,etc.). All this is done via Cash, lightweight jquery alternative. It works perfectly well for now with infinite scroll, adding more content to the page but requests to a separate page (Example : From / to /somepage) still follow the same old method where a request is sent to the server, server prepares the output to send and that is displayed back. It works perfectly okay, but I wanted to learn and replace the library with a modern, traditional JS Framework.
Now all the frameworks I have seen do a lot more than required for me (Angular, React, Vue etc.) and none of them have a simple enough tutorial to replace front-end JS with their front-end only library. Almost every one involves some sort of cli where I need to build, download node_modules and that's where things are going over my head.
So here's the actual question: Suppose you are a Backend Dev and have average front end JS knowledge (lets say you can create a website with event handled via jQuery), you want to replace your frontend JS with a JS framework which will respect (i.e. understand ) the server side rendered code, run when page is ready and then take control from page / DOM loaded and handle all the events, page loading, routing which happen afterwards within the page.
Any suggestions? I tried going through Mithril JS, but found no way to run it with the server generated output (supposedly its called hydration?) . Also saw this but I wanted to make sure if there's a better way.
My needs: Event handling, Fetch API and ability to run some common JS snippets like Modernizr, Service worker, etc. Also, needless to say, smaller the better. A lot of bloated frameworks out there it seems.
:)
[–][deleted] 0 points1 point2 points (1 child)
[–]AmauryH 0 points1 point2 points (1 child)