I tried to make the example a bit more descriptive. I changed `publicPath` in `now.config.js` to be `/_next/static/`, in place of `./`, and `outputPath` to `static/` in place of `static/css/`. The reason is that the webpack config will still fallback to `file-loader` for any content that is imported by the user and which is bigger that `8192` bytes. I think this content should not land in the css folder, which should probably stay css specific.
Moreover, for user content, like regular images, the former settings will fail.
If you have this:
```javascript
import LargeFile from './LargeFile.png'
```
it would be placed in `static/css/` but its url would resolve to `<base-url>/LargeFile.png`, which will fail. It works for semantic-ui alone, because `@zeit/next-css` will put the styles in `static/css/` and so `publicPath` of `./` would work just fine.
Putting assets in `static/` and setting `publicPath` to '/_next/static/' will resolve correctly for both semantic-ui related assets as well as for regular user assets.
I hope I am not mixing something up. I tested it locally and in serverless deployment, and this looks pretty consistent.
* Implement circular JSON err.sh link
* Add test for getInitialProps returning circular json
* Make test warn less
* Fix tests
* Add reference to original tests
Hi there
I noticed you have not yet included the api breaking changes in `"redux-saga": "1.0.0"`. Therefore I felt free to upgrade the dependencies in `examples/with-redux-saga`.
I do not know anything about apollo nor graphql, that is why I did not upgrade `examples/with-apollo-and-redux-saga`. But, I think you should do this on occasion.
Keep the great work up.
Regards
Fixes#6117
I'm not entirely sure why we had this rule in the first place. I think for some tests related things when we didn't have a monorepo yet. However it could also be related to bundle sizes. I'll compare that when the build finishes.
The reason for #6117 is that we added `react-is` to the dependency tree of Next.js to check valid elements. react-redux uses hoist-non-react-statics which ships a different version of react-is in this case, one that has `ReactIs.isMemo`
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.
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`.
Fixes#5363
I noticed this happening when making some changes on the nextjs.org/learn app. Basically we didn't apply updates when a warning was emitted from webpack. This would cause issues for users using eslint-loader or similar too.
ctx.pathname was set to url including the query of the page to prefetch
therefore the page was cached with the wrong key (article%3Fid=1?id=1),
and that's why the cache didn't work (right key: article?id=1)
There's still a few Typescript helpers in use, but regenerator is added by Babel after this change, as it was already in the bundle it'll drop bundle sizes by quite a bit, eg _app.js becomes half the size.
RE: https://github.com/zeit/next.js/issues/4587, this pull request improves the with-segment example.
Previously, only SSR page loads were tracked. This pull request adds manual page view logging via `Router.events.on('routeChangeComplete')` in `Page.js`.
There is also a minor bug fix on the textarea to remove a console error.
`react-is` isn't used in production, so we shouldn't bundle it.
Note: most of those plugins are using the `dev` variable, but in case someone runs `NODE_ENV=development next build`, they would need a copy of `react-is` because the conditional use of `react-is` checks `NODE_ENV` — not whether or not HMR is being used (what what the `dev` variable is based on).
…aces (home and about pages). This makes it the example more clear and why someone might want to use _app.js in the first place. Also, added a button on the about page that allows for passing and arbitrary value from the about page to the context provider. I disagree with the naming convention of calling the class CounterProvider. It includes both a Provider and Consumer so it should have some name that covers both. Maybe it should be called CounterContext but I did not change that. I've seen other examples of the same naming conversion so figure I'm the odd duck here (still think it's wrong no matter how many people do it).