Skip to content

Commit

Permalink
Merge branch 'canary' into merceyz/examples-names
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Sep 5, 2020
2 parents 995f721 + ae7ae0b commit 5d0b68d
Show file tree
Hide file tree
Showing 18 changed files with 68 additions and 19 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
"registry": "https://registry.npmjs.org/"
}
},
"version": "9.5.4-canary.2"
"version": "9.5.4-canary.3"
}
2 changes: 1 addition & 1 deletion packages/create-next-app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-next-app",
"version": "9.5.4-canary.2",
"version": "9.5.4-canary.3",
"keywords": [
"react",
"next",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/eslint-plugin-next",
"version": "9.5.4-canary.2",
"version": "9.5.4-canary.3",
"description": "ESLint plugin for NextJS.",
"main": "lib/index.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-bundle-analyzer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/bundle-analyzer",
"version": "9.5.4-canary.2",
"version": "9.5.4-canary.3",
"main": "index.js",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/next-codemod/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/codemod",
"version": "9.5.4-canary.2",
"version": "9.5.4-canary.3",
"license": "MIT",
"dependencies": {
"chalk": "4.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/next-mdx/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/mdx",
"version": "9.5.4-canary.2",
"version": "9.5.4-canary.3",
"main": "index.js",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/next-plugin-google-analytics/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/plugin-google-analytics",
"version": "9.5.4-canary.2",
"version": "9.5.4-canary.3",
"repository": {
"url": "vercel/next.js",
"directory": "packages/next-plugin-google-analytics"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-plugin-sentry/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/plugin-sentry",
"version": "9.5.4-canary.2",
"version": "9.5.4-canary.3",
"repository": {
"url": "vercel/next.js",
"directory": "packages/next-plugin-sentry"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-plugin-storybook/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/plugin-storybook",
"version": "9.5.4-canary.2",
"version": "9.5.4-canary.3",
"repository": {
"url": "vercel/next.js",
"directory": "packages/next-plugin-storybook"
Expand Down
2 changes: 1 addition & 1 deletion packages/next-polyfill-nomodule/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/polyfill-nomodule",
"version": "9.5.4-canary.2",
"version": "9.5.4-canary.3",
"description": "A polyfill for non-dead, nomodule browsers.",
"main": "dist/polyfill-nomodule.js",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/next/next-server/lib/router/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ export default class Router implements BaseRouter {

if (process.env.__NEXT_HAS_REWRITES) {
resolvedAs = resolveRewrites(
as,
parseRelativeUrl(as).pathname,
pages,
basePath,
rewrites,
Expand Down
8 changes: 4 additions & 4 deletions packages/next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "next",
"version": "9.5.4-canary.2",
"version": "9.5.4-canary.3",
"description": "The React Framework",
"main": "./dist/server/next.js",
"license": "MIT",
Expand Down Expand Up @@ -77,8 +77,8 @@
"@babel/preset-typescript": "7.10.4",
"@babel/runtime": "7.11.2",
"@babel/types": "7.11.5",
"@next/react-dev-overlay": "9.5.4-canary.2",
"@next/react-refresh-utils": "9.5.4-canary.2",
"@next/react-dev-overlay": "9.5.4-canary.3",
"@next/react-refresh-utils": "9.5.4-canary.3",
"ast-types": "0.13.2",
"babel-plugin-syntax-jsx": "6.18.0",
"babel-plugin-transform-define": "2.0.0",
Expand Down Expand Up @@ -123,7 +123,7 @@
"react-dom": "^16.6.0"
},
"devDependencies": {
"@next/polyfill-nomodule": "9.5.4-canary.2",
"@next/polyfill-nomodule": "9.5.4-canary.3",
"@taskr/clear": "1.1.0",
"@taskr/esnext": "1.1.0",
"@taskr/watch": "1.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dev-overlay/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/react-dev-overlay",
"version": "9.5.4-canary.2",
"version": "9.5.4-canary.3",
"description": "A development-only overlay for developing React applications.",
"repository": {
"url": "vercel/next.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/react-refresh-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next/react-refresh-utils",
"version": "9.5.4-canary.2",
"version": "9.5.4-canary.3",
"description": "An experimental package providing utilities for React Refresh.",
"repository": {
"url": "vercel/next.js",
Expand Down
19 changes: 19 additions & 0 deletions test/integration/custom-routes/pages/nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,27 @@ export default () => (
<Link href="/hello" as="/first">
<a id="to-hello">to hello</a>
</Link>
<br />
<Link href="/hello-again" as="/second">
<a id="to-hello-again">to hello-again</a>
</Link>
<br />
<Link
href={{
pathname: '/with-params',
query: {
something: 1,
another: 'value',
},
}}
as="/params/1?another=value"
>
<a id="to-params-manual">to params (manual)</a>
</Link>
<br />
<Link href="/params/1?another=value">
<a id="to-params">to params</a>
</Link>
<br />
</>
)
2 changes: 1 addition & 1 deletion test/integration/custom-routes/pages/with-params.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useRouter } from 'next/router'

const Page = () => {
const { query } = useRouter()
return <p>{JSON.stringify(query)}</p>
return <p id="query">{JSON.stringify(query)}</p>
}

Page.getInitialProps = () => ({ hello: 'GIPGIP' })
Expand Down
28 changes: 28 additions & 0 deletions test/integration/custom-routes/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,34 @@ const runTests = (isDev = false) => {
expect(await getBrowserBodyText(browser)).toMatch(/Hello again/)
})

it('should work with rewrite when manually specifying href/as', async () => {
const browser = await webdriver(appPort, '/nav')
await browser
.elementByCss('#to-params-manual')
.click()
.waitForElementByCss('#query')

const query = JSON.parse(await browser.elementByCss('#query').text())
expect(query).toEqual({
something: '1',
another: 'value',
})
})

it('should work with rewrite when only specifying href', async () => {
const browser = await webdriver(appPort, '/nav')
await browser
.elementByCss('#to-params')
.click()
.waitForElementByCss('#query')

const query = JSON.parse(await browser.elementByCss('#query').text())
expect(query).toEqual({
something: '1',
another: 'value',
})
})

it('should match a page after a rewrite', async () => {
const html = await renderViaHTTP(appPort, '/to-hello')
expect(html).toContain('Hello')
Expand Down
4 changes: 3 additions & 1 deletion test/integration/dynamic-routing/pages/another.js
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
export default () => 'hello from another!'
export default function Another() {
return 'hello from another!'
}

0 comments on commit 5d0b68d

Please sign in to comment.