Skip to content

[hades] Upgrade to Inversify 7 #27

Description

@dustinlacewell

This is an AI generated report, use as heuristic only:

Migration Summary for pkgs/hades

This summary outlines the necessary changes to migrate pkgs/hades to Inversify v7, based on the analysis from the provided history.

load and unload Methods

load is used in pkgs/hades.

pkgs/hades/src/HadesContainer.ts

In the constructor of HadesContainer, this.load is used twice.

this.load(buildProviderModule()); // binding-decorators support
// ...
this.load(configModule);

Since this is in a constructor, these must be changed to the synchronous version:

this.loadSync(buildProviderModule()); // binding-decorators support
// ...
this.loadSync(configModule);

ContainerModule API

The ContainerModule API has changed to pass options as an object.

pkgs/hades/src/HadesContainer.ts

ContainerModule is used with a callback from @ldlework/inversify-config-injection.

const configCallback = configBinder.getModuleFunction();
const configModule = new ContainerModule(configCallback);

The @ldlework/inversify-config-injection package may need to be updated for compatibility with Inversify v7, as it provides the configCallback function that is passed to the ContainerModule constructor.

BindingFluentSyntax API & Removed interfaces namespace

interfaces.ContainerOptions is used in pkgs/hades.

pkgs/hades/src/HadesContainer.ts

interfaces.ContainerOptions is used in the type definition for HadesContainerOptions.

import { Container, ContainerModule, type interfaces } from "inversify";
//...
export type HadesContainerOptions = interfaces.ContainerOptions & {
//...

The import should be changed to:

import { Container, ContainerModule, type ContainerOptions } from "inversify";

And the usage updated to:

export type HadesContainerOptions = ContainerOptions & {
//...

Custom metadata and middlewares

The Custom metadata and middlewares feature was removed in Inversify v7.

This change requires manual review of the codebase to determine if it was used. There is no reliable way to search for this feature automatically.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions