-
Notifications
You must be signed in to change notification settings - Fork 73
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
Complement vendor prefixed properties by compatibility data from MDN #27
Conversation
My vote would be to remove them if they're known to be no longer supported. Thus these typings can serve a valuable function of notifying people that they're using unsupported properties. It's important to remember that people can always choose to circumvent the type system with casts, but I would think 99% of users wouldn't want to be using deprecated properties. |
Yeah, that's my vote too. The only problem I can think of is releasing a patch release with updated MDN data where, lets say, a At least there should be information about this in the README with examples of how to use module augmentation to extend interfaces with properties using TypeScript. Not sure if something similar works with Flow though. But it could be possible to preserve them for Flow definitions not for TypeScript definitions. |
Perhaps you could leave them in but prepend a |
That would be nice if it resulted in warnings for the users, but AFAIK it has no semantic meaning. |
This seems like a good approach to me 👍 |
index.d.ts
Outdated
@@ -189,17 +189,21 @@ export interface StandardLonghandProperties<TLength = string | 0> { | |||
minInlineSize?: MinInlineSizeProperty<TLength>; | |||
minWidth?: MinWidthProperty<TLength>; | |||
mixBlendMode?: MixBlendModeProperty; | |||
motionDistance?: MotionDistanceProperty<TLength>; |
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.
It doesn't feel like early drafts belongs in StandardProperties
. They are not "standard" anymore. Should they be included in VendorProperties
instead?
Well TSLint actually warns usage of identifiers marked with |
Oh interesting, I didn’t know about that! |
dbd1608
to
ffb4b4d
Compare
I separated the removed and deprecated properties into a Lines 588 to 596 in ef757f2
|
1bc8215
to
d06d03e
Compare
I think I've got everything right now. I refactored some code so I hope I haven't introduced any bugs. I'll do some samples to verify. |
Usage of deprecated identifiers enables warnings through TSLint
d06d03e
to
af53a44
Compare
It's satisfying to see the amount of important properties this adds to the definitions. 🎉
EDIT
Question: The last line here removes vendor prefixed properties that's no longer supported. Without this line it will add a couple of dozen prefixedMoz
andO
properties likeMozBoxShadow
andOTransform
. Do we want them or should they be removed?Removed and deprecated properties are separated into a
ObsoleteProperties
interface marked as@deprecated
. This enables warnings through TSLint and enables the possibility to manually exclude that interface.Some tasks needs to be completed before this is done: