-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[test] Type-check framerfx package #21868
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.
Thanks for looking at this. Aside from the couple of questions raised, my main concern is that the changes have been made to generated code, rather than the templates used to generate them.
This comment has been minimized.
This comment has been minimized.
ae01db5
to
bc13420
Compare
This comment has been minimized.
This comment has been minimized.
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.
More questions than comments.
framer/Material-UI.framerfx/design/document.json
could be checked in (after opening the package in Framer) so that it doesn't show errors when first opened.
const iconName = `${iconProp && pascalCase(iconProp)}${ | ||
theme === 'Filled' ? '' : theme | ||
}` as keyof typeof Icons; | ||
const Icon = Object.keys(Icons).indexOf(iconName) !== -1 ? Icons[iconName] : undefined; |
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?
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.
includes
was introduced in ES7 (es2016). The published tsconfig indicates ES6 (es2015). Since it's unclear what the actual TS environment in framer is I'd rather downgrade it. Especially because indexOf
vs includes
has little cost to convert.
f5f8394
to
d942bd9
Compare
otherwise framer thinks it's a component
d942bd9
to
8d468db
Compare
Remaining issues in framer are due to an old TypeScript version. They seem to be using a version prior to 3.0 (hence all the errors regarding required props missing since TS < 3.0 did not understand defaultProps). Since TypeScript 2.9 is no longer supported in DefinitelyTyped I put responsibility for updating TS on framer. |
Shouldn't we support the version they're using? |
If they use a version that doesn't support React features then we really can't. Because of that version we already have issues. With this PR we're at least sound in TypeScript 3.x. Prior to this PR we're not sound in any TypeScript version. |
Based on #21888. Diff to #21888 only: eps1lon/material-ui@feat/update-framer...eps1lon:test/framer-typecheck
Enables type-checking for
framer/Material-UI.framerfx
package and fixes all type errors.Dropping
naming-style
since we have a more battle-tested and typed alternative inlodash
.naming-style
only has ~100 downloads/month which makes it a liability.TODO:
as const
).Closes #21887