Commit graph

4151 commits

Author SHA1 Message Date
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
Henrik Wenz
a09036e061 Fix with-slate example (#8566) 2019-09-02 13:00:15 -05:00
Ali eslamifard
dd9448c574 Update README and data-fetch example to use function components. (#8546)
* 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

* remove

* Update README.md according to Hooks concept.

* Update example

* Update README.md

* Components should use functional syntax

* Update packages/next/README.md

Co-Authored-By: Tim Neutkens <tim@timneutkens.nl>

* Update packages/next/README.md

Co-Authored-By: Tim Neutkens <tim@timneutkens.nl>

* Update packages/next/README.md

Co-Authored-By: Tim Neutkens <tim@timneutkens.nl>

* Update packages/next/README.md

Co-Authored-By: Tim Neutkens <tim@timneutkens.nl>

* Update README.md
2019-09-02 12:47:30 +02:00
Raibima Putra
f47f014f7a Fix react-native-web example FOUC (#8576) 2019-09-02 12:38:51 +02:00
Natalie Marleny
efa368d427 Update README.md badge text (#8593) 2019-09-01 20:30:18 +02:00
Giuseppe
ad0cca9549 Update styled-jsx (#8583)
* Update styled-jsx

Fixes an escaping issue in template literals that @lfades found

* Update next-server's styled-jsx also
2019-08-31 10:08:43 -05:00
Houssein Djirdeh
689b1319b6 Update performance marking (#8527)
* creates perf marks object constant

* updates clearmarks to only clear core marks

* adds test + fixes object constqnt reference

* hardcodes perf marks and removes constant

* adds test to check custom marks are not cleared
2019-08-30 22:40:05 -04:00
JJ Kasper
7310e6bca6
Remove extra default export from readme (#8579) 2019-08-30 12:28:04 -05:00
Lukáš Huvar
5cc3b8a531 Fix docs (#8577) 2019-08-30 18:51:48 +02:00
Joe Haddad
67e7753c85
Fix serverless chunking (#8569)
* Fix Serverless Chunking

* Remove old test & environment variable

* Update serverless trace test case
2019-08-30 07:26:30 -04:00
JJ Kasper
340594398e
Make sure to 404 for /_next/static (#8564) 2019-08-29 15:00:54 -05:00
JJ Kasper
4eb7dde490 Add err.sh for incompatible href and as (#8561)
* Add err.sh for incompatible href and as

* Add note for only showing when Link is clicked
2019-08-29 13:25:42 -04:00
Jacky Shikerya
4adf710788 Encode URL paths in HTML and CSR (#8435)
* added filename encoder for testing

* fixes in page-loader

* fix possibly undefined

* conflict resolution

* Update packages/next/pages/_document.tsx

Co-Authored-By: Joe Haddad <timer150@gmail.com>

* move encoding into individual tags as Joe suggested
2019-08-29 12:56:24 -04:00
Joe Haddad
1f4e34ca00
Anonymous Telemetry (#8529)
* Add anonymous telemetry

* Fix types

* Remove semver package

* Rename build time variable

* Track CSS-in-JS solutions

* Single retry and 5s timeout
2019-08-29 12:43:06 -04:00
Henrik Wenz
ce25f747e7 Refactor active-class-name example (#8558)
- use router hook instead of hoc
- simplify ActiveLink component
- add prop-types
- add function names
- use fragments instead of divs
2019-08-29 12:22:42 -04:00
Henrik Wenz
aa406a1d62 Fix with-context-api example (#8559)
## Motivation

The code before this PR had serveral issues:

1. Context uses reference identity to determine when to re-render, there are some gotchas that could trigger unintentional renders in consumers when a provider’s parent re-renders.

https://reactjs.org/docs/context.html#caveats

2. `setState` should use the reducer pattern in this example to make sure clicks are not swallowed by react batch.
2019-08-29 12:09:22 -04:00
Adam Goth
c6ec289c55 Fix typo in link in example's README (#8545) 2019-08-28 17:00:48 +02:00
Mark
7bd4f4f3bf Remove link (#8539) 2019-08-27 23:05:47 -04:00
Jason Miller
1b6e455807 Add modern-preset Babel option (#8521)
* Add `modern-preset` Babel option

* fix test failure

* prefix configuration option with "experimental-"

* fix issues noted by @janicklas-ralph
2019-08-27 17:20:07 -04:00
Sebastian Silbermann
bb0ccd9a4d Specify loader paths for PnP support (#8531)
* fix(next): Loader not found using yarn v2

* Use Object.fromKeys pattern instead
2019-08-27 16:37:47 -04:00
Borek Bernard
4292a9a21c Update with-zones example (#8459)
* Add more pages to the 'blog' zone

- New dynamic page `pages/blog/post/[id].js`
- `pages/blog.js` moved to `pages/blog/index.js`

* Update Now and Next configs to support both `now dev` and `next dev`

- Set `assetPrefix` dynamically to either `/blog` or `''`.
- Update package.json scripts for both 'home' and 'blog' apps, support `yarn dev` in both of them.

* Update example description in README

* Fix formatting issues

* Make `/static` assets work in the 'blog' app

* Add routing rule for `/blog/static` to now.json

* Shorten README

I reverted it back to the state of 233152ee17 and then updated it with info on recent changes of the `with-zones` example.

* Use `continue: true` in now.json

Applies suggestions from code review.

Co-Authored-By: Joe Haddad <timer150@gmail.com>

* Fix JSON formatting

* Add routing rule for `_next` and `static` folders

* Update README of with-zones example slightly

Applies suggestions from code review.

Co-Authored-By: Joe Haddad <timer150@gmail.com>

* Remove unnecessary "dest" from `now.json`

Co-Authored-By: Joe Haddad <timer150@gmail.com>
2019-08-27 16:24:29 -04:00
Jean
08dcbdca9c Improve With Firebase Authentication example (#8533)
* [with-firebase-authentication] remove deprecated warning

* [with-firebase-authentication] improve client and server credentials example

* [with-firebase-authentication] fix typo in the docs
2019-08-27 15:39:13 -04:00
Henrik Wenz
78d274db9b Improve with-apollo example (#8508)
* Simplify apollo setup

* Allow disabling of ssr in favor of automatic static optimization

- Converted Class to Function Component
- Added ssr config option

* Exclude @apollo/react-ssr from client bundle

* Remove WithApollo.getInitialProps from the client

* Remove displayName from production build

* Fix production switch

* Change export & fucntion naming

- Use named export
- Change function naming

* Warn if someone tries to use this HOC with _app.js
2019-08-27 09:43:29 -05:00
Tage A. L. K
9efed17503 Update with-react-intl for v3 (#8526)
* Update dependencies

> Update dependencies

* Changes to make v3 work

> Use hook `useIntl` instead of HOC `injectIntl`
> Change use of class components
> Changes to dependencies

* Small changes

Small changes
2019-08-26 15:40:36 -05:00
Lukáš Huvar
509d160318 Normalize errors to use nextjs.org (#8518) 2019-08-26 16:00:37 +02:00
Henrik Wenz
17b1154d9b Remove _app from with-apollo example (#8504)
* Remove _app from with-apollo example

This allows automatic static optimization for pages, that don’t need apollo.

* Rename with-apollo

Name should be same as hoc

* Adjust text to reflect latest changes

more info: 4321c469466160d13bcd52afa099385e84a112a0
2019-08-24 22:19:26 -04:00
Daniel Almaguer
af9099c2a5 Add missing dependency to next-server (#8507) 2019-08-24 22:01:09 -04:00
JJ Kasper
5e4d7f2f27 Fix backslashes in stats causing tests to fail on windows (#8505) 2019-08-24 16:06:21 -04:00
JJ Kasper
f81b6d56e0 Replace worker-farm with jest-worker (#8496)
* Replace worker-farm with jest-worker

* Apply suggestions from code review

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

* Remove semaphores on top of jest-worker, unwind
terser worker, and remove extra error log
2019-08-24 14:55:42 -04:00
Joe Haddad
2c7b4d8aaa
v9.0.5 2019-08-24 12:45:04 -04:00
Joe Haddad
0f92a8770a
v9.0.5-canary.3 2019-08-24 11:34:12 -04:00
Houssein Djirdeh
010059915d Add version property to Next.js instance (#8499)
* adds global for next version

* updates to use env variable and keeps it local

* Test Next.js version presence

* Unfocus test
2019-08-24 00:49:24 -04:00
JJ Kasper
12c211bdbe Add config for diffing fetched pages (#8492) 2019-08-23 19:36:44 -04:00