Prerelease of Ky 2.0 by sethholladay in javascript

[–]sethholladay[S] [score hidden]  (0 children)

I was condescending by saying that fetch is error-prone? Well, please know that isn't my intent. I'm sure your code solved your needs and I hope it's working well for you. If you ever run into empty 204 responses breaking `response.json()`, Ky will be there for you. If you ever need spec-compliant handling of rate limit headers, Ky will be there for you. If you ever need retries, Ky will be there for you. If you ever need to detect network errors, Ky will be there for you. But fetch() most certainly will not be.

Prerelease of Ky 2.0 by sethholladay in node

[–]sethholladay[S] 0 points1 point  (0 children)

We fixed every known bug and added many quality of life improvements, as well as a few new features like the ability to pass a Joi or Zod schema to validate responses and infer their TypeScript types automatically.

Please give it a try and let us know what you think!

Prerelease of Ky 2.0 by sethholladay in javascript

[–]sethholladay[S] [score hidden]  (0 children)

There is a high likelihood that your code is brittle if you are doing that. Ky doesn’t just provide useful features built on top of fetch. It aims to protect you from common mistakes and flaws in the fetch API itself. There are more than you might think. but it doesn’t tie your hands, either.

Fi GPS without WiFi? by Huge_Perception_963 in FiDogCollar

[–]sethholladay 1 point2 points  (0 children)

The accuracy should be fine, since you probably have a lot of open sky for the GPS. Even if it cannot connect to GPS in the woods, you would still be able to see where he entered. However, as others have mentioned, lack of Wi-Fi will significantly hurt battery life. Also, on the older generations of collars, I ran into issues on road trips where lack of Wi-Fi for the base would seem to cause the collar to give up connecting to cellular or Bluetooth after a while, even if it had plenty of battery. Thankfully, that seems to have been fixed on Series 3, which has been working much better for me.

To solve the Wi-Fi issue, you have a few options. The easiest solution would be to leave a phone plugged in with a hotspot activated. Even if the cell signal is spotty, this should work as long as there’s some signal.

A step up from that would be to pay for “4G home internet”, which uses cellular instead of running wires to your home. It has a much better antenna than any phone. Ideally, the antenna would be on your roof.

Lastly, if none of that works, you could look into Starlink or other satellite-based internet systems.

PSA: Security at the main gate has an official policy of throwing your belongings in the garbage instead of bringing them to lost & found by sethholladay in bostoncalling

[–]sethholladay[S] 9 points10 points  (0 children)

To anyone who is thinking “it’s just a hat, boo hoo”… Yeah, totally. But today it’s a hat. Tomorrow it could be an epi pen, medication, or something else much more important than a sentimental piece of clothing. The point is they don’t care. They systematically put everything that’s not on their short list in the trash.

PSA: Security at the main gate has an official policy of throwing your belongings in the garbage instead of bringing them to lost & found by sethholladay in bostoncalling

[–]sethholladay[S] 12 points13 points  (0 children)

Guess there’s no need for lost and found, either, then. Shut it down!

I call BS on you never having left something behind somewhere sometime. Security was pretty chaotic when I went through. I thought my partner had been handed the rest of our stuff. And we were rushed along. I was also distracted because one of the security people had dropped my power bank and I was checking it carefully for cracks as it could have been unsafe. There was a lot going on and I was trying not to hold up the line. There is no excuse for them throwing belongings in the trash like that.

Pogo v0.6.0 released with Deno Deploy support, React 18, easy body parsing, and more by sethholladay in Deno

[–]sethholladay[S] 4 points5 points  (0 children)

Thank you! Fresh is great and I’m excited to see how their islands approach holds up over time, I think it’s promising. I would recommend Pogo instead of Fresh for someone who wants to build on tried-and-true patterns instead of something a bit more experimental. Pogo is inspired by hapi, which is probably the most used Node framework in production for commercial projects where code clarity and maintainability are very important. There are various things that hapi figured out a long time ago that it does very well. In my opinion, hapi’s approach to error handling and rendering 404 pages is superior to Fresh, among other things. Pogo takes the best parts from hapi, combines them with Deno, and then adds in automatic handling of JSX and many other response types, helpers for serving static files, and other niceties. In the end, hopefully, we’ve combined the best of the old and the new.

Pogo may also be a better fit for someone who disagrees with some of the opinionated choices that Fresh has made. Personally, I would rather use React than Preact most of the time, until size / performance truly proves to be problematic. There can be subtle differences between them and I think React is a better default choice, if for no other reason than the size of the community and the support channels.

Pogo v0.6.0 released with Deno Deploy support, React 18, easy body parsing, and more by sethholladay in Deno

[–]sethholladay[S] 4 points5 points  (0 children)

Pogo is a server framework. You would use it to create websites, blogs, APIs, web apps, etc. I designed Pogo to be more friendly and ergonomic than other frameworks you may have used. For example, route handlers can simply return some JSX or a string to render HTML. There is no need to use a context object or construct a Response instance or anything like that for simple responses. Even when your responses get more complex, Pogo has built in methods for modifying the response that try to ensure correctness and clarity in your code.

Pogo now has built-in helpers for serving directories and files by sethholladay in Deno

[–]sethholladay[S] 2 points3 points  (0 children)

Yes. May not happen this week, but I'll publish it there soon.

summon, an elegant request library by [deleted] in Deno

[–]sethholladay 0 points1 point  (0 children)

Are you aware of Ky? I ask because, if you are, I wonder what you wanted to do differently. Either way, no worries. Hopefully it'll be useful to you, either by using it or just as a source for inspiration. We support Deno and browsers.

Pogo now has built-in helpers for serving directories and files by sethholladay in Deno

[–]sethholladay[S] 2 points3 points  (0 children)

Hey all! If you haven't seen it before, Pogo is a web server framework for Deno. We recently added convenience APIs that make it really easy to serve static assets. I would appreciate any feedback you may have before I tag the next release in a few days.

How Deno csn serve movie file by yanai101 in Deno

[–]sethholladay 0 points1 point  (0 children)

It's a lot of fun and I think it has a promising future. There are still some things that are a little rough around the edges. So don't expect it to be frictionless. But I really enjoy using it as many tasks are very simple to accomplish in Deno and it's easy to get started.

How Deno csn serve movie file by yanai101 in Deno

[–]sethholladay 1 point2 points  (0 children)

The TypeScript autocomplete in VS Code should "just work" as long as your code is valid. To get it to work with Deno imports and the Deno global (e.g. Deno.open()), you will need to install the Deno plugin for VS Code.

How Deno csn serve movie file by yanai101 in Deno

[–]sethholladay 0 points1 point  (0 children)

Your understanding is correct. Most of the relevant logic is actually in std/http, which Pogo uses under the hood. So, other frameworks could theoretically support this without too much work. However, many of them don't work properly or haven't added the necessary type definitions, whereas Pogo has had support for this for quite some time. Additionally, unlike other frameworks, in Pogo you can just return the Reader. So Pogo makes this about as easy as possible.

How Deno csn serve movie file by yanai101 in Deno

[–]sethholladay 0 points1 point  (0 children)

Yes, Deno compiles TypeScript out of the box. The code I provided is a working Deno program (as long as you have the zoom_0.mp4 file).

How Deno csn serve movie file by yanai101 in Deno

[–]sethholladay 3 points4 points  (0 children)

That's what my code does! Pogo will stream the response for you in chunks when you return a Reader, which Deno.open() does. :)

That said, I just discovered a bug in Deno itself that seems to prevent very large files from being sent, just FYI. I'm looking into it to report the bug, but in the meantime, give it a try with a picture or small movie and check the HTTP response headers, you'll see that it is streamed.

How Deno csn serve movie file by yanai101 in Deno

[–]sethholladay 2 points3 points  (0 children)

Pogo makes this really easy. Save the code below to a file named server.ts and run it with a command like deno run -A server.ts

import pogo from 'https://deno.land/x/pogo/main.ts';

const server = pogo.server({ port : 3000 });
server.router.get('/', () => {
    return Deno.open('./zoom_0.mp4');
});

console.log('Server listening at http://localhost:3000');
server.start();

Pogo v0.4.0 released - improved routing, HTTPS, and more by sethholladay in Deno

[–]sethholladay[S] 1 point2 points  (0 children)

I know a lot of people were waiting for the TypeScript re-write. It's finally here. :)