Skip to content

Commit f3d5183

Browse files
authoredApr 28, 2021
Remove experimental note for has routes (#24529)
This removes the warnings/notes for the `has` custom-routes feature being experimental ## Documentation / Examples - [x] Make sure the linting passes
1 parent 5de5e49 commit f3d5183

File tree

5 files changed

+2
-17
lines changed

5 files changed

+2
-17
lines changed
 

‎docs/api-reference/next.config.js/headers.md

-2
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,6 @@ module.exports = {
173173

174174
## Header, Cookie, and Query Matching
175175

176-
Note: this feature is still experimental and not covered by semver and is to be used at your own risk until it is made stable.
177-
178176
To only apply a header when either header, cookie, or query values also match the `has` field can be used. Both the `source` and all `has` items must match for the header to be applied.
179177

180178
`has` items have the following fields:

‎docs/api-reference/next.config.js/redirects.md

-2
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,6 @@ module.exports = {
117117

118118
## Header, Cookie, and Query Matching
119119

120-
Note: this feature is still experimental and not covered by semver and is to be used at your own risk until it is made stable.
121-
122120
To only match a redirect when header, cookie, or query values also match the `has` field can be used. Both the `source` and all `has` items must match for the redirect to be applied.
123121

124122
`has` items have the following fields:

‎docs/api-reference/next.config.js/rewrites.md

-2
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,6 @@ module.exports = {
197197

198198
## Header, Cookie, and Query Matching
199199

200-
Note: this feature is still experimental and not covered by semver and is to be used at your own risk until it is made stable.
201-
202200
To only match a rewrite when header, cookie, or query values also match the `has` field can be used. Both the `source` and all `has` items must match for the rewrite to be applied.
203201

204202
`has` items have the following fields:

‎packages/next/lib/load-custom-routes.ts

-9
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import {
66
PERMANENT_REDIRECT_STATUS,
77
TEMPORARY_REDIRECT_STATUS,
88
} from '../next-server/lib/constants'
9-
import { execOnce } from '../next-server/lib/utils'
10-
import * as Log from '../build/output/log'
119
// @ts-ignore
1210
import Lexer from 'next/dist/compiled/regexr-lexer/lexer'
1311
// @ts-ignore
@@ -163,12 +161,6 @@ function tryParsePath(route: string, handleUrl?: boolean): ParseAttemptResult {
163161

164162
export type RouteType = 'rewrite' | 'redirect' | 'header'
165163

166-
const experimentalHasWarn = execOnce(() => {
167-
Log.warn(
168-
`'has' route field support is still experimental and not covered by semver, use at your own risk.`
169-
)
170-
})
171-
172164
function checkCustomRoutes(
173165
routes: Redirect[] | Header[] | Rewrite[],
174166
type: RouteType
@@ -245,7 +237,6 @@ function checkCustomRoutes(
245237
invalidParts.push('`has` must be undefined or valid has object')
246238
hadInvalidHas = true
247239
} else if (route.has) {
248-
experimentalHasWarn()
249240
const invalidHasItems = []
250241

251242
for (const hasItem of route.has) {

‎test/integration/custom-routes/test/index.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1783,8 +1783,8 @@ describe('Custom routes', () => {
17831783
)
17841784
})
17851785

1786-
it('should show warning for experimental has usage', async () => {
1787-
expect(stderr).toContain(
1786+
it('should not show warning for experimental has usage', async () => {
1787+
expect(stderr).not.toContain(
17881788
"'has' route field support is still experimental and not covered by semver, use at your own risk."
17891789
)
17901790
})

0 commit comments

Comments
 (0)
Please sign in to comment.