Commit graph

4233 commits

Author SHA1 Message Date
JJ Kasper
2139f66ac3 Add test for duplicate scripts and add extra de-duping (#8709) 2019-09-11 17:20:47 -04:00
Joe Haddad
eb8c11bbda
Organize webpack configuration imports (#8711)
This PR simply organizes the webpack config imports.
2019-09-11 16:41:29 -04:00
Joe Haddad
55369051f5
Warn build on duplicate pages (#8646)
* Fail build on duplicate pages
This will fail the `next build` command when a duplicate page is found.
In development, we'll emit a warning instead of crashing the dev server.

* Add test for warning in development

* Only issue a warning

* Fix production test

* Fix development test

* Remove useless arg

* Warn in development, too
2019-09-11 14:26:10 -04:00
Joe Haddad
594851111b
Nit: sort experimental keys (#8707) 2019-09-11 14:10:51 -04:00
JJ Kasper
5a0dcbc95b Update pages-loader to return one value (#8629)
* Update pages-loader to return one value

* de-dupe page mod update also
2019-09-11 13:21:10 -04:00
Joe Haddad
fcadad9960
TypeScript report on active pages only (#8703)
* TypeScript report on active pages only
The TypeScript integration needs to report on active pages only.
When inactive pages are reported, they block the compilation and prevent the user from fixing the error (because the file isn't watched).

We cannot add the file to the webpack watcher because the compilation has already been sealed.

* Remove TODO message

* Test that inactive pages are not type checked
2019-09-11 13:06:48 -04:00
JJ Kasper
e5aa9614e1 Lock CircleCi image for now (#8706)
* use legacy image for now

* Use image hash

* Update config
2019-09-11 12:56:32 -04:00
Joe Haddad
53f4f82e4c
Catch all requests in custom server (#8704)
Some users aren't aware they need to edit their custom server to support various HTTP Methods (e.g. POST for API Routes).

Instead, we should just handle all HTTP Methods out-of-the-box.

---

Closes #8237
2019-09-11 10:23:41 -04:00
Michael Lustig
a809368e59 Fix login popup not working (#8700) 2019-09-10 22:16:20 -04:00
Jakub Karabuła-Stysiak
5496e0f8b3 Add electron typescript example (#8682)
* Add initial Electron-Typescript-Next example

* Move and add types

* Update readme

* Update renderer

* remove config
2019-09-10 14:22:00 -05:00
JJ Kasper
a5ebe41a9a Delay updating asPath for auto exported pages (#8681)
* Delay updating asPath for auto exported pages

* Add additional test ensuring asPath is updated
2019-09-10 13:30:25 -04:00
Joe Haddad
79090718da
Test non-flag and re-runs of telemetry cmds (#8697) 2019-09-10 13:21:10 -04:00
JJ Kasper
7b933f675a Optimize test setup (#8644)
* Tweak test set-up

* Update azure config

* Add cleaning test files and windows handling

* Limit windows test to one at a time

* Tweak test settings

* Update tests splitting

* remove custom concurrency for azure

* Test Azure var

* Update Azure config

* bump

* Simplify cleaning up
2019-09-10 13:11:55 -04:00
Joe Haddad
4c6c9cc882
Add telemetry CLI tests (#8696)
* Add telemetry CLI tests

* Apply suggestions from code review

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

* Update index.test.js
2019-09-10 12:45:37 -04:00
Joe Haddad
ba683b3fab
Support non-flag variant of telemetry cmds (#8695)
This adds support for `next telemetry disable` (and keeps support for `next telemetry --disable`).

This also informs the user telemetry was already disabled if they re-run the command to give peace of mind.
2019-09-10 12:31:18 -04:00
Diogo Dutra
af7d021d48 Fix relay modern server express example (#8683) 2019-09-10 09:01:59 +02:00
JJ Kasper
8444c1ffba
Update stats-config to be more deterministic (#8679) 2019-09-09 16:06:13 -05:00
Filip Wojciechowski
92e26ce1b1 better type for AppTree in NextPageContext (#8662)
* better type for AppTree in NextPageContext

* updated tests

* new AppTreeType type and updated tests

* removed a commented out line

* another take on the type of AppTree, with updated tests

* allow passing additional props to AppType

* Update suite name
2019-09-09 11:23:34 -05:00
Maël Nison
9fa8baa03a Uses the PnP API when available (#8668)
* Uses the PnP API when available

* Moves the resolution into an helper

* Update packages/next/lib/resolve-request.ts

Co-Authored-By: Joe Haddad <joe.haddad@zeit.co>

* Apply Prettier
2019-09-09 11:47:42 -04:00
Joe Haddad
93d6a670fe
Resolve externals using webpack's context (#8669) 2019-09-08 13:53:33 -04:00
Joe Haddad
b10f797889
Re-enable anonymous telemetry (#8667) 2019-09-07 14:11:17 -04:00
Joe Haddad
3052a8ff92
Remove Telemetry Registration (#8664) 2019-09-07 10:51:09 -04:00
Joe Haddad
3000d71955 Add intl and Apollo to packages of interest (#8665) 2019-09-07 15:00:08 +02:00
JJ Kasper
e9ffb41462
Revert "Remove extra pages from export test" (#8658)
* Revert "Remove extra pages (#8651)"

This reverts commit 9546f9c3ac.

* Rename export error pages
2019-09-06 11:18:00 -05:00
Maël Nison
d3c1731c09 Adds the PnP plugin by default (#8653)
* Adds the PnP plugin by default

* Covers loaders

* Fixes linting
2019-09-06 09:49:38 -04:00
Lukáš Huvar
0c6c1f9e07 Fix yarn workspaces example (#8631)
* Add now.json to fix deploy

* Adjust now.json

* Fix next.config.js

* Update next.config.js

* Update examples/with-yarn-workspaces/now.json

Co-Authored-By: Joe Haddad <joe.haddad@zeit.co>
2019-09-06 13:44:39 +02:00
Lukáš Huvar
9546f9c3ac Remove extra pages (#8651) 2019-09-06 13:05:38 +02:00
Joe Haddad
73b6c1e633
[docs] useRouter cannot be used with classes (#8649)
The `useRouter` function is a hook and cannot be used with Classes.

A few React beginners have brought this up, so we document the alternatives to hooks.
2019-09-05 23:05:59 -04:00
Joe Haddad
6444889c9b
Update Create Next App Template (#8648)
This updates the Create Next App template to remove the "Create Next App" card.

Instead, we now display cards to the docs, learn, and the examples.
2019-09-05 22:51:42 -04:00
Joe Haddad
319bc463e7
Mention Custom App GIP in UPGRADING (#8647)
This tells the user to check their custom <App> for `getInitialProps` if they previously copied the example.

This should help them leverage automatic static optimization!
2019-09-05 22:37:22 -04:00
Aaron Reisman
6c01bbd6df Add Apollo Server and Client Example App (#8195)
* Add Apollo Server and Client Example

* Update Apollo Client to use previous example setup
2019-09-05 18:42:32 -05:00
Alex Matseshe
e78324a742 Fix typo in README.md #8640 (#8642) 2019-09-05 14:43:37 -05:00
Henrik Wenz
62aa5c8772 Improve with-apollo-auth example (#8633)
* Remove connectToDevTools in favour of better default

* Remove redirect code from client

* Simplify function

* Remove apollo-boost

This package is optimized for client usage only.
We actually never used it. We only usered its reexports.

More info:
https://www.apollographql.com/docs/react/v2.5/recipes/authentication/#header

* Remove stopPropagation

We actually don’t need it.

* Refactor getToken method

We want to show how to get the token.
This can be from a cookie or some other isomorph store.
We are not interested in the cookie abstraction in this example.

* Secure cookie

not perfect but better than before….

* Add ssr config option

This was documented but not implemented
2019-09-05 11:09:32 -05:00
Tim Neutkens
5a9b0ba2ce v9.0.6-canary.1 2019-09-05 16:11:08 +02:00
Joe Haddad
6e77c071c7
Update Next.js Telemetry Event Shapes (#8628)
* Update Next.js Telemetry Event Shapes

* Force value as-is
2019-09-04 20:31:35 -04:00
JJ Kasper
61b8b7323e Update workers for next export (#8623)
* Add failing test

* Add jest-worker to export
2019-09-04 19:56:11 -04:00
JJ Kasper
110c83fa44 Update commons glob for granular chunks (#8622) 2019-09-05 00:48:09 +02:00
Henrik Wenz
cba5c05b36 Fix getInitialProps issue in with-apollo example (#8620)
* Fix getInitialProps in with-apollo example

The code before had two design flaws:

* When we skip WithApollo.getInitialProps we must hoist PageComponent.getInitialProps if it is present.
* We should expose the apolloClient to underlying PageComponent.getInitialProps contexts.

* Add abort check

* Add some comments

* Add client only example page

https://github.com/zeit/next.js/pull/8620#issuecomment-527870886

* Remove connectToDevTools setting in favor default config

7eaf4132cd/packages/apollo-client/src/ApolloClient.ts (L170-L173)

* Remove fetch check

This is done by https://www.npmjs.com/package/isomorphic-unfetch

* Remove apollo-boost

I am removing this package, because we never actually used it.
This is because we use the named export of apollo boost wich resolves to apollo-client.

This way we removed apollo-link-state, apollo-link-error

* Remove redirect code from the client
2019-09-04 11:46:39 -05:00
Tim Neutkens
2ba352da39 Move next-server back into next package (#8613)
* Initial move

* Make emitting work

* Update paths

* Remove leftover files

* Add correct externals configuration

* Import correct path

* Update path to work with ts-server test

* Update lib directory

* Compile next-server/lib
2019-09-04 10:00:54 -04:00
Bauyrzhan
42771f6451 Delete next-env.d.ts in JS implementation example (#8619) 2019-09-04 11:01:18 +02:00
Tim Neutkens
d501b941f0 v9.0.6-canary.0 2019-09-04 10:54:38 +02:00
JJ Kasper
56501aeb82 Fix production test failing in ie11 (#8612) 2019-09-03 12:13:50 -04:00
Joe Haddad
b587281162
Disable Telemetry (#8614)
We need to disable telemetry until we figure out how we want to store the data.
2019-09-03 11:34:34 -04:00
JJ Kasper
fbf784d76f Add data-ampdevmode attribute for AMP scripts (#8524)
* Add data-ampdevmode attribute

* Apply suggestions from code review

Co-Authored-By: Joe Haddad <joe.haddad@zeit.co>
2019-09-03 11:11:22 -04:00
Joe Haddad
ffc205ba8c
Use URL-friendly chunk names (#8609)
* Use URL-friendly chunk names

* Fix example linting
2019-09-03 10:55:48 -04:00
Henrik Wenz
97e40057bb Use import instead of require in with-apollo example (#8575) 2019-09-02 20:14:35 -05:00
Ali eslamifard
40c6ec4fb0 This example shows how to use STOMP inside a Next.js application. (#8511)
* This example show how to use STOMP inside a Next.js application.

* Fix useEffect

* Add _app.js implementation

* Fix lint error

* Fix lint error

* Update examples/with-stomp/README.md

Co-Authored-By: Luis Fernando Alvarez D. <luis@zeit.co>

* withStomp removed

* The url address changed

* _app.js removed. useClient added.

* remove

* revert

* Add next.config.js

* Updated readme
2019-09-02 19:59:29 -05:00
Henrik Wenz
cf4fdaf4f2 Remove _app.js from with-apollo-auth example (#8556)
* Move apollo logic into one file

+ Use http-link from http boost

* Remove _app.js from with-apollo-auth example

* Covert other class components to functional components

* Use esm import instead of require
2019-09-02 16:10:53 -05:00
Lukas Strassel
83a10eefee add cookie path property (#8594)
played around with that example and was wondering why it didn't work any more when having an `auth/login` page.

I hope this addition will spare someone else some confusion :)
2019-09-02 13:30:29 -05:00
Henrik Wenz
4a1215b701 Refactor with-loading example (#8560)
* Remove inline styles in favor of styled-jsx

* Remove getInitialProps from app

Allow automatic static optimization

* Remove _document.js

We really don’t need it in this example

* Migrate Class to Function Components
2019-09-02 13:05:29 -05:00