Skip to content

Commit

Permalink
Revert "[a11y] Route Announcements" (#23082)
Browse files Browse the repository at this point in the history
Reverts #20428 temporarily to move this feature into the next canary release.
  • Loading branch information
shuding authored Mar 15, 2021
1 parent 688611a commit 732c49c
Show file tree
Hide file tree
Showing 14 changed files with 12 additions and 260 deletions.
5 changes: 0 additions & 5 deletions packages/next/client/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@ import {
NEXT_DATA,
ST,
} from '../next-server/lib/utils'
import { Portal } from './portal'
import initHeadManager from './head-manager'
import PageLoader, { StyleSheetTuple } from './page-loader'
import measureWebVitals from './performance-relayer'
import { RouteAnnouncer } from './route-announcer'
import { createRouter, makePublicRouterInstance } from './router'

/// <reference types="react-dom/experimental" />
Expand Down Expand Up @@ -786,9 +784,6 @@ function doRender(input: RenderRouteInfo): Promise<any> {
<Head callback={onHeadCommit} />
<AppContainer>
<App {...appProps} />
<Portal type="next-route-announcer">
<RouteAnnouncer />
</Portal>
</AppContainer>
</Root>
)
Expand Down
6 changes: 6 additions & 0 deletions packages/next/client/link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ function linkClicked(
shallow,
locale,
scroll,
}).then((success: boolean) => {
if (!success) return
if (scroll) {
// FIXME: proper route announcing at Router level, not Link:
document.body.focus()
}
})
}

Expand Down
9 changes: 0 additions & 9 deletions packages/next/client/portal/LICENSE

This file was deleted.

24 changes: 0 additions & 24 deletions packages/next/client/portal/index.tsx

This file was deleted.

67 changes: 0 additions & 67 deletions packages/next/client/route-announcer.tsx

This file was deleted.

8 changes: 4 additions & 4 deletions test/integration/build-output/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,17 @@ describe('Build Output', () => {
expect(parseFloat(indexSize) - 266).toBeLessThanOrEqual(0)
expect(indexSize.endsWith('B')).toBe(true)

// should be no bigger than 64.6 kb
expect(parseFloat(indexFirstLoad)).toBeCloseTo(64.6, 1)
// should be no bigger than 63.9 kb
expect(parseFloat(indexFirstLoad)).toBeCloseTo(64.1, 1)
expect(indexFirstLoad.endsWith('kB')).toBe(true)

expect(parseFloat(err404Size) - 3.7).toBeLessThanOrEqual(0)
expect(err404Size.endsWith('kB')).toBe(true)

expect(parseFloat(err404FirstLoad)).toBeCloseTo(67.8, 0)
expect(parseFloat(err404FirstLoad)).toBeCloseTo(67.1, 0)
expect(err404FirstLoad.endsWith('kB')).toBe(true)

expect(parseFloat(sharedByAll)).toBeCloseTo(64.4, 1)
expect(parseFloat(sharedByAll)).toBeCloseTo(63.9, 1)
expect(sharedByAll.endsWith('kB')).toBe(true)

if (_appSize.endsWith('kB')) {
Expand Down
1 change: 0 additions & 1 deletion test/integration/client-navigation-a11y/next.config.js

This file was deleted.

19 changes: 0 additions & 19 deletions test/integration/client-navigation-a11y/pages/index.js

This file was deleted.

11 changes: 0 additions & 11 deletions test/integration/client-navigation-a11y/pages/page-with-h1.js

This file was deleted.

11 changes: 0 additions & 11 deletions test/integration/client-navigation-a11y/pages/page-with-title.js

This file was deleted.

This file was deleted.

101 changes: 0 additions & 101 deletions test/integration/client-navigation-a11y/test/index.test.js

This file was deleted.

2 changes: 1 addition & 1 deletion test/integration/fallback-modules/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('Build Output', () => {
expect(parseFloat(indexSize)).toBeGreaterThanOrEqual(2)
expect(indexSize.endsWith('kB')).toBe(true)

expect(parseFloat(indexFirstLoad)).toBeLessThanOrEqual(67.8)
expect(parseFloat(indexFirstLoad)).toBeLessThanOrEqual(67.5)
expect(parseFloat(indexFirstLoad)).toBeGreaterThanOrEqual(60)
expect(indexFirstLoad.endsWith('kB')).toBe(true)
})
Expand Down
2 changes: 1 addition & 1 deletion test/integration/size-limit/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,6 @@ describe('Production response size', () => {
const delta = responseSizesBytes / 1024

// Expected difference: < 0.5
expect(delta).toBeCloseTo(286.7, 0)
expect(delta).toBeCloseTo(285.3, 0)
})
})

0 comments on commit 732c49c

Please sign in to comment.