Live data from Hacker News

A whole website in a single JavaScript file

deno.com

131–140 of 170 posts

Re: A whole website in a single JavaScript file

#132

Where’s Tailwind coming from in this example? It doesn’t seem to be imported, and I can’t see anything about it in their playground link either: https://dash.deno.com/playground/website-in-a-single-js

> For rendering of the JSX, we use nanossr, which is a tiny server-side renderer that uses twind under the hood for styling

Re: A whole website in a single JavaScript file

#133

Where’s Tailwind coming from in this example? It doesn’t seem to be imported, and I can’t see anything about it in their playground link either: https://dash.deno.com/playground/website-in-a-single-js

nanossr seems to be using twind (https://github.com/tw-in-js/twind) under the hood.

Re: A whole website in a single JavaScript file

#135
post #52

> /// : Deno comes with various TypeScript libraries enabled by default; with this comment, we tell it to not use those, but instead only the ones we specify manually. Interesting. I checked the docs on this and it’s not quite clear to me why this is needed in this case, or what the benefit is in taking this approach. Is this strictly a build time optimization, or is it necessary in this example?

It’s actually not needed at all for runtime. It’s purely for editor experience and type checking.

Re: A whole website in a single JavaScript file

#136
post #105

Earlier quoted context omitted.

There is no need to manually set up your own Node.js SSR framework for React. Next.js exists, and is quite mature at this point. Next.js is quite fun. Highly recommend it. The novel thing, for this, in my mind, is the edge hosting.

But just like all other frameworks, the cost isn't just getting it started, it's learning the framework, learning the ecosystem, and slowly building up your knowledge of the edge cases when you start moving past it's limits. Next.js puts you squarely back in monolith server-side territory in that regard, it's just a different flavor. Of course it has it's upsides if you're doing a purely React application. But you've…

I wonder if this is why a keep reverting to PHP , most stuff I can build without frameworks or just the odd library because I know how.

Everytime I give myself some free project experiments (have a local PI for tinkering) I always feel it’s unnecessarily complicated or feeling that hill I have to climb, at which point I can dream the solution in PHP frontend JS/HTML.

Re: A whole website in a single JavaScript file

#137
post #18
post #6

Earlier quoted context omitted.

What other kinds of examples would you like to see ? The goal was to showcase simple yet intuitive JSX + tailwind at edge, we didn't elaborate on more advanced use-cases like authenticated pages, API endpoints/forms, dynamic pages (location, etc...) or parametric routes.

I'd love an example where the user updates some piece of data. The update should be displayed right away to the user and in a DB.

There is another blog post coming up in a couple of weeks (hopefully) that will demo this.

Re: A whole website in a single JavaScript file

#138
post #51

Wow that's cool. Would love to see a more "interactive" to-do or "guestbook" site that shows how that side of things work. Also wondering if this can be done serverless-ly or requires something always on?

Deno Deploy is serverless, and Deno CLI is always on, so you can do either with the same code

Re: A whole website in a single JavaScript file

#140

In Firefox 98.0.2 / Windows 10, at the playground, the URL does not reflect the route, and refreshing will display the hidden but currently selected route, rather than the URL route. https://imgur.com/a/ZP95YcD

Yup, this is very unfortunate, but sadly a browser cross origin privacy protection. We can not fix it without injecting some third party code into your site automatically (which we don’t want to do).
Post reply on HN