Skip to content

Commit

Permalink
Fix the import for apps with a base path (#3092) (#3093)
Browse files Browse the repository at this point in the history
(cherry picked from commit 6a2982a)

Co-authored-by: Matthew Leibowitz <[email protected]>
  • Loading branch information
github-actions[bot] and mattleibow authored Dec 2, 2024
1 parent 892b723 commit 810ce17
Show file tree
Hide file tree
Showing 12 changed files with 43 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,31 @@
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
// Uncomment the <base> element in index.html to use these profiles
"http/app": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "app",
"commandLineArgs": "--pathbase=/app",
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/app/_framework/debug/ws-proxy?browser={browserInspectUri}",
"applicationUrl": "http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"https/app": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "app",
"commandLineArgs": "--pathbase=/app",
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/app/_framework/debug/ws-proxy?browser={browserInspectUri}",
"applicationUrl": "https://localhost:5001;http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>SkiaSharpSample</title>
<base href="/" />
<!-- <base href="/" /> -->
<base href="/app/" />
<link rel="stylesheet" href="css/bootstrap/bootstrap.min.css" />
<link rel="stylesheet" href="css/app.css" />
<link rel="icon" type="image/png" href="favicon.ico" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ internal partial class JSModuleInterop : IDisposable
public JSModuleInterop(IJSRuntime js, string moduleName, string moduleUrl)
{
#if NET7_0_OR_GREATER
moduleTask = JSHost.ImportAsync(moduleName, "/" + moduleUrl);
moduleTask = JSHost.ImportAsync(moduleName, "../" + moduleUrl);
#else
if (js is not IJSInProcessRuntime)
throw new NotSupportedException("SkiaSharp currently only works on Web Assembly.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
<PackageTags>aspnet;blazor;web</PackageTags>
</PropertyGroup>

<PropertyGroup>
<TypeScriptTarget>es2015</TypeScriptTarget>
<TypeScriptModuleKind>es2015</TypeScriptModuleKind>
<TypeScriptNoImplicitAny>True</TypeScriptNoImplicitAny>
</PropertyGroup>

<ItemGroup>
<SupportedPlatform Include="browser" />
</ItemGroup>
Expand All @@ -21,7 +27,7 @@
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="7.0.0" Condition="$(TargetFramework.StartsWith('net7.0'))" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.0" Condition="$(TargetFramework.StartsWith('net8.0'))" />
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="9.0.0" Condition="$(TargetFramework.StartsWith('net9.0'))" />
<PackageReference Include="Microsoft.TypeScript.MSBuild" Version="5.5.3" PrivateAssets="all" />
<PackageReference Include="Microsoft.TypeScript.MSBuild" Version="5.7.1" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
Expand Down
14 changes: 0 additions & 14 deletions source/SkiaSharp.Views/SkiaSharp.Views.Blazor/tsconfig.json

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@


declare namespace DotNet {
interface DotNetObjectReference extends DotNet.DotNetObject {
_id: number;
dispose();
dispose(): void;
}
}

0 comments on commit 810ce17

Please sign in to comment.