Skip to content

Commit

Permalink
Merge branch 'canary' into split-chunks-css
Browse files Browse the repository at this point in the history
  • Loading branch information
Timer committed Feb 4, 2020
2 parents befc190 + bc81379 commit 888a1d7
Show file tree
Hide file tree
Showing 142 changed files with 1,316 additions and 1,122 deletions.
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
}
},
"overrides": [
{ "files": ["**/__tests__/**"], "env": { "jest": true } },
{
"files": ["**/*.ts", "**/*.tsx"],
"parser": "@typescript-eslint/parser",
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/build_test_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ jobs:
with:
path: '.'
key: ${{ github.sha }}

# TODO: remove after we fix watchpack watching too much
- run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

- run: node run-tests.js --timings -g ${{ matrix.group }}/6 -c 3

testsPass:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test_react_next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,7 @@ jobs:

- run: yarn upgrade react@next react-dom@next -W --dev

# TODO: remove after we fix watchpack watching too much
- run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

- run: node run-tests.js --timings -g ${{ matrix.group }}/6 -c 3
15 changes: 15 additions & 0 deletions errors/404-get-initial-props.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 404.js Cannot Have getInitialProps

#### Why This Error Occurred

In your `404.js` page you added `getInitialProps` or `getServerProps` which is not allowed as this prevents the page from being static and `404.js` is meant to provide more flexibility for a static 404 page. Having a static 404 page is the most ideal as this page can be served very often and if not static puts extra strain on your server and more invocations for serverless functions which increase the cost of hosting your site unnecessarily.

#### Possible Ways to Fix It

Remove `getInitialProps` from `404.js` and make sure no HOC's used in `404.js` attach `getInitialProps`.

If you want to fetch data for your `404.js` page move it to a client side fetch inside of `componentDidMount` or `useEffect(() => {}, [])`.

### Useful Links

- [Automatic Static Optimization](https://nextjs.org/docs/advanced-features/automatic-static-optimization)
23 changes: 0 additions & 23 deletions errors/serverless-publicRuntimeConfig.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ function SignIn() {
const passwordElement = event.currentTarget.elements.password

try {
await client.resetStore()
const { data } = await signIn({
variables: {
email: emailElement.value,
password: passwordElement.value,
},
})
client.resetStore()
if (data.signIn.user) {
router.push('/')
await router.push('/')
}
} catch (error) {
setErrorMsg(getErrorMessage(error))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@ function SignOut() {
const [signOut] = useMutation(SignOutMutation)

React.useEffect(() => {
if (typeof window !== 'undefined') {
signOut().then(() => {
client.resetStore()
signOut().then(() => {
client.resetStore().then(() => {
router.push('/signin')
})
}
})
}, [signOut, router, client])

return <p>Signing out...</p>
Expand Down
2 changes: 0 additions & 2 deletions examples/blog-starter/now.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"version": 2,
"name": "nextjs-blog-starter",
"alias": ["nextjs-blog-starter.now.sh"],
"builds": [{ "src": "package.json", "use": "@now/next" }],
"routes": [
{ "src": "/feed.json", "dest": "/_next/static/feed.json" },
{ "src": "/blog/(?<page>[^/]+)$", "dest": "/blog?page=$page" }
Expand Down
2 changes: 1 addition & 1 deletion examples/using-preact/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Preact example

This example uses [Preact](https://github.com/developit/preact) instead of React. It's a React like UI framework which is fast and small. Here we've customized Next.js to use Preact instead of React.
This example uses [Preact](https://github.com/preactjs/preact) instead of React. It's a React like UI framework which is fast and small. Here we've customized Next.js to use Preact instead of React.

Here's how we did it:

Expand Down
4 changes: 2 additions & 2 deletions examples/using-preact/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"dependencies": {
"module-alias": "2.2.2",
"next": "latest",
"preact": "10.0.0",
"preact-render-to-string": "5.0.7"
"preact": "10.2.1",
"preact-render-to-string": "5.1.4"
},
"license": "ISC",
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion examples/with-firebase-hosting/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"preserve": "npm run build-public && npm run build-funcs && npm run build-app && npm run copy-deps && npm run install-deps",
"serve": "cross-env NODE_ENV=production firebase serve",
"predeploy": "npm run build-public && npm run build-funcs && npm run build-app && npm run copy-deps",
"deploy": "firebase deploy",
"deploy": "NODE_ENV=production firebase deploy",
"clean": "rimraf \"dist/functions/**\" && rimraf \"dist/public\"",
"build-public": "cpx \"src/public/**/*.*\" \"dist/public\" -C",
"build-funcs": "babel \"src/functions\" --out-dir \"dist/functions\"",
Expand Down
8 changes: 0 additions & 8 deletions examples/with-jest-flow/.babelrc

This file was deleted.

3 changes: 0 additions & 3 deletions examples/with-jest-flow/.eslintrc.json

This file was deleted.

8 changes: 0 additions & 8 deletions examples/with-jest-flow/.flowconfig

This file was deleted.

42 changes: 0 additions & 42 deletions examples/with-jest-flow/README.md

This file was deleted.

This file was deleted.

23 changes: 0 additions & 23 deletions examples/with-jest-flow/__tests__/index.test.js

This file was deleted.

17 changes: 0 additions & 17 deletions examples/with-jest-flow/components/Page.js

This file was deleted.

35 changes: 0 additions & 35 deletions examples/with-jest-flow/flow-typed/next.js.flow

This file was deleted.

4 changes: 0 additions & 4 deletions examples/with-jest-flow/jest.config.js

This file was deleted.

4 changes: 0 additions & 4 deletions examples/with-jest-flow/jest.setup.js

This file was deleted.

29 changes: 0 additions & 29 deletions examples/with-jest-flow/package.json

This file was deleted.

9 changes: 0 additions & 9 deletions examples/with-jest-flow/pages/index.js

This file was deleted.

3 changes: 0 additions & 3 deletions examples/with-jest-react-testing-library/.babelrc

This file was deleted.

42 changes: 0 additions & 42 deletions examples/with-jest-react-testing-library/README.md

This file was deleted.

Loading

0 comments on commit 888a1d7

Please sign in to comment.