jwplayer / ott-web-app

Reference implementation for JWP-powered apps
Apache License 2.0
70 stars 52 forks source link

Refactor / update services members visibility and explicit inject #590

Closed ChristiaanScheermeijer closed 1 month ago

ChristiaanScheermeijer commented 1 month ago

When implementing services in other platforms we override certain existing services to add custom minor custom implementation.

But we have two problems with this:

We can't access injected services when extending a service because they are all declared private. This means we have to inject the same service a second time and name it something else (storageService2 for example).

The second problem is that when extending a class that injects services via the constructor, the injection fails when there is no @inject(Service) annotation. I believe this is because the class method descriptor is lost when extending the class, but I'm not sure. I think it's safer to explicit annotate the arguments which also makes it consistent.

github-actions[bot] commented 1 month ago

Visit the preview URL for this PR (updated for commit 79825f5):

https://ottwebapp--pr590-refactor-services-in-4tgqyc6e.web.app

(expires Fri, 04 Oct 2024 12:58:45 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: c198f8a3a199ba8747819f7f1e45cf602b777529