Skip to content
Open
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
666c007
Merge branch 'latest' of ssh://github.com/bbc/simorgh into latest
louisearchibald Aug 4, 2026
93cd21f
Merge branch 'latest' of ssh://github.com/bbc/simorgh into latest
louisearchibald Aug 12, 2026
7dfa2f7
extract inline js into own helper files
louisearchibald Aug 13, 2026
b8ca483
use in document.page file
louisearchibald Aug 13, 2026
813c5fc
Merge branch 'latest' into WS-2769-update-inline-JS-nextJS
louisearchibald Aug 18, 2026
531785c
Merge branch 'WS-2769-update-inline-JS-nextJS' of ssh://github.com/bb…
louisearchibald Aug 18, 2026
8d18cf4
Merge branch 'latest' into WS-2769-update-inline-JS-nextJS
louisearchibald Aug 20, 2026
89e493d
Merge branch 'WS-2769-update-inline-JS-nextJS' of ssh://github.com/bb…
louisearchibald Aug 21, 2026
793df09
remove arrow functions to maintain compatibility with opera mini
louisearchibald Aug 21, 2026
11c10f1
Merge branch 'latest' into WS-2769-update-inline-JS-nextJS
louisearchibald Aug 21, 2026
7f2b85e
copilot import suggestion
louisearchibald Aug 21, 2026
b08f36d
Merge branch 'latest' into WS-2769-update-inline-JS-nextJS
LilyL0u Aug 25, 2026
07e60e6
Merge branch 'latest' into WS-2769-update-inline-JS-nextJS
LilyL0u Aug 25, 2026
59a8aab
adds tests for removeNoJsClass
holchris Aug 25, 2026
d9c6257
adds test for getSimorghEnvVars
holchris Aug 25, 2026
082ba49
Merge branch 'latest' into WS-2769-update-inline-JS-nextJS
louisearchibald Aug 27, 2026
30ed11d
update inline JS in canonical renderer nextjs location
louisearchibald Aug 27, 2026
ba4b1de
Merge branch 'WS-2769-update-inline-JS-nextJS' of ssh://github.com/bb…
louisearchibald Aug 27, 2026
45abf32
Merge branch 'latest' into WS-2769-update-inline-JS-nextJS
louisearchibald Aug 28, 2026
bed60eb
Merge branch 'WS-2769-update-inline-JS-nextJS' of ssh://github.com/bb…
louisearchibald Aug 28, 2026
4dd4e6c
Merge branch 'latest' into WS-2769-update-inline-JS-nextJS
LilyL0u Aug 28, 2026
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
5 changes: 5 additions & 0 deletions src/app/lib/utilities/removeNoJsClass/index.tsx

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated this now too, thanks for spotting. 🙏

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
function removeNoJsClass() {
document.documentElement.classList.remove('no-js');
}
Comment thread
holchris marked this conversation as resolved.

export default removeNoJsClass;
7 changes: 7 additions & 0 deletions src/app/lib/utilities/setSimorghEnvVars/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { EnvConfig } from '../getEnvConfig';
Comment thread
Copilot marked this conversation as resolved.
Outdated

function setSimorghEnvVars(envVars: EnvConfig) {
window.SIMORGH_ENV_VARS = envVars;
}
Comment thread
holchris marked this conversation as resolved.

export default setSimorghEnvVars;
6 changes: 4 additions & 2 deletions ws-nextjs-app/pages/_document.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ import addOperaMiniClassScript from '#app/lib/utilities/addOperaMiniClassScript'
import handleServerLogging from '#utilities/handleServerLogging';
import getAmpLiteCss from '#utilities/getAmpLiteCss';
import optimiseCssPrefixes from '#utilities/optimiseCssPrefixes';
import setSimorghEnvVars from '#app/lib/utilities/setSimorghEnvVars';
import removeNoJsClass from '#app/lib/utilities/removeNoJsClass';
import ComponentTracking from '../renderers/ComponentTracking';
import ReverbTemplate from '../renderers/ReverbTemplate';
import litePageTransforms from '../renderers/litePageTransforms';
Expand Down Expand Up @@ -168,12 +170,12 @@ export default class AppDocument extends Document<DocProps> {
<script
type="text/javascript"
dangerouslySetInnerHTML={{
__html: `document.documentElement.classList.remove("no-js");`,
__html: `(${removeNoJsClass.toString()})()`,
}}
/>
{addOperaMiniClassScript()}
<Script strategy="beforeInteractive">
{`window.SIMORGH_ENV_VARS=${JSON.stringify(clientSideEnvVariables)}`}
{`(${setSimorghEnvVars.toString()})(${JSON.stringify(clientSideEnvVariables)})`}
</Script>
{pageType === 'live' && (
<script src="https://www.riddle.com/embed/build-embedjs/embedV2.js" />
Expand Down
Loading