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 Type Definitions #70

Merged
merged 5 commits into from
Dec 23, 2020
Merged

Typescript Type Definitions #70

merged 5 commits into from
Dec 23, 2020

Conversation

jescalan
Copy link
Collaborator

There has been a long standing PR to convert this entire library to typescript that has been plagued with a variety of issues stemming from its lack of default exports and two separate exports. In the meantime, perhaps we can bridge the gap by just providing typings. I pulled this out of one I wrote in a consuming typescript library, but I am not great at typescript so any thoughts here appreciated. If this works out, will write one for renderToString and ship it as major, call it a day for now!

@Southclaws
Copy link

Southclaws commented Dec 12, 2020

Nice!

I was trying to debug this for ages last night and it turned out I just passed a field to the wrong object in the params 😂 I added quick typings myself (yes by copying the code into our project 🤠) to identify the issue and fix it so this is going to be super useful!

@jescalan jescalan changed the title WIP: typings Typescript Type Definitions Dec 22, 2020
@jescalan
Copy link
Collaborator Author

jescalan commented Dec 23, 2020

I'm feeling pretty good about this. I'm going to cut a prerelease here for testing - since this library uses hooks, running npm link produces a hooks error. Installing the prerelease should make it easier to test for real in live projects. If anyone else wants to take an opportunity to test it, that would be wonderful!

You can try it out with npm i next-mdx-remote@canary

@jescalan
Copy link
Collaborator Author

Just completed a full test on one of my team's typescript apps and everything seemed to work correctly. I'm going to add some docs on the types and give a day for review if anyone else wants to take a look, then move forward with this one. Onwards!

@jescalan jescalan merged commit 5b39c3b into master Dec 23, 2020
@jescalan jescalan deleted the typings branch December 23, 2020 21:39
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.

2 participants