Commit graph

985 commits

Author SHA1 Message Date
Javi Velasco
f354f46b3f
Deprecate nested Middleware in favor of root middleware (#36772)
This PR deprecates declaring a middleware under `pages` in favour of the project root naming it after `middleware` instead of `_middleware`. This is in the context of having a simpler execution model for middleware and also ships some refactor work. There is a ton of a code to be simplified after this deprecation but I think it is best to do it progressively.

With this PR, when in development, we will **fail** whenever we find a nested middleware but we do **not** include it in the compiler so if the project is using it, it will no longer work. For production we will **fail** too so it will not be possible to build and deploy a deprecated middleware. The error points to a page that should also be reviewed as part of **documentation**.

Aside from the deprecation, this migrates all middleware tests to work with a single middleware. It also splits tests into multiple folders to make them easier to isolate and work with. Finally it ships some small code refactor and simplifications.
2022-05-19 15:46:21 +00:00
Steven
9f0024a5ee
Change experimental layout=raw to use native img lazy loading (#36985)
This PR changes the experimental `layout=raw` images to use the native lazy loading behavior (as opposed to the IntersectionObserver).

This will (eventually) lead to smaller client bundles and faster image loading since there is no JS needed to load the image.

However, we'll lose the `lazyRoot` and `lazyBoundary` behavior since those are specific to the IntersectionObserver implementation.
2022-05-18 21:05:15 +00:00
Gaspar Garcia Jr
c72d32d3b5
Clarify .env* environment variable priority (#36967)
Clarify that the environment variables are ordered in descending priority and that the existing system environment is not overridden.

fixes https://github.com/vercel/next.js/issues/36966

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-05-17 17:52:41 +00:00
Sidharth Rathi
7b83c19da5
Support graceful shutdowns (#36909)
## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [x] Related issues linked using [19693](https://github.com/vercel/next.js/discussions/19693)
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ x] Make sure the linting passes by running `yarn lint`


Closes #29959
2022-05-16 14:40:39 +00:00
You Nguyen
c667d2ba72
Update runtime-configuration.md (#36923)
If I understand correctly, a page that relies on `publicRuntimeConfig` must be server-side rendered, then that page need either `getInitalProps` or `getServerSideProps`, or the application has a Custom App with `getInitialProps` enabled.
2022-05-16 09:15:01 +00:00
Jiachi Liu
ed4d009841
Drop the unstable web vital hook and remove exports of flush effects (#36912)
* remove the experimental web vital hook api
* remove the exported flush effects api and only error on development, keep only usage to styled-jsx

for web vital hook API: The usage is not widly adopted since the existing exported vital api could do the same work. In the future we'll deprecate the `_app.server` in favor of `_app` in server component pages. so that this api won't be required.

for flush effects api: other css-in-js libs are not using the same approach like styled-jsx which holding a style registry and could flush it during streaming. emotion-js and styled-components are still relying on `Document.getInitialProps` atm and we have supported it in latest canary
2022-05-14 21:20:24 +00:00
Josh Goldberg
fa4ca66f20
Update no-floating-promises lint rule docs page (#36913)
Small docs fix. We've got a snazzy new website at typescript-eslint.io. Eventually the .md docs pages will serve just as partial docs sources, not the right URL to visit.
2022-05-14 14:04:11 +00:00
Sagnik Chatterjee
3674cadae5
docs: adding changes to setCookie example (#36870)
fixes #28453

## Bug

- [x] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [X] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [X] Make sure the linting passes by running `yarn lint`
2022-05-13 14:24:44 +00:00
Hunter Tunnicliff
521f88e159
Move CI build cache instructions to Deployment docs (#35418)
This PR moves the instructions for configuring CI providers to preserve Next.js's build cache out of the _No Cache Detected_ error message and into ~the _Deployment_~ a new page within the _Advanced Features_ docs. 

This change is beneficial because it makes the CI configuration examples visible in the context of other helpful documentation for deploying Next.js.

👉 **Prior to this change, these CI configuration examples didn't show up in the Next.js docs.**

The relocated instructions are now linked on the _No Cache Detected_ error message page.

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`

Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: Steven <steven@ceriously.com>
2022-05-13 09:56:47 -04:00
Jiachi Liu
b717b6eb1d
docs: add more details about nextRuntime in webpack config and runtime in next config (#36862)
## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2022-05-12 16:53:59 +00:00
Robert Keyser
66d98e2fc6
scss exects semicolon (#36779)
copy/pasting the SCSS example into VSCode results in linter warning. Fixed with semicolon on variable assignment. Added the second semicolon for consistency.



## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-05-12 16:29:01 +00:00
Rich Haines
6a00a1b464
Updated copy around enabling source maps (#36852)
This PR updates the copy in the source maps section of the docs to reflect the improvement made to webpack that generate source maps.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2022-05-12 11:45:23 +00:00
James Perkins
22c0b65eb5
Fixing Tina + Adding a demo URL (#35480)
## Documentation / Examples

- Updating Tina Demo URL
- Adding Tina to blog-starter example
- Adding Tina to Basic features section
- Updating Tina to actually work again
2022-05-10 17:52:54 +00:00
Kiko Beats
b78c28f7a0
feat: better cookies API for Edge Functions (#36478)
This PR introduces a more predictable API to manipulate cookies in an Edge Function context.

```js
const response = new NextResponse()

// set a cookie
response.cookies.set('foo, 'bar') // => set-cookie: 'foo=bar; Path=/'`

// set another cookie
response.cookies.set('fooz, 'barz') // => set-cookie: 'foo=bar; Path=/, fooz=barz; Path=/'`

// delete a cookie means mark it as expired
response.cookies.delete('foo') // => set-cookie: 'foo=; Path=/; Expires=Thu, 01 Jan 1970 00:00:00 GMT, fooz=barz; Path=/'`

// clear all cookies means mark all of them as expired
response.cookies.clear() // => set-cookie: 'fooz=; Path=/; Expires=Thu, 01 Jan 1970 00:00:00 GMT, foo=; Path=/; Expires=Thu, 01 Jan 1970 00:00:00 GMT'`
``` 

This new cookies API uses [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) interface, and it's available for `NextRequest` and `NextResponse`.

Additionally, you can pass a specific cookies option as a third argument in `set` method:

```js
response.cookies.set('foo', 'bar', {
  path: '/',
  maxAge: 60 * 60 * 24 * 7,
  httpOnly: true,
  sameSite: 'strict',
  domain: 'example.com'
}
```

**Note**: `maxAge` it's in seconds rather than milliseconds.

Any cookie manipulation will be reflected over the `set-cookie` header, transparently.

closes #31719
2022-05-09 09:50:32 +00:00
Steven Tey
3fd1168504
Fixed typo (#36753)
## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2022-05-07 20:50:31 +00:00
Rich Haines
49910ea9ac
Updated the middleware api docs env section to remove dev and prod (#36739)
…rding due to customer confusion

This PR updates the middleware (edge functions) api docs environment section to remove the dev and prod wording due to customer confusion

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2022-05-07 00:24:39 +00:00
Steven
da8d1984d2
Add experimental wildcard remotePatterns config for upstream images (#36245)
## Description 
This PR implements a new configuration object in `next.config.js` called `experimental.images.remotePatterns`.

This will eventually deprecate `images.domains` because it covers the same use cases and more by allowing wildcard pattern matching on `hostname` and `pathname` and also allows restricting `protocol` and `port`.

## Feature

- [x] Implements an existing feature request.
- [x] Related issues linked
- [x] Unit tests added
- [x] Integration tests added
- [x] Documentation added
- [x] Telemetry added. In case of a feature if it's used or not.
- [x] Errors have helpful link attached, see `contributing.md`

## Related 

- Fixes #27925 
- Closes #18429 
- Closes #18632
- Closes #18730
- Closes #27345
2022-05-05 02:19:16 +00:00
Ryan Patterson
d1db7141ba
Add docs about nextRuntime for custom webpack (#36685)
This variable is exported by next but undocumented, and its usage is necessary to build auxiliary scripts for your server-side applications. See https://github.com/vercel/next.js/issues/36237#issuecomment-1117694528 for an example.



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2022-05-04 19:14:06 +00:00
oof2win2
3e78f0cb5d
fix(docs): mention cookies in context (#36342)
Mention that the HTTP.IncomingMessage object is augmented by `cookies` in getServerSideProps

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2022-05-04 16:25:55 +00:00
Stig Kleppe-Jørgensen
9cda84b484
Improve wording (#36649)
## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [x] Improve wording
- [ ] Make sure the linting passes by running `yarn lint`
2022-05-03 21:57:29 +00:00
jpveilleux
0234e6d553
Added type to Page Component for TypeScript (#36608)
* Added type to Page Component for TypeScript

Following this tutorial, I noticed that TS was complaining that "getLayout" did not exist on Page. That is normal since Page is typed as NextPage. I simply exported the new type we create in "_App.tsx" and used it as the return type for Page. This will probably help others seeing that red in their editors and perhaps being confused.

* Small linting change

* Apply suggestions from code review

* Update layouts.md

* lint fix

* update type

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-05-03 15:58:31 -05:00
abdallah akrab
3682534986
docs: add jest-environment-jsdom package for Jest configuration (#36632)
## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`

Jest 28 does not include jest-environment-jsdom by default.

following guide & running jest without jest-environment-jsdom causes the following  error:

<img width="1598" alt="image" src="https://user-images.githubusercontent.com/37980706/166319065-2bc29bb4-7d56-43e5-b85d-5a7484f17b1b.png">
2022-05-03 11:12:52 +00:00
Lee Robinson
d6cb99b37e
Add docs about SSR caching (yes, you can do this with Next.js) (#36588)
I've heard a lot of folks not realize this is possible 😄 Hopefully this helps.
2022-04-30 16:45:54 +00:00
Houssein Djirdeh
fd2ba11763
Adds inline script functionality to next/script for worker and beforeInteractive strategies (#36364)
Adds inline script functionality to `next/script` for `worker` and `beforeInteractive` strategies. 

- fixes #36318 
- fixes #26343
- fixes #26591
- fixes #26343
- fixes #26240


Co-authored-by: Janicklas Ralph <6142074+janicklas-ralph@users.noreply.github.com>
2022-04-29 15:20:31 +00:00
Adam Tolley
67a619ea64
Add note about running next without a sub-command (#36560)
This should be made explicitly clear because other code may just call `next` instead of `next dev` (e.g. https://github.com/netlify/framework-info/blob/main/src/frameworks/next.json).

Being in the ninth circle of debug hell right now I could not take it for granted that the two were the same till I saw some kind of confirmation, either from the docs or from the source.  Source is great, but calling it out in the docs would saved me some time.



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2022-04-29 02:57:48 +00:00
Mohamed ElSaadany
e4f66fe911
Adds <link rel="preconnect" ... /> to example optimized font output (#36529)
This makes it clear that the font optimization adds these for you.
This avoids duplicate `<link rel="preconnect" />` in the HTML output if the developer is unaware that it is being added automatically.



## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2022-04-28 00:04:18 +00:00
Lee Robinson
ea0456dc07
Add docs on self-hosted ISR persisting across pods. (#36520)
ISR works self-hosted, but there's some more guidance needed when hosting with container-based setups (e.g. Kubernetes) and how the files are shared between different pods. This was based on community feedback. Please let me know if you'd like to see any additions here! 🙏
2022-04-27 23:38:08 +00:00
Alex Castle
93d8fac184
Always add height and width prop to image with layout="raw" (#36523)
This PR makes the following changes:
* Always add the `height` and `width` prop to image with `raw` layout (previously only added to images without `sizes`)
* Add a warning if a raw layout image is getting stretched (which can be caused by interaction of height and width prop with styles)
* Remove automatic aspect-ratio style from `raw` images. This is no longer necessary if all `raw` images have height and width props.
* Update tests and docs accordingly
2022-04-27 21:59:05 +00:00
Luis Alvarez D
ff140a7291
Update usage paragraph of next/script onLoad (#36453)
Changing the paragraph to not include `beforeInteractive` as one of the possible use cases of `onLoad`.

*Update:* Added docs for `onError` in the API reference of `next/script`.

@housseindjirdeh does `onError` also has the same limitation or is this only for `onLoad`?

Closes https://github.com/vercel/next.js/issues/33402

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [x] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2022-04-25 17:51:35 +00:00
JJ Kasper
e832007536
Revert "Change getStaticProps to getStaticPaths in getStaticPaths docs" (#36425)
This change was un-necessary and `getStaticProps` was correct here so this reverts the change. 

Reverts vercel/next.js#36403
2022-04-25 03:33:36 +00:00
youngvform
2a42de2fd1
Change getStaticProps to getStaticPaths in getStaticPaths docs (#36403)
## Overview
The subject is `When does getStaticPaths run` but this docs denotes about `getStaticProps`.
So could you check `getStaticProps` is right?

## Documentation / Examples

- [X] Make sure the linting passes by running `yarn lint`
2022-04-23 14:41:03 +00:00
Maedah Batool
60488e68e3
Fix broken data fetching links in docs (#33766)
* Fix broken links for Data Fetching

* Fix link data fetching doc

* Improve link file paths

* Update errors/large-page-data.md

Co-authored-by: Steven <steven@ceriously.com>

* Update links

* Fix linting

* Lint tests

* Lint tests

Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2022-04-22 14:03:07 +02:00
Janicklas Ralph
0441f816a6
Changes to the beforeInteractive strategy to make it work for streaming (#31936)
Changes to the beforeInteractive strategy to make it work for streaming

Splitting `beforeInteractive` into two strategies `beforeInteractive` at the _document level and `beforePageRender` for page level <Scripts>
2022-04-21 21:15:53 +00:00
Joshua Davis
5a93e211cb
Clarifies that path params exist on query object (#36321)
Clarifies that the query object contains query and dynamic path parameters. As I was helping another engineer, I tried to reference this documention. I thought the routing page would be a more useful reference if it indicated how to read path parameters.



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2022-04-20 23:04:43 +00:00
Daniil Grishkin
49820daca6
Fix introduction.md for next.config.js (#36286)
Fix line in link to interface `NextConfig` where describe `next.config.js` properties.



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2022-04-19 20:35:49 +00:00
David Barker
44c7fd7999
Add onLoad gotcha note to basic-features doc (#36261)
#33097 adds a note to the `Script` documentation explaining that `onLoad` cannot be used with the `beforeInteractive` strategy. However, this note was missing in the [Basic Features](https://nextjs.org/docs/basic-features/script) documentation, causing some confusion. This adds the note there too.

This will hopefully fix a lot of confusion noted in https://github.com/vercel/next.js/issues/33191.
2022-04-19 11:50:19 +00:00
Jim Fisher
a2e65ac6d8
Docs: workarounds for router not resetting state (#35651)
* Docs: workarounds for router not resetting state (fixes #35138)

* Apply suggestions from code review

* updates

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-04-15 21:56:38 -05:00
Basant
ec7c911295
fixed typo, that should say 'in' not 'from' (#36046)
we can import server or client components in any server component, not from it.



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`


Co-authored-by: Tim Neutkens <6324199+timneutkens@users.noreply.github.com>
Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-04-15 15:34:21 +00:00
Eric Burel
e69820accc
Loosen the "public" condition on getSSP (#36018)
<!--
Thanks for opening a PR! Your contribution is much appreciated.
In order to make sure your PR is handled as smoothly as possible we request that you follow the checklist sections below.
Choose the right checklist for the change that you're making:
--

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
** I've made the change via GitHub UI sorry :)**

Hi, 

I think the "data must be public" condition on getSSP is not really true, and even counter-productive. Being able to statically render more content is most probably positive, in terms of perceived and real performance of the app + energy consumption. It's actually totally possible, and not even that hard thanks to middleware, to statically render custom, paid, segment-specific content (and even individual-specific content under certain conditions).

I've documented the reason for this change in a few places if you want more details:
- related PR on React: https://github.com/reactjs/reactjs.org/pull/4566
- demo implementation and explanation on how to couple middlewares and getSSP to statically render any kind of content (including custom content): https://blog.vulcanjs.org/render-anything-statically-with-next-js-and-the-megaparam-4039e66ffde
2022-04-15 13:23:32 +00:00
Balázs Orbán
c0f979b5c8
Update upgrading.md (#36091) 2022-04-15 14:43:26 +02:00
Aman Mittal
4726b5a618
Add instructions to create pages directory and add an index.js file to it (#35971)
* Update from-create-react-app.md

* Update from-create-react-app.md

* Fix typo

* Update docs/migrating/from-create-react-app.md

Co-authored-by: Lee Robinson <me@leerob.io>

* Update docs/migrating/from-create-react-app.md

Co-authored-by: Lee Robinson <me@leerob.io>

* Update from-create-react-app.md

* fix lint-language issue

* Update .alexrc

* Update docs/migrating/from-create-react-app.md

Co-authored-by: Steven <steven@ceriously.com>

* Update from-create-react-app.md

* Update docs/migrating/from-create-react-app.md

Co-authored-by: Steven <steven@ceriously.com>

Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: Steven <steven@ceriously.com>
2022-04-15 14:40:37 +02:00
Rich Haines
d38a46e2e4
Revert "Improvements to the MDX Docs and replaced a leftover reference to babel" (#36066)
Reverts vercel/next.js#35332
2022-04-11 16:11:35 +00:00
Amy Burns
9a7d175915
Moving middleware file (#36009)
This PR fixes a request from `@rauchg` that we specify more clearly that Middleware is Beta and organize it properly within the navigation. 

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2022-04-11 14:01:14 +00:00
Markos-Th09
5bf7265c35
Improvements to the MDX Docs and replaced a leftover reference to babel (#35332)
* Added next.config.mjs for @next/mdx

* Replaced leftover reference to babel

* Fixed formatting problem

* Added next-mdx-remote and @mdx-js/mdx as options
2022-04-11 12:21:43 +02:00
JJ Kasper
a0924fc7c7
Add docs for x-nextjs-cache header (#36023)
This adds documentation for the `x-nextjs-cache` header which is now exposed for ISR pages and image optimization requests to help signal the cache state. 

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`

Co-authored-by: Steven <steven@ceriously.com>
2022-04-08 17:38:50 -04:00
Shu Ding
3d4f4c6995
Update the docs for Switchable Runtime (#36015)
As per the feedback in #35952.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2022-04-08 16:26:14 +00:00
Björn
9c12d85c5d
Mention HTTP 303 See Other in redirects section (#35997)
Migrating from express to nextjs API routes broke one of our APIs because of how `redirect` works in nextjs vs. how it works in express. We need to redirect the user to a confirmation page via GET after making a POST request, which is not possible with `redirect`.

HTTP 303 seems to be the way to go in that case and I think it should be mentioned here.


## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2022-04-08 15:52:34 +00:00
Shu Ding
1c92591466
Update docs related to React 18 (#35952)
* update docs of streaming

* add switchable runtime docs

* add page to manifest

* Apply suggestions from code review

Co-authored-by: Steven <steven@ceriously.com>

* Update docs/advanced-features/react-18/streaming.md

Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: Steven <steven@ceriously.com>
2022-04-08 17:09:55 +02:00
Francis Gulotta
5feb400aff
docs: clarify when you use getServerSideProps (#35922)
Removed the misleading TTFB information. It was easy to read that incorrectly and while getStaticProps does have a better TTFB that's not why you might need to avoid getServerSideProps, I gave better examples. 

I also wanted to answer "well how do I cache `getServerSideProps`?" and now there's a link.

## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`
2022-04-07 22:00:28 +00:00
Sølve Tornøe
07723be8b3
Refactor default locale prefix to support clone() (#35874)
## Bug
fixes https://github.com/vercel/next.js/issues/35273

- [x] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`


## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
2022-04-06 15:00:39 +00:00