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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support method signatures in objects #1511

Merged
merged 2 commits into from Dec 21, 2022

Conversation

flugg
Copy link
Contributor

@flugg flugg commented Dec 20, 2022

While there is no built-in formatter for functions, it's still nice to be able to parse method signatures in objects. Among other, having no parser for this means types referencing types with bivariance-hacks, which is used in a lot of TS libraries, among other React - wont be able to be parsed at all. For instance:

type EventHandler<E extends SyntheticEvent<any>> = { bivarianceHack(event: E): void }["bivarianceHack"];

This PR solves this by adding support for method signatures.

I had to be a bit creative in the tests, as there's no formatter so the assertValidSchema utility wont work. Therefore, I added a new assertMissingFormatterFor utility that implicilty tests that we're able to parse the type, even though we can't format it.

Version

Published prerelease version: v1.2.0-next.5

Changelog

馃帀 This release contains work from new contributors! 馃帀

Thanks for all your work!

鉂わ笍 Alexander T酶mmer氓s (@flugg)

鉂わ笍 null@mvanniekerkSQ

鉂わ笍 null@swnf

鉂わ笍 Thomas (@thomaswr)

鉂わ笍 Arthur Fiorette (@arthurfiorette)

鉂わ笍 Sean Keenan (@sean9keenan)

馃殌 Enhancement

馃悰 Bug Fix

馃敥 Dependency Updates

Authors: 9

@domoritz domoritz changed the title Support method signatures in objects feat: support method signatures in objects Dec 21, 2022
@domoritz domoritz merged commit df2de31 into vega:next Dec 21, 2022
@flugg
Copy link
Contributor Author

flugg commented Dec 21, 2022

Thanks for the quick merge!

@flugg flugg deleted the feature/support-method-signatures branch December 21, 2022 14:43
@github-actions github-actions bot mentioned this pull request Dec 22, 2022
@github-actions
Copy link

馃殌 PR was released in v1.2.0 馃殌

@github-actions github-actions bot added released This issue/pull request has been released. and removed prerelease labels Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants