Commit graph

183 commits

Author SHA1 Message Date
Rafael Almeida
813b1e62c5
Add App.getInitialProps example to the TypeScript page (#13785)
I added the commented code with the `AppContext` type to match the example from the [Custom App](https://nextjs.org/docs/advanced-features/custom-app) page. But since this is the TS page I think we could remove these comments and use a clean example, what do you think? 🤔
2020-06-05 18:03:31 +00:00
Shu Uesugi
4e6c326a56
Docs: Fix links to Agility CMS Examples (#13794)
 `cms-agility-cms`
 `cms-agilitycms`

See: https://github.com/vercel/next.js/tree/canary/examples/cms-agilitycms
2020-06-05 09:14:43 +00:00
Jan Potoms
1c8f1b50e3
Add a note about optional catch-all and rootmost route (#13791)
Fixes https://github.com/vercel/next.js/issues/13467
2020-06-05 06:19:01 +00:00
Jazib Sawar
6ce7a0378e
CMS Cosmic Example (#13499)
* Add Cosmic CMS Example

* with native .env support, this file isn't needed anymore

* FIX use path alias

* Add cosmicjs package

* Fix alias import in pages/api/preview

* Added: react-imgix & lazysizes package

* Load lazysizes in layout

* Used imgix image with lazyloading

* Added avatar imgix optimizations

* EDITED: steps to install content, preview

* EDITED: demo link

* EDITED: Install step

* EDITED: preview link steps

* Edited: demo link

* FIXED: object_slug

* Screenshots

* Fixed object_slug link

* Update README.md

* Fix: formatting issue

* Updated readme and renamed .env to env.local

* Sanity checks

* Handle fallback data when expected

* Added link to the example in other examples

* Updated demo deployment

* Added example to docs

* minor lint fix

* Remove manual download step

* use vercel.json

Co-authored-by: Tony Spiro <tspiro@tonyspiro.com>
Co-authored-by: Luis Alvarez <luis@vercel.com>
2020-06-04 15:18:11 -05:00
Joe Haddad
7d9b331775
docs: adjust custom polyfill suggestion (#13766)
The current [with-polyfills](https://github.com/vercel/next.js/blob/canary/examples/with-polyfills/) example is not the suggested way to add polyfills and is known to cause issues with bundling.

The proper way to load polyfills is to include them as the first line in `pages/_app.js`, which I've updated the docs to say.
2020-06-04 16:49:37 +00:00
Timothy
d1c16124b5
Update instances of Now to Vercel where applicable (#13760)
This pull request renames various instances of `now` to `vercel` etc. in order to match content that's being updated on the Vercel platform.
2020-06-04 14:57:17 +00:00
Vincent Voyer
33d44238a9
docs(env variables): small wording change (can => have to) (#13757)
When reading
"In order to expose a variable to the browser you can prefix the variable with NEXT_PUBLIC_. For example:"

I thought that I could maybe use something else than NEXT_PUBLIC_. I guess "have to" or similar would be better here, let me know
2020-06-04 13:22:12 +00:00
Shu Uesugi
c02d86ec52
Docs: Add supported browsers and features (#13741)
[ch1981]

Add the “Supported Browsers and Features” page. The content is taken mostly from the blog posts: [9.4](https://nextjs.org/blog/next-9-4), [9.3](https://nextjs.org/blog/next-9-3), and [9.1.7](https://nextjs.org/blog/next-9-1-7).

- This page is added under “Basic Features” on the sidebar.
- It still links to `with-polyfills` example, but [this example was updated recently](04fbe0b756). I simplified the README.
- Removed the FAQ section on supported browsers.
- On ["Customizing Babel Config"](https://nextjs.org/docs/advanced-features/customizing-babel-config), remove the list of presets which were outdated and instead link to [the preset file](https://github.com/vercel/next.js/blob/canary/packages/next/build/babel/preset.ts) so it’s always up to date.
2020-06-04 10:15:34 +00:00
James Mosier
bb6ae2648d
Added React Strict Mode documentation (#13723)
Added new documentation for React Strict mode under the `next.config.js` doc level.

Closes #13713
2020-06-03 17:22:58 +00:00
Joe Haddad
cfa00c9fcd
chore(docs): use proper Jamstack casing (#13697)
`JAMstack` is now `Jamstack`.
2020-06-03 03:02:41 +00:00
Jefferson Bledsoe
9ff29f710d
Docs: Add postcss-preset-env to the warning when customising the PostCSS configuration (#13695)
The [docs for customising the PostCSS config](https://nextjs.org/docs/advanced-features/customizing-postcss-config) warn the user they will need to manually install any dependencies that Next.JS will implicitly use if the config is not overridden. `postcss-preset-env` is missing from the install command.
2020-06-02 23:29:34 +00:00
Luis Alvarez D
ef22a8b7c5
[Examples] Add missing cms links (#13683)
This was a change that I forgot to push into the Agility CMS example PR, adding it now.
2020-06-02 17:36:12 +00:00
Shu Uesugi
d60fada097
CMS Strapi Example (#12701)
* Strapi Example

* Fix og image URL

* Remove next.config.js

* Apply updates

* Remove API_URL

* Bugfixes

* Finish Strapi README

* Deploy Strapi

* Add strapi examples

* now →  vercel [ch1796]

* Use npx

* Minor readme update

* Prettier fix

Co-authored-by: Luis Alvarez <luis@vercel.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-06-01 18:49:43 -05:00
Joe Haddad
f49309a92e
docs([[...rest]]): add experimental banner (#13641)
This feature is still experimental.
2020-06-01 22:51:57 +00:00
Luis Alvarez D
ad24a0c855
[Examples] Add WordPress Blog (#13194)
* Added most of the stuff

* Updated pages

* Removed unrequired deps

* API fixes

* Fixes fixes and updated readme

* Updated og image

* Added demo and links to example

* Updated packages

* update name. bump dependencies

* Renamed .env.example to .env.local.example

* Added node_modules to .gitignore

* use recommended config

* enable absolute import/alias support

* remove jsconfig.json

* allow HTML entities in post titles

* add underline to content links

* add basic ul & ol styles

* add code block styles

* add basic text alignment

* add basic image alignment styles

* adjust pre font-size and figcaption

* indent ul,ol lists to line up with grid

* add basic button styles

* add basic file styles

* add basic blockquote style

* add basic audio styles

* add h4 and enhance blockquote styles

* add basic cover block styles

* add basic verse styles

* add basic two-column block styles

* add tags

* add categories

* Only ignore .vercel

The rest is injected by create-next-app

* now → vercel

* npm init → npx

* Wordsmith

* Wordsmith

* Wordsmith

* Wordsmith

* Improve issue link

* Wordsmith

Co-authored-by: Greg Rickaby <greg@gregrickaby.com>
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
Co-authored-by: Shu Uesugi <shu@chibicode.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-06-01 17:17:20 -05:00
Luis Alvarez D
ee87e5d811
Update links in environment variables documentation (#13621)
- The first links were updated to match the new titles
- Removed the `# .env.local` comment as it's redundant
- Added links to the sections related to data fetching
2020-05-31 23:24:14 +00:00
Tim Neutkens
c384ca3710
Update environment variables documentation (#13618)
Based on feedback from @mcsdevv's team. Solves many of the issues users run into with the current docs.
2020-05-31 21:43:49 +00:00
Pavel Korotenko
ff2a03f30a
Update AMP validation docs (#13525)
Updates docs for AMP validation with usage examples for custom validators added in #9191 and `skipValidation` mode added in #10705
2020-05-29 18:05:51 +00:00
Joe Haddad
f0ff77ed88
Add note about GS(S)P imports (#13475)
As reported here:
https://twitter.com/vvoyer/status/1246913957899763712?s=21
2020-05-28 03:22:15 +00:00
Joe Haddad
b7e17e09e5
Update references to zeit/next.js (#13463) 2020-05-27 17:51:11 -04:00
Manu Schiller
9f1b4f5694
Add type inference for getStaticProps and getServerSideProps (#11842)
This adds `InferredStaticProps` and `InferredServerSideProps` to the typings.

- [x] add types for type inference 
- [x] add explanation to docs
- [ ] tests - are there any?

![inferred-props](https://user-images.githubusercontent.com/56154253/79068041-24bcab00-7cc4-11ea-8397-ed1b95fbeca7.gif)

### What does it do:

As an alternative to declaring your Types manually with:
```typescript
type Props = {
  posts: Post[]
}

export const getStaticProps: GetStaticProps<Props> = () => ({
  posts: await fetchMyPosts(),
})

export const MyComponent(props: Props) =>(
 // ...
);
```

we can now also infer the prop types with
```typescript
export const getStaticProps = () => ({
  // given fetchMyPosts() returns type Post[]
  posts: await fetchMyPosts(),
})

export const MyComponent(props: InferredStaticProps<typeof getStaticProps>) =>(
 // props.posts will be of type Post[]
);

```

### help / review wanted
- [ ] I am no typescript expert. Although the solution works as intended for me, someone with more knowledge could probably improve the types. Any edge cases I missed?
- [ ] are there any tests I should modify/ add?
2020-05-27 19:02:22 +00:00
Jacob D. Castro
983d1da844
[Docs]: minor typo in jsx file extension (#13451)
There was no period before `jsx` in the list of file types for pages. I added the period for consistency.
2020-05-27 17:02:51 +00:00
s
dcf446d83d
Update Static HTML Export documentation (#11814)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-05-27 00:58:12 -04:00
Joe Haddad
7bd52b8dee
docs(static-html-export): note getServerSideProps (#13401)
x-ref: #12313
2020-05-26 17:16:04 +00:00
Shu Uesugi
de2363bd91
Update debugging docs (#13270)
* Update debugging docs

* typo

* Update docs/debugging.md

Co-authored-by: Luis Alvarez D. <luis@vercel.com>

* Update docs/debugging.md

Co-authored-by: Luis Alvarez D. <luis@vercel.com>

* Clarify

* Move to advanced features

Co-authored-by: Luis Alvarez D. <luis@vercel.com>
2020-05-23 15:58:33 -05:00
Vincent Voyer
aa51f2fcef
docs(debugging): explain how to debug in Chrome DevTools/VS Code (#10807)
This new documentation page explains how to debug your backend and frontend code in Chrome DevTools/VS Code. This works perfectly with full source map support for both Node.js and React code.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-05-23 14:47:28 +02:00
Ian Sutherland
1a53f4500a
Update custom server docs (#13172) 2020-05-22 19:19:36 +02:00
Joe Haddad
1577ae5ce0
Fix dotenv file loading order (#13161)
This matches the `dotenv` spec:
https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use

---

Closes #13015
2020-05-22 17:13:16 +00:00
Luis Alvarez D
fca88d1cfe
Updated docs (#13205)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-05-22 10:36:45 +02:00
Luis Alvarez D
195e3e0ac3
[Docs] Replace hot reloading with fast refresh (#13207)
- Mention React Fast Refresh instead of hot reloading in docs
- Added a mention of our deployment docs in the main documentation page
- replaced `npm init` with `npx`
2020-05-22 02:40:06 +00:00
Zach Waterfield
25021473a5
Update the Automatic Static Optimization docs to explicitly state that Next.js will trigger an update. (#13096) 2020-05-19 18:09:57 +02:00
Tim Neutkens
dde5d3bdfe
Update prefetching explanation to correctly reflect data prefetching (#13088) 2020-05-19 07:03:42 -04:00
Joe Haddad
86160a5190
Upgrade to Prettier 2 (#13061) 2020-05-18 15:24:37 -04:00
Stig Kleppe-Jørgensen
97a61a18b2
x-powered-by is added to response, not request (#13037) 2020-05-18 12:58:29 -04:00
Jan Potoms
f8125c9ed7
[Experimental] Implement optional catch all routes (#12887) 2020-05-18 09:47:13 -04:00
Luis Alvarez D
c239c74629
Use a top level heading (#12960) 2020-05-16 15:04:18 +02:00
Tim Neutkens
313b552026
Enable .env support by default (#12911)
* Enable .env support by default

Given we've had tons of reports from various people that expected .env support to work even though they had dotenv installed already I think it's fine to enable it as a default:

Fixes #12728

* Remove old test

* Fix duplicate env loading

* Update docs

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2020-05-15 14:02:16 -05:00
Joe Haddad
9c79955047
Strip out dead code for ignoreDevErrors (#12941) 2020-05-15 13:30:01 -04:00
Nicholas Chiang
c21278999c
Update module-path-aliases.md (#12900) 2020-05-15 11:54:27 +02:00
Brian Gershon
5da1dcf669
Warn users about migrating to 9.4 from dotenv (#12859) 2020-05-14 12:09:33 -04:00
Rafael Almeida
634e621a6e
Fix typo in Environment Variables doc page (#12770) 2020-05-12 13:50:04 +02:00
Jamie Kyle
c88bc17830
Use an if statement instead of expression statement (#12747) 2020-05-11 23:51:26 -04:00
0xflotus
2a62e51a10
(docs): fixed typo error (#12746) 2020-05-11 17:08:31 -04:00
Sergio Xalambrí
e91c0fccbb
Add missing parenthesis in Sending results to analytics example (#12733) 2020-05-11 15:47:56 -04:00
Houssein Djirdeh
ec38b0f0bd
Minor update to "Measuring performance" docs (#12741) 2020-05-11 15:39:21 -04:00
Sébastien Vanvelthem
653098d397
Use @/ to show module alias instead of @ prefixed (#12600)
* docs: controversial '@' prefix aliases should not be used

* Update docs/advanced-features/module-path-aliases.md

Co-authored-by: Joe Haddad <timer150@gmail.com>

* Update docs/advanced-features/module-path-aliases.md

Co-authored-by: Joe Haddad <timer150@gmail.com>

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: Joe Haddad <timer150@gmail.com>
2020-05-11 13:52:59 +02:00
Luis Alvarez D
0b36211a1f
[Docs] Environment Variables (#12696) 2020-05-11 02:18:34 -04:00
Tim Neutkens
467b2c7ebc
Enable sassOptions support in next.config.js (#12685) 2020-05-10 22:11:48 -04:00
Tim Neutkens
e3aeb2f768
Update code sample in performance measurement docs (#12690) 2020-05-10 21:39:18 -04:00
Tim Neutkens
fcbffa3683
Update documentation that refers to isomorphic fetch libs (#12686) 2020-05-10 14:16:03 -04:00