Skip to content

Auto detect JS isulation modul file #63993

@wolfgangschneider

Description

@wolfgangschneider

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

I am trying to load a Components JS isolation file in a simple way without hard code its location but I have to hardcode the path to the JSInvoke "Import" function.

module = await JS.InvokeAsync<IJSObjectReference>("import",
                "./Components/Pages/AlertUser.razor.js");"

It would be nice if the component( or the JS runtime) knows the js File location and load it.

Describe the solution you'd like

one solution could be that the component load the IS modul

_jsModule = await this.LoadComponentJSModueAsync(JSRuntime);
or visa verse , the JSRunntime can do it

` _jsModule = await JSRunntime.LoadComponentJSModueAsync(this);

Additional context

sometimes during development components move from on package or directory to another. A hardcoded import path has always been to update. From a helicopter view js isolation it should have the same behaviour than CSS isolation

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-blazorIncludes: Blazor, Razor Components

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions