Live data from Hacker News

Cloudflare Pages: Best server tech since CGI-bin?

taras.glek.net

61–70 of 226 posts

Re: Cloudflare Pages: Best server tech since CGI-bin?

#61

I feel like there's a large class of tools in this space now (Vercel, Netlify) that do all of this and more, and this post is less about Cloudflare Pages and more about the (really good) state of static hosting these days? One thing that stuck out was the comment about "Twitter cards", since Vercel/Next now has this built in: https://twitter.com/vercel/status/1579561293069316096

No it’s pointing out the server side scripting part which was new to me. do analogs exist in those other hosting options? This seems like a really nice facility - closest analog client side wise is a service worker or something that adjusts fetch.

Re: Cloudflare Pages: Best server tech since CGI-bin?

#62

How does using GPT-3 make the types more visible? Feels futuristic but also incomprehensible to me. > As a shortcut, I used GPT-3 to generate a basic typescript function for me. This let me look at TS type definitions and get a better idea of what’s available so I could get developing.

Hope the author responds, because that stuck out to me too! My assumption was that their prompt was something like "typescript cloudflare function" and they just used the resultant code to see types in action inside their IDE.

GitHub Copilot is GPT-3 under the hood, so maybe that way?

Re: Cloudflare Pages: Best server tech since CGI-bin?

#63

How does using GPT-3 make the types more visible? Feels futuristic but also incomprehensible to me. > As a shortcut, I used GPT-3 to generate a basic typescript function for me. This let me look at TS type definitions and get a better idea of what’s available so I could get developing.

Hope the author responds, because that stuck out to me too! My assumption was that their prompt was something like "typescript cloudflare function" and they just used the resultant code to see types in action inside their IDE.

Author here.

I just got access to OpenAI codex. I used edit function and asked it to modify the JS hello world, to add typescript annotations.

This is the git commit following that gpt conversation :)

    -export async function onRequest(context) {
    +export async function onRequest(context: {
    +  request: Request;
    +  env: { [key: string]: string };
    +  params: { [key: string]: string };
    +  waitUntil: (promise: Promise) => void;
    +  next: () => Promise;
    +  data: { [key: string]: any };
    +}) {
Not as minimal as the code I posted, but it got me over the stumbling block.

Re: Cloudflare Pages: Best server tech since CGI-bin?

#64
post #26
post #4

Earlier quoted context omitted.

Static hosting combined with server-side dynamic content modification using postgres was the interesting part for me. Static hosting has historically been seen as exactly that, static and immutable. Things like Cloudflare functions/workers can turn static hosting into dynamic content delivery while maintaining (most of) the benefits of static hosting. Granted, this can be done whether the underlying content is hosted…

Yes, it's great because static/static+some dynamic bits fits a lot of use cases and it's quite simple to deploy, manage and maintain. It's nothing that new though, Firebase (part of GCP) and Netlify have had that for years. CloudFlare just have the right combination of marketing, reputation, pricing and tech to make headlines with it again.

I have never seen an example where you land a JS file in a static website in git and it just runs as part of server side middleware. Seems legit novel but would like to know other examples.

Re: Cloudflare Pages: Best server tech since CGI-bin?

#65
post #14

a bit off-topic, but couldn't resist: > As a shortcut, I used GPT-3 to generate a basic typescript function for me. This let me look at TS type definitions and get a better idea of what’s available so I could get developing. As a long time programmer, I keep trying to maintain my skepticism of AI/ML techniques for program authoring. Comments like this are dissolving my objections by the minute...

See my comment re GPT above. It has saved me quite a few hours since I started using it.

Re: Cloudflare Pages: Best server tech since CGI-bin?

#66
post #62

Earlier quoted context omitted.

Hope the author responds, because that stuck out to me too! My assumption was that their prompt was something like "typescript cloudflare function" and they just used the resultant code to see types in action inside their IDE.

GitHub Copilot is GPT-3 under the hood, so maybe that way?

I use copilot, but not for this. I find raw gpt-3 conversational interface to be much more useful for getting over various small programming puzzles.

Re: Cloudflare Pages: Best server tech since CGI-bin?

#67

Earlier quoted context omitted.

Cloudflare reports 50% quarter growth year over year, it sounds to me you're in a minuscule minority.

That the majority does it does not mean its a good thing.

It absolutely is, Cloudflare offers great services and they deserve it!

Re: Cloudflare Pages: Best server tech since CGI-bin?

#68

Why not just make it CGI (or FastCGI) compatible so you can test it locally or run it in other environments? At least for things that are actually generating responses rather than acting as middleware. Oh, right, vendor lock-in.

You can pretty easily change from Cloudflare to any other Jamstack host. Cgi just isn't necessary anymore and would be more baggage than anything at this point. The old web stacks are just time sinks. It's so much nicer to be able to git push... And that's it. Done.

> It's so much nicer to be able to git push... And that's it. Done.

Can you elaborate? My CGI-based website is deployed with `git push` as well, not sure what the difference is there.

Re: Cloudflare Pages: Best server tech since CGI-bin?

#69

Earlier quoted context omitted.

We just don't want to support MiTMFlare with our traffic and money.

Cloudflare reports 50% quarter growth year over year, it sounds to me you're in a minuscule minority.

Yes, let's simplify the Internet, being decentralised is such a crutch! We should all just connect directly to Cloudflare.

Re: Cloudflare Pages: Best server tech since CGI-bin?

#70

I feel like there's a large class of tools in this space now (Vercel, Netlify) that do all of this and more, and this post is less about Cloudflare Pages and more about the (really good) state of static hosting these days? One thing that stuck out was the comment about "Twitter cards", since Vercel/Next now has this built in: https://twitter.com/vercel/status/1579561293069316096

Author here. I actually thought about using this library. In my case re-rending as svg was too complex. Much more practical to upload screenshots of DOM, share those via functions/middleware.
Post reply on HN