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

feat: add typescript typings for @mdx-js/mdx, @mdx-js/react, @mdx-js/runtime, and @mdx-js/vue #811

Merged
merged 5 commits into from
Dec 16, 2019

Conversation

ChristianMurphy
Copy link
Member

@ChristianMurphy ChristianMurphy commented Oct 11, 2019

This adds typings for @mdx-js/mdx, @mdx-js/react, @mdx-js/runtime, and @mdx-js/vue.

A few notes on the typings

  • the typings target TypeScript 3.4+, because they depend on the Unified typings, which require at least 3.4
  • Even through TypeScript is not officially supported, adding typings may break the setup for TypeScript adopters who hand rolled typings, out of an abundance of caution Unified has been releasing typings as major releases to communicate this. This may, or may not be an approach mdx wants to take
  • These typings don't necessarily need to live in this code base, the could also be published to definitely typed instead, if preferred.

/cc @Rokt33r

@ChristianMurphy ChristianMurphy requested a review from a team October 11, 2019 23:12
@vercel vercel bot temporarily deployed to staging October 11, 2019 23:12 Inactive
@vercel
Copy link

vercel bot commented Oct 11, 2019

This pull request is being automatically deployed with ZEIT Now (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://zeit.co/mdx/mdx/hho2n3q5v
🌍 Preview: https://mdx-git-fork-christianmurphy-feat-add-typescript-typings.mdx.now.sh

@vercel vercel bot temporarily deployed to staging October 12, 2019 01:16 Inactive
@vercel vercel bot temporarily deployed to staging October 12, 2019 01:47 Inactive
@ChristianMurphy ChristianMurphy changed the title feat: add typescript typings for @mdx-js/mdx and @mdx-js/react feat: add typescript typings for @mdx-js/mdx, @mdx-js/react, and @mdx-js/vue Oct 12, 2019
@vercel vercel bot temporarily deployed to staging October 12, 2019 02:45 Inactive
@ChristianMurphy ChristianMurphy changed the title feat: add typescript typings for @mdx-js/mdx, @mdx-js/react, and @mdx-js/vue feat: add typescript typings for @mdx-js/mdx, @mdx-js/react, @mdx-js/runtime, and @mdx-js/vue Oct 12, 2019
@ChristianMurphy ChristianMurphy force-pushed the feat/add-typescript-typings branch from 08b8ca2 to 2f654e6 Compare October 12, 2019 02:47
@vercel vercel bot temporarily deployed to staging October 12, 2019 02:47 Inactive
@johno
Copy link
Member

johno commented Oct 12, 2019

Thanks for this! I think it makes sense for the types to live in the monorepo 👍. Since we're probably about a month out from a v2 release maybe that's when we can merge in the types to make sure we avoid possible breakage?

You mind maybe pointing this PR to the v2 branch and then we can merge it @ChristianMurphy (when ready)?

Copy link
Member

@johno johno left a comment

Choose a reason for hiding this comment

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

I don't use TypeScript so we probably want more eyes on this, but lgtm! 🙏 💟

@ChristianMurphy ChristianMurphy changed the base branch from master to v2 October 12, 2019 13:29
@ChristianMurphy

This comment has been minimized.

@ChristianMurphy ChristianMurphy force-pushed the feat/add-typescript-typings branch from 2f654e6 to 08ca639 Compare October 12, 2019 15:13
@ChristianMurphy
Copy link
Member Author

re-targeted and re-based off v2 branch.

@ChristianMurphy ChristianMurphy added ☂️ area/types This affects typings 💎 v2 Issues related to v2 🦋 type/enhancement This is great to have 🧑 semver/major This is a change 🙉 open/needs-info This needs some more info labels Oct 12, 2019
Copy link
Member Author

@ChristianMurphy ChristianMurphy left a comment

Choose a reason for hiding this comment

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

typings for @mds-js/loader and @mdx/vue-loader have also been added.
Documentation for typescript has been updated to reflect new types.

export type Components = {
[key in ComponentType]?: React.ComponentType<{ children: React.ReactNode }>
}
* \\\\\\\\\\`@mdx-js/mdx`
Copy link
Member Author

Choose a reason for hiding this comment

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

The backslashes were added by prettier 🤷‍♂️

@ChristianMurphy ChristianMurphy force-pushed the feat/add-typescript-typings branch from 5b2d76f to e8fdf1d Compare October 12, 2019 23:03
@johno
Copy link
Member

johno commented Dec 16, 2019

Going to go ahead and merge into v2. We'l prolly want to verify we don't need any changes after all v2 updates are made, but there shouldn't actually be any breaking changes for users so it probably won't be an issue.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
☂️ area/types This affects typings 💪 phase/solved Post is done 🧑 semver/major This is a change 🦋 type/enhancement This is great to have 💎 v2 Issues related to v2
Development

Successfully merging this pull request may close these issues.

3 participants