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

Internal properties of Components should be ignored #458

Closed
rudro opened this issue May 18, 2023 · 0 comments · Fixed by #459
Closed

Internal properties of Components should be ignored #458

rudro opened this issue May 18, 2023 · 0 comments · Fixed by #459

Comments

@rudro
Copy link
Contributor

rudro commented May 18, 2023

Most properties of needle components classes are public when they are consumed by descendants. Some properties are fileprivate when only some other class in the same file is the only use of the property. (At Uber we put the builder class and the component class in the same file, so sometimes when a dependency is only used by the corresponding builder we use this).

The needle generated code in the vast majority of cases lives in a separate module (or maybe the main app target). In a rare case, where the whole app is in a single library maybe the needle generated code lives in the same module.

So in all the cases where needle gen code live sin a different package, we can't see the internal properties, so needle should just ignore them in it's parsing.

The reason this was not done until now is that the same AST parser is used to scan component classes as well as the dependency protocols. For the protocols, we typically mark them public so then the vars in them "look internal" as far as the AST is concerned, but they need to be considered by needle.

rudro added a commit that referenced this issue May 19, 2023
- Fixes #458 (see bug for details)
rudro added a commit that referenced this issue Aug 16, 2023
* Ignore internal properties in components

- Fixes #458 (see bug for details)

* Fix tests
@rudro rudro changed the title Optional properties of Components should be ignored Internal properties of Components should be ignored Aug 22, 2023
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 a pull request may close this issue.

1 participant