Comments (10)
Hello,
do I understand correctly that you tried to use the library in the new Blazor App setting and in the traditional Blazor Server setting?
It should work with Blazor Server that existed prior to .NET 8, however the new Blazor (United) App setup is fundamentally different and I will need some time to figure out how to properly adjust the library to this.
If using Blazor App, it should still work as long as long as the components of this library are marked with the RenderModeServer attribute, this hasn't been done yet however as it will require the minimum .NET version to be upped to .NET 8, and also this doesn't seem desirable to force this usage.
I'll need to figure out some new approach to enable the usage in Blazor Apps.
from bytexdigital.blazor.components.cookieconsent.
For the meantime yes.
I'l need to find a solution that enables usage both in classic WebAssembly projects and in the new Blazor App projects that doesn't force you to use one specific rendering mode and which also enables access to the cookie consent data outside of interactive components.
from bytexdigital.blazor.components.cookieconsent.
I've pushed a test package version with support for the new Blazor Web App.
https://www.nuget.org/packages/BytexDigital.Blazor.Components.CookieConsent/1.1.0-preview.1693095817
Here are the updated installation instructions:
https://github.com/BytexDigital/BytexDigital.Blazor.Components.CookieConsent#how-to-install
Please let me know if it works out for you.
from bytexdigital.blazor.components.cookieconsent.
I've updated installation steps for Blazor Web Apps to explain when adding what is necessary. Please let me know if it's understandable.
from bytexdigital.blazor.components.cookieconsent.
Thanks for the fast response. Yes i am talking about the new Blazor Web App template in .Net 8 Preview SDK that conbines webassembly and ssr.
I guess i need to fallback to a classic manual cookie approach in the meantime.
from bytexdigital.blazor.components.cookieconsent.
@ynnob It seems that I was wrong about how future Blazor United projects work and compatibility should be pretty much almost there.
I'll try to get a template of the new Blazor United and see what's missing in the library for good compatibility with the current .NET 8 previews, then document it in the README.
from bytexdigital.blazor.components.cookieconsent.
@ynnob It seems that I was wrong about how future Blazor United projects work and compatibility should be pretty much almost there.
I'll try to get a template of the new Blazor United and see what's missing in the library for good compatibility with the current .NET 8 previews, then document it in the README.
Happy to hear that! Looking forward for it!
from bytexdigital.blazor.components.cookieconsent.
Hey! Looks good to me.
I implemented it and it just works. No problems so far.
Thanks man!
from bytexdigital.blazor.components.cookieconsent.
Hey @RyanTT whats the reason for A and B (1. Configure your App.razor)?
Because if i would use B for example i will get some console errors complaining about a missing dotnet.js file
Code:
<BytexDigital.Blazor.Components.CookieConsent.CookieConsentHandler @rendermode="@RenderMode.Server" />
<BytexDigital.Blazor.Components.CookieConsent.CookieConsentInitializer @rendermode="@RenderMode.WebAssembly" />
Changing the CookieConsentInitializer to RenderMode.Server does not display this error. But with and without the error it seems to work correctly.
Edit:
I have WebAssembly not activated in my project currently.
from bytexdigital.blazor.components.cookieconsent.
The cookie consent initializer has the job of making sure everything in WASM is hooked up correctly if you render the UI on the server instead. If you do not use WASM though, you can skip this (and as you can see it will error out if WASM isn't used by the rest of the app).
This is only necessary if you render the UI on one side and also have components interacting with the CookieConsent lib on the other side (e.g. rendered on Server but also used in WASM)
I forgot to update the docs for this use case
from bytexdigital.blazor.components.cookieconsent.
Related Issues (19)
- Manually open the preferences modal HOT 6
- Script does not execute in Firefox upon consent HOT 3
- Component crashes if cookieconsent.js is blocked HOT 6
- Redirect if declined HOT 3
- Showing sites privacy policy when clicked HOT 3
- How to read the consent level ? HOT 1
- Cookie not set in docker HOT 11
- ConsentDescriptionText appears twice HOT 2
- customize order of OpenPreferences and AcceptAll buttons HOT 3
- Cookie not saving on production HOT 2
- UseDefaultConsentPrompt not found? HOT 2
- CookiePolicyOptions and AddCookieConsent HOT 5
- How to show policy in a modal? HOT 1
- Revoke consent manually seems not to disable services HOT 6
- Feature Request: Reject all Button HOT 5
- french translation incorrect
- Issues with Blazor Web App setup HOT 5
- y HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bytexdigital.blazor.components.cookieconsent.