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

Add ESLint and TypeScript #458

Merged
merged 12 commits into from Aug 4, 2022
Merged

Add ESLint and TypeScript #458

merged 12 commits into from Aug 4, 2022

Conversation

pmbanugo
Copy link
Contributor

@pmbanugo pmbanugo commented Jul 17, 2022

Closes #457

This PR adds TypeScript and rewrites the library code using TypeScript.

Highlight:

  • Rewrote the library using TS
  • Rewrote the test using TS and node-tap
  • Updated the GitHub Actions
  • Generate types for the library
  • Removes deprecated endpoints
  • Drops Node.js 12 support

@leerob
Copy link
Member

leerob commented Jul 17, 2022

Amazing! Will dive into this and take a look.

packages/micro/src/bin/micro.ts Outdated Show resolved Hide resolved
packages/micro/src/bin/micro.ts Outdated Show resolved Hide resolved
packages/micro/src/lib/handler.ts Outdated Show resolved Hide resolved
@pmbanugo pmbanugo force-pushed the typescript branch 2 times, most recently from f3c66ec to 1e19d20 Compare July 22, 2022 16:16
}

if (obj instanceof Stream || readable(obj)) {
//TODO: Wouldn't (obj instanceof Stream) be the only check here? Do we specifically need a Readable stream or a Stream object that's not of NodeJS Stream?
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure about this. The comment is for someone here to let me know why we do this. Or discuss later in the future if this is necessary.

@pmbanugo pmbanugo marked this pull request as ready for review July 22, 2022 16:28
@pmbanugo pmbanugo requested a review from leerob July 22, 2022 16:29
@pmbanugo
Copy link
Contributor Author

pmbanugo commented Jul 22, 2022

Hi @leerob It's ready for review.

@leerob
Copy link
Member

leerob commented Jul 24, 2022

I think we'll need to add a test script for CI.

CleanShot 2022-07-24 at 13 51 35@2x

@pmbanugo
Copy link
Contributor Author

pmbanugo commented Jul 24, 2022

I think we'll need to add a test script for CI.

CleanShot 2022-07-24 at 13 51 35@2x

@leerob I've updated the script, it should work now.

@pmbanugo
Copy link
Contributor Author

That should work but it's failing 😓 I'm not sure why, but I'll check again.

@pmbanugo
Copy link
Contributor Author

@leerob Updated... If it doesn't work this time, perhaps you can try clearing the cache and rerunning the build.

@leerob
Copy link
Member

leerob commented Jul 25, 2022

It works! 🎉

Copy link
Member

@leerob leerob left a comment

Choose a reason for hiding this comment

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

Will try to get one more review on here tomorrow, but LGTM.

@pmbanugo
Copy link
Contributor Author

Will try to get one more review on here tomorrow, but LGTM.

Hi, @leerob just following up on this 😄

@leerob
Copy link
Member

leerob commented Jul 31, 2022

Planning to go ahead and merge/release #460, and then let's release this as a major version 👍

@pmbanugo
Copy link
Contributor Author

@leerob Do you want me to update my branch and use the reverted change, or go ahead with what I currently have with serve and http.Server? I guess you would want the second option as part of the major version release.

@leerob
Copy link
Member

leerob commented Jul 31, 2022

What do you think? I think we probably keep the breaking changes.

@pmbanugo
Copy link
Contributor Author

pmbanugo commented Aug 1, 2022

I think we keep the breaking change because that way we can use it programmatically with fastify or something similar. I'll make the necessary changes and update the PR soon.

@pmbanugo
Copy link
Contributor Author

pmbanugo commented Aug 1, 2022

I left it with the breaking change and updated the documentation

@leerob leerob merged commit 8d2ca07 into vercel:main Aug 4, 2022
@pmbanugo pmbanugo deleted the typescript branch August 4, 2022 08:35
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.

Add ESLint and move to TypeScript
2 participants