Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove experimental note for has routes #24529

Merged
merged 3 commits into from
Apr 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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