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

Add missing style Helmet serialization in the HTML component to make it work in SSR too #6480

Merged
merged 5 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/volto/news/6480.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Added missing style Helmet serialization in the HTML component to make it work in SSR. @sneridagh
Fix deprecation notice for the usage of apple-mobile-web-app-capable.
3 changes: 2 additions & 1 deletion packages/volto/src/helpers/Html/Html.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ class Html extends Component {
{head.meta.toComponent()}
{head.link.toComponent()}
{head.script.toComponent()}
{head.style.toComponent()}

<script
dangerouslySetInnerHTML={{
Expand Down Expand Up @@ -129,7 +130,7 @@ class Html extends Component {
<link rel="manifest" href="/site.webmanifest" />
<meta name="generator" content="Plone 6 - https://plone.org" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="mobile-web-app-capable" content="yes" />
{process.env.NODE_ENV === 'production' && criticalCss && (
<style
dangerouslySetInnerHTML={{ __html: this.props.criticalCss }}
Expand Down
3 changes: 3 additions & 0 deletions packages/volto/src/helpers/Html/Html.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ jest.mock('../Helmet/Helmet', () => ({
script: {
toComponent: () => '',
},
style: {
toComponent: () => '',
},
htmlAttributes: {
toComponent: () => ({
lang: 'en',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ exports[`Html renders a html component 1`] = `
/>
<meta
content="yes"
name="apple-mobile-web-app-capable"
name="mobile-web-app-capable"
/>
<link
as="script"
Expand Down Expand Up @@ -136,7 +136,7 @@ exports[`Html renders a html component with apiPath present 1`] = `
/>
<meta
content="yes"
name="apple-mobile-web-app-capable"
name="mobile-web-app-capable"
/>
<link
as="script"
Expand Down
Loading