Commit graph

32 commits

Author SHA1 Message Date
Joe Haddad
f17d435166
Ensure all examples are MIT licensed (#16691) 2020-08-29 22:32:35 -04:00
Jesse Jafa
694ccc7ca0
Upgrade typescript to 4.0 (#16673) 2020-08-29 22:17:02 -04:00
Kristoffer K
2e6bc8eba4
ci: add pnp test (#16255) 2020-08-17 13:39:57 -04:00
Willian Justen
18dc1f66c6 Remove isomorphic-unfetch from examples (#12948)
Since 9.4 release, fetch is pollyfilled by default from #12353,
so the import is not needed anymore.
2020-05-15 22:23:55 +02:00
francismarcus
05e8b38e16 Updated packages for examples/with-typescript (#9791)
* Update packages

* Update examples/with-typescript/package.json

Co-Authored-By: JJ Kasper <jj@jjsweb.site>

* Run lint-fix

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2019-12-19 16:13:04 -06:00
Resi Respati
42bf21091e [with-typescript] Updated TypeScript example to use API routes (#9073)
* [with-typescript] Updated TypeScript example to use API routes

Next.js 9.0.0 has been out for a while, which supports API routes, but
the examples were never updated to make use of it. This PR adds a simple
example of an API route which also makes use of dynamic routing.

A simple `fetch()` wrapper is also added for example purposes, and the
pages structure have also been updated to dynamic routing.

* Properly link to the dynamic page
2019-10-16 13:38:14 -05:00
takehiro-takahashi
0410a43d5a update package (#8906) 2019-09-29 20:39:32 +02:00
Joe Haddad
5205695578
Switch all examples to next@latest (#7806) 2019-07-08 18:41:33 -04:00
Lukáš Huvar
830281fecd Update typescript example (#7684) 2019-06-27 13:50:38 +02:00
Resi Respati
28b020538a [with-typescript] Remove obsolete TypeScript plugin and updated readme (#7368)
* [with-typescript] Remove obsolete TypeScript plugin and update readme
2019-05-21 12:30:17 -05:00
Resi Respati
a275ad0922 Updated typescript examples (#7337)
* Updated with-typescript example
2019-05-15 21:04:08 -05:00
Lukáš Huvar
d7152f6ae4 Update typescript example to reflects out of box usage (#7235) 2019-05-14 13:31:46 -05:00
Resi Respati
6d41ed7e6f [with-typescript] Updated typescript and removed unused deps (#6116)
I've updated the TypeScript dependency to the latest version. Also
removed some dependencies that may not be needed.

I've also fixed tslint errors which may have appeared because of
previous updates to this starter kit, as well as added comments
to explain some parts of the code.
2019-01-24 10:18:43 +01:00
Justin Noel
d6ec10a4bf add new nextjs typings with samples (#6102)
The current `examples/with-typescript` is not using the latest type definitions currently available on DefinitelyTyped project for next.

Added new list page examples that demonstrate how to use the new Types for both stateless functional components and classes.  Also modified examples for list to demonstrate typings for `getInitialProps`.
2019-01-23 12:37:09 +01:00
Peter Kellner
3a3347dc5f The current TypeScript "with-typescript" looks like it was put there as a place holder. I'm fairly new to TypeScript but I'm sure the changes I've made here will be a huge improvement. Open to suggestions and to update as appropriate. Also, Tried to run yarn lint --fix to no avail. I can't figure out how to get it to find lint whether I'm running on my mac or PC. I tried lots of variations around npm i lint -g but had no success. (#6011) 2019-01-08 22:29:58 +01:00
Juan Olvera
7e12997af6 Test updater script on examples folder (#5993)
I wrote a [script](https://github.com/j0lv3r4/dependency-version-updater) to update dependencies recursively in `package.json` files, e.g.:

```
$ node index.js --path="./examples" --dependencies="react=^16.7.0,react-dom=^16.7.0"
```

This PR contains the result against the examples folder.
2019-01-05 12:19:27 +01:00
Duncan L
d141b95603 Examples: Update with-typescript Example Packages (#5410)
Update packages for with-typescript example
2018-10-09 12:48:27 +02:00
Resi Respati
397daece42 with-typescript example updates (#5267)
* [with-typescript] Updated `@zeit/next-typescript` and typescript typings

* [with-typescript] Updated tsconfig to match new recommended config

* [with-typescript] upgraded dependencies, implement type-checking

* [with-typescript] add _document example, fixed tsconfig

* [with-typescript] updated README

* [with-typescript] updated example contents

* [with-typescript] adopt the Layout component from Flow example
2018-09-26 09:58:36 +02:00
jhartley218
ad2d4432e7 Update @types/next to latest in typescript example. (#4750)
Updating to a more recent version of `@types/next` fixes an error I encountered while building a new app on top of the "with-typescript" example:

`Property `push` not found in SingletonRouter`

Additional context: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/26665

To test, add a simple Router.push operation to the `pages/index.tsx`

```
import Router from 'next/router'
// ...
<span onClick={() => Router.push({ pathname: '/about' })}>TEST</span>
```
2018-07-09 13:32:52 +02:00
Vinicius Pacheco Furtado
de6bf4e75f Fix typescript examples (#4704)
Update @zeit/next-typescript version on examples using it
2018-06-30 22:23:38 +02:00
Luke Barton
cbfdcce32d Update typescript examples to use 1.0.1 of next-typescript (#4472)
* Update typescript examples to use 1.0.1 of next-typescript

* Add .babelrc modifications to upgraded typescript examples
2018-05-25 11:28:35 +02:00
yhirano55
ee1b6d93ce Minor improve with-typescript example [ci skip] (#4402)
* Added license to package.json.
* Modified package name same as dir name.
2018-05-17 12:45:13 +02:00
Tim Neutkens
2c3f40600c Upgrade with-typescript to use latest next-typescript 2018-05-12 13:59:15 +02:00
Volker Rose
aec4c00214 Update next-typescript to latest version 0.1.1 (#4176)
This example gave me 404s on `pages/*.tsx` when using it with the latest nextjs (`5.1.0`) and `@zeit/next-typescript@0.0.11`. The latest next-typescript plugin version fixes it.
2018-05-08 17:38:21 +02:00
Tim Neutkens
69ca73ca56 Upgrade @zeit/next-typescript in with-typescript example (patch) 2018-03-30 00:07:33 +02:00
Bonggyun Lee
87ab61eba5 example/with-typescript (#3698)
* example/with-typescript2

* apply standard js style

* remove unnecessary file & code

* fix link url

* replace with-typescript
2018-02-06 11:06:48 -05:00
Brice BERNARD
bda073cfc1 Remove next.d.ts to use @types/next (#3297) 2017-11-16 12:28:10 +01:00
Brice BERNARD
45e26f22b3 Fix tsx workaround, bootstrap next.d.ts, add tslint deps (#2885) 2017-11-13 13:59:00 +01:00
Kohei Hasegawa
63ac27b900 Update TypeScript example (#3074) 2017-10-11 21:36:04 +02:00
Sagi
ab82f06c87 Added react and react-dom dependencies (#2518)
* Added react and react-dom dependencies

Added missing `react` and `react-dom` dependencies which are required by next.js

* Moved react & react-dom to dependencies

Moved react & react-dom to dependencies from devDependencies
2017-07-09 15:26:35 +02:00
Henrik
f14297dc80 Normalize example package.json files (#2350) 2017-06-23 10:46:44 +02:00
Giacomo Rebonato
b00f0c2044 TypeScript example proposal (#845)
* TypeScript example proposal

* removed unused loader

Removed typings

Moved TypeScript to dev dependencies

removed unused typings

changed react typings version

removed react dependency

set next dependency version to latest

removed not needed babel preset

enabled sourcemaps

simplified tsconfig

modified component to be a functional one

* Ignore build

* Making npm script Windows-friendly

* Clean up

* Added readme

* fixed typo
2017-02-09 12:36:58 +01:00