-
Notifications
You must be signed in to change notification settings - Fork 455
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
PPX v4: mark props type in externals as @live
.
#6796
Conversation
Fixes rescript-lang/rescript-vscode#994 Dead code elimination in the editor tooling complains about props never being read in the `props` type record defined by the V4 ppx. This is because externals don't provide the implementation of the component, and it's in the implementation that props could be read. This OR marks the `props` type definition as `@live` for external components, so the dead code analysis does not fire.
fc2e2c8
to
05c1cc1
Compare
Incidentally, noticed there were no PPX v4 tests for external components in interface files. Added one in |
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.
Perfect!
@@ -346,22 +346,26 @@ let make_type_decls_with_core_type props_name loc core_type typ_vars = | |||
~manifest:core_type; | |||
] | |||
|
|||
let live_attr = ({txt = "live"; loc = Location.none}, PStr []) |
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.
nit: Maybe we can put this in jsx_common.ml like Jsx_common.optionalAttr
* PPX v4: mark props type in externals as `@live`. Fixes rescript-lang/rescript-vscode#994 Dead code elimination in the editor tooling complains about props never being read in the `props` type record defined by the V4 ppx. This is because externals don't provide the implementation of the component, and it's in the implementation that props could be read. This OR marks the `props` type definition as `@live` for external components, so the dead code analysis does not fire. * Update CHANGELOG.md
* PPX v4: mark props type in externals as `@live`. Fixes rescript-lang/rescript-vscode#994 Dead code elimination in the editor tooling complains about props never being read in the `props` type record defined by the V4 ppx. This is because externals don't provide the implementation of the component, and it's in the implementation that props could be read. This OR marks the `props` type definition as `@live` for external components, so the dead code analysis does not fire. * Update CHANGELOG.md
* PPX v4: mark props type in externals as `@live`. Fixes rescript-lang/rescript-vscode#994 Dead code elimination in the editor tooling complains about props never being read in the `props` type record defined by the V4 ppx. This is because externals don't provide the implementation of the component, and it's in the implementation that props could be read. This OR marks the `props` type definition as `@live` for external components, so the dead code analysis does not fire. * Update CHANGELOG.md
* PPX v4: mark props type in externals as `@live`. Fixes rescript-lang/rescript-vscode#994 Dead code elimination in the editor tooling complains about props never being read in the `props` type record defined by the V4 ppx. This is because externals don't provide the implementation of the component, and it's in the implementation that props could be read. This OR marks the `props` type definition as `@live` for external components, so the dead code analysis does not fire. * Update CHANGELOG.md
Fixes rescript-lang/rescript-vscode#994
Dead code elimination in the editor tooling complains about props never being read in the
props
type record defined by the V4 ppx. This is because externals don't provide the implementation of the component, and it's in the implementation that props could be read. This PR marks theprops
type definition as@live
for external components, so the dead code analysis does not complain.