fix: revert next 13 update

The update causes problems with the emoji picker in the production build

Revert "fix: Fix sign-in-button cypress tests"
Revert "chore(deps): update nextjs monorepo to v13"
Revert "fix: Remove anchor hack from internal-link"
Revert "fix: Remove a tag childs from NextJS link components"

This reverts commit f2ae04743a.
This reverts commit a7fd14a3
This reverts commit 6d30448157.
This reverts commit 7f7f020d91.

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2022-11-06 21:22:59 +01:00 committed by David Mehren
parent 2203defbc6
commit b67df0eadf
11 changed files with 140 additions and 132 deletions

View file

@ -97,7 +97,7 @@
"markdown-it-sup": "1.0.0",
"markdown-it-toc-done-right": "4.2.0",
"mermaid": "9.2.0",
"next": "13.0.2",
"next": "12.3.2",
"react": "18.2.0",
"react-bootstrap": "2.5.0",
"react-bootstrap-typeahead": "6.0.0",
@ -124,7 +124,7 @@
"yjs": "13.5.42"
},
"devDependencies": {
"@next/bundle-analyzer": "13.0.2",
"@next/bundle-analyzer": "12.3.2",
"@testing-library/cypress": "8.0.3",
"@testing-library/dom": "8.19.0",
"@testing-library/jest-dom": "5.16.5",

View file

@ -31,12 +31,14 @@ export const InternalLink: React.FC<LinkWithTextProps> = ({
title
}) => {
return (
<Link href={href} className={className} id={id} title={title}>
<Link href={href}>
<a className={className} id={id} title={title}>
<ShowIf condition={!!icon}>
<ForkAwesomeIcon icon={icon as IconName} fixedWidth={true} />
&nbsp;
</ShowIf>
{text}
</a>
</Link>
)
}

View file

@ -32,7 +32,10 @@ export const Redirect: React.FC<RedirectProps> = ({ to }) => {
return (
<span {...testId('redirect')}>
Redirecting to <Link href={to}>{to}</Link>
Redirecting to{' '}
<Link href={to}>
<a>{to}</a>
</Link>
</span>
)
}

View file

@ -23,12 +23,14 @@ export const NavbarBranding: React.FC = () => {
return (
<Navbar.Brand>
<Link href='/intro' className='text-secondary text-decoration-none d-flex align-items-center'>
<Link href='/intro'>
<a className='text-secondary text-decoration-none d-flex align-items-center'>
<HedgeDocLogoWithText
logoType={darkModeActivated ? HedgeDocLogoType.WB_HORIZONTAL : HedgeDocLogoType.BW_HORIZONTAL}
size={HedgeDocLogoSize.SMALL}
/>
<Branding inline={true} />
</a>
</Link>
</Navbar.Brand>
)

View file

@ -19,7 +19,8 @@ export const ReadOnlyModeButton: React.FC = () => {
const noteIdentifier = useApplicationState((state) => state.noteDetails.primaryAddress)
return (
<Link href={`/s/${noteIdentifier}`} target='_blank'>
<Link href={`/s/${noteIdentifier}`}>
<a target='_blank'>
<Button
title={t('editor.documentBar.readOnlyMode')}
className='ms-2 text-secondary'
@ -27,6 +28,7 @@ export const ReadOnlyModeButton: React.FC = () => {
variant='outline-light'>
<ForkAwesomeIcon icon='file-text-o' />
</Button>
</a>
</Link>
)
}

View file

@ -19,7 +19,8 @@ export const SlideModeButton: React.FC = () => {
const noteIdentifier = useApplicationState((state) => state.noteDetails.primaryAddress)
return (
<Link href={`/p/${noteIdentifier}`} target='_blank'>
<Link href={`/p/${noteIdentifier}`}>
<a target='_blank'>
<Button
title={t('editor.documentBar.slideMode')}
className='ms-2 text-secondary'
@ -27,6 +28,7 @@ export const SlideModeButton: React.FC = () => {
variant='outline-light'>
<ForkAwesomeIcon icon='television' />
</Button>
</a>
</Link>
)
}

View file

@ -64,7 +64,8 @@ export const HistoryCard: React.FC<HistoryEntryProps & HistoryEventHandlers> = (
<div className={'d-flex flex-column'}>
<PinButton isDark={false} isPinned={entry.pinStatus} onPinClick={onPinEntry} />
</div>
<Link href={`/n/${entry.identifier}`} className='text-decoration-none flex-fill text-dark'>
<Link href={`/n/${entry.identifier}`}>
<a className='text-decoration-none flex-fill text-dark'>
<div className={'d-flex flex-column justify-content-between'}>
<Card.Title className='m-0 mt-1dot5' {...cypressId('history-entry-title')}>
{entryTitle}
@ -78,6 +79,7 @@ export const HistoryCard: React.FC<HistoryEntryProps & HistoryEventHandlers> = (
<div className={`${styles['card-footer-min-height']} p-0`}>{tags}</div>
</div>
</div>
</a>
</Link>
<div className={'d-flex flex-column'}>
<EntryMenu

View file

@ -45,8 +45,10 @@ export const HistoryTableRow: React.FC<HistoryEntryProps & HistoryEventHandlers>
return (
<tr>
<td>
<Link href={`/n/${entry.identifier}`} className='text-light' {...cypressId('history-entry-title')}>
<Link href={`/n/${entry.identifier}`}>
<a className='text-light' {...cypressId('history-entry-title')}>
{entryTitle}
</a>
</Link>
</td>
<td>{formatHistoryDate(entry.lastVisitedAt)}</td>

View file

@ -33,8 +33,10 @@ export const HeaderNavLink: React.FC<PropsWithChildren<HeaderNavLinkProps>> = ({
return (
<Nav.Item>
<Link href={to} className={`nav-link text-light ${activeClass} ${styles['nav-link']}`} {...cypressId(props)}>
<Link href={to} passHref={true}>
<a className={`nav-link text-light ${activeClass} ${styles['nav-link']}`} href={to} {...cypressId(props)}>
{children}
</a>
</Link>
</Nav.Item>
)

View file

@ -39,8 +39,8 @@ export const SignInButton: React.FC<SignInButtonProps> = ({ variant, ...props })
return (
<ShowIf condition={authProviders.length > 0}>
<Link href={loginLink} passHref={true} {...cypressId('sign-in-button')}>
<Button title={t('login.signIn')} variant={variant || 'success'} {...props}>
<Link href={loginLink} passHref={true}>
<Button title={t('login.signIn')} {...cypressId('sign-in-button')} variant={variant || 'success'} {...props}>
<Trans i18nKey='login.signIn' />
</Button>
</Link>

157
yarn.lock
View file

@ -1952,7 +1952,7 @@ __metadata:
"@hedgedoc/markdown-it-plugins": 1.0.0
"@hedgedoc/realtime": 0.3.0
"@mrdrogdrog/optional": 1.0.0
"@next/bundle-analyzer": 13.0.2
"@next/bundle-analyzer": 12.3.2
"@react-hook/resize-observer": 1.2.6
"@redux-devtools/core": 3.13.1
"@reduxjs/toolkit": 1.9.0
@ -2039,7 +2039,7 @@ __metadata:
markdown-it-sup: 1.0.0
markdown-it-toc-done-right: 4.2.0
mermaid: 9.2.0
next: 13.0.2
next: 12.3.2
prettier: 2.7.1
react: 18.2.0
react-bootstrap: 2.5.0
@ -2594,19 +2594,19 @@ __metadata:
languageName: node
linkType: hard
"@next/bundle-analyzer@npm:13.0.2":
version: 13.0.2
resolution: "@next/bundle-analyzer@npm:13.0.2"
"@next/bundle-analyzer@npm:12.3.2":
version: 12.3.2
resolution: "@next/bundle-analyzer@npm:12.3.2"
dependencies:
webpack-bundle-analyzer: 4.3.0
checksum: 7aed60d4f2dc349eb2e026c054c32a881607b6c6b328913fc492b9bc5eac8deae3a9cf121bd04f9e3c8edacb794d08e73dc10a4530ecbda81215a9cbb717cad8
checksum: 21c9f8b3e27fa25481d8a592964570838072c35d3c66eeef60a9903388654927228e226419d266a73c7a6f82e1d8d8479ffeb256e4f23f792a99abc1306319fc
languageName: node
linkType: hard
"@next/env@npm:13.0.2":
version: 13.0.2
resolution: "@next/env@npm:13.0.2"
checksum: e84eca92328421d9824a82177b018234b2cd0aa59a482569b7a52b16eaabdafe6343f21bec7d15035cb8ea831929097c7d92c711d295630f6b74a655f9ddcad6
"@next/env@npm:12.3.2":
version: 12.3.2
resolution: "@next/env@npm:12.3.2"
checksum: 668aba397427dd5d19563844274ae7425c99db890e36d2262b9d107122a85500634518fdb916562b3c8a298de983183e241717b535d975df4c997baaa4730ddf
languageName: node
linkType: hard
@ -2619,93 +2619,93 @@ __metadata:
languageName: node
linkType: hard
"@next/swc-android-arm-eabi@npm:13.0.2":
version: 13.0.2
resolution: "@next/swc-android-arm-eabi@npm:13.0.2"
"@next/swc-android-arm-eabi@npm:12.3.2":
version: 12.3.2
resolution: "@next/swc-android-arm-eabi@npm:12.3.2"
conditions: os=android & cpu=arm
languageName: node
linkType: hard
"@next/swc-android-arm64@npm:13.0.2":
version: 13.0.2
resolution: "@next/swc-android-arm64@npm:13.0.2"
"@next/swc-android-arm64@npm:12.3.2":
version: 12.3.2
resolution: "@next/swc-android-arm64@npm:12.3.2"
conditions: os=android & cpu=arm64
languageName: node
linkType: hard
"@next/swc-darwin-arm64@npm:13.0.2":
version: 13.0.2
resolution: "@next/swc-darwin-arm64@npm:13.0.2"
"@next/swc-darwin-arm64@npm:12.3.2":
version: 12.3.2
resolution: "@next/swc-darwin-arm64@npm:12.3.2"
conditions: os=darwin & cpu=arm64
languageName: node
linkType: hard
"@next/swc-darwin-x64@npm:13.0.2":
version: 13.0.2
resolution: "@next/swc-darwin-x64@npm:13.0.2"
"@next/swc-darwin-x64@npm:12.3.2":
version: 12.3.2
resolution: "@next/swc-darwin-x64@npm:12.3.2"
conditions: os=darwin & cpu=x64
languageName: node
linkType: hard
"@next/swc-freebsd-x64@npm:13.0.2":
version: 13.0.2
resolution: "@next/swc-freebsd-x64@npm:13.0.2"
"@next/swc-freebsd-x64@npm:12.3.2":
version: 12.3.2
resolution: "@next/swc-freebsd-x64@npm:12.3.2"
conditions: os=freebsd & cpu=x64
languageName: node
linkType: hard
"@next/swc-linux-arm-gnueabihf@npm:13.0.2":
version: 13.0.2
resolution: "@next/swc-linux-arm-gnueabihf@npm:13.0.2"
"@next/swc-linux-arm-gnueabihf@npm:12.3.2":
version: 12.3.2
resolution: "@next/swc-linux-arm-gnueabihf@npm:12.3.2"
conditions: os=linux & cpu=arm
languageName: node
linkType: hard
"@next/swc-linux-arm64-gnu@npm:13.0.2":
version: 13.0.2
resolution: "@next/swc-linux-arm64-gnu@npm:13.0.2"
"@next/swc-linux-arm64-gnu@npm:12.3.2":
version: 12.3.2
resolution: "@next/swc-linux-arm64-gnu@npm:12.3.2"
conditions: os=linux & cpu=arm64 & libc=glibc
languageName: node
linkType: hard
"@next/swc-linux-arm64-musl@npm:13.0.2":
version: 13.0.2
resolution: "@next/swc-linux-arm64-musl@npm:13.0.2"
"@next/swc-linux-arm64-musl@npm:12.3.2":
version: 12.3.2
resolution: "@next/swc-linux-arm64-musl@npm:12.3.2"
conditions: os=linux & cpu=arm64 & libc=musl
languageName: node
linkType: hard
"@next/swc-linux-x64-gnu@npm:13.0.2":
version: 13.0.2
resolution: "@next/swc-linux-x64-gnu@npm:13.0.2"
"@next/swc-linux-x64-gnu@npm:12.3.2":
version: 12.3.2
resolution: "@next/swc-linux-x64-gnu@npm:12.3.2"
conditions: os=linux & cpu=x64 & libc=glibc
languageName: node
linkType: hard
"@next/swc-linux-x64-musl@npm:13.0.2":
version: 13.0.2
resolution: "@next/swc-linux-x64-musl@npm:13.0.2"
"@next/swc-linux-x64-musl@npm:12.3.2":
version: 12.3.2
resolution: "@next/swc-linux-x64-musl@npm:12.3.2"
conditions: os=linux & cpu=x64 & libc=musl
languageName: node
linkType: hard
"@next/swc-win32-arm64-msvc@npm:13.0.2":
version: 13.0.2
resolution: "@next/swc-win32-arm64-msvc@npm:13.0.2"
"@next/swc-win32-arm64-msvc@npm:12.3.2":
version: 12.3.2
resolution: "@next/swc-win32-arm64-msvc@npm:12.3.2"
conditions: os=win32 & cpu=arm64
languageName: node
linkType: hard
"@next/swc-win32-ia32-msvc@npm:13.0.2":
version: 13.0.2
resolution: "@next/swc-win32-ia32-msvc@npm:13.0.2"
"@next/swc-win32-ia32-msvc@npm:12.3.2":
version: 12.3.2
resolution: "@next/swc-win32-ia32-msvc@npm:12.3.2"
conditions: os=win32 & cpu=ia32
languageName: node
linkType: hard
"@next/swc-win32-x64-msvc@npm:13.0.2":
version: 13.0.2
resolution: "@next/swc-win32-x64-msvc@npm:13.0.2"
"@next/swc-win32-x64-msvc@npm:12.3.2":
version: 12.3.2
resolution: "@next/swc-win32-x64-msvc@npm:12.3.2"
conditions: os=win32 & cpu=x64
languageName: node
linkType: hard
@ -4845,13 +4845,6 @@ __metadata:
languageName: node
linkType: hard
"client-only@npm:0.0.1":
version: 0.0.1
resolution: "client-only@npm:0.0.1"
checksum: 0c16bf660dadb90610553c1d8946a7fdfb81d624adea073b8440b7d795d5b5b08beb3c950c6a2cf16279365a3265158a236876d92bce16423c485c322d7dfaf8
languageName: node
linkType: hard
"cliui@npm:^7.0.2":
version: 7.0.4
resolution: "cliui@npm:7.0.4"
@ -10005,34 +9998,34 @@ __metadata:
languageName: node
linkType: hard
"next@npm:13.0.2":
version: 13.0.2
resolution: "next@npm:13.0.2"
"next@npm:12.3.2":
version: 12.3.2
resolution: "next@npm:12.3.2"
dependencies:
"@next/env": 13.0.2
"@next/swc-android-arm-eabi": 13.0.2
"@next/swc-android-arm64": 13.0.2
"@next/swc-darwin-arm64": 13.0.2
"@next/swc-darwin-x64": 13.0.2
"@next/swc-freebsd-x64": 13.0.2
"@next/swc-linux-arm-gnueabihf": 13.0.2
"@next/swc-linux-arm64-gnu": 13.0.2
"@next/swc-linux-arm64-musl": 13.0.2
"@next/swc-linux-x64-gnu": 13.0.2
"@next/swc-linux-x64-musl": 13.0.2
"@next/swc-win32-arm64-msvc": 13.0.2
"@next/swc-win32-ia32-msvc": 13.0.2
"@next/swc-win32-x64-msvc": 13.0.2
"@next/env": 12.3.2
"@next/swc-android-arm-eabi": 12.3.2
"@next/swc-android-arm64": 12.3.2
"@next/swc-darwin-arm64": 12.3.2
"@next/swc-darwin-x64": 12.3.2
"@next/swc-freebsd-x64": 12.3.2
"@next/swc-linux-arm-gnueabihf": 12.3.2
"@next/swc-linux-arm64-gnu": 12.3.2
"@next/swc-linux-arm64-musl": 12.3.2
"@next/swc-linux-x64-gnu": 12.3.2
"@next/swc-linux-x64-musl": 12.3.2
"@next/swc-win32-arm64-msvc": 12.3.2
"@next/swc-win32-ia32-msvc": 12.3.2
"@next/swc-win32-x64-msvc": 12.3.2
"@swc/helpers": 0.4.11
caniuse-lite: ^1.0.30001406
postcss: 8.4.14
styled-jsx: 5.1.0
styled-jsx: 5.0.7
use-sync-external-store: 1.2.0
peerDependencies:
fibers: ">= 3.1.0"
node-sass: ^6.0.0 || ^7.0.0
react: ^18.2.0
react-dom: ^18.2.0
react: ^17.0.2 || ^18.0.0-0
react-dom: ^17.0.2 || ^18.0.0-0
sass: ^1.3.0
dependenciesMeta:
"@next/swc-android-arm-eabi":
@ -10070,7 +10063,7 @@ __metadata:
optional: true
bin:
next: dist/bin/next
checksum: f6fea2ee34a8c490834cbd7688cfb346337a4dc8530282bf50ee94e20277ad66cb00a614c92c07f8b00832795eaa3a10847f10c8d540789b0b1b1f2914a3b239
checksum: fa2372c3dfaa8c3910ad443a6489ea2578c141e8c819544eb98da6ed6a6c960b2496ac8e9baa4f919bc55c60fd072b85eca5fd2a7073a521364f3247ec09dfa2
languageName: node
linkType: hard
@ -11939,11 +11932,9 @@ __metadata:
languageName: node
linkType: hard
"styled-jsx@npm:5.1.0":
version: 5.1.0
resolution: "styled-jsx@npm:5.1.0"
dependencies:
client-only: 0.0.1
"styled-jsx@npm:5.0.7":
version: 5.0.7
resolution: "styled-jsx@npm:5.0.7"
peerDependencies:
react: ">= 16.8.0 || 17.x.x || ^18.0.0-0"
peerDependenciesMeta:
@ -11951,7 +11942,7 @@ __metadata:
optional: true
babel-plugin-macros:
optional: true
checksum: e5b70476fd9059147dfe35dd912e537e422a7f900cc88f80456c97da495c655598875d64de2199641d627770a7e55ed08be0fd82646bc386791fdb1d0e5af2b1
checksum: 61959993915f4b1662a682dbbefb3512de9399cf6901969bcadd26ba5441d2b5ca5c1021b233bbd573da2541b41efb45d56c6f618dbc8d88a381ebc62461fefe
languageName: node
linkType: hard