3 ms·
The Vercel SQL library doesn't mix raw SQL and HTML. It can't, since that'd easily allow public db access on the frontend. What people wanted was the speed of
by robertoandred 3y ago
The Vercel SQL library doesn't mix raw SQL and HTML. It can't, since that'd easily allow public db access on the frontend.
What people wanted was the speed of a server-rendered starting point and the flexibility and performance of client-side templating and interactivity. JS/React can deliver this, PHP cannot.
- tacker2000 3y agoYou could do that with PHP backend + any frontend framework during the last 2 decades before. OK, now you can do it using just one JS framework i guess? But is it a revolution? A breakthrough?
- robertoandred 3y agoYou couldn't do that before. Combining a PHP backend and a frontend framework meant you had two different html templates.
- omnimus 3y agoWhat are you event talking about? Are you aware that any touring completel language can output JSON... what two different html templates?
- tacker2000 3y agoThats not true. You had one .php file (or more, if you use includes) where everything was located: the HTML, if necessary any JS via <script> and interspersed with <?php … ?> depending on what dynamic stuff you wanted to output. And this is parsed to one output file that is sent back to the browser.
- omnimus 3y agoWow i just said that it is server side javascript because you were claiming ... and that its mixing raw sql with html template like what was hated in PHP. Have you even looked at https://vercel.com/storage/postgres https://vercel.com/storage/postgres - its right there in their example. You are either trolling me or you are not really sure how these things work?