Commit graph

12138 commits

Author SHA1 Message Date
Tim Neutkens
d4a98a15f7
Add todo for dependsOn (#39677) 2022-08-17 10:39:37 +01:00
Sukka
7fe5c883fc
fix(create-app): support github url has trailing slash (#39665)
## Bug

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

The PR fixes #39642, by supporting GitHub repo URLs with a trailing slash while without branch and path.
2022-08-17 01:59:32 +00:00
Steven
53f0e2b31c
Update image tests files from *.js to *.ts (#39663)
Let's utilize typescript for our tests
2022-08-16 23:29:55 +00:00
Balázs Orbán
7de3cf5f89
fix(next-server): Fix priority for edge routes (#39462)
Fixes #39411
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 pnpm lint
 The examples guidelines are followed from our contributing doc

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-08-16 19:05:03 +01:00
Tim Neutkens
57b6eff904
Add separate entry per layout/page. (#39611)
Builds on top of #39162 which adds support for creating any kind of bundle path without breaking the compilation.
Ensures every layout gets a separate client-side bundle if it has client components being used.

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 pnpm lint
 The examples guidelines are followed from our contributing doc

Co-authored-by: Jiachi Liu <inbox@huozhi.im>
Co-authored-by: Shu Ding <g@shud.in>
2022-08-16 19:00:23 +02:00
Shu Ding
63a8196e85
Refactor base server (#39649)
Closes #39037. Moving `generateRoutes` to each runtime server.

## 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 `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-08-16 14:47:27 +00:00
JJ Kasper
f00aef4bf7
Update test failure logging (#39655)
This attempts to address the missing log outputs noticed in the below test run.
x-ref: https://github.com/vercel/next.js/runs/7839842437?check_suite_focus=true
2022-08-16 15:14:37 +01:00
JJ Kasper
5061167190
Add comment on slash normalizing in server (#39653)
Documentation / Examples

 Make sure the linting passes by running pnpm lint
 The examples guidelines are followed from our contributing doc

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2022-08-16 13:41:22 +01:00
magic-akari
3f63a491d0
fix(next/dynamic): handle template literal import path (#39623)
## Bug

- [x] fixes #39522 
- [x] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
2022-08-16 11:48:16 +00:00
Tim Neutkens
6876bb4c44
Enable additional TypeScript ESLint rules (#39640)
Enables some rules that are useful and already pass currently.


## 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 `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-08-16 11:08:40 +00:00
Henrik Wenz
3d3938b793
[Docs] Update with-slate example (#39639)
## Changelog

- Migrated `with-slate` example to typescript
- Updated dependencies to latest stable versions
- Added api route to demonstrate saving of `editorState`

## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm lint`
- [x] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-08-16 10:47:07 +00:00
Henrik Wenz
7a93093332
[Docs] Update with-loading example (#39646)
Changelog

Updated dependencies
Migrated to Typescript
Use CSS from npm module

Documentation / Examples

 Make sure the linting passes by running pnpm lint
 The examples guidelines are followed from our contributing doc
2022-08-16 11:29:48 +01:00
JJ Kasper
6fd2a7fa31
Remove webpack4 types (#39631)
These types are no longer needed as we are only leveraging webpack 5 so this finishes migrating our types away from webpack 4's types.
2022-08-16 09:55:37 +00:00
Alex Cole
11bd44f031
Update Convex Example (#39562)
This makes a few changes to the Convex example app.
We're using this example app in the Convex quick start (https://docs.convex.dev/quick-start), so I want to make sure we're setting new users up for success.

Upgrade to the newest version of Convex (includes adding a tsconfig.json for Convex functions)
Switch to pinning Convex to latest
Check in generated code so the example will make more sense to users browsing on GitHub or before they regenerate the code. This required ignoring it in the global .prettierignore
Add prettier
Update styling so "Powered by Convex" appears on screen.
Switch the syntax of one function to make it type check after developers add a schema

Documentation / Examples

 Make sure the linting passes by running pnpm lint
 The examples guidelines are followed from our contributing doc

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2022-08-16 01:21:53 +01:00
Shu Ding
059fba21a0
Eliminate path and utils from base server (#39622)
`_isLikeServerless` is only needed by the Node.js server.

## 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 `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-08-15 18:58:49 +00:00
Muhammad Musa
f743aa1833
Update strategies count to 4 (#39610)
## 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 `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-08-15 18:37:19 +00:00
Jiachi Liu
27e0b1293b
Add edge ssr to pr stats (#39621)
Monitoring edge-ssr bundle size in PR stats

change the react version in stats-app to 18
checking size of edge ssr page
2022-08-15 13:28:31 -05:00
Shu Ding
8f027c2d7a
Next Server code refactoring (#39591)
Move the route definitions into the conditions and remove unused method.

## 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 `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)


Co-authored-by: Jiachi Liu <4800338+huozhi@users.noreply.github.com>
2022-08-15 18:20:28 +00:00
JJ Kasper
eff9732afc
Remove minify: false for webpack5 bundle (#39620)
As noticed by @shuding we were disabling minifying for the webpack 5 bundle which was most likely left over from debugging which isn't necessary now as we can use the local version of webpack via the NEXT_PRIVATE_LOCAL_WEBPACK5 env variable instead.
2022-08-15 12:42:31 -05:00
Tim Neutkens
4cd8b23032
Enable @typescript-eslint/no-use-before-define for functions (#39602)
Follow-up to the earlier enabling of classes/variables etc.

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 pnpm lint
 The examples guidelines are followed from our contributing doc

Co-authored-by: Steven <steven@ceriously.com>
2022-08-15 10:29:51 -04:00
Jan Potoms
683db9a8ad
Support tsconfig paths without baseurl (#34926)
tsconfig behaves differently with `tsc` vs. Next.js. When `baseurl` is omitted, `paths` should be resolved against the tsconfig location. Consequentially, in this case the paths must start with `./`. This PR aligns Next.js behavior with `tsc` around `paths` without `baseurl`. 

Related: https://github.com/microsoft/TypeScript/pull/40101
2022-08-15 13:33:25 +00:00
Shu Ding
e0d7ee01df
Fix Edge SSR routes (#39594)
Currently Edge SSR routes are added to both `routedPages` (catch-all page render routes) and `edgeRoutesSet` (catch-all edge function routes). This causes the request to be handled by both and results in an error (the Node server can't execute the Edge SSR route as a regular page). 

Another fix is to make sure Edge Function routes are sorted too, so `/foo` can be caught before dynamic ones like `/[id]`.

## Bug

- [ ] Related issues linked using `fixes #number`
- [x] 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 `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-08-14 21:51:11 +00:00
Milind Mishra ⚛️
6791e7547e
Typo (#39596)
## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [x] 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 `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)

## Bug was a simple `typo`

![image](https://user-images.githubusercontent.com/28717686/184554656-83594c8e-cfab-4da1-89a2-f98d08ffe03f.png)


- Now fixed
2022-08-14 21:05:30 +00:00
JJ Kasper
0f65bf6e8b
Fix failing switchable runtime deploy test (#39579)
This ensures we add the needed manifest for b5aa571c71 in the `required-files-manifest`. No new test cases have been added as this was caught by the existing deploy test. 

## Bug

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

x-ref: https://github.com/vercel/next.js/runs/7821226464?check_suite_focus=true#step:8:193
2022-08-13 20:39:31 +00:00
JJ Kasper
d8809164ad
v12.2.6-canary.0 2022-08-13 12:27:25 -05:00
JJ Kasper
47a6120738
Update .env HMR handling (#39566) 2022-08-13 11:55:55 -05:00
Tim Neutkens
91d09bbad0
Rename page -> entry in on-demand-entry-handler (#39564)
Given that it's not just pages now I've renamed the entry handling.


## 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 `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-08-12 21:40:41 +00:00
LongYinan
6ff05b6815
Fix preinstall failed in yarn@1.x on FreeBSD with npm@8.17 (#39529)
[Build fixed: https://github.com/vercel/next.js/runs/7802539969?check_suite_focus=true](https://github.com/vercel/next.js/runs/7811339499?check_suite_focus=true)
2022-08-12 19:51:08 +00:00
Shu Ding
9cfa9945f0
Eliminate Amp in Edge runtime (#39560)
Amp mode is always disabled in the Edge runtime:

b5aa571c71/packages/next/server/render.tsx (L588)

So we can safely add the additional condition (`process.env.NEXT_RUNTIME !== 'edge' &&`) for the compiler to do DCE.

## 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 `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-08-12 19:29:39 +00:00
Jiachi Liu
aef60dc581
Support multiple flush effects (#39559)
Bring more flexibility for consume flush effects in separate places. Then you can move it into different client components roots
2022-08-12 19:06:08 +00:00
Tim Neutkens
2b2c2acf6e
Refactor handling of addPageEntry promise (#39547)
Follow-up to #39162. Refactors `addPageEntry` to no longer add into the `added` map.


## 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 `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-08-12 17:41:04 +00:00
Jiachi Liu
3c9ad33c69
Remove precopied styled-jsx (#39520)
follow-up for #39518

* revert `styled-jsx/style` import path to `next/dist/shared/styled-jsx`
* Since `styled-jsx` cannot be resolved through `node_modules/next/node_modules` by external resolving, we forcedly resolve styled-jsx as cjs external in webpack


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-08-12 17:08:38 +00:00
Andrew Cherniavskii
d9a1c4315e
[docs] Avoid next config validation warning (#39554)
[docs] avoid next config validation warning
2022-08-12 10:54:57 -05:00
Shu Ding
0c95a93858
Eliminate path polyfill and incremental-cache from base server (#39548)
Continue to optimize the base server to make it leaner. These are only needed by the Node.js server currently.

Related:
- #39433
- #39045
- #39044
- #39037

## 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 `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-08-12 15:25:47 +00:00
Bennett Dams
9d1980d086
docs: Rename API middlewares title in sidebar (#39534)
Based on the PR #39407, the sidebar title for API middlewares is changed from "API Middlewares" to "Request Helpers".




## Documentation / Examples

- [x] Make sure the linting passes by running `pnpm lint`
- [x] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
2022-08-12 13:55:39 +00:00
Tim Neutkens
b5aa571c71
Refactor client entry plugin to separate methods. (#39162)
WIP.


## 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 `pnpm lint`
- [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)


Co-authored-by: Shu Ding <3676859+shuding@users.noreply.github.com>
2022-08-12 13:01:19 +00:00
Cody Olsen
0c7217ba8f
docs(examples): use vercel integration in cms-sanity (#39323)
## Feature

- [x] Documentation added

## Documentation / Examples

- [x] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)

This PR updates the cms-sanity example to:
- Deploy to Vercel with the [Sanity Vercel Integration](https://www.sanity.io/docs/vercel-integration) by default.
- You can still opt-out of using the Sanity Vercel Integration, clicking `You can also set up manually` gives you all the information you need.
- The blog itself is updated so it's much more resilient to missing data, and is setup to set `revalidate: 60` until you have a On-demand Revalidation webhook setup.
- Preview Mode is now enabled on the frontpage as well.
- The Sanity client setup, and webhook validation, are updated to follow our current best practices.
2022-08-12 03:56:49 +00:00
JJ Kasper
911ba233d9
v12.2.5 2022-08-11 20:50:08 -05:00
JJ Kasper
d06fc0f0c4
v12.2.5-canary.7 2022-08-11 19:17:02 -05:00
JJ Kasper
4049cd7cb5
Re-add styled-jsx as a normal dependency (#39518)
This re-adds `styled-jsx` as a normal dependency for now leaving the require hook in place so that we can correctly handle mis-matching versions in the module tree. 

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

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`
2022-08-11 23:54:26 +00:00
JJ Kasper
de1bf3e471
v12.2.5-canary.6 2022-08-11 16:46:44 -05:00
Jeferson S. Brito
249f429f52
fix(examples/with-wdyr): example config to support SWC (#39465) 2022-08-11 16:44:13 -05:00
Tim Neutkens
db9040b0b8
Enable @typescript-eslint/no-use-before-define variables,enums,typedefs for core files (#39511)
* Enable @typescript-eslint/no-use-before-define typedefs and enums

* Enable variables

* Move in client/index

* Revert "Move in client/index"

This reverts commit 592d70cf3d9cd39e741905faf9229f664c9b4ebd.

* Move wrapApp

* Revert "Revert "Move in client/index""

This reverts commit 14b6105eb45ab87b3b4a1d6f2907d8b9e9657888.

* Fix classes cases
2022-08-11 16:32:52 -05:00
Tim
d510758b52
fix: ensure hidden iframe apps render in development mode (#39514) 2022-08-11 16:22:19 -05:00
Alex Castle
13a5eb2228
Add position styling to future fill images (#39438)
This PR adds default style properties to a fill-mode image using `next/future/image` of 0 for all positions. This should replicate the existing `layout="fill"` behavior better, and make it easier to migrate.

Tests are also added for fill styling.
2022-08-11 18:16:05 +00:00
JJ Kasper
a9b415b850
v12.2.5-canary.5 2022-08-11 12:09:48 -05:00
Alvin Bryan
1f6bc34751
Fixed issues with environment variables for Windows users (#37853) 2022-08-11 11:39:53 -05:00
Jiachi Liu
7f54585f8d
Bump styled-jsx and remove manual types creation (#39506) 2022-08-11 10:13:26 -05:00
JJ Kasper
d158c0c580
Make dev watch ignore more specific (#39504)
This fixes the case where we were incorrectly ignoring the next-auth API endpoint since it matched the `.next` watch ignore and also adds a test case to ensure we match this route correctly. 

## Bug

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

Fixes: https://github.com/vercel/next.js/issues/39495
2022-08-11 15:09:57 +00:00
JJ Kasper
f863ba7193
v12.2.5-canary.4 2022-08-10 23:00:59 -05:00