Commit graph

7386 commits

Author SHA1 Message Date
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
Daniel K
a03fcbf7eb
[bundle-analyzer] Fix incorrect example (#18952)
This confused me a lot, because in the case of `withBundleAnalyzer({})` it will ignore any previous config and basically override everything.

Furthermore, it makes more sense to move the call with `enabled` option inside so it's aligned with other plugins approach.
2020-11-11 08:02:43 +00:00
JJ Kasper
ae75c6a640
Update chokidar to latest (#18995)
Updates to the latest version of `chokidar`

x-ref: https://github.com/vercel/next.js/issues/17416
2020-11-11 07:35:31 +00:00
JJ Kasper
48acc479f3
Ensure basePath behavior with GS(S)P redirect (#18988)
This ensures we match the `basePath` handling for redirects in `next.config.js` with redirects from `getStaticProps` and `getServerSideProps` and also adds a separate test suite to ensure GS(S)P redirects with `basePath` work correctly

Fixes: https://github.com/vercel/next.js/issues/18984
Closes: https://github.com/vercel/next.js/pull/18892
2020-11-11 07:13:18 +00:00
JJ Kasper
a429a47fe0
Ensure correct defaultLocale is provided for locale domain (#19040)
This ensures we use the `defaultLocale` for a locale domain when rendering non-static pages. Static pages will initially contain the global `defaultLocale` and then be updated on the client since we don't currently prerender a version of the pages for each locale domain. 

Closes: https://github.com/vercel/next.js/issues/18970
2020-11-11 02:09:45 +00:00
Kanitkorn Sujautra
6de34e7557
Add missing dependency to with-typescript-eslint-jest (#17864)
In `with-typescript-eslint-jest` example, `identity-obj-proxy` is being used here, but it's not in `package.json` yet.
5b1be2bb98/examples/with-typescript-eslint-jest/jest.config.js (L14)

This PR adds `identity-obj-proxy` to `package.json`.
2020-11-11 00:14:03 +00:00
Lyderic Dutillieux
50400f7eeb
Fixed wrong function name in error message (#19034)
Changed function name from "getStaticProps" to "getStaticPaths" in Exception message thrown when 'paths' is invalid.
2020-11-10 23:53:08 +00:00
Ante Sepic
e404b9962b
[Examples] Prevent getStaticProps from returning "undefined" (#19012)
If the example is cloned and ran with no further setup (no environment variables set up), it will error out because `extractPostEntries` will return `undefined` which can not be serialized by `getStaticProps `.

This PR basically ensures that we return an empty array instead of the `undefined` for a collection of posts, and a `null` instead of the `undefined` for a single post.
2020-11-10 23:33:51 +00:00
Callum Booth
f300ecaa94
Feat(example): Add with-zustand example (#17835)
Helps with https://github.com/pmndrs/zustand/issues/182 

I have seen the comments from this PR https://github.com/vercel/next.js/pull/11222#pullrequestreview-406998918 and this PR matches the with-redux example.
2020-11-10 23:06:49 +00:00
Ash Connell
b8c49ae97a
Add with-knex example (#17904)
* Add with-knex example

* Fix with-knex README typo

Co-authored-by: Ash Connell <hello@ashconnell.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-11-10 17:45:21 -05:00
Joe Haddad
5927796bdf
v10.0.2-canary.8 2020-11-10 17:06:14 -05:00
Gerald Monaco
80671273ca
Revert "Remove next-head-count (#16758)" (#18713)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-11-10 16:35:47 -05:00
WeichienHung
a2bea9b492
Add mutation example to with-typescript-graphql (#16742)
Fixes  https://github.com/vercel/next.js/issues/16550

Add a graphql mutation operation in this example.
The changes are:
1. Define mutation in schema `type-defs.graphqls`
2. Add mutation to `viewer.graphql ` that compiled to typescript code.
3. Add mutation resolver in `resolvers.ts`
4. [UI] add a input box and button to submit mutation request to change name. 

screenshot of change
![mutation_example](https://user-images.githubusercontent.com/1462027/91797123-5ffc4e00-ec54-11ea-910b-3ddb399b42f0.gif)
2020-11-10 21:10:54 +00:00