static service injection analysis
See original GitHub issueA while ago I opened https://github.com/embroider-build/embroider/issues/829 because I didn’t understand why a service was not included in the build while it was explicitly injected in multiple locations. This brought up the discussion of a potential staticServices
flag for Embroider, and creating an API for injecting services that is easier to statically analyze. It’s been a while since I’ve closed that issue but I still think it would a good addition so I’m opening this one to track it.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Static Analysis and Dependency Injection - NDepend
Static analysis deals with classes, methods and design measures like lines of code or complexity. It is design-time analysis. · Dynamic analysis ......
Read more >Dependency Injection with Static Analysis and Context-Aware ...
Abstract The dependency injection design pattern improves the config- urability, testability, and maintainability of object-oriented applications.
Read more >Should I use Dependency Injection or static factories?
Two answers seem possible dependency injection or using the factory pattern. However both seem wrong: Factories make testing a pain and don't allow...
Read more >Angular: Dependency Injection vs. Static methods
Today we quickly explain when and why to use dependency injection on Angular over static classes. Dependency Injection #. Dependency injection ( ...
Read more >Dependency Injection vs. Static Access - Chief Delphi
@Tyler_S asks what the disadvantages of the static access pattern. The traditional summary of reasons to use Dependency Injection are below.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This isn’t strictly an embroider concern. We don’t want embroider to support different API than the official Ember docs show. Ember as a whole needs to adopt a different API for service injection.
Embroider is one motivation, but nicer typescript support is another.
Yes, as long as the unit test also imports and registers the service, the same way the other consumers of the service would.