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

[WIP]: Scrim types #531

Closed
wants to merge 14 commits into from
Closed

[WIP]: Scrim types #531

wants to merge 14 commits into from

Conversation

wenche
Copy link
Contributor

@wenche wenche commented Aug 31, 2020

Part of #249

wenche and others added 11 commits August 28, 2020 09:40
* Install typescript and types for react and react-dom

* Add support for typescript by using .ts extensions for js files

* Change file extensions to .ts in figma-broker
* Fix tsconfig for tokens package. Didn't realise that this was missing...

* Add typescript and typescript config

* Rename index.js -> index.ts

* Rename file endings for icons in figma broker
* Add typescript packages

* Add tsconfig

* Couldn't do it without the tslib deps, even if it's supposed to be a dep on rollup-plugin-typescript2

* Disable ts checks as a baseline before porting
* First try for typescript support for Divider

* In the middle of using proptables from ts components in the storybook

* Lot's of lot's of tweeks to make prop tables in storybook working. This commit is kind of a proof of concept

* Remove classname, key and ref from props table

* Removed debug env

* Removed configuration of typescript in storybook main

* Remove old testing stuffs

* Remove old rollup typescript plugin

* Delete copy'n pasted babel typescript transpiler, we use rollup plugin instead

* Remove testing stuffs
* First try for typescript support for Divider

* In the middle of using proptables from ts components in the storybook

* Lot's of lot's of tweeks to make prop tables in storybook working. This commit is kind of a proof of concept

* Remove classname, key and ref from props table

* Removed debug env

* Removed configuration of typescript in storybook main

* Remove old testing stuffs

* Remove old rollup typescript plugin

* Delete copy'n pasted babel typescript transpiler, we use rollup plugin instead

* Remove testing stuffs

* Fix test
* configure eslint for typescript

* one config to rule them all

* update stuff
@wenche
Copy link
Contributor Author

wenche commented Aug 31, 2020

With this I'm stuck with an empty props in docgen. I don't know why this i happening. From es build file

try {
  Scrim.displayName = "Scrim";
  Scrim.__docgenInfo = {
    description: "",
    displayName: "Scrim",
    props: {}
  };
} catch (e) {}

@wenche
Copy link
Contributor Author

wenche commented Aug 31, 2020

My impression is that the code and the tests itself have some flaws... I think we are struggling both with TS and suboptimal code here. E.g.

 /** Stupid hack to avoid crash on ...rest*/
  [x: string]: any

Quick fix from mighty Internet to avoid crash in the tests with <Scrim onKeyDown={handleClose}>

Also it's hard to wrap my head around the differents between TS KeyboardEvent and React.KeyboardEvent. It's a mess right now :/

as the onClose is either called by react onClick or javascript keydown EventListener we don't need the React.KeyboardEvent
@wenche
Copy link
Contributor Author

wenche commented Oct 7, 2020

Closing this pull request since it is far behind the rest of the code base. (Aka long lived PR's are not a good idea :) )

@wenche
Copy link
Contributor Author

wenche commented Oct 7, 2020

See PR #654

@wenche wenche closed this Oct 7, 2020
@wenche wenche deleted the types-for-scrim branch October 7, 2020 12: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.

3 participants