Skip to content

Replace import.meta.resolve #7117

@kanej

Description

@kanej

Don’t use import.meta.resolve because it’s not type-safe, and it doesn’t fail in compilation time.

HookHandlerCategoryFactories:

Current:

[HookCategoryNameT in keyof HardhatHooks]?:
    | HookHandlerCategoryFactory<HookCategoryNameT>
    | string;

New:

[HookCategoryNameT in keyof HardhatHooks]?:
    | HookHandlerCategoryFactory<HookCategoryNameT>
    | () => Promise<{default: HookHandlerCategoryFactory<HookCategoryNameT>}>;

NewTaskDefinitionBuilder and TaskOverrideDefinitionBuilder

Current:

setAction(action: NewTaskActionFunction<TaskArgumentsT> | string): this;

New:

interface LazyActionObject<T>{
  action: () => Promise<{ default: T }>;
};
setAction(action: NewTaskActionFunction<TaskArgumentsT> | LazyActionObject<NewTaskActionFunction<TaskArgumentsT>>): this; 

HardhatPlugin:

Current:

dependencies?: Array<() => Promise<HardhatPlugin>>;

New:

dependencies?: () => Array<Promise<{default: HardhatPlugin}>>;

Metadata

Metadata

Labels

status:readyThis issue is ready to be worked onv-nextA Hardhat v3 development task

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions