Skip to content

Commit

Permalink
Remove experimental note for has routes (#24529)
Browse files Browse the repository at this point in the history
This removes the warnings/notes for the `has` custom-routes feature being experimental

## Documentation / Examples

- [x] Make sure the linting passes
  • Loading branch information
ijjk authored Apr 28, 2021
1 parent 5de5e49 commit f3d5183
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 17 deletions.
2 changes: 0 additions & 2 deletions docs/api-reference/next.config.js/headers.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,6 @@ module.exports = {

## Header, Cookie, and Query Matching

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.

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.

`has` items have the following fields:
Expand Down
2 changes: 0 additions & 2 deletions docs/api-reference/next.config.js/redirects.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@ module.exports = {

## Header, Cookie, and Query Matching

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.

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.

`has` items have the following fields:
Expand Down
2 changes: 0 additions & 2 deletions docs/api-reference/next.config.js/rewrites.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,6 @@ module.exports = {

## Header, Cookie, and Query Matching

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.

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.

`has` items have the following fields:
Expand Down
9 changes: 0 additions & 9 deletions packages/next/lib/load-custom-routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import {
PERMANENT_REDIRECT_STATUS,
TEMPORARY_REDIRECT_STATUS,
} from '../next-server/lib/constants'
import { execOnce } from '../next-server/lib/utils'
import * as Log from '../build/output/log'
// @ts-ignore
import Lexer from 'next/dist/compiled/regexr-lexer/lexer'
// @ts-ignore
Expand Down Expand Up @@ -163,12 +161,6 @@ function tryParsePath(route: string, handleUrl?: boolean): ParseAttemptResult {

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

const experimentalHasWarn = execOnce(() => {
Log.warn(
`'has' route field support is still experimental and not covered by semver, use at your own risk.`
)
})

function checkCustomRoutes(
routes: Redirect[] | Header[] | Rewrite[],
type: RouteType
Expand Down Expand Up @@ -245,7 +237,6 @@ function checkCustomRoutes(
invalidParts.push('`has` must be undefined or valid has object')
hadInvalidHas = true
} else if (route.has) {
experimentalHasWarn()
const invalidHasItems = []

for (const hasItem of route.has) {
Expand Down
4 changes: 2 additions & 2 deletions test/integration/custom-routes/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1783,8 +1783,8 @@ describe('Custom routes', () => {
)
})

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

0 comments on commit f3d5183

Please sign in to comment.