-
Notifications
You must be signed in to change notification settings - Fork 735
converting view to typescript #714
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Niryo
I went over everything, I asked some questions there..
anyway, there's a bug, the View example screen and TextField example screen are throwing error.
maybe there are more screens. I will try to investigate myself little later, but maybe u have an idea what's the bug
@@ -0,0 +1,34 @@ | |||
import {colorsPalette} from '../src/style/colorsPalette'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you create this? should the modifier be auto generated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually you are right. initially, this file contained lots of manual types with all the combination of the dynamic usage, for example "paddingT-s3". as you can see, the problem is with the s3, we can't automatically generate typings for the dynamic value, so the former guy that created the manual types, added predefined values for many of the dynamic ones and I wanted to use them. but then I found out that typescript can't read the '-' symbol, so it didn't help us and I removed it.
If you want we can add those types to the modifiers.ts file itself, it's up to you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we will never support dynamic modifiers values (for instance if someone load his own colors or spacings values)
So maybe it's ok not to have typings for that.. I don't know.
the question is, if user will use the component with a modifier that has no typing
<View bg-customColor .../>
will they get a tslint error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when I say dynamic, I mean the value. when you type paddingT-785, the value is dynamic and typescript currently don't have support for patterns, so we can't verify that the value is good. as a workaround, the dude from Kiev added some typings for common values, like padding-5 | padding-6 | padding-7| etc...
but it doesn't work, because as I said, it looks like typescript can't handle the -
.
@ethanshar oh, I'll check it too and update |
Co-Authored-By: Ethan Sharabi <ethans@wix.com>
again, skip the autogenerated typings, but don't skip the typings that are in the "typings" dir (the manual ones).