Skip to content

Conversation

@notaphplover
Copy link

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.

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.
@sanex3339
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants