-
Notifications
You must be signed in to change notification settings - Fork 422
fix: v3 Library with Blazor Web App .NET 8 #623
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
Comments
There seems to be an issue with loading the needed script (
That should get you in a working state again. |
@vnbaaij How does this script normally get loaded? Are you using a JavaScript initializer? |
Thanks @vnbaaij -- got the UI working...interactivity is not (sorting does nothing on clicking on the grid now) |
Yes, the lib.module.js file uses beforeStart initializer to load the we components script |
The behavior has changed with . NET 8. I'm in contact with Mackinnon to see what would be a solution for this |
@timheuer this how it works with .NET 8 at the moment (JS initializers behavior is not yet finalized, see also dotnet/aspnetcore#50187)
By using the new template (which generates a SSR site) the module script (that loads the web components script and hooks up the custom events)) does not get called. Adding the web components script tag, as suggested by me before, only solves part of the problem. I solved it in my copy of a site generated with the template as follows:
to
2 - Add I guess adding |
@vnbaaij Just curious if there's been any progress on this issue. Looking at the related issue from aspnetcore, it doesn't look like there's been much movement. It does appear that the above workarounds seem to work for me for individual pages. But it does NOT seem to work for me for things that are part of the MainLayout. E.g. if I have MainLayout.razor: <FluentMainLayout>
<Header><h3>My Page</h3></Header>
<Body>
@Body
</Body>
<NavMenuContent>
<FluentNavMenuLink Href="/" Text="Home" />
<FluentNavMenuLink Href="/SomeRoute" Text="Some Route" />
</NavMenuContent>
</FluentMainLayout> And then on my page, I have a FluentDataGrid (details don't really matter, since it works), then:
I can't set Is there a different workaround for the layout file? Or do we need to wait for resolution of the underlying issue? |
Hi, See also #706. We are blocked on this till .NET 8 RC2. The issue with MainLayout/@Attribute will be addressed then. |
Will we get the .net8 FluentUI version of the "Blazor-Web-App" Template fully functional and with support for SSR and a Mainlayout and NavMenu that supports SSR with RC2/RTM? Setting the MainLayout or NavMenu to @Attribute [RenderModeServer] kinda defeats the ability to choose rendermodes on a per page base. (With Add Dynamic WebAssembly component option) supported ? |
We will work on such a template, but it probably won't come before the next major release of the library (which will be .NET 8 and higher only). As I understand it, you can't change rendermodes for child components (ie if parent gets rendermode server set, then child components get rendermode server as well) so if we would set |
Thank you for your encouraging feedback, @vnbaaij. Although the NavMenu doesn't strictly impose its render mode on the 'pages', it implies that a SignalR connection would be necessary on every page where the NavMenu is featured. I am quite fond of the concept where this connection is initiated only if a particular page necessitates it, thereby avoiding unnecessary SignalR connections on WASM or SSR pages. Consequently, I am on the lookout for a NavMenu that is compatible with SSR (or WASM or static ?) mode. |
Now that dotnet/aspnetcore#50187 has been fixed and RC2 released, is there work that needs to be done in the code here? Or should we be able to remove some of the workarounds now? |
I'm running RC2 and I am getting no styles applied. I want to use SSR for basic components like this that don't need interactivity. |
When using SSR, you will need to include the web components script. As there is no Blazor script being loaded/used, our script will also not get loaded.
If you would later add interactivity, the Blazor script will kick in and try to load the web component script again but JavaScript will handle that gracefully by design. p.s. the new V4 templates will take care of inserting the script based on the choices you make when creating an app from the template |
Closing this as there is no action from our side. There are templates from us that set everything up correctly (for v4). Rest is more a case of awareness and education. |
🐛 Bug Report
When using the library with the new Blazor Web App (.NET8 Preview 7) template, I'm not getting any of the styles loading like the Header, etc. The content is rendering, no errors in outputs/console log/etc. just not getting any UI that is expected.
💻 Repro or Code Sample
(install .NET 8 Preview 7)
🤔 Expected Behavior
Header renders like documentation indicates

😯 Current Behavior
Header content renders, but nothing else

The text was updated successfully, but these errors were encountered: