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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -64,20 +64,22 @@ export const HistoryCard: React.FC<HistoryEntryProps & HistoryEventHandlers> = (
<div className={'d-flex flex-column'}> <div className={'d-flex flex-column'}>
<PinButton isDark={false} isPinned={entry.pinStatus} onPinClick={onPinEntry} /> <PinButton isDark={false} isPinned={entry.pinStatus} onPinClick={onPinEntry} />
</div> </div>
<Link href={`/n/${entry.identifier}`} className='text-decoration-none flex-fill text-dark'> <Link href={`/n/${entry.identifier}`}>
<div className={'d-flex flex-column justify-content-between'}> <a className='text-decoration-none flex-fill text-dark'>
<Card.Title className='m-0 mt-1dot5' {...cypressId('history-entry-title')}> <div className={'d-flex flex-column justify-content-between'}>
{entryTitle} <Card.Title className='m-0 mt-1dot5' {...cypressId('history-entry-title')}>
</Card.Title> {entryTitle}
<div> </Card.Title>
<div className='text-black-50 mt-2'> <div>
<ForkAwesomeIcon icon='clock-o' /> {DateTime.fromISO(entry.lastVisitedAt).toRelative()} <div className='text-black-50 mt-2'>
<br /> <ForkAwesomeIcon icon='clock-o' /> {DateTime.fromISO(entry.lastVisitedAt).toRelative()}
{lastVisited} <br />
{lastVisited}
</div>
<div className={`${styles['card-footer-min-height']} p-0`}>{tags}</div>
</div> </div>
<div className={`${styles['card-footer-min-height']} p-0`}>{tags}</div>
</div> </div>
</div> </a>
</Link> </Link>
<div className={'d-flex flex-column'}> <div className={'d-flex flex-column'}>
<EntryMenu <EntryMenu

View file

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

View file

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

View file

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

157
yarn.lock
View file

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