Commit graph

7990 commits

Author SHA1 Message Date
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
Shu Ding
732c49cdc8
Revert "[a11y] Route Announcements" (#23082)
Reverts vercel/next.js#20428 temporarily to move this feature into the next canary release.
2021-03-15 19:09:24 +00:00
Kyle Boss
688611a582
[a11y] Route Announcements (#20428)
# Route Announcements

## Summary
This PR improves the accessibility of NextJS's client-side navigation by announcing route changes to screen readers.

## Context
When a user who is sighted clicks on a link, they can see the content change. It's an affirmation that what the user intended to do by clicking a link actually worked! Users navigating the page via a screen-reader will not get this feedback on NextJS sites (This is an issue on many SPA-like architectures).

https://user-images.githubusercontent.com/4213649/103017382-63b02b00-44f8-11eb-9940-fb530d2d3018.mov

## Solution
Whenever there is a route change, the new `<RouteAnnouncer />` will look for a name to give the new page and then announce it! The name is found by first looking for an `h1`, falling back to `document.title`, and lastly to `pathname`. `<RouteAnnouncer />` is a visually hidden component placed within the `<AppContainer />`.

## Demo
https://user-images.githubusercontent.com/4213649/103017401-6ad73900-44f8-11eb-8050-b3e9a7e0c3f2.mov

## Inspiration
First and foremost, this PR was inspired by @marcysutton's studies and writing, [What we learned from user testing of accessible client-side routing techniques with Fable Tech Labs
](https://www.gatsbyjs.com/blog/2019-07-11-user-testing-accessible-client-routing/) as well as @madalynrose's [Accessible Routing](https://github.com/gatsbyjs/gatsby/pull/19290) PR for Gatsby.

There were also learnings gleaned from the conversations within #7681.

### Related Issues & PRs
- Resolves #7681
- Relates to #19963
2021-03-15 18:36:55 +00:00
JJ Kasper
4f894a3a33
v10.0.9-canary.8 2021-03-15 13:02:13 -05:00
Lee Robinson
a63c64a02d
Update error message for next export and next/image. (#23061) 2021-03-15 13:01:12 -05:00
Lee Robinson
c4508d1d13
Update README to fix broken links. (#23058)
Also put current maintainers at the top of the list.
2021-03-15 16:36:24 +00:00
Alex Safian
3063d3b8ff
Update pages.md (#23064)
The `path` variable must be an array of objects which has a `params` key. This code will prevent reader confusion.
2021-03-15 02:44:58 +00:00
JJ Kasper
9afcdfcbc4
Ensure i18n index prefetch is correct with trailingSlash (#22746)
This fixes index data route loading for i18n with `trailingSlash: true` enabled and also fixes prerendering `asPath` values not containing a trailingSlash when enabled. 


Fixes: https://github.com/vercel/next.js/issues/17813
Fixes: https://github.com/vercel/next.js/issues/22747
2021-03-14 12:58:34 +00:00
Karthikeyan Ranasthala
c1b2b3f91f
Add an example for styled-jsx with content security policy (#23021)
This is an example on how to use styled-jsx with content security policy.
2021-03-12 19:03:24 +00:00
JJ Kasper
0ec58c6328
v10.0.9-canary.7 2021-03-12 09:40:31 -06:00
JJ Kasper
7e63bd7d54
Ensure export only triggers when static pages are present (#22996)
This makes sure we don't trigger the export step if we aren't exporting any static pages during a build. This also adds an invariant to ensure we don't attempt creating a progress with 0 items.

Fixes: https://github.com/vercel/next.js/issues/22994
2021-03-12 08:36:28 +00:00
Kenneth Lum
2af5a0e47c
it is props: { posts } (#23004)
changing `props: posts` to `props: { posts }`
2021-03-12 08:11:01 +00:00
Kenneth Lum
e7a22afe2f
When there is data already, the props is props: { data } (#23003)
When there is data already, the props is props: { data }
Would be better if the `props: { }` part is `props: { data }`
2021-03-12 08:03:10 +00:00
JJ Kasper
62967fc667
Add note for loading env files during testing (#22982)
This adds a note to the environment variables documentation to mention how the env files can be loaded using the `@next/env` package as this has been brought up a few times. 

x-ref: https://github.com/vercel/next.js/issues/22936#issuecomment-796665303
x-ref: https://github.com/vercel/next.js/issues/17903
2021-03-12 00:47:42 +00:00
JJ Kasper
97ebc742e8
v10.0.9-canary.6 2021-03-11 13:54:57 -06:00
Dale Bustad
ffbb10fa9a
Silence trace debug messages (#22988)
These messages aren't necessary in the normal course of using Next.js.  Hiding behind a flag to reduce the noise.
2021-03-11 19:51:43 +00:00
Nabil Boussouf
371aa608b2
Install tailwindcss as a development dependency (#22964)
Set tailwindcss as a development dependency https://tailwindcss.com/docs/guides/nextjs#install-tailwind-via-npm
2021-03-11 14:16:36 +00:00
JJ Kasper
014a2f8495
v10.0.9-canary.5 2021-03-10 15:50:50 -06:00
Dale Bustad
e27b7e996d
Telemetry-compatible tracing (#22713)
A number of changes here.  I recommend viewing the diff with the <a href="?w=1">whitespace flag enabled</a>.

- OpenTelemetry is replaced with a custom and lightweight tracing solution.
- Three trace targets are currently supported: console, Zipkin, and NextJS.
- Tracing is now governed by environment variables rather than `--require instrument.js`.
  + `TRACE_TARGET`: one of `CONSOLE`, `ZIPKIN`, or `TELEMETRY`; defaults to `TELEMETRY` if unset or invalid.
  + `TRACE_ID`: an 8-byte hex-encoded value used as the Zipkin trace ID; if not provided, this value will be randomly generated and passed down to subprocesses.

Other sundry:

- I'm missing something, probably a setup step, with the Zipkin target.  Traces are captured successfully, but you have to manually enter the Trace ID in order to view the trace - it doesn't show up in queries.
- I'm generally unhappy with [this commit](235cedcb3e).  It is... untidy to provide a telemetry object via `setGlobal`, but I don't have a ready alternative.  Is `distDir` strictly required when creating a new Telemetry object?  I didn't dig too deep here.

As noted, there are a lot of changes, so it'd be great if a reviewer could:

- [ ] pull down the branch and try to break it
- [ ] check the Zipkin traces and identify possible regressions in the functionality

Closes #22570
Fixes #22574
2021-03-10 21:00:20 +00:00