Commit graph

13025 commits

Author SHA1 Message Date
Kiko Beats
137008e613
[middleware] add tests for body reading methods #37980 (#41718) 2022-11-01 20:45:58 -07:00
Balázs Orbán
460e19f0aa
docs(script): explain expected next/script behavior on client-side navigation (#42260)
This PR explains that a navigation via `Link` would not re-execute
`next/script` components once they are added.

Fixes #42111

Ref: [slack
thread](https://vercel.slack.com/archives/C02UJ0QH45Q/p1667237775929339)

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a 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 a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-11-01 20:38:15 -07:00
OJ Kwon
76fdd256cc
refactor(next/turbo): consolidate turbo devserver logic (#42315)
<!--
Thanks for opening a PR! Your contribution is much appreciated.
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:
-->

This PR simplifies how `--turbo` is being invoked in its napi bindings.
After refactoring in turbopack's devserver, it is possible to reuse same
logic between napi bindings / standalone binaries.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a 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 a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-11-01 20:27:14 -07:00
JJ Kasper
0c2404a406
v13.0.2-canary.0 2022-11-01 13:55:50 -07:00
JJ Kasper
4a6ccc259b
Add mongodb to default server externals (#42313)
Follow-up to https://github.com/vercel/next.js/pull/42294
2022-11-01 13:19:09 -07:00
Tim Neutkens
1af21b51c1
Add preload for layouts / components (#41519)
Preload layout/component so that fetching starts eagerly.
<!--
Thanks for opening a PR! Your contribution is much appreciated.
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:
-->

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a 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 a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-11-01 13:07:55 -07:00
Shu Ding
b72dc5b69f
Improve the error message when custom export fields are used in an entry (#42221) 2022-11-01 11:17:06 -07:00
Shu Ding
fc397caa6f
Add sqlite3 to the default list of server externals (#42294)
Related discussions:
https://github.com/vercel/next.js/discussions/41745#discussioncomment-4018964

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a 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 a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-11-01 15:41:57 +01:00
Wyatt Johnson
6c7e76b551
Hybrid App Hooks Support (#41767)
This adapts the new client hooks of `usePathname`, `useSearchParams`,
and `useRouter` to work within the `pages/` directory to aid users
attempting to migrate shared components over to the `app/` directory.

> **Exception:**
> When the pages router is not ready, `useSearchParams` will return an
empty `URLSearchParams`. This mirrors the behavior seen in the `pages/`
directory today in that `router.query` is not available until the client
hydrates.

This also adds a new option for `useRouter` to bring it line with the
correct typings with the app directory. By default, calling
`useRouter()` will return the type `NextRouter | null` to represent what
you get when you call it from a component originating from the app
directory. If you want to instead force it to return `NextRouter` as it
does today, you can pass a boolean into the `useRouter` call as such:

```ts
const router = useRouter()     // typeof router === NextRouter | null
const router = useRouter(true) // typeof router === NextRouter
```

This change is designed to ease the incremental adoption of app.
2022-10-31 20:13:27 -07:00
JJ Kasper
b0ad8adc26
Update app-dir E2E tests for deploy (#42269)
x-ref:
https://github.com/vercel/next.js/actions/runs/3364229800/jobs/5579571814

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a 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 a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-10-31 17:07:53 -07:00
JJ Kasper
c1c3eac325
v13.0.1 2022-10-31 14:45:52 -07:00
JJ Kasper
1c1b5031d9
v13.0.1-canary.4 2022-10-31 12:40:18 -07:00
JJ Kasper
50ced119e2
Add E2E test for @vercel/og API route (#42258)
This ensures we don't have a fatal error when not necessary and ensures
`@vercel/og` is working as expected.

x-ref: [slack
thread](https://vercel.slack.com/archives/CGU8HUTUH/p1667239940322769?thread_ts=1667238747.240989&cid=CGU8HUTUH)

## Bug

- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have a 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 a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-10-31 12:32:35 -07:00
JJ Kasper
96696c2d3b
Add event for dev process stop (#42255)
x-ref: [slack
thread](https://vercel.slack.com/archives/C02HEJASXGD/p1667173179573409?thread_ts=1667165920.338789&channel=C02HEJASXGD&message_ts=1667173179.573409)

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a 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 a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-10-31 12:19:22 -07:00
JJ Kasper
a4f9d77f78
Update failing e2e middleware response test (#42256)
Fixes:
https://github.com/vercel/next.js/actions/runs/3362784779/jobs/5576284398

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a 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 a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-10-31 11:39:51 -07:00
Tim Neutkens
8e3586d2cc
Optimize bundle size for appDir (#42252)
- Ensure React / other deps are deduped against main-app bundle
- Only require web-vitals when it's needed
- Move warnOnce into separate file as it's not tree shaken
- Add create-next-app with bundle analyzer

<details>
<summary>13.0.0 (react-dom deduping bug)</summary>

<img width="1912" alt="13-0-0" src="https://user-images.githubusercontent.com/6324199/199067942-d2394ffa-fc1c-4606-94f4-b489ef959a9b.png">

</details>

<details>
<summary>Canary (react-dom deduping bug fixed)</summary>

<img width="1912" alt="current-canary-branch" src="https://user-images.githubusercontent.com/6324199/199067999-786b523e-b4f0-4044-8d2e-acaa0386771a.png">

</details>

<details>
<summary>This PR</summary>

<img width="1912" alt="pr-changes" src="https://user-images.githubusercontent.com/6324199/199068060-2fdb6e11-8b94-4683-9b8e-65bb6faab34a.png">

</details>



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a 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 a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-10-31 17:50:35 +00:00
Duncan Ogle
848bb3af73
Escape HTML on "<Link> with <a> child" page (#42114)
Non-escaped characters is leading this page to attempt to render the title as HTML tags. This change escapes those values so they may present correctly

https://nextjs.org/docs/messages/invalid-new-link-with-extra-anchor

<img width="524" alt="Screenshot 2022-10-29 at 06 57 16" src="https://user-images.githubusercontent.com/5629994/198817257-47b45ce9-2841-4db1-82f2-91e2c9b22808.png">



## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm build && pnpm lint`
- [x] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-10-31 16:16:42 +00:00
JJ Kasper
76dc2dcf97
v13.0.1-canary.3 2022-10-31 09:01:43 -07:00
Hannes Bornö
ca1946b0db
Multiple local font weights and styles (#42232)
Allows you to specify multiple weights and styles for a
`@next/font/local` font family.

When generating a fallback font family it will pick the font file with
the weight closest to normal, this will typically make up most of the
text on a page.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a 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 a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-10-31 08:59:28 -07:00
Hannes Bornö
cc0c85e5eb
Default font config fix (#42235)
Fixes typo and makes sure both loaders always have a default value.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a 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 a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-10-31 08:56:37 -07:00
JJ Kasper
b7ea0a5abe
Add prompt for ESLint to CNA (#42218)
Following up https://github.com/vercel/next.js/pull/42012 this adds an
additional prompt for include ESLint config/dependencies or not. As
discussed, this also removes the slow down from doing separate
`dependencies` and `devDependencies` installs since this separation is
no longer required now that we have `output: 'standalone'` which ensures
only actual necessary dependency files are used for production builds.

<details>

<summary>Before</summary>


https://user-images.githubusercontent.com/22380829/198953290-116b422d-4359-4aa9-9d82-b3265fde7b3f.mp4


</details>

<details>

<summary>After</summary>




https://user-images.githubusercontent.com/22380829/198953347-20dbf897-92b3-45ea-a9d2-cfb61622251d.mp4



</details>

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a 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 a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-10-31 08:51:50 -07:00
Shu Ding
2280a2dd56
Fix CSS modules imports from outside of the root directory (#42106)
Fixes #41856. There is no way to apply those loader rules to specific
directories, especially when `transpileModules` is used. This PR changes
that to be based on the issuer layer.

## Bug

- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have a 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 a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-10-31 08:44:48 -07:00
Amy Burns
005cf9b7a7
Adding note about beta docs (#42230)
## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a 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 a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-10-31 15:29:45 +00:00
Tobias Koppers
13615953db
update turbo version (#42228)
Update the turbopack version.
2022-10-31 08:07:34 -07:00
C. Lewis
4316d3884e
docs(create-next-app): copy changes from #42012 to package-level README (#42217)
Just ensures the README for the package and the README on the nextjs.org
site match regarding interactive mode etc.
2022-10-31 00:02:02 -07:00
汪心禾 Wang, Xinhe
0affdebf67
Fix typo pnpm-lock.yam in .prettierignore_staged (#42212)
Fix typo `pnpm-lock.yam` in #38915

Regenerate pnpm-lock.yaml without formatting (#42208)

<!--
Thanks for opening a PR! Your contribution is much appreciated.
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:
-->

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a 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 a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)

None of the above

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-10-30 22:58:45 -07:00
C. Lewis
389c77f205
feat(create-next-app): JS/TS prompt (with appDir support); enhanced testing (#42012)
Resubmitting this PR following this comment from Tim. This work has been done already and we can build off of it to get this in faster. 

> Just to be clear we're planning to rework create-next-app to give you the option to choose between JavaScript or TypeScript so it'll solve this request. For `app` right now it'll stay TypeScript till that is implemented.
> 
> _Originally posted by @timneutkens in https://github.com/vercel/next.js/discussions/41745#discussioncomment-3985833_

---

I added the `--ts, --typescript` flag to `create-next-app` in https://github.com/vercel/next.js/pull/24655, and since then I have seen it used very frequently, including in recent issues (such as https://github.com/vercel/next.js/issues/33314) and most Next.js tutorials on YouTube. I noticed the template logic added in this PR was also used to add the `appDir` configuration as well.

We discussed a while ago adding the following user flow:

- `create-next-app --js, --javascript` creates a JS project
- `create-next-app --ts, --typescript` creates a TS project
- `create-next-app [name]` (no `--js, --ts`) prompts the user to choose either JS or TS, with TS selected by default.

### Review

Adding support for appDir and refactoring the templates brought the pain-of-review up a bit, but it's not so bad when broken into increments.

The original 8-file diff is here:
1f47d9b0bf

And the PR that brought the diff up to 59 files (mostly owed to `app` template dirs and file structure refactors):
bd3ae4afd3 ([PR link](https://github.com/ctjlewis/next.js/pull/3/files))

### Demo

https://user-images.githubusercontent.com/1657236/198586216-4691ff4c-48d4-4c6c-b7c1-705c38dd0194.mov


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-10-31 05:43:39 +00:00
JJ Kasper
b7a9b06281
Fix next/link codemod errors in with-turbopack (#42203)
x-ref: https://github.com/vercel/next.js/pull/41913

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-10-30 21:06:35 -07:00
JJ Kasper
86b3e7d5b1
Ensure we detect config correctly with turbo flag (#42201)
Ensures we handle the `configFileName` field properly from
`next.config.js`.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a 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 a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-10-30 20:06:11 -07:00
Ishaq Ibrahim
29c5acd33b
issue-41925 fix: skip duplicate props when transferring props from anchor to link (#42158)
Fixes issue #41925 by skipping duplicate props. I've tested the changes
locally - the duplicate prop is being skipped successfully. The
new-link.test.js suite is also passing.

<!--
Thanks for opening a PR! Your contribution is much appreciated.
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:
-->

## Bug

- [x] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a 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 a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)

Co-authored-by: Ishaq Ibrahim <ishaq.ibrahim@convertdigital.com.au>
2022-10-30 13:09:14 -07:00
Tim Neutkens
ab42da0626
Run next/link codemod for Next.js 13 on examples (#41913) 2022-10-30 21:00:45 +01:00
Mike Holloway
8ada894a2c
Correcting documentation (#42179)
`response` hasn't been defined in the documentation at the point that a cookie check is being made. The update makes the check against the `request` object instead.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a 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 a helpful link attached, see `contributing.md`

## Documentation / Examples

- [] Make sure the linting passes by running `pnpm build && pnpm lint`
- [] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-10-30 19:02:56 +00:00
Tim Neutkens
e2b6c87af0 v13.0.1-canary.2 2022-10-30 17:29:49 +01:00
Balázs Orbán
2e6588d028
fix: allow resolving large JSON data in server components (#42025)
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2022-10-30 16:52:35 +01:00
JJ Kasper
6d53e8b34f
v13.0.1-canary.1 2022-10-30 01:54:04 -07:00
JJ Kasper
9ac42fd6f3
Update vscode config handling (#42169)
This ensures we correctly preserve comments in the config similar to our
tsconfig handling and removes the `gitignore` updating as we can't infer
safely if a user wants this file ignored or not.

Fixes: https://github.com/vercel/next.js/issues/41808

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a 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 a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-10-30 01:51:44 -07:00
JJ Kasper
56dd821a71
Update turbo crates (#42014)
## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a 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 a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-10-30 01:28:54 -07:00
JJ Kasper
a67f100ee8
Ensure app revalidate has correct default (#42168)
Ensures if an invalidate revalidate value is used we correctly override
with our default.

x-ref: [slack thread](https://vercel.slack.com/archives/C048Q9QSNDA)

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a 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 a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-10-30 00:46:40 -07:00
Shu Ding
1d58c0ab91
Improve TypeScript plugin error when the configuration is not statically analyzable (#42062)
As per
https://github.com/vercel/next.js/issues/41951#issuecomment-1294199692,
this PR improves the TS plugin error message when a non-literal
configuration is used:

<img width="902" alt="CleanShot 2022-10-28 at 07 36 31@2x"
src="https://user-images.githubusercontent.com/3676859/198650771-026a0430-d5bc-4826-9aef-b1bfb7947c6f.png">

Also a bug is fixed so string template literals (``const revalidate =
`auto`;``) will no longer result in an error.

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a 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 a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-10-30 00:31:01 -07:00
Steven
d651e2799a
Fix failing codemod test url-to-withrouter (#42109)
This test was failing when running

```
cd ./packages/next-codemod
pnpm build
pnpm test
```
2022-10-29 22:26:21 -07:00
Steven
676be08d32
Warn when legacy prop detected on next/image (#42102)
Instead of hard error, we can try to convert legacy props to the new
props and print a warning.

We still recommend upgrading by running one (or both) codemods because
the new component no longer has a wrapping `<span>`.

<img width="616" alt="image"
src="https://user-images.githubusercontent.com/229881/198756393-7d981686-f4db-485b-9f5f-1ff614d35959.png">

Read more: https://nextjs.org/docs/messages/next-image-upgrade-to-13
2022-10-29 22:22:08 -07:00
Alpha
f355dd4f4f
[docs] Enhanced grammar in building README. (#42155)
Closes https://github.com/vercel/next.js/issues/42154

This PR enhances grammar in building README.
2022-10-29 22:02:24 -07:00
Alpha
c19c10069f
grammar fix in adding-examples README. (#42152)
Closes https://github.com/vercel/next.js/issues/42151

This PR fixes grammar in adding-examples README.
2022-10-29 22:02:08 -07:00
Alpha
0a0c8e0299
Enhanced grammar. (#42148)
closes  https://github.com/vercel/next.js/issues/42147

This PR enhances the grammar in adding-documentation README.
2022-10-30 04:59:24 +00:00
Jay Kumar
9bf811eea0
Fix typo in importing counterReducer (#42162)
## Bug

- [ ] Fixes type in importing counterReducer
2022-10-30 00:37:32 +00:00
Ingólfur Valsson
ee6601ceda
Broken link in example page (#42135)
Link to source file was broken since rename #41434



## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm build && pnpm lint`
- [x] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2022-10-30 00:20:11 +00:00
Jiachi Liu
ff0d082d46
Keep react-dom/server.node in precompiled (#42138)
In `server/render.tsx` we're switching between `react-dom/server.browser` and `react-dom/server` based on the react version users're using, unlike directly resolving them with nodejs on server side, turbopack needs to resolve both while bundling.
2022-10-29 21:32:28 +00:00
Jiachi Liu
6028a7a69f
Remove react root condition and always use concurrent mode (#42141)
Removing the `hasReactRoot` condition and `__NEXT_REACT_ROOT` env var since next 13 requires latest react 18 to be installed, all the react 17 (non concurrent mode) compatible code can be dropped now.
2022-10-29 20:34:03 +00:00
Shu Ding
6e734d92a1
Fix CSS imports from outside of the app dir when src folder is present (#42108)
Previously we use `path.join(compiler.context, chunk.name)` as the entry
name, which isn't always the case especially when there is the `src`
folder. This PR fixes that by using `appDir`.

## Bug

- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
- [ ] Errors have a 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 a helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-10-29 01:38:55 -07:00
Jiachi Liu
d510204fe5
types: leverage webpack types and remove casting (#42104)
* Use webpack types directly through webpack namespace
* Remove webpack types casting to any
2022-10-29 04:00:33 +02:00