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

fix(forms): fix wrong references in types in picasso-forms #1330

Merged
merged 1 commit into from
May 22, 2020

Conversation

denieler
Copy link
Collaborator

Description

We have currently an issue in the types of picasso-forms, that come types are imported incorrectly from @toptal/picasso/src/**. Looks like this is happening because of an issue in tsc - microsoft/TypeScript#34793.

So currently this code:

import { ButtonProps } from '@toptal/picasso'
export type Props = Omit<ButtonProps, 'type'>
export const SubmitButton = (props: Props) => {

got transformed by tsc into:

import { ButtonProps } from '@toptal/picasso';
export declare type Props = Omit<ButtonProps, 'type'>;
export declare const SubmitButton: {
    (props: Pick<Pick<import("@toptal/picasso/src/Button").Props, "color" | "hidden" | "size" | "style" | "icon" | "active" | "disabled" | "children", ...

which is wrong. But after modifying ButtonProps somehow - looks like tsc understand better what we want from it. I haven't found yet a better fix

@denieler denieler requested review from a team and dempfi May 22, 2020 09:35
import { Props } from './Button'

export { default } from './Button'
export type ButtonProps = OmitInternalProps<Props>
export type ButtonProps = Props
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we don't need OmitInternalProps anymore, because Button is using useStyles already 👍

@denieler denieler changed the title fix(forms): fix wrong references in types in picass-forms fix(forms): fix wrong references in types in picasso-forms May 22, 2020
@havenchyk
Copy link
Contributor

which is wrong

but what exactly went wrong?

@denieler
Copy link
Collaborator Author

which is wrong

but what exactly went wrong?

This was the issue - https://github.com/toptal/staff-portal/pull/849#discussion_r428988456
@toptal/picasso/src/Button - this link is not correct, because we don't have src folder in Picasso package after the release

@denieler denieler force-pushed the fx-fix-picasso-forms-types branch from 9a4b6ec to fe91785 Compare May 22, 2020 14:45
@toptal-devbot
Copy link
Collaborator

🎉 Last commit is successfully deployed 🎉

Demo is available on:

Your davinci-bot 🚀

@denieler denieler merged commit c4aab7b into master May 22, 2020
@denieler denieler deleted the fx-fix-picasso-forms-types branch May 22, 2020 16:30
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.

3 participants