Skip to content

Commit 3d05fe0

Browse files
committed
Enable replaceAll polyfill for older browsers
1 parent ab74464 commit 3d05fe0

4 files changed

Lines changed: 18 additions & 3 deletions

File tree

package-lock.json

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"@radix-ui/react-accordion": "^1.1.2",
3333
"@radix-ui/react-dropdown-menu": "^2.0.6",
3434
"@radix-ui/react-tooltip": "^1.0.7",
35+
"core-js": "^3.47.0",
3536
"date-fns": "^1.29.0",
3637
"fs-extra": "^6.0.0",
3738
"gray-matter": "^4.0.3",

src/app/layout.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { StyledLayout } from '@/components/layout/styled-layout';
1010
import { siteMetadata } from '@/lib/site-metadata';
1111
import { buildMetadata } from '@/lib/utils/build-metadata';
1212
import StyledComponentsRegistry from '@/styles/styled-component-registry';
13+
import { Polyfills } from '@/components/elements/polyfills';
1314

1415
const PostHogPageView = dynamic(() => import('@/components/layout/posthog-page-view'), {
1516
ssr: false,
@@ -57,6 +58,8 @@ export default function RootLayout({
5758
}>) {
5859
return (
5960
<html lang="en" suppressHydrationWarning>
61+
<Polyfills />
62+
6063
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
6164
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
6265
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
'use client';
2+
3+
// Polyfill for older browsers (more common here than we'd expect, due to testing
4+
// on old Android emulators etc):
5+
import 'core-js/actual/string/replace-all';
6+
7+
export function Polyfills() {
8+
return null;
9+
}

0 commit comments

Comments
 (0)