Commit graph

8008 commits

Author SHA1 Message Date
Tim Neutkens
7ecf24489a
Update static-dir-deprecated.md 2021-03-23 14:45:36 +01:00
Tim Neutkens
e52a224c21
Add manifest of error pages (#23310)
## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added

## 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.

## Documentation / Examples

- [x] Make sure the linting passes
2021-03-23 12:53:17 +00:00
Lee Robinson
b7588fd936
[examples] Small updates to blog example. (#23258) 2021-03-22 22:10:15 -05:00
Pedro Duarte
2ef00a3c4a
Update with-stitches example (#23281)
## Examples

- [x] Make sure the linting passes

This PR updates the `with-stitches` example to use the Beta `0.1.0` release.
2021-03-22 21:29:58 +00:00
Shu Ding
c8680a344f
Remove visibility: hidden from the image component (#23278)
This PR removes the `visibility` style property change from next/image. It was previously added in #18195 to fix a bug that when no `src` is set, and that bug is not valid anymore as all images will always have `src` (and a fallback too).

It also fixes the problem that screen readers ignore elements with `visibility: hidden`.

Fixes #23201.

## Bug

- [x] Related issues #23201
- [ ] Integration tests added

## 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.

## Documentation / Examples

- [ ] Make sure the linting passes
2021-03-22 19:20:52 +00:00
Johan Eliasson
f384cd103b
Consistent use of colons in contributing docs (#23260)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2021-03-22 15:46:07 +01:00
Tim Neutkens
fe80128915 v10.0.10-canary.7 2021-03-22 11:35:23 +01:00
Tobias Koppers
c9a2e5b8f0
upgrade webpack to 5.27.1 (#23224)
fixes #23125

fixes https://github.com/tailwindlabs/tailwindcss-jit/issues/54

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added

## 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.

## Documentation / Examples

- [ ] Make sure the linting passes
2021-03-22 09:21:51 +00:00
Julien Karst
8e4123e9d9
feat: add exemple with redux toolkit in typescript (#23250)
This pull request add typescript to the current redux-toolkit example on next.js. @markerikson suggested this nice idea to add a ts example: https://twitter.com/acemarke/status/1370877104527712259?s=20

This example is with the previous redux-toolkit example which was more complex. An example with the current example is available here: https://github.com/vercel/next.js/pull/23249

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added

## 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.

## Documentation / Examples

- [ ] Make sure the linting passes
2021-03-22 03:21:13 +00:00
Mito
46fc696840
Include useEffect in SPA demo import, Fix punctuation (#23256)
Under the Single-Page App (SPA) heading, there is a code snipped which has a missing import:
import { useState } from 'react'
to
import { useState, useEffect } from 'react'

Also added apostrophe to description:
your old application entry point
to
your old application's entry point



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added

## 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.

## Documentation / Examples

- [X] Make sure the linting passes
2021-03-22 01:35:04 +00:00
Lee Robinson
6a418b7da9
[examples] Add portfolio starter kit. (#23212) 2021-03-21 19:44:59 -05:00
Shu Ding
89ec21ed68
Fix wrong source path resolved from the stack frame to not expose internal code (#23203)
Currently Next.js exposes internal code in the error overlay if certain errors were created from the user code. Some examples were attached in #20776.

We can clearly see that the path is wrong (`../next-server`), it should be `./node_modules/next/dist/next-server`:

![CleanShot 2021-03-19 at 01 33 04](https://user-images.githubusercontent.com/3676859/111670728-1ae7e400-8853-11eb-9213-3b359798900e.png)

The root cause is the `__nextjs_original-stack-frame` middleware resolves the file path with the following code:

```js
path.resolve(
  rootDirectory,
  getSourcePath(sourcePosition.source)
)
```

where `rootDirectory` is the **app root**, but `sourcePosition.source` comes from the module path, which is relative to the path of the `next` binary, not the app root. 

That explains why we see `../next-server` from the error above, because it's relative to `./node_modules/next/bin/next`.

Because of that, the resolved result will never have `node_modules` in its path and it won't be filtered by the error overlay in the UI. Here's a screenshot of the frame object in the UI:

![CleanShot 2021-03-18 at 23 01 29@2x](https://user-images.githubusercontent.com/3676859/111670062-65b52c00-8852-11eb-9293-3a6e5b7c4b9b.png)

And the filter we use to determine if a frame is expanded or not only depends on `body.originalStackFrame`:

```js
expanded: !Boolean(
  body.originalStackFrame?.file?.includes('node_modules') ?? true
)
```

So this PR also adds `source.file` check to ensure they will be ignored (not necessary because we fixed the path resolving).

Fixes #20776.
2021-03-20 19:34:45 +00:00
Tobias Koppers
8c72806ace
add separate progress output for typechecking (#23226)
## Bug

- [x] Related issues linked using `fixes #number`
- [ ] Integration tests added

## 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.

## Documentation / Examples

- [ ] Make sure the linting passes

Fixes #23240
2021-03-20 19:11:45 +00:00
Nikita
ebfbbdb331
Fix broken link (#23230) 2021-03-19 20:58:22 +00:00
Ciprian Caba
919ac17f76
Update reference to commit sha (#23215)
VERCEL_GIT_COMMIT_SHA is now available by default across all integrations
2021-03-19 16:49:20 +00:00
Shu Ding
32c435d819
Experimental feature for allowing importing Typescript files outside of the root directory (#22867)
This PR attempts to provide an option to allow importing TS/TSX from outside of the current Next.js project root directory. Although this goes against the design decision that no source code should be imported from outside of root and [might bring tons of issues](https://github.com/vercel/next.js/issues/19928#issuecomment-741596557), it will still be helpful in some monorepo use cases.

This PR assumes that the external files are following the same language syntax rules and under the same tooling versions as the source code inside your project root. And it's also not allowed to enable the `baseUrl` feature in the external directory (as the project should only have 1 import base URL).

X-ref: #9474, #15569, #19928, #20374.
2021-03-19 16:43:46 +00:00
JJ Kasper
79066aee8e
v10.0.10-canary.6 2021-03-19 11:20:13 -05:00
Tim
a1b97ac3f8
Added Prepr CMS Examples to docs (#23221)
Following commit 1f5c2c8513

Adding documentation links to example.

## 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.

## Documentation / Examples

- [x ] Make sure the linting passes
2021-03-19 16:10:35 +00:00
Tim Neutkens
3caf6420d0 Add PR template 2021-03-19 09:59:26 +01:00
Tim Neutkens
2874bbc61c v10.0.10-canary.5 2021-03-19 09:50:42 +01:00
Sam Ko
e71014609e
Fix invalid console.error link (#23213) 2021-03-19 09:22:19 +01:00
Tim Neutkens
c72e85cd37
Update CODEOWNERS 2021-03-19 09:21:11 +01:00
JJ Kasper
b6bb110aca
Ensure process exits after build completes (#23207)
This ensures we exit the build process after the build completes even if timers/connections are left open since this can cause the process to hang indefinitely. This was the previous behavior although got changed un-intentionally in e27b7e996d

This updates our production test with an open timer to ensure it doesn't block the process from completing.
2021-03-19 08:06:28 +00:00
Lee Robinson
e2cdf6d581
Update README for sentry example. (#23205)
The packages referenced here were removed.
2021-03-18 18:16:03 +00:00
Lee Robinson
115674f6a4
Clarify a custom server doesn't mean you can't use an existing backend. (#23200)
I've been this confusion quite a few times.

> So with my requirements, how big of a sin is it to use Next only for the frontend and get all its data, JWT tokens, etc. from my NodeJS backend by calling its respective APIs to said backend?

> Even the docs mention that running a custom server is not a great idea...
2021-03-18 17:31:44 +00:00
Vincent Voyer
1b020e6cd1
docs(authentication): rephrase next-iron-session/next-auth (#23199)
I thought that the current wording was not accurate both for next-iron-session and next-auth.

- next-auth is a full-featured authentication system like passport
- next-iron-session is a session utility

The previous copy was less clear about that and, for example, said you should go for next-iron-session for user/password and next-auth for everything else. Which is not the case. I use next-iron-session with only a Slack login, and you can implement email/password with next-auth.

Hope you like it!

PS: I have no preference between the two, I think they serve a different purpose. I used the two (and authored one).

I used next-auth on https://sourcekarma.vercel.app/
2021-03-18 17:04:58 +00:00
Mokshit Jain
aaa999d696
Make @tailwindcss/jit default engine for Tailwind CSS (#23192)
This Pull Request makes [`@tailwindcss/jit`](https://github.com/tailwindlabs/tailwindcss-jit) the default engine for Tailwind CSS.

It has the following advantages:
- Lightning-fast build times because the CSS is generated on demand.
- Every variant is enabled out of the box.
- Generate arbitrary styles without writing custom CSS.
- Better performance in browser dev-tools.
2021-03-18 15:57:31 +00:00
Shu Ding
241a916e03
Improve image optimizer to only create 1 worker thread (#23188)
As stated in #23157, this PR merges all the operations into 1 worker thread (`processBuffer` in `impl.ts`) and only pass a list of operation names and args into the worker. This should improve the speed and memory usage of next/image.

Fixes #23157. X-ref: #22925.
2021-03-18 15:51:36 +00:00
Tim Neutkens
70d306e0ac
Add note about multiple requests when using incremental static generation (#23190) 2021-03-18 16:22:29 +01:00
Tim Neutkens
ea374d8156 v10.0.10-canary.4 2021-03-18 13:54:25 +01:00
Tobias Koppers
b267635d63
rename to NEXT_WEBPACK_LOGGING (#23186)
as vercel doesn't allow env vars starting with _
2021-03-18 12:53:41 +00:00
Tobias Koppers
60af3a125a v10.0.10-canary.3 2021-03-18 12:23:30 +01:00
Tobias Koppers
a408416299
get files from entrypoints instead of from chunks (#23174) 2021-03-18 11:14:58 +00:00
Tobias Koppers
75c62cb74c
add env var to enable advanced webpack logging and profiling (#23178)
This allows to use `__NEXT_WEBPACK_LOGGING` to enable verbose webpack logging output to investigate into performance and cache problems.

`__NEXT_WEBPACK_LOGGING=1` enables some basic logging

`__NEXT_WEBPACK_LOGGING=infrastructure` enables only infrastructure logging

`__NEXT_WEBPACK_LOGGING=profile-client` enables deep profile output of the client build

`__NEXT_WEBPACK_LOGGING=profile-server` same for the server

`__NEXT_WEBPACK_LOGGING=profile-client,infrastructure` combines multiple things
2021-03-18 09:46:07 +00:00
Lee Robinson
f827bf0cdc
Update Redis example to use Tailwind. (#23131)
And an improved design 😄 

https://roadmap-redis.vercel.app/
2021-03-17 21:11:57 +00:00
Josh Flayhart
34e9409770
[Docs] Update next.config.js link to default config (#22989)
It's currently misleading and I chose to freeze to a particular version since pointing to canary every time is likely to break (as is happening prior to this PR).

The link will now go to: https://github.com/vercel/next.js/blob/v10.0.8/packages/next/next-server/server/config-shared.ts#L33
2021-03-17 20:21:39 +00:00
Mokshit Jain
7dc45a325e
Add Typescript section to Redux Toolkit Example (#23166)
I have added a new section to the `with-redux-toolkit` example on setting up Typescript with Redux Toolkit and React-Redux.

It links the redux toolkit documentation and Next.js documentation on adding Typescript to a Next.js project.
2021-03-17 18:59:14 +00:00
Tim Neutkens
7757364fc6 v10.0.10-canary.2 2021-03-17 10:13:36 +01:00
Tobias Koppers
e019ef6acc
update webpack, fix runtime location, fix undeclared variable, omit env vars from cache version (#23113)
* this will fix problems with serverless target which doesn't use a runtime chunk
* It also omit env vars from contributing to cache version as webpack will handle that now
* It moves the webpack-runtime chunk from ./chunks back to ./
2021-03-17 08:32:45 +00:00
JJ Kasper
a9da48d3da
v10.0.10-canary.1 2021-03-16 16:33:31 -05:00
Shu Ding
1bf4cf3e76
Upgrade jest-worker (#23077)
This PR upgrades `jest-worker` and `jest-cli` to the latest pre-release version, also removed `jest-circus` which is included in Jest by default. `jest-worker@next` includes a fix for memory leak that we need (https://github.com/facebook/jest/pull/11187). 

Fixes #22925. This will also improve the OOM issue for `next dev` #15855.
2021-03-16 21:08:35 +00:00
Mokshit Jain
091d56ade8
Simplify redux toolkit example and update packages (#23047)
I have simplified the `with-redux-toolkit` example and changed the directory structure to "feature folders". I have removed the `notes` page and API route as it wasn't directly related to the redux toolkit. This example is also identical to the official [cra redux template](https://github.com/reduxjs/cra-template-redux). All the dependencies have also been updated.
2021-03-16 20:15:54 +00:00
Lee Robinson
f3cbdf0b02
Document how to use basePath with next/image. (#23123)
Supersedes https://github.com/vercel/next.js/pull/23115 for more clarity and a better recommendation.
2021-03-16 19:56:41 +00:00
Shane Rogers
308c2beca2
Add image base path configuration option (#23115)
I similarly [couldn't find this info](https://github.com/vercel/next.js/issues/19711#issuecomment-750414110) in the docs about configuring the image path when using an app `basePath`, so thought I'd add it.
2021-03-16 17:13:24 +00:00
Abdullah Mzaien
e36eb381da
Duplicate scroll description (#23103)
- `scroll` - Optional boolean, controls scrolling to the top of the page after navigation. Defaults to `true` and 
  - `scroll`: Scroll to the top of the page after a navigation. Defaults to `true`
as options for router.push
2021-03-16 16:39:14 +00:00
René Keller
44081d0852
fix(lib/db): type mismatch (#23107)
Fixes "Type 'string' is not assignable to type 'number'." TS warning
2021-03-16 10:31:15 +00:00
Lee Robinson
9431439c6d
Add note about next/export to Image Optimization docs. (#23088)
https://github.com/vercel/next.js/discussions/19065#discussioncomment-484842
2021-03-16 01:05:14 +00:00
JJ Kasper
d680ba65a6
v10.0.10-canary.0 2021-03-15 19:59:56 -05:00
Shu Ding
85499b5375
Revert "Revert "[a11y] Route Announcements"" (#23086)
Reverts vercel/next.js#23082
2021-03-15 20:18:11 +00:00
JJ Kasper
ca9f808cd5
v10.0.9 2021-03-15 14:12:40 -05:00