Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript Support #137

Closed
willsmanley opened this issue Jan 1, 2021 · 6 comments · Fixed by #177
Closed

TypeScript Support #137

willsmanley opened this issue Jan 1, 2021 · 6 comments · Fixed by #177

Comments

@willsmanley
Copy link

It would be nice to have a @types/dynalite for this lib

@leaumar
Copy link

leaumar commented Sep 30, 2021

Our project uses this, perhaps a good starting point? I don't know dynalite enough myself to kickstart this.

declare module 'dynalite' {
  import { Server } from 'http';

  interface DynaliteServer {
    listen: (callback: (error: Error | undefined) => void) => Server;
  }

  interface DynaliteOptions {
    createTableMs?: number;
    path?: string;
  }

  export default function dynalite(options?: DynaliteOptions): DynaliteServer;
}

I do wish this TS support gets made soon, it's now the only hurdle (after dozens, and dozens, and dozens before it...) between our project and yarn2+pnp. 😅

@reconbot
Copy link
Member

reconbot commented Sep 4, 2023

@ryanblock I'm making some types right now for a project - would you rather them contributed to @types/dynalite or to this project directly as jsdoc comments?

@ryanblock
Copy link
Member

ryanblock commented Sep 4, 2023

@reconbot hey man! I don't have a personal preference, only that I am not maintaining them, heh! JSDoc has proved to be limiting and didn't quite work out when used in some other projects of late, although I guess if all we're doing is adding them to the index.js file, that's probably super straightforward, no?

@reconbot
Copy link
Member

reconbot commented Sep 4, 2023

Yea JSDOC works out for this project. The silly bit is that we pass the options object to the https.createServer() to pass the included ssl keys (which are expired btw) but don't pass it to http.createServer() So you could mess with the server options but only if you use ssl.

@ryanblock
Copy link
Member

Oh jeez, those keys are expired eh? Iirc Michael mentioned they were a huge thorn in his side and that he kind of wished he hadn't added https support. I'm going to propose dropping it, or at least dropping use of our own keys (e.g. if you want to use that feature, you have to supply your own keys). We've looked at https in Sandbox-land time and time again, and every time we arrive at the conclusion that it's way more trouble than it's worth, especially given the local dev context.

@reconbot
Copy link
Member

reconbot commented Sep 4, 2023

💯 I fully support removing keys. I was going to create an issue about it but figured I was procrastinating on my real work and let it be

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

4 participants