Inversify v7 migration#1368
Inversify v7 migration#1368notaphplover wants to merge 1 commit intojavascript-obfuscator:masterfrom
Conversation
Migrate the dependency injection framework from Inversify v6 to v7. This is a breaking change in the Inversify API that requires updates throughout the codebase. Key changes: - Update inversify dependency from 6.1.4 to 7.11.0 - Replace `interfaces.Bind` with `ContainerModuleLoadOptions` in all container modules - Change `bind` parameter to `options` in ContainerModule callbacks - Update method calls from `bind()` to `options.bind()` - Replace `whenTargetNamed()` with `whenNamed()` - Import `ContainerModuleLoadOptions` instead of `interfaces` from inversify - Add `injectFromBase` decorator to all injectable classes that extend from base classes - Update factory types to use `Factory<T, [Args]>` and `ResolutionContext` instead of `interfaces.Context` - Replace `interfaces.ServiceIdentifier<T>` with `ServiceIdentifier<T>` - Update `context.container.getNamed()` to `context.get()` with options object in factory bindings All container modules, custom code helpers, custom nodes, generators, node transformers, and storage classes have been updated to be compatible with the new Inversify v7 API.
|
Thank you for your effort. I'll think about what to do with this PR, because though great work has been done, the Pro version on Obfuscator.io, which is a fork of the OSS version, also must be in sync with the OSS version in terms of used library versions. But the Pro version is heavily ahead of the OSS version, so i need to apply the migration to Inversify@7 to all new VM-related classes there as well. So i'll keep the PR open, and most likely merge it somewhere in February. |
|
@notaphplover hi, as i manually migrated the Obfuscator.io Pro version to Would you mind please syncing the PR with the latest master to ensure all new possible classes are also migrated, then when CI is green i merge the PR |
|
Hey @sanex3339, sure, I'll do it in a couple of days |
Migrate the dependency injection framework from Inversify v6 to v7. This is a breaking change in the Inversify API that requires updates throughout the codebase.
Key changes:
interfaces.BindwithContainerModuleLoadOptionsin all container modulesbindparameter tooptionsin ContainerModule callbacksbind()tooptions.bind()whenTargetNamed()withwhenNamed()ContainerModuleLoadOptionsinstead ofinterfacesfrom inversifyinjectFromBasedecorator to all injectable classes that extend from base classesFactory<T, [Args]>andResolutionContextinstead ofinterfaces.Contextinterfaces.ServiceIdentifier<T>withServiceIdentifier<T>context.container.getNamed()tocontext.get()with options object in factory bindingsAll container modules, custom code helpers, custom nodes, generators, node transformers, and storage classes have been updated to be compatible with the new Inversify v7 API.