Commit graph

7448 commits

Author SHA1 Message Date
JJ Kasper
1e61b69e31
Add locale: false for custom-routes + i18n (#19164)
This mirrors the `basePath: false` behavior for custom-routes with `locale: false` to allow users to configure the locales manually (`locale: false`) or have the locales be handled automatically for custom-routes. 

Fixes: https://github.com/vercel/next.js/issues/18927
Fixes: https://github.com/vercel/next.js/issues/18795
2020-11-14 03:35:42 +00:00
Steven
17a53e2765
Revise image example with layouts near the top (#19161)
This page is useful for testing out layouts so we moved that section to the top.
2020-11-14 02:00:02 +00:00
Steven
84716ae60d
Add next/image docs for omitted props (#19158)
This will make it clear which properties are not allowed
2020-11-14 00:07:47 +00:00
Steven
7aa8c2c7ec
Update docs to use <Image> instead of <img> (#19160)
This unifies the docs to always use `<Image>` instead of `<img>` so we can set readers up for success.
2020-11-13 23:43:05 +00:00
Tony Spiro
f4c2c6d4d1
Upgrade Cosmic example to Next.js 10, image load fix, post sorting by -created_at (#18310) 2020-11-13 23:22:06 +00:00
xeust
cd1e2e1d60
Example: Deta Base (#19061)
Add an example for using Next.js with Deta Base on Vercel.
2020-11-13 23:00:30 +00:00
Joe Haddad
ba791d0d84
v10.0.2-canary.15 2020-11-13 16:18:27 -05:00
Steven
318a1bf309
Add "nonce" from <Head> to the injected <style> to satisfy CSP (#19150)
Fixes #18557
2020-11-13 20:29:16 +00:00
Balázs Orbán
29694572ed
Fix typo in 1.Bug_report.md (#19143)
likelyhood -> likelihood
2020-11-13 11:36:52 +00:00
Tim Neutkens
75ec4d60a2
Update 1.Bug_report.md 2020-11-13 10:59:05 +01:00
Tim Neutkens
14aa838dbf
Mention feature requests are converted to discussions 2020-11-13 10:57:22 +01:00
Joe Haddad
415d7fd75e
Respect next/babel user provided runtime option (#19136) 2020-11-13 02:41:54 -05:00
Joe Haddad
8ff5213614
v10.0.2-canary.14 2020-11-12 23:31:34 -05:00
Steven
20ab35128c
Add missing sizes prop on image component (#19128)
- Fixes #19120
- Closes #18413 
- Related to #19041
2020-11-13 04:30:41 +00:00
Joe Haddad
9174b7a337
Fix component lifecycle order for style swap (#19125)
Co-authored-by: Gerald Monaco <gbmonaco@google.com>
2020-11-12 22:57:15 -05:00
Joe Haddad
f108dbf2c9
v10.0.2-canary.13 2020-11-12 22:29:15 -05:00
Akuma Isaac Akuma
7631c1cac5
Added query object as property to url object (#18340)
`url` object is an instance of `url.URL` which has no property called `query` and it's causing an error with Next image-optimizer as you can see with the error log below.

```log
TypeError: Cannot destructure property 'url' of 'parsedUrl.query' as it is undefined.
    at imageOptimizer (/[redacted]/node_modules/next/next-server/server/image-optimizer.ts:51:11)
    at Object.fn (/[redacted]/node_modules/next/next-server/server/next-server.ts:617:11)
    at Router.execute (/[redacted]/node_modules/next/next-server/server/router.ts:200:40)
    at DevServer.run (/[redacted]/node_modules/next/next-server/server/next-server.ts:1017:41)
    at DevServer.run (/[redacted]/node_modules/next/server/next-dev-server.ts:406:18)
    at DevServer.handleRequest (/[redacted]/node_modules/next/next-server/server/next-server.ts:437:14)
    at /[redacted]/server/next-wrapper.ts:9:5
```
2020-11-12 21:23:58 +00:00
LittleboyHarry
08ce06a3ef
Improve with-electron-typescript example (#18277)
1. updates the `.gitignore` for this example to ignore the temporary output folders. ( similar to #15783 )
2. change yarn run script to npm run script ( I don't like use yarn currently. )
2020-11-12 21:02:43 +00:00
Tuan Nguyen
c64bbfeacd
Propose some sentence changes (#19121) 2020-11-12 20:08:31 +00:00
Joe Haddad
04ab35298a
Remove preload for priority images (#19118)
Fixes #18720

This removes image preloading. It doesn't work correctly on any browser other than Chrome (with Chrome's real engine). On all other browsers, it triggers 2x the bytes to be downloaded. The tradeoff isn't worth it here IMO.

Chrome itself should be smart enough to bump an `<img />` tag's priority over other preloads that are script type during the preparse phase.

We can reintroduce this when we don't hurt non-Chrome users.
2020-11-12 19:45:50 +00:00
Steven
5562daf7a1
Fallback to default config to enable testing Image component (#19107)
Fixes #18415 by using the default config as fallback.

Users who wish to use their `next.config.js` values will still need the workaround from https://github.com/vercel/next.js/issues/18415#issuecomment-718180659
2020-11-12 19:24:08 +00:00
JJ Kasper
4866c47d9d
Ensure optional catchall prerendered indexes and i18n (#19116)
This ensures root optional-catch-all index routes with i18n are output to the correct location and are also loaded from the `prerender-manifest` correctly. 

Fixes: https://github.com/vercel/next.js/issues/19095
2020-11-12 18:50:32 +00:00
Matsumoto Toshi
c88872cea0
fix: issue #18338 - don't add a trailing slash to external links (#18595)
## Description

Fixes #18338 - Fixed an issue with `trailingSlash: true` adding a slash to the end of an external link.

After
```
<h1 class="Home_title__3DjR7">Welcome to <a href="https://nextjs.org">Without slash</a></h1>
<h1 class="Home_title__3DjR7">Welcome to <a href="https://nextjs.org">With slash?</a></h1>
```

Before
```
<h1 class="Home_title__3DjR7">Welcome to <a href="https://nextjs.org">Without slash</a></h1>
<h1 class="Home_title__3DjR7">Welcome to <a href="https://nextjs.org/">With slash?</a></h1>
```
2020-11-12 18:10:40 +00:00
JJ Kasper
6c282a3df4
Add note about changing basePath config (#19111) 2020-11-12 12:48:37 -05:00
Anton Rieder
62633b1af5
Fix grammar in isSerializableProps (#19072)
I believe this should read ["altogether"](https://www.merriam-webster.com/dictionary/altogether) not "all together".
2020-11-12 16:07:14 +00:00
Josh Flayhart
5afed07925
Update node-html-parser lib (#19103)
In working with @devknoll on https://github.com/vercel/next.js/pull/17770 we thought it would be a good idea to update to the latest minor version from 1.2.20 -> 1.4.9 based on some bug fixes in these minor releases. I would like to separate this out to simplify the growing changeset in https://github.com/vercel/next.js/pull/17770, where we need to use `node-html-parser` to parse HTML for custom react components.

The linked changeset above will take some time and there are some [useful bug fixes](https://github.com/taoqf/node-html-parser/commits/master) and features in this minor release we could benefit from anyway. Namely:

- add nextSibling, nextElementSibling
- missing node tag
- `<style>` tag is not parsed correctly

Also I think it's a good idea to separate this out for testing.
2020-11-12 15:46:35 +00:00
Tim Neutkens
feb0cb497b
Add upgrading guide from Next.js 9 to 10 (#19101)
There are no breaking changes but we're seeing some reports of confusion because there's no section for 9 to 10, so this adds it.
2020-11-12 15:22:59 +00:00
Joe Haddad
88db0c79c8
v10.0.2-canary.12 2020-11-12 02:15:14 -05:00
Joe Haddad
c78c982e0b
Adjust how CSS files are fetched (#19091) 2020-11-12 02:14:48 -05:00
Ludovico Fischer
ac3fe8e004
Bump node-sass development dep to v5 (#19070) 2020-11-12 01:51:44 -05:00
Mihai Pocorschi
08f6c57efb
fixed project name to reflect example name in readme (#19056) 2020-11-12 01:51:27 -05:00
Joe Haddad
6b42b5a702
v10.0.2-canary.11 2020-11-12 00:57:00 -05:00
George
9b4a63402d
fix(examples/with-chakra-ui): Fixed Spelling (#19088) 2020-11-12 00:56:26 -05:00
Joe Haddad
67494bd991
Upgrade use-subscription for React 16/17 bicompat (#19087)
Fixes #18518
2020-11-12 05:53:59 +00:00
JJ Kasper
54b70425ab
Ensure i18n with basePath works properly (#19083) 2020-11-12 00:26:48 -05:00
JJ Kasper
41866a135c
Add experimental Next.js plugin version locking (#19084) 2020-11-11 23:59:57 -05:00
Yann Pringault
d2b017c519
[examples/blog-starter-typescript] Upgrade to TypeScript v4 (#18225)
Co-authored-by: Luis Alvarez D <luis@vercel.com>
2020-11-11 21:34:30 -05:00
jose-donato
e827925735
Example for adding a service worker into a next.js application (#17855)
Example for adding a service worker without any plugin or custom server
2020-11-12 01:09:25 +00:00
Lucas Varela
7fd04c956d
Add self-hosted information to with-sentry example (#18102)
* Add info about SENTRY_URL on source map uploading

* Update examples/with-sentry/README.md

Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: Luis Alvarez D <luis@vercel.com>
2020-11-11 19:47:11 -05:00
Vyacheslav Konyshev
e6a6beb38d
fix(examples/with-firebase-cloud-messaging): replace deprecated method (#19080) 2020-11-11 18:41:37 -05:00
Jose Manuel Casani Guerra
f226a376b1
refactor: update example of storybook (#17936)
## Change

- Update package versions
- Replace @storybook/addons, @storybook/addon-actions to @storybook/addon-essentials
- Replace examples of button, the action function is legacy: https://storybook.js.org/docs/react/essentials/actions#advanced--legacy-usage
2020-11-11 23:14:42 +00:00
Marco Valsecchi
27691d5882
Use useRouter over Router for with-react-ga example (#17710)
Use useRouter over Router and add a workaround for the issue #11639
2020-11-11 22:33:15 +00:00
JJ Kasper
9f6d5b14df
Add test and errsh for mixed notFound/redirect error (#19076)
This ensures the mixed `notFound`/`redirect` error is shown correctly and adds an err.sh for the error. 

Closes: https://github.com/vercel/next.js/issues/18727
2020-11-11 22:02:11 +00:00
JJ Kasper
d1036539d6
Ensure params and locale are parsed correctly in fallback mode (#19063)
This fixes a few things related to optional catch-all routes and i18n. The first thing is it ensures the correct data route is generated on the client so that the locale isn't duplicated for an optional catch-all route, the next is it ensures the browser history is updated correctly when only a locale change is occurring, and then it also ensures we handle the locales and normalizing for fallback optional catch-all pages correctly.

Tests have been added to ensure these cases are covered properly and we don't regress on them, these changes were also tested on Vercel [here](https://next-js-bug-i18n-root-params-nybg44l0b.vercel.app/)

Fixes: https://github.com/vercel/next.js/issues/18633 
Fixes: https://github.com/vercel/next.js/issues/19059
2020-11-11 20:33:44 +00:00
Daniel Stocks
44932612f8
Fixed missing SSR styles in with-fela example (#17647)
Added `<Html>` and `<Head>` components in the custom `_document.js` for the with-fela example package

This fixes an issue where fela `<style>` tags were not added and sent as part of the server-side rendered HTML payload, causing a FOUC.
2020-11-11 20:12:51 +00:00
Joe Haddad
0d1d3178a9
v10.0.2-canary.10 2020-11-11 13:16:41 -05:00
Joe Haddad
0d5bf65feb
Replace page loader with new route loader (#19006)
This pull request completely replaces our old page loader with a brand new route loader.

Our existing comprehensive test suite means I did not need to add a bunch of tests. I did add them where behavior was added or fixed.

Summary of the changes:

- Eagerly evaluates prefetched pages in browser idle time (speeds up transitions)
- Router is **no longer frozen** indefinitely if the Build Manifest never arrives
- Router is **no longer frozen** indefinitely if a page fails to bootstrap
- New `withFuture` utility instead of ad-hoc deduping per resource
- Prefetching is now delayed until browser idle time to not impact TTI
- Browsers without `prefetch` now fall back to eager evaluation instead of using `preload`
- We're now ready to serve non-static assets **with `no-store` without breaking prefetching**
- **Application can now hydrate without fetching CSS assets—this is a huge performance win that was previously blocking hydration**

---

The minor size increase here is unfortunate, but we have to incur it for correctness.

---

Fixes #18389
Fixes #18642
2020-11-11 18:13:16 +00:00
JJ Kasper
9cda047f0e
v10.0.2-canary.9 2020-11-11 11:10:21 -06:00
Steven
917d594ca8
Print error during next export with default image loader (#19032)
Fixes #18356
2020-11-11 15:46:48 +00:00
Kristoffer K
d40d7d6562
fix(next): resolve absolute path to @babel/runtime (#18921)
**What's the problem this PR addresses?**

https://github.com/vercel/next.js/pull/18768 started to ncc `@babel/plugin-transform-runtime` which broke its Yarn PnP support since the version of `resolve` it uses can't be patched by Yarn.

Fixes https://github.com/yarnpkg/berry/runs/1359235077?check_suite_focus=true#step:5:79

cc @guybedford

**How did you fix it?**

Resolve the absolute path to `@babel/runtime` so it doesn't have to go through `resolve`

---

Fixes https://github.com/vercel/next.js/issues/19026
2020-11-11 15:18:33 +00:00