amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

Service registration should not create the service

Open cramforce opened this issue 10 years ago • 8 comments

Currently our installFooService methods all make an instance of the service. This was different originally, before we started to centrally install the services in their respective JS binary.

We should switch the registrations to be just that, so that we don't make instances until we have to.

cramforce avatar Sep 14 '16 01:09 cramforce

Agree. At least beyond 3-4 most important services.

dvoytenko avatar Sep 14 '16 16:09 dvoytenko

@dvoytenko who will be the best person to work on this?

adelinamart avatar Feb 14 '17 00:02 adelinamart

@adelinamart Not necessarily :)

dvoytenko avatar Feb 14 '17 00:02 dvoytenko

This is an easy starter bug. Maybe one of our new team members could take it?

jridgewell avatar Feb 14 '17 19:02 jridgewell

It is not all that easy. I spent 30 minutes on it and failed :)

But, yes. I was thinking maybe @kmh287?

cramforce avatar Feb 15 '17 01:02 cramforce

/to @kmh287 /cc @choumx

dreamofabear avatar Feb 16 '17 22:02 dreamofabear

I'm not sure this can be done without a rather large refactor. Almost all of the install methods on each of the services returns the service. Some of these always have their return values ignored and those are easy enough to fix, but there are others that have assignments to their return values both in tests and in other parts of the code.

kmh287 avatar Feb 24 '17 14:02 kmh287

I'd just move one-by-one tbh

dvoytenko avatar Feb 24 '17 17:02 dvoytenko