1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00
Commit graph

2685 commits

Author SHA1 Message Date
Patrick Smith 98568046a3 Add PropType validation for next/head children (#5504)
Give `Head` a more detailed error messages in dev mode by validating the children prop's PropTypes.
2018-10-28 23:04:35 +01:00
Max Fierro 2c343baeba Fix issue with HMR not working (#5544)
Change the ignore patterns to ignore `.git/` folder.
Add Windows pattern matching for `.next/` and `.git/` folders.

Fixes #5429
2018-10-28 23:01:45 +01:00
Janek Rahrt a7b6ffa914 Fix ssr auth bug and dependency problems (#5543)
* fix graphql dep

* fix ssr auth bug

* fix linting issues
2018-10-28 13:13:28 -07:00
Dmitriy e382be655c Fix readme (#5513)
* Fix readme

* Fix spelling mistake

Co-Authored-By: dipiash <dmitriytemn@gmail.com>
2018-10-26 13:42:23 -07:00
Ben James 1770efad63 Fix typo in router error message (#5515)
Tiny typo fix 🙂
2018-10-26 19:28:10 +02:00
Michael Herold dfe7c4652f Updated contributing steps for next-server (#5405) (#5518) 2018-10-25 22:51:20 +02:00
Quentin Sommer def2ce7eda feat: Added react-useragent example (#5507)
Add an example how to use `@quentin-sommer/react-useragent` with next.

I've been asked this https://github.com/quentin-sommer/react-useragent/issues/10 and plan to link this example as reference!

See readme for details
2018-10-23 23:33:41 +02:00
David Calhoun ba5f1b2c21 [change] Update react-native-web example (#5489)
Utilize ES modules, which are now the default export for
`react-native-web`.

_NOTE:_ [This example requires `next@^7.0.0`](https://bit.ly/2PaEhao).
2018-10-22 22:32:24 +02:00
Olivier Tassinari e02c0d000a Make IE 11 happy (#5499)
https://sentry.io/share/issue/3bc66ffadcad46a9aae703d5eba1e342/

![capture d ecran 2018-10-22 a 12 04 16](https://user-images.githubusercontent.com/3165635/47287491-b1683a80-d5f2-11e8-8c3f-e409340b880f.png)
2018-10-22 22:31:50 +02:00
Noel Yoo c111eac1ae Update circleci build (#5491) 2018-10-22 13:05:04 +02:00
Noel Yoo f43079659c Include node v10 for travis ci (#5490) 2018-10-20 22:25:51 +02:00
Christopher Lee 98eb710189 removed deprecated useBuiltIns from .babelrc (#5486) 2018-10-20 21:09:03 +02:00
ultrox 2ce3f39585 fix(examples/with-react-intl): Bug when accept-language is anything other then 'en' (#5488)
package accept returns false if can't find language in offered list of languages, then later on
bool is attempted to be split, and app crashes in prod & dev
2018-10-20 20:11:59 +02:00
Tim Neutkens e8c73b45fa Run yarn lint —fix 2018-10-20 19:37:42 +02:00
Henrik Wenz d40f27239a Add size-limit test (#5339) 2018-10-20 17:03:19 +02:00
Timmy Willison 1b8f56556b Output warnings and errors from webpack individually (#5442)
- Shows warnings even when resolving, to facilitate hints set to 'warning'
- Fixes #876 : Set performance.hints to 'warning' or 'error' in next.config.js
2018-10-20 17:02:20 +02:00
Henrik Wenz 18488f47b0 Fix linter (#5350)
* Fix linter

* Add test env

* Fix lint errors
2018-10-20 17:00:01 +02:00
Vasyl Berezovyy 9a09de2feb Remove ignore plugin from webpack build flow (#5394) 2018-10-20 16:59:43 +02:00
Anthony Cerbic 4be4452fd8 Add cloud9 (c9.io) to examples (#5448) 2018-10-20 16:58:21 +02:00
komkanit 3e72da686f upgrade react-native-web to fix bug (#5459) 2018-10-20 16:58:03 +02:00
Alexandre Cisneiros 398dcd4281 Fix typo on README.md (#5484)
Just a quick typo fix on Multi Zones documentation :)
2018-10-20 16:56:59 +02:00
zsx 5b6489ebf3 Fix the bug with not passing props to wrapped element of with-rematch example (#5483) 2018-10-20 14:31:26 +02:00
Seth Bergman f5156b2297 Fixed broken link (#5479)
Fixes link to 404 page in sentry docs
2018-10-19 14:52:41 +02:00
Jerome Fitzgerald 6eba3ad9ab 🐳️ multistage: remove devDependencies (#5477)
Docker Multistage
* Remove `devDependencies` from `./node_modules`
 in `builder` for faster copy on `base` init

* Added `isomorphic-unfetch` to show it not
 being copied over to `base`.

* `isomorphic-fetch` will still show from `next`
2018-10-19 00:36:04 +02:00
Gerhard Preuss 9634bad79d Remove note on OSS/non-OSS issue (#5474)
I successfully deployed this example with `now` and `now --public` (I am on premium plan).
Did this before deploy

```sh
$ cp Dockerfile.multistage Dockerfile
```
2018-10-18 11:14:17 +02:00
Zach Curtis 829f4e581c Fixed auth token not getting refreshed on client cache reset (#5471) 2018-10-17 16:52:29 +02:00
Luc 6f80581adc Update styled-components to v4 (#5458) 2018-10-16 12:03:25 +02:00
Iurii Kucherov 619ba00001 Fix typos on comments (#5457)
Hello,

Here is a small PR to fix some typos on the comments.
2018-10-16 01:25:16 +02:00
Jan Czizikow 9d50f8afb5 Update using emotion - fixes: Warning: <title> should not be used in _document.js's <Head> (#5454) 2018-10-15 17:02:19 +02:00
Don Alvarez af9214b302 mobx-state-tree examples should use _app (#5362)
The mobx-state-tree examples (with and without typescript) pre-dated the next _app class and needed to be updated to use _app for persisting state across client-side navigation transitions. Also removed unneeded custom server class to better keep with the "show one feature per example" style of the next examples folder
2018-10-14 10:04:58 +02:00
zsx 1b8bfc70f3 Fix the bug with creating duplicate components of with-rematch example (#5440) 2018-10-12 16:16:52 +02:00
Henrik Wenz 95a6a872b6 Refactor test setup (#5391)
- [x] Move jest config from npm scripts to `jest.config.js`
- [x] Remove obsolete cross-env package (we don't need it anymore 🎉)
- [x] Fix bug where tests are not waiting for webdriver to be ready.
2018-10-12 15:32:17 +02:00
Henrik Wenz d4785eb013 Fix coverage (#5435)
* removed nyc in favor of jest
* fixed coverage
2018-10-12 14:38:35 +02:00
Rafael Almeida 449dd29da0 Update with-react-i18next example to use react-i18next@8.0.6 (#5368)
Fixes #5352 . This updates the example updating react-i18next to v8.0.6, replacing the `translate` HOC to `withNamespaces` and `I18n` to `NamespacesConsumer`.

There is one thing that I am not sure if is correct or not so I need some guidance. You gotta wrap the page with the `withI18next` HOC so it will extend the `getInitialProps` of the page with this:

```
Extended.getInitialProps = async (ctx) => {
  const composedInitialProps = ComposedComponent.getInitialProps
    ? await ComposedComponent.getInitialProps(ctx)
    : {}

  const i18nInitialProps = ctx.req
    ? i18n.getInitialProps(ctx.req, namespaces)
    : {}

  return {
    ...composedInitialProps,
    ...i18nInitialProps
  }
}
```

The problem lies in `i18n.getInitialProps` that has this code:

```
i18n.getInitialProps = (req, namespaces) => {
  if (!namespaces) namespaces = i18n.options.defaultNS
  if (typeof namespaces === 'string') namespaces = [namespaces]

  req.i18n.toJSON = () => null // do not serialize i18next instance and send to client

  const initialI18nStore = {}
  req.i18n.languages.forEach((l) => {
    initialI18nStore[l] = {}
    namespaces.forEach((ns) => {
      initialI18nStore[l][ns] = (req.i18n.services.resourceStore.data[l] || {})[ns] || {}
    })
  })

  return {
    i18n: req.i18n, // use the instance on req - fixed language on request (avoid issues in race conditions with lngs of different users)
    initialI18nStore,
    initialLanguage: req.i18n.language
  }
}
```

In my understanding, among other things, it gets the `i18n` object from the request (included by the `server.js`) and uses the data to create `initialI18nStore` and `initialLanguage`, and then return these two objects plus the `i18n` object itself. If you add the `i18n` object on the return, then there will be a crash on the client-side render of the page:

```TypeError: Cannot read property 'ready' of null```

I don't know why, but returning it breaks `NamespacesConsumer` component from `react-i18next` (the state becomes null). So I commented this line and the provider on `_app.js` is getting the `i18n` instance from the `i18n.js` file (the same as `server.js`). I don't know if this would be an issue so I would like help to debug this.
2018-10-11 16:20:01 +02:00
Tim Neutkens 384fbdc3aa v7.0.2-canary.9 2018-10-11 11:42:53 +02:00
Tim Neutkens 965f50beb2
Remove pathname (#5424) 2018-10-10 21:58:15 +02:00
Adam Stankiewicz 299cc65d21 Show that <Head /> is needed for custom document (#5376)
* Show that <Head /> is needed for custom document

* Add comment explaining required Document fields

* Update README.md
2018-10-10 12:00:02 +02:00
Henrik Wenz 61fe50a493 Update husky & lint-staged (#5389)
* Update husky & lint-staged

* Move to pre-commit package

* Include bin files

* Remove husky
2018-10-10 11:58:44 +02:00
Luc e174304639 Remove examples/.babelrc (#5415)
* fix relative path in examples/.babelrc

* remove examples/.babelrc

* remove examples/.gitignore
2018-10-10 09:52:48 +02:00
Kenneth Luján Rosas 6dcc9bd59a feat: add dynamic layouts with _app.js example (#5420)
Regarding a question about having different global layouts via `_app.js` usage, it came up that we could use a static property in the page that needed a different one(Thanks @timneutkens )

Link to the Spectrum post: https://spectrum.chat/?t=af6ca794-5420-4780-abd8-96f085a19e09

This PR adds an example called `with-dynamic-app-layout`, that showcases that use case in the simplest way I could think of.

Let me know if there's changes or improvements to be made. 🎉
2018-10-10 09:49:22 +02: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
Duncan L 6d5389ef2d Examples: Update custom-server-typescript examples packages (#5411) 2018-10-09 12:48:05 +02:00
Duncan L 5fbca72ea2 Examples: Update with-redux-observable example packages (#5412) 2018-10-09 12:47:26 +02:00
Luc 91b21f9514 Update with-jest example .babelrc config (#5414)
* simplify babelrc

* simplify "test" script

* update dependencies
2018-10-09 12:45:51 +02:00
Shu Ding 409cf71a4d Move styled-jsx to external modules (#5403) 2018-10-08 16:26:05 +02:00
Henrik Wenz 8ac4561745 Remove AppVeyor artefacts (#5398) 2018-10-08 14:06:09 +02:00
Luc c178481611 Remove @babel/runtime devDependencies in next-server (#5360)
* Move @babel/runtime to dependencies

* Remove @babel/runtime, keep @babel/runtime-corejs2
2018-10-07 21:22:47 +02:00
Romello Goodman fad1265d17 Upgrading the styled component packages (#5390)
Upgrading the styled-components and babel styled components packages!
2018-10-07 15:32:31 +02:00
Henrik Wenz ef01f13e5d Improve test setup (#5388)
* Update jest

* Let jest start chromedriver

This makes sure chromedriver always ends even if the test was canceled by the user.

* Properly close browser in production-config test

* Properly close browser in production/security test

* Properly close browser in export test

* Properly close browser in app-aspath test

* Remove taskr from project root

This isn’t needed anymore

* Readd taskr to project root (temporary)

* Improve global setup/teardown

* Properly close browser in basic/client-navigation test

Clicking an target=_blank link will open a second browser window. We can only close this by using broser.quit()
2018-10-07 15:04:43 +02:00
Logan McAnsh f3c65fd417 update polka example (#5370)
[polka](https://github.com/lukeed/polka/releases/tag/v0.5.0) changed their listen api to be more like express like
2018-10-07 15:00:44 +02:00