Commit graph

47 commits

Author SHA1 Message Date
Pierre de la Martinière
46ddd8cf60
Update next-transpile-modules to 9.0.0 across examples (#30418)
## Documentation / Examples

- [x] Make sure the linting passes by running `yarn lint`

It's this time of the year again :^) congrats to the Next.js team for the amazing release!
2021-10-27 09:48:28 +00:00
Luc Leray
f52955ec94
Clean up examples package.json (#27121)
Clean up package.json files in the `examples` directory:
- Add `private: true`
- Remove `version` (because they are irrelevant for packages that are not meant to be published)
- Remove `name` (because they are optional for packages that are not meant to be published, and when someone clones an example, they often rename it and the property becomes stale)
- Remove `author`
- Remove `description`
- Remove `license`

Also remove `with-dynamic-app-layout` example completely, since it does the same as `layout-component` (https://github.com/vercel/next.js/pull/27121#discussion_r668178408).

## Documentation / Examples

- [x] Make sure the linting passes
2021-07-12 19:58:03 +00:00
Nick Babcock
5629223407
Update examples to use React 17 (#26133)
[With next 11 requiring react 17](https://nextjs.org/blog/next-11#upgrade-guide), most of the examples
need to be updated, so the following snippet updated all the examples to
a compatible react version.

```bash
cd examples/
fd -g 'package.json' | xargs sed -r -i 's/"react": ".*"/"react": "^17.0.2"/
fd -g 'package.json' | xargs sed -r -i 's/"react-dom": ".*"/"react-dom": "^17.0.2"/'

# exclude experimental react version
git checkout with-reason-relay/package.json
```
2021-06-16 16:43:26 +00:00
Pierre de la Martinière
8afdaa3c04
Update next-transpile-modules to 7.3.0 across examples (#26040)
## Documentation / Examples

- [x] Make sure the linting passes

Just updated `next-transpile-modules` across examples. We shipped a workaround in 7.2 for the one breaking change that scared people from updating from v4 to v5+, I tested the updated examples, so we should be good.
2021-06-13 16:21:38 +00:00
Luis Alvarez D
e28fd50441
Include utm_source on example links to vercel.com (#21305) 2021-01-19 07:28:54 +00:00
Luc Leray
8eaabe2fb0
Fix deploy buttons URLs (#20834)
Fix all deploy button URLs in the Next.js repo to follow the following format:
```
https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/<EXAMPLE_NAME>&project-name=<EXAMPLE_NAME>&repository-name=<EXAMPLE_NAME>
```

The detailed docs for the Deploy Button can be found here: https://vercel.com/docs/more/deploy-button.

Also updates legacy Vercel import flow URLs (starting with vercel.com/import or with vercel.com/new/project), to use the new vercel.com/new URLs.

---

For example, for the `hello-world` example:

The URL is https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/hello-world&project-name=hello-world&repository-name=hello-world

And the deploy button looks like this:
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/hello-world&project-name=hello-world&repository-name=hello-world)

---

For reference, I used the following regexes to search for the incorrect URLs

```
\(https://vercel.com/import/git\?s=https://github.com/vercel/next.js/tree/canary/examples/(.*)\)
\(https://vercel.com/import/git\?c=1&s=https://github.com/vercel/next.js/tree/canary/examples/([^&]*)(.*)\)
\(https://vercel.com/import/project\?template=https://github.com/vercel/next.js/tree/canary/examples/(.*)\)
https://vercel.com/import/git
https://vercel.com/import/select-scope
https://vercel.com/import
https://vercel.com/new/project
```
2021-01-07 01:40:29 +00:00
Jens Meindertsma
a3c47721a1
Include all files in Prettier (#17050)
This uses the "Expand directories" feature introduces in Prettier 2.0 to automatically format all supported file types.

Also, I fixed some badly formatted files.
2020-09-14 02:53:19 +00:00
Joe Haddad
f17d435166
Ensure all examples are MIT licensed (#16691) 2020-08-29 22:32:35 -04:00
NorbertLuszkiewicz
c03d4931de
Simplify example usage instructions (#16678)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-08-29 22:22:02 -04:00
Pierre de la Martinière
0729394ee1
Update next-transpile-modules in all examples (#15739)
Should prevent some tears when people tries to replicate some example with Next.js 9.5.0 ;)

cheers!
2020-07-31 15:53:53 +00:00
Tanmay Laud
f00ad581a1
Added .gitignore to examples that are deployed to vercel (#15127)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-07-16 10:52:23 -04:00
Joe Haddad
4a12fb0a5f
Normalize example gitignores (#13768)
This removes a bunch of unnecessary `.gitignore`s and fixes some CMS examples that don't ignore `node_modules` etc.
2020-06-04 20:39:52 +00:00
Joe Haddad
7d038dfef1
Suggest npx over npm init (#13637)
This updates old examples to the more universal `npx` command.

Fixes https://github.com/vercel/next.js/discussions/12103
2020-06-01 17:36:57 +00:00
Joe Haddad
b7e17e09e5
Update references to zeit/next.js (#13463) 2020-05-27 17:51:11 -04:00
JJ Kasper
1f6ce106ae
Update codeload and deploy links for org rename (#13141)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-05-27 14:11:39 -04:00
Tim Neutkens
483bd3ddda
Rename ZEIT to Vercel (#12075)
* Find/replace

* Update more URLs

* More rename

* Fix remaining examples

* More updates

* Update create-next-app

* Update remaining text

* Update

Co-authored-by: Shu Uesugi <shu@chibicode.com>
2020-04-21 11:47:12 +02:00
Nathan Sculli
fa39b311ec
A little bit of maintenance on the ReasonML examples (#11662)
* Add babel-types package

`next dev` was failing with:

```
Error: Cannot find module 'babel-types'
```

* Upgrade to the latest bs-platform

Also add the `babel-types` package to stop the `next dev` command from complaining.

* Remove extraneous babel-plugin-bucklescript dependency.

Seems the dependency has been deprecated, and it doesn't seem to be required
anyways.
2020-04-06 10:44:01 +02:00
Shu Uesugi
c57cdbb31d
Rename zeit.co/new → zeit.co/import (#10674)
* Replace zeit.co/new → zeit.co/import

* Update deployment.md
2020-02-24 19:08:34 -05:00
Shu Uesugi
5f041447bc
Remove Now CLI reference from examples (#10501)
* Find/Replace "Deploy it to the cloud..."

* Find/Replace "Deploy it to the cloud..." (no colon)

* Find/Replace "Deploy it to the cloud..." for firebase

* Convert remaining ones

* Storybook deployment

* Update with-stripe-typescript

* Update contributing.md

* Remove `now`

* Update examples/with-stripe-typescript/README.md

Co-Authored-By: Luis Alvarez D. <luis@zeit.co>
2020-02-12 17:14:57 -05:00
Jorge Cuadra
1db77143f6
Fix with-reasonml example (#10399) 2020-02-03 14:01:41 -05:00
Shu Uesugi
6804039e94 Make example READMEs more consistent (#10124)
* npx create → npm init

* Fix inconsistent instructions

* Update amp-first

* Update with-graphql-react

* with-firebase-cloud-messaging

* Update with-higher-order-component

* change create-next-app url

* Update create-next-app instruction

* Update instructions to use npm instead of npx

* Move "the idea behind the example" to top

* Rename

* Rename

* Update contributing.md with a README template
2020-01-16 23:23:56 +01:00
Luis Alvarez D
7edf0da0c4 Add the deploy button to compatible examples (#9547) 2019-11-27 11:40:58 -05:00
Joe Haddad
18a9c7e371
Improve linting rules to catch more errors (#9374)
* Update `packages/`

* Update examples

* Update tests

* Update bench

* Update top level files

* Fix build

* trigger
2019-11-10 19:24:53 -08:00
Luis Alvarez D
f10f3304fe Replace the deprecated Create Next App URL (#9032) 2019-10-10 23:34:14 -04:00
Nathan Sculli
5c678537d6 [with-reasonml] Show both internal and shared state managment. (#7312)
* Show both internal and shared state managment in example.
* Add a global state custom hook.
2019-05-23 16:46:42 -05:00
Natalie Marleny
9f09299548 fix:5049 Make Count in with-reasonml persist in runtime (#7302)
This replicates the functionality of the shared-modules example with ReasonML.
2019-05-11 00:46:34 +02:00
Anthony Mittaz
7f471a4463 Tweak ReasonML example (#7254)
* Lock bs-platform to 5.0.3 (avoiding issues with reason language server)

https://github.com/jaredly/reason-language-server/issues/275

* Reformat code

* Ask bucklescript to use es6 instead of commonjs

* Rework getInitialProps (can now use a promise)

* Ignore .bsb.lock
2019-05-05 13:02:27 +02:00
Connor Davis
3fa04620e7 Remove Deploy To Now buttons (#7126)
* Remove Deploy To Now buttons

* Remove remaining buttons
2019-04-24 10:53:58 +02:00
Nathan Sculli
e3ddca4784 Update the recommendation section in examples/with-reasonml (#7089) 2019-04-19 15:28:28 -05:00
Nathan Sculli
44f7d1fbc4 Upgrade with-reasonml example to Reason React 0.7 and JSX 3 (#7078)
- Use the new [@react.component] decorator for all of the react
  components and bindings.
- Use the new react hook integrations for the counter component.
- Add a `npm run dev:reason` and `npm run dev:next` commands to make
  running the build processes in separate terminals easier.  I didn't
  update the README because I'm unsure if this is something that would
  be desired.
- upgrade to reason react 0.7.0
- upgrade to react and react-dom 16.8.6
- upgrade to bs-platform 5.0.3
- upgrade to @babel/core 7.4.3
2019-04-20 02:57:08 +09:00
Adam Lane
c4b9e079bf Add example of getInitialProps to with-reasonml (#5975)
The current reasonml needs an example of how to do getInitialProps.  tmepple posted the only known way of doing it in [this comment](https://github.com/zeit/next.js/issues/4202#issuecomment-439175214).   It is unlikely reasonml users are going to discover that comment or figure it out on their own so having it in an example is critical. 

Also, dependencies updated.  After updating dependencies, I get this error:
```
ModuleBuildError: Module build failed (from ./node_modules/next/dist/build/webpack/loaders/next-babel-loader.js):
[1] Error: Cannot find module '@babel/core'
[1]  babel-loader@8 requires Babel 7.x (the package '@babel/core'). If you'd like to use Babel 6.x ('babel-core'), you should install 'babel-loader@7'.
```
Seems like @babel/core is required as peer dependency per [this comment](https://github.com/babel/gulp-babel/issues/124#issuecomment-326853222) so I added it.

The way to do getInitialProps has changed in 7.0.2 canary so this also has a comment in the code about what change is required to get that working.
2019-01-02 11:43:19 +01:00
Adam Lane
b36382bb83 update with-reasonml dependencies (#5651) 2018-11-10 08:09:51 +01:00
Adam Lane
3d9564215c example with-reasonml dependency updates (#5048)
The original example fails to compile on my windows machine but updating bs-platform fixes that.
Depending on bs-next causes example to fail (package compiled with old incompatible version of bs-platform) so I have included it in a bindings directory where it can serve as an example of reason bindings.
Sources have been migrated to the latest reason-react.
2018-09-03 01:38:54 +02:00
Michael Herold
5b3578e58f #4751 - Explicitly mention install when cloning examples (#4758)
Preferably this installation wouldn't be necessary, but in lieu of a fix...

#4751
2018-07-11 23:56:15 +02:00
Tony Kovanen
6158243339 with-reasonml: better setup (#4218)
With this setup we're compiling the .re/.ml files directly to source
directories with a .bs.js extension, and enabling next.js to pick up
that extension for pages.
2018-04-27 08:24:46 -07:00
Tony Kovanen
f378448b79 with-reasonml: use default exports (#4217) 2018-04-26 20:35:30 -07:00
Tony Kovanen
2457df5d06 examples/with-reasonml: use bs-next for Next.Link (#4214)
Fixes #4028
2018-04-26 10:05:04 -07:00
James Hegedus
f2e56609cd Examples: stabalise README format and create-next-app usage (#4009)
* Examples: clarify language around Yarn create & npx

* add missing READMEs and create-next-app usage

* suggest people tag jthegedus in firebase related issues

* add yarn alt instructions

* cerebraljs example readme & fixes
2018-04-03 14:19:05 +02:00
James Hegedus
b1d8b839dd Examples: use npx and yarn create to run create-next-app on examples (#4002)
* remove global npm install of create-next-app

* add npx to create-next-app command in examples

* add bash to shell snippets

* add yarn create to next-app command in examples

* fix READMEs named with lowercase

* change READMEs to use UPPERCASE
2018-03-14 09:09:46 +01:00
Romain Quellec
2a845a61b7 Correct url to blog post (#3709) 2018-02-06 15:22:32 +01:00
Tim Neutkens
9a82ca4029 Update Next.js version on examples 2018-01-30 21:46:15 +01:00
Tim Neutkens
24c1ac6ca9
Use canary for all example downloads (#3411) 2017-12-06 18:12:42 -08:00
Fouad Matin
2528779394 examples: add create-next-app (#3377)
* examples: add create-next-app

* fix with-typescript readme
2017-12-02 20:30:17 -08:00
Adrian Li
f9c6e12037 Update reason example to version 3 syntax and fix errors (#3347)
* update dependencies

* add bsconfig refmt version

* update to new syntax

* add dependency on concurrently for dev convenience

* fix dev script
2017-11-28 14:15:03 +01:00
Alain
df5b96adec typo on line 7 (#3031)
bsb make world instead of nake world.
2017-10-02 16:12:52 +02:00
Nicholas Rakoto
016920e3e0 Example: Improve ReasonML example (#3021)
* Git ignore with-reasonml/lib folder

The lib folder contains code generated by BuckleScript, it shouldn't be
versioned.

* Fix, case sensitive paths

Next.js use case-sensitive-paths-webpack-plugin and BuckleScript tries
to maintain the filename case.

* Refactor, use a .babelrc file instead of a babel config in package.json

This is the official recommended way in Next.js

* Enable way, way, waaaay nicer error messages!

Adds `"bsc-flags": ["-bs-super-errors"]` to the bsconfig.json file.

https://reasonml.github.io/community/blog/#way-way-waaaay-nicer-error-messages

* Fix npm scripts & use concurrently to run bsb & next in parallel for dev

* Upgrade bs-platform

* Replace statefulComponent with new reducerComponent

https://github.com/reasonml/reason-react/blob/master/HISTORY.md#024

* Upgrade with-reasonml example to next.js 3
2017-09-30 22:02:45 +02:00
Tim Neutkens
eba9ebef5f Merge v3-beta into master (#2809)
* Add examples/with-redux-code-splitting. (#2721)

* #1757 Relay Modern Example (#2696)

* Add ReasonML example (#2640)

* Add ReasonML example

* Add a gitignore specifically for the reasonml example

* Allow custom className for <Main /> (#2802)

* 3.0.2

* Remove beta information from the README.

* 3.0.3

* Remove unnecessary lookup in example with emotion (#2731)

* Document SCSS/Less (#2742)

* Document SCSS/Less

* Add missing word

* Add docs for examples dir

* Add extra example

* uppercase J

* Add with pkg example (#2751)

* Add custom server micro example (#2750)

* Ease running multiple examples at the same time with process.env.PORT (#2753)

* Add line-height rule for error page h2 (#2761)

* Add support for fetching multiple translation files (#2743)

* Add support for fetching multiple translation files

* Cleanup

* Clear missed interval (#2611)

* clear missed interval

* remove trailing whitespace

* Relay Modern Example (#1757) (#2773)

* Simplification of Relay Modern Example (#1757) (#2776)

* Use deterministic names for dynamic import (#2788)

* Always use the same name for the same dynamic import.

* Add unit tests for the modulePath generation.

* Allow tests to run correctly on Windows.

* Make the chunk name a bit pretty.

* Fix tests to run on Windows.

* 3.0.4

* Revert "Make the chunk name a bit pretty." (#2792)

This reverts commit 0c9e8cf2271955e74ab9f752b5869b98c1dc60f9.

* 3.0.5

* Use _ as the divider for dynamic import name splitter. (#2793)

Using - gives us some weird webpack errors.

* 3.0.6

* next/dynamic Error Message Tweaks (#2798)

* Fixed issue (#2804)

https://github.com/zeit/next.js/issues/2800

* docs(material-ui): move the source code to Material-UI repository (#2808)
2017-08-27 22:13:35 +02:00