Commit graph

8171 commits

Author SHA1 Message Date
JJ Kasper
e532c58c23
Ensure locale cookie does not error with similarly named cookie (#24182)
This ensures we don't error when a cookie with a similar name to the `NEXT_LOCALE` cookie is present. 

## Bug

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

Fixes: https://github.com/vercel/next.js/issues/23787
Closes: https://github.com/vercel/next.js/pull/23788
2021-04-20 13:41:14 +00:00
James George
bd70e8fced
chore(create-next-app): update help information (#24251)
Add description for `--use-npm` flag that shows up as part of the help information.

## 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-04-20 13:12:10 +00:00
JJ Kasper
a147539e11
Update CI jobs to re-use cache (#24231)
* Speed up test yarn pnp job

* speed up webpack 5 tests too
2021-04-20 06:10:29 -05:00
Tim Neutkens
f53df09c02
Update 3.feature_request.yml 2021-04-20 11:13:25 +02:00
Tim Neutkens
ce57fff719
Update 2.example_bug_report.yml 2021-04-20 11:13:11 +02:00
Tim Neutkens
a9132d0fda
Update 1.bug_report.yml 2021-04-20 11:12:29 +02:00
Dale Bustad
b2d8e15d1e
Babel Turbo Loader, Part 2 (#24078)
This PR addresses the potential for memory leakage with the previous caching scheme; it should also be more efficient, resulting in fewer instances where a fresh Babel config must be generated.  Documentation has been added, and `overrides` have been removed in favor of conditional plugins for consistency.

This approach is easier to break, in that `CharacteristicsGermaneToCaching` must be correct for all cases.  However, it means that <= 8 configs will need to be generated within the context of a single thread, and the config-caching is about as fast as we can get it.
2021-04-20 08:45:57 +00:00
Gergo Tolnai
997b37ace3
Docs: add info about fallback to prerender-error (#22828) 2021-04-20 08:15:02 +00:00
Tom Greuter
213db224f3
Update Preview Mode docs with note on local dev (#22906) 2021-04-19 22:19:32 -05:00
Jaime Leonardo Suncin Cruz
f4e610d192
Simplify with redux toolkit typescript (#24161)
Remove clock and notes features to be consistent with `with-redux-toolkit` example, add unit test with Jest

## 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-04-20 03:09:49 +00:00
Emmanuel Gautier
0699114956
chore(with-react-intl): allow extracting translation key from a deeper directory (#23874) 2021-04-19 22:04:49 -05:00
Martin Janeček
1f54ba6559
docs: reduce image size in sample Dockerfile (#24108) 2021-04-19 22:00:56 -05:00
Sachin Raja
990ce64f03
custom server example: update to remove body-parser unneeded dep (#23899) 2021-04-19 21:58:57 -05:00
Joost Jansky
698ab55cb7
Enable JIT for Tailwind + Emotion CSS example (#23912) 2021-04-19 21:57:15 -05:00
Ondřej Chrastina
2186f1eb55
Update seed data for Kontent CMS example. (#24089) 2021-04-19 21:54:06 -05:00
Arthur
1508b4baf1
update with-realm-web example (#24241) 2021-04-19 21:53:32 -05:00
Gaël Haméon
cb6b4798f6
Clarify dynamic imports documentation (#24168) 2021-04-19 21:53:00 -05:00
JJ Kasper
bfde2833c0
v10.1.4-canary.11 2021-04-19 21:41:09 -05:00
JJ Kasper
aab6b37e50
Omit un-necessary stack trace from invalid routes (#24240)
This removes the extra stack trace from throwing an error instead of logging and then exiting since the stack trace doesn't provide any additional information that is helpful for debugging in this case. 

<details>

<summary>Before screenshot</summary>

![image](https://user-images.githubusercontent.com/22380829/115301794-4f3b1280-a127-11eb-8a0d-0797efb8fc9f.png)


</details>

<details>

<summary>After screenshot</summary>

<img width="962" alt="Screen Shot 2021-04-19 at 3 53 45 PM" src="https://user-images.githubusercontent.com/22380829/115301901-6ed23b00-a127-11eb-83f9-e3f4cf0ed8fe.png">


</details>
2021-04-20 02:03:46 +00:00
Valeri Karpov
e0da6a6057
cache Mongoose connections between hot reloads (#23321)
## 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 - No, I get hundreds of unrelated errors like:
```
build/babel/plugins/next-page-config.ts(8,28): error TS2307: Cannot find module 'next/types'.
build/entries.ts(11,32): error TS2307: Cannot find module '@next/env'.
build/index.ts(1,31): error TS2307: Cannot find module '@next/env'.
build/index.ts(9,10): error TS2305: Module '"next/dist/compiled/nanoid/index.cjs"' has no exported member 'nanoid'.
```

Re: https://github.com/Automattic/mongoose/issues/9987, the current Mongoose example doesn't do a good job of persisting state between hot reloads. Not sure why Lambda doesn't keep the same `import mongoose` between reloads, but it doesn't seem to. This approach lines up more closely with [Mongoose's Lambda docs](https://mongoosejs.com/docs/lambda.html) and the existing `with-mongodb` example.
2021-04-19 20:08:15 +00:00
Jan Amann
6eabef68cd
Add next-intl example (#21447)
I've recently built an i18n library that is tailored to usage in Next.js: [next-intl](https://github.com/amannn/next-intl). It complements the internationalized routing capabilities of Next.js by managing translations and providing them to components, as well as handling date and time formatting. It's a bit young, but I'm using it in two production apps now and I'm quite confident in the library.

Would you want to include an example and link to it?
2021-04-19 19:58:36 +00:00
jai-sharma
79e7370b39
Bumping up the rebass version (v1 - v4) and fixing components and styling for it. (#23342)
The with-rebass example was using an outdate version of rebass(v1) which was throwing all sorts of deprecated warnings in the terminal, I've bumped up the version to the latest(v4) and made necessary changes to index.js page to keep it working.

If there is any issue, or some additional work needed, I am absolutely open to help.

Love the next.js framework and work you guys are doing ✌.
2021-04-19 19:48:38 +00:00
Jasper Moelker
76184ab0ca
docs: fix a11y router examples (#23031)
Non-interactive elements such as a `<span>` should not have event bindings as they are not accessible by everyone.
This fix solves this issue by replacing it with a `<button>` which is suitable for interaction.
Since a button defaults to `type="submit"` the button also explicitly has a `type="button"` to prevent accidental form submits (all examples aim to navigate, not to submit a form).

[More background on this a11y best practice](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/no-static-element-interactions.md)
2021-04-19 19:42:52 +00:00
Mileta Dulović
3892453cd7
Fixed bug where styled-jsx examples don't work because of a wrong plugin (#23414)
## Bug

Fixes #23293. 

Problem was that `styled-jsx-plugin-sass` was used instead of `@styled-jsx/plugin-sass` so it didn't work. 

You can refer to the issue that is linked for more info.
2021-04-19 19:37:22 +00:00
Zorn
02f38c5ca8
Fix call to setInterval (#22357) 2021-04-19 19:10:18 +00:00
Brais Antela
fa138358e1
Minor fix to build command (#24158)
## 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-04-19 18:27:12 +00:00
Tobias Koppers
155e34c3a6
upgrade webpack to 5.34 (#24230) 2021-04-19 18:18:07 +00:00
Tobias Koppers
cc246cdc41
add css to the stats-app (#24228)
add a page with CSS to the stats app

We should compare stats for CSS too
2021-04-19 17:42:40 +00:00
Tim Neutkens
aee453e219
Disable strictExportPresence when webpack 5 is enabled (#24214)
Solves an issue some users ran into where enabling webpack 5 highlighted a wrong JSON import where named exports were used for JSON data.

> Should not import the named export 'myValue' (imported as 'myValue') from default-exporting module (only default export is available soon)
2021-04-19 18:50:09 +02:00
Kristoffer K
d24a0c18c1
ci: fix PnP e2e tests using Webpack 5 (#24216)
Fixes the e2e PnP tests by updating `enhanced-resolve` to get the fix in https://github.com/webpack/enhanced-resolve/pull/289, the tests started failing in https://github.com/vercel/next.js/pull/23810

## 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-04-19 14:43:55 +00:00
JJ Kasper
0bcc6943ae
v10.1.4-canary.10 2021-04-18 08:59:27 -05:00
Tobias Koppers
5bdef6aabe
startup performance improvements (#24129)
* import next-server logic during the time the configuration is loaded
* load minimizer plugins only when used
* load ReactDevOverlay only when used
* load only meta information of tsconfig for validation
* make worker for configuration loading lighter
* only load runTypeCheck when used
* load postcss config only when used
2021-04-18 10:28:09 +00:00
JJ Kasper
65588083db
Ensure query for static pages with rewrites is updated correctly (#24189)
This updates the query refreshing on the client to also refresh when rewrites are used and the page is static since additional query values can be provided from rewrites that are relied on client-side. An additional test has been added in the custom-routes suite to ensure this is working correctly. 

## Bug

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

Fixes: https://github.com/vercel/next.js/issues/23490
Fixes: https://github.com/vercel/next.js/issues/22931
Fixes: https://github.com/vercel/next.js/issues/21062
2021-04-18 10:00:04 +00:00
JJ Kasper
6e7245cddb
Add error for getStaticPaths on non-dynamic page (#24188)
Noticed in this issue the reproduction was using `getStaticPaths` on a non-dynamic page incorrectly although we don't currently show an error for this. 

## Bug

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

x-ref: https://github.com/vercel/next.js/issues/22931
2021-04-18 09:31:40 +00:00
JJ Kasper
a153b63240
Ensure locale is not duplicated from differing casing (#24187)
This ensures we don't attempt adding a locale to a path when the locale is already present but in a different casing, this also ensures we successfully remove the locale if the casing differs in the path. Additional tests have been added in the `i18n-support` suites to ensure this is working correctly. 

## Bug

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

Fixes: https://github.com/vercel/next.js/issues/23553
2021-04-18 09:01:01 +00:00
JJ Kasper
d2b0d43eb9
Update incremental adoption in rewrites doc (#24186)
This updates the incremental adoption section in the rewrites docs to mention the new fallback rewrites instead of the no-op rewrite and also points to the incrementally adopting Next.js doc. 

## Documentation / Examples

- [x] Make sure the linting passes

Closes: https://github.com/vercel/next.js/pull/23700
Closes: https://github.com/vercel/next.js/issues/23699
2021-04-18 08:26:08 +00:00
JJ Kasper
557ecb0fa2
Update SWR in with-magic example (#24185)
## Documentation / Examples

- [x] Make sure the linting passes

Closes: https://github.com/vercel/next.js/issues/24184
2021-04-17 22:26:43 +00:00
Abdullah Mzaien
2e7d405fed
Update Chakra UI examples to latest versions. (#23585)
## 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-04-17 21:22:30 +00:00
umarsenpai
9fcfce3463
Fix serving Images through external rewrite with Image component (#21001)
This PR fixes the issue described here: https://github.com/vercel/next.js/issues/20909

The _req passed to getRequestHandler doesn't have `on` function which is required by http-proxy. It throws the error e.on is not a function. We should also wait for buffer to finish writing before sending the response. 

Fixes: https://github.com/vercel/next.js/issues/20909
Closes: https://github.com/vercel/next.js/issues/24177
2021-04-17 21:03:08 +00:00
JJ Kasper
432c9ee5fc
Use same num workers between export and build (#24180)
This ensures we use the same `numWorkers` config between `next build` and `next export` since we already calculate the correct value to use [in the config](6e22a440e2/packages/next/next-server/server/config-shared.ts (L99-L103)). 

## Bug

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

Fixes: https://github.com/vercel/next.js/issues/23318
2021-04-17 20:09:26 +00:00
Julien Benchetrit
646a881183
Docs update: Redirect paths with parentheses (#24062)
It took me quite a while to understand that in order to redirect from `/english(default)/:path` to `/en-us/:path`, I have to escape the parentheses in the source with double backslashes so I thought I'd suggest it as a small doc update.


## Documentation / Examples

- [x] Make sure the linting passes
2021-04-17 19:40:35 +00:00
Steven Tey
6e22a440e2
Updated prefetch documentation (#24171)
Added the fact that when `prefetch` is set to `false`, Next will prefetch the link when an `onMouseEnter` is triggered. Response to issue #11793



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

Closes: https://github.com/vercel/next.js/issues/23525
2021-04-17 16:08:06 +00:00
JJ Kasper
fe0583edea
v10.1.4-canary.9 2021-04-16 10:09:07 -05:00
JJ Kasper
7d77a19af2
Fix fallback: false triggering 404 before rewrites (#24121)
This fixes dynamic pages with `fallback: false` that don't have a matching path causing a 404 before rewrites are checked unexpectedly. This ensures we treat `fallback: false` pages as a match only if they also have a matching static path so that fallback rewrites can be triggered correctly. An additional test suite as been added to ensure this is working as expected. 

## Bug

- [ ] Related issues linked using `fixes #number`
- [x] Integration tests added
2021-04-16 15:07:24 +00:00
James George
4b8e539628
test(create-next-app): use latest examples (#24048)
Update CNA test suite to consume [vercel-learn-starter](https://github.com/vercel/next-learn-starter) as the example repo.

## 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-04-16 13:39:34 +00:00
Marc van Gend
b7a12655e2
Document the need to call App.getInitialProps() from a custom app's getInitialProps (#24002)
Document the need to call App.getInitialProps() from a custom app's getInitialProps. See https://github.com/vercel/next.js/issues/23055.
2021-04-16 14:54:02 +02:00
Sahil Rajput
15133b47ec
Fix typescript types. (#23771)
Fix typescript type for cache and null check in mutation result.

## Bug

- fixes : https://github.com/vercel/next.js/issues/23770

**That issue deals with -**

- Return the codeflow if data is not returned from the mutation, and that fixes this warning.
![Screenshot from 2021-04-07 18-24-44](https://user-images.githubusercontent.com/31458531/113873069-18353a80-97d2-11eb-8c8c-9e9c9d280f95.png)

- Supply typescript typings for the target cache object.
![Screenshot from 2021-04-07 18-52-15](https://user-images.githubusercontent.com/31458531/113873504-80841c00-97d2-11eb-9b14-17d16a524c84.png)

Thanks.!
2021-04-15 18:55:30 +00:00
Martin Alix
b2ee0a93fe
Fix IE11 incompatibility due to string litterals (#23784)
Fixes #22270

## Bug

- [X] Related issues linked using `fixes #number`
- [  ] Integration tests added
2021-04-15 16:34:52 +00:00
JJ Kasper
35258650ac
Update with-electron test (#24036)
* Use ssh for git regexr dependency

* remove .git from dep

* update

* update test

* update step

* update install

* remove dep temporarily

* remove extra change

* move deps to specific test
2021-04-15 10:21:32 -05:00
JJ Kasper
3fb4e091bc
v10.1.4-canary.8 2021-04-15 09:50:36 -05:00