-
Notifications
You must be signed in to change notification settings - Fork 579
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
[ENH] - Add Prerender IModuleControl property (similar to RenderMode)… #4179
Conversation
@vnetonline this looks good... the only question I have is related to the default behavior: Currently there is a Site setting for Prerender which controls whether or not pre-rendering is enabled for the entire site. Currently it is possible to set Prerendering to False at the Site level and only enable Prerendering for some specific components (ie. only some Interactive components on public facing pages which need to be indexed for SEO purposes). Based on this PR, this scenario would no loinger be possible due to the default value and logic below: ModuleState.Prerender != false ? PageState.Site.Prerender : ModuleState.Prerender Basically this says that if the component-level property is set to True then it should use the Site Setting - Prerender property setting (which would be False in the case I described above). Perhaps a more appropriate solution would be if the component-level Prerender property was a nullable boolean type and had a default value of null. Then the logic would be able to determine if the value was overridden or not: ModuleState.Prerender == null ? PageState.Site.Prerender : ModuleState.Prerender The above logic uses the Site Setting unless it is explicitly overridden at the component level. Thoughts? |
@sbwalker, the above logic sounds good, I would reverse it from a conventional perspective, it's more readable like this
I will modify the PR and submit it again |
@sbwalker I have tried to do as you suggest, but I haven't been successful because
when you say that "only enable Prerendering for some specific components" where does this happen ?? |
@sbwalker i can do what you suggested using below code block ... but it doesn't look elegant enough
|
Simplefied Version
|
@vnetonline the PR is already merged |
Yes thank you was just adding a comment as to what changed in this commit |
… #4178
@sbwalker I had a go at adding Prerender just like RenderMode, I hope my implementation meets your standards let me know if you would like me to modify anything