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

Update Bun.serve() types documentation to match the exact values from bun.d.ts #10420

Merged
merged 10 commits into from Apr 30, 2024

Conversation

mangs
Copy link
Contributor

@mangs mangs commented Apr 21, 2024

What does this PR do?

I've been spending a lot of time looking at Bun.serve() and its types lately, and I noticed the website documentation documenting the types are out of date. This PR attempts to bring them in line with the current published types in bun.d.ts.

I matched the types exactly, added missing keys, and reordered the keys in each object to be in alphabetical order so it's a bit easier to find what you're looking for.

Formatted with Prettier.

  • Documentation or TypeScript types (it's okay to leave the rest blank in this case)
  • Code changes

docs/api/http.md Outdated
maxRequestBodySize?: number;
port?: string | number;
reusePort?: boolean;
serverNames?: Record<string, TLSOptions>; // Server Name Indication (SNI) / TLS virtual hosts
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

serverNames is incorrect, it does not exist in the codebase

tls can optionally be an array of the object type or just the object type

Copy link
Contributor Author

@mangs mangs Apr 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, this must have changed since I filed this; this is how it was yesterday. Thanks for the heads up. I just pulled main now and the types appear to be different. I'll do a once over on all of them to make sure they're right.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually come to think of it I was checking types from bun-types version 1.1.4 not main. I'm checking main now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All set

@mangs
Copy link
Contributor Author

mangs commented Apr 30, 2024

Bump. Pretty sure this is ready to go.

@Jarred-Sumner Jarred-Sumner merged commit 185a4bf into oven-sh:main Apr 30, 2024
@mangs mangs deleted the update-http-types-docs branch April 30, 2024 00:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants