-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Split up the extension activation code into phases. #10454
Comments
For step B: Initialization and DI Registrationsrc/client/extension-init.ts (in
src/client/extension-activation.ts (in "activateLegacy()"):
Specifics
Initialization Onlysrc/client/extension-activation.ts (in "activateLegacy()"):
Non-Trivial ConstructorsSee the next comment. Other Activationsrc/client/extension-activation.ts (in "activateLegacy()"):
|
(for #10454) This is the basic prep work for making the flow of extension activation more clear.
non-trivial constructors:~96 total, grouped very roughly:
Details
|
@karthiknadig Is this issue now outdated? If we expect this to naturally happen as we separate out the components, we might as well close this. |
Context
The extension's activation hook (per package.json) is the
activate()
function insrc/client/extension.ts
. However, it's difficult to tell what is happening there and when. Basically, this function does quite a few things, in roughly the following order:ServiceManager
)The main problems with the status quo are:
activate()
(and it's subordinates) isn't clearly structured along those linesFixing this will help the project in a variety of ways, including making it easier to reduce the extension's startup time.
Solution
We should restructure
activate()
and the rest of extension.ts along lines of the steps above. At a high-level the following would happen during activation:The top-level code would be straightforward and look something like this:
To get there the following must happen in this order:
A. refactor extension.ts as above, with
initializeComponents()
initially empty andactivateComponents()
basically the init/activation code currently inactivateUnsafe()
B. identify the objects currently involved in activation and where:
C. factor DI registration & object init out of existing "activation" code, putting it into
initializeComponents()
D. (maybe) separate DI registration from object init
E. pull remaining activation code up into extension.ts
Open Questions
The text was updated successfully, but these errors were encountered: