🍳為什麼沒人給 Next.js 的設計提出這個問題 :(
Lars-Erik Roald:
I don't get why Next.js community get so fuzzed up by this. This is in essence what Next.js is about.
You either drink the cool aid or you switch back to SPA.
Putting the server code in a separate function or in another layer really doesn't change anything. And remember this is for demonstrational purpose.
(FYI There is no sql injection here as the templated sql is somehow converted to a parameterized query by the sql-library. I still think sql template literal is a bad practice because it is so easy mess up and it is not obvious that this is converted to parameterized query.)
https://twitter.com/lroal/status/1717810357501149310