Commit graph

12277 commits

Author SHA1 Message Date
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
dcdev67
79d1b33332
[examples] Add on-demand revalidation to Contentful example (#39475)
## Feature

- [x] 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`

## Changes

Added in on-demand revalidation for Contentful example. Specifically, added the revalidate api path, a new environment variable which will contain the secret, and some additions to the README.


Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-08-11 03:58:53 +00:00
Noel Kim (김민혁)
40f0eb126b
feat(next-swc/modularize_imports): Add Kebab case (#38583)
* Feat: Add Kebab case

* Add document

* Feat: Add Kebab case

* Add document

* Add Test cases
2022-08-10 22:51:05 -05:00
JJ Kasper
4e6d05575e
Add hot-reloading for env file changes (#38483)
* Add hot-reloading for env file changes

* update watching

* update test

* update initial env handling

* undo test change

* add comment for entries clearing

* update on-demand-entry-handler restart handling

* lint-fix

* handle bad plugin
2022-08-10 22:27:48 -05:00
X7Becka
970469f359
FIX GAUSSIAN BLUR IN FUTURE\IMAGE (#39190)
## Bug

- [fixes #39035 ] 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: Steven <229881+styfle@users.noreply.github.com>
Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com>
2022-08-11 00:09:42 +00:00
JJ Kasper
d246257602
v12.2.5-canary.3 2022-08-10 18:18:54 -05:00
JJ Kasper
c97a8e8f1b
Fix swc build for freebsd target (#39478)
* Fix swc build for freebsd target

* test build

* update build

* update version

* test v0

* use napi directly

* revert vm version

* undo test build
2022-08-10 18:09:10 -05:00
Steven
3d2765342e
Update contributing.md to recommend corepack (#39479)
Since corepack is already [enabled for this repository](1669c60684/package.json (L218)), lets recommend it for contributing.

Learn more: https://styfle.dev/blog/corepack
2022-08-10 22:32:51 +00:00
JJ Kasper
1669c60684
Fix next.config.js overwriting on deploy e2e test (#39476) 2022-08-10 16:44:21 -05:00
Maedah Batool
bd61406e54
Improve next/future/image Migration docs (#39421)
The [comparison table for migration](https://nextjs.org/docs/api-reference/next/future/image#migration) to `next/future/image` looks odd layout-wise. The issue was brought up via this [Slack thread](https://vercel.slack.com/archives/C02F56A54LU/p1660040275310949).

This PR makes this improvement.

### New implementation

<img width="1216" alt="image" src="https://user-images.githubusercontent.com/12712988/183631902-6850836b-cb4e-44ea-909f-ba353725be15.png">

## 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: Steven <229881+styfle@users.noreply.github.com>
2022-08-10 20:40:53 +00:00
JJ Kasper
44eea0c9c9
v12.2.5-canary.2 2022-08-10 15:32:25 -05:00
JJ Kasper
c9aa2ea2cf
Tweak styled-jsx type declarations (#39474)
* Tweak styled-jsx type declarations

* fix lint
2022-08-10 15:26:54 -05:00