question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

static service injection analysis

See original GitHub issue

A 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:open
  • Created 2 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ef4commented, Jun 14, 2022

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.

1reaction
ef4commented, Jun 10, 2022

Yes, as long as the unit test also imports and registers the service, the same way the other consumers of the service would.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found