Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ship blazor app package in spfx cdn app folder #6

Open
omarceloribeiro opened this issue Aug 11, 2023 · 5 comments
Open

ship blazor app package in spfx cdn app folder #6

omarceloribeiro opened this issue Aug 11, 2023 · 5 comments
Assignees
Milestone

Comments

@omarceloribeiro
Copy link
Owner

Currently the blazor app is hosted in SiteAssets library.
Change to ship the blazor app within the spfx solution package

@omarceloribeiro omarceloribeiro added this to the First MVP milestone Aug 13, 2023
@omarceloribeiro omarceloribeiro self-assigned this Aug 14, 2023
@omarceloribeiro
Copy link
Owner Author

using the webpart properties to inform the url of blazorapp folder until figure out how to package blazor assets to appcatalog with the same folder structure

@omarceloribeiro
Copy link
Owner Author

found out that needs to compile and package the blazor app with a custom webpack loader, like
angular2-template-loader Loads and compiles Angular Components

@omarceloribeiro
Copy link
Owner Author

using file-loader as webpackloader

@omarceloribeiro
Copy link
Owner Author

opened the issue
SharePoint/sp-dev-docs#9150

I am trying to deploy files to a subfolder in ClientSideAssets but is not working.
The file is shown in correct path inside .sppkg, in the correct subfolder inside ClientSideAssets.
also in xml ClientSideAssets.xml.rels the attribute Target is poiting to the subfolder I want,
but still when add the packge to AppCatalog the files goes always to the root folder (inside the feature folder)

<?xml version="1.0" encoding="utf-8"?>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
    <Relationship
        Type="http://schemas.microsoft.com/sharepoint/2012/app/relationships/partconfiguration"
        Target="/ClientSideAssets.xml.config.xml" Id="r3"></Relationship>
    <Relationship
        Type="http://schemas.microsoft.com/sharepoint/2012/app/relationships/clientsideasset"
        Target="/ClientSideAssets/blazorapp1/sample-data/weather.json"  Id="r4"></Relationship>

    ....
</Relationships>

@omarceloribeiro
Copy link
Owner Author

Answer:

The folder "ClientSideAssets" in the SPPKG is not the actual representation of the folder that is uploaded to the App Catalog. Instead, the ClientSideAssets.xml.rels points to a list of files within the SPPKG and these files always get uploaded as a flat list to ClientSideAssets/ in the App Catalog. The ClientSideAssets/ folder that's inside the package is just for organization/debugging.

Given the first issue, there's not a way to actually upload anything into a subfolder in ClientSideAssets/. So, my recommendation here (for now) would be to instead, separately deploy the Blazor app to a CDN and then reference the CDN from your web part code when loading the Blazor app. You would probably want to also add versioning on the CDN (i.e. https://somecdn.com/v1.1.0/blazorapp1/...).

The team has been exploring Blazor, but we don't have an officially recommended support path for it yet. Since this is a feature you are interested in SPFx having support for, I'd also recommend filing a UserVoice ticket.

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

No branches or pull requests

1 participant