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

2901 commits

Author SHA1 Message Date
Kenneth Luján Rosas 616c3d7ac8 docs(readme): add documentation for renderPage customization on _document.js (#5723)
Per @timneutkens suggestion [here](https://github.com/zeit/next.js/pull/5631#issuecomment-440588455) I went ahead and gave a shot at trying to document `renderPage` usage.

This PR:
- Documents `renderPage` legacy and current usage.
2018-12-10 17:01:59 +01:00
Diogo Dutra a996fba09c Added a new example with relay modern and a graphql server with express. (#4670)
* Added a new example with relay modern and a graphql server with express.

* removed .graphqlconfig file from with-relay-modern-server-express example
2018-12-10 16:50:35 +01:00
Saro Vindigni 2fdd43c307 Create with-firebase-hosting-and-docker example (#5373)
* ADD with-firebase-hosting-and-docker example

* Improve doc
2018-12-10 16:19:57 +01:00
Leon 9ddc1d7b6f update styletron example (#5573) 2018-12-10 15:04:58 +01:00
Oscar Busk 27c0b199d0 Fix paths when built on windows (#5795)
This PR Fixes #4920

So the problem is that when a next.js application is built on windows, the `pages-manifest.json` file is created with backslashes. If this built application is deployed to a linux hosting enviroment, the server will fail when trying to load the modules.

```
Error: Cannot find module '/user_code/next/server/bundles\pages\index.js
```

My simple solution is to modify the `pages-manifest.json` to always use linux separator (`/`), then also
modify `server/require.js` to, when requiring page, replace any separator (`\` or `/`) with current platform-specific file separator (`require('path').sep`).

The fix in `server/require.js` would be sufficient, but my opinion is that having some cross-platform consistency is nice.

This change was tested by bulding an application in windows and running it in linux and windows, aswell as building an application in linux and running it in linux and windows. The related tests was also run.
# Conflicts:
#	test/integration/production/test/index.test.js
2018-12-10 14:48:06 +01:00
Justin Stahlman 6a75118247 Use more recent version of svg plugin (#5788)
The demo did not work. Updating to babel-plugin-inline-react-svg v1.0.1 did work.
2018-12-10 14:45:15 +01:00
moflo b0148cf453 Update for use with Firestore (#5793)
Google seems to be deprecated the legacy realtime database and moving towards default use of Firestore, although it's still officially in beta. This PR migrates towards Firestore and the recommended loading methods for the Firebase 5.6.0 libraries. Note: the Firebase and Firebase-Admin dependencies should be updated to 5.6.0 and 6.3.0 respectively.
2018-12-10 14:25:40 +01:00
Bill Searle 77d5f36eea improved ant-design with less (#5847)
Hey @timneutkens I've updated this example a bit.

- Fixed `/asserts` spelling to `/assets`.
- Removed the `/assets/styles.less` as importing this caused the entire ant-design css sheet to be loaded, now only the React components imported will have their styles loaded via the babel plugin which was already configured. Resulted in dropping the CSS for this example from ~630kb to ~220kb.
- Removed `index.js` as it's not needed.
2018-12-10 12:20:01 +01:00
Tim Neutkens 8b6173917a
Convert next-server.js to typescript (#5844) 2018-12-09 22:46:45 +01:00
Tim Neutkens 61894816ba
Remove app variable as it’s only used once (#5842)
* Remove app variable as it’s only used once

* Remove double spread
2018-12-08 13:14:44 +01:00
Tim Neutkens 0e6d190706
Move sendHTML and rewrite in ts (#5839)
* Move send-html function and rewrite in typescript

* Move getPageFiles and convert to ts

* Move getPageFiles and convert to ts (#5841)

* Move getPageFiles and convert to ts

# Conflicts:
#	packages/next-server/server/render.js

* Fix unit tests
2018-12-07 15:52:29 +01:00
Tim Neutkens 8873242b0b
Move getPageFiles and convert to ts (#5841)
* Move getPageFiles and convert to ts

# Conflicts:
#	packages/next-server/server/render.js

* Fix unit tests
2018-12-07 13:35:01 +01:00
Tim Neutkens 8ca5749ff9
Remove unused properties (#5837) 2018-12-07 00:57:39 +01:00
Peter Kellner c03d25b97a Added length calculation for insert of cache rather then default to 1… (#5835)
* Added length calculation for insert of cache rather then default to 1. changed default cache from 100 to 100MB

* adjusted for lint
2018-12-06 23:17:59 +01:00
Tim Neutkens ffe1a12f2e
Move getDynamicImportBundles into own ts file (#5836) 2018-12-06 22:34:53 +01:00
Tim Neutkens 3c62b07593
Move serve-static to typescript (#5833) 2018-12-06 16:54:33 +01:00
Tim Neutkens 5d2250ac27
Remove unused functions (#5832)
Couldn't find a reference to these functions as next-server uses the renderToHTML directly.
2018-12-06 16:47:10 +01:00
Tim Neutkens 261eb16308
Only check if BUILD_ID exists when reading throws error (#5834)
We don't have to check if the file already exists here, since it's always in production mode (dev overrides the readBuildId method to always be `development`) If the file is not found (error is thrown) we check if the file exists. If not we throw a helpful error. In other cases we throw the original error.
2018-12-06 16:46:53 +01:00
Jeroen Knoops 510eb5771c Updates version of firebase (#5829)
Firebase has some issues with grpc. ( Firebase has some issues with grpc ) This is resolved in a newer version of firebase. Especially with npm 6.4.1. https://github.com/firebase/firebase-js-sdk/issues/1341

Issue #5688
2018-12-06 11:17:18 +01:00
Tim Neutkens 902c5244f3 v7.0.2-canary.41 2018-12-05 22:41:26 +01:00
Tim Neutkens 6729fa4580 Mark react/react-dom as external when in lambdas mode (#5828) 2018-12-05 13:40:17 -08:00
Tim Neutkens dd556bf90b
Add tsc type checking (#5826)
* Add tsc type checking

* Add linting on circle

* Add node-fetch types

* Use strict mode
2018-12-05 21:45:50 +01:00
Tim Neutkens 7098501547 v7.0.2-canary.40 2018-12-05 15:05:59 +01:00
Tim Neutkens 1a5fc941ce Remove console.log after verifying the correct files are ignored 2018-12-05 15:05:14 +01:00
Tim Neutkens a62a6276c7 v7.0.2-canary.39 2018-12-05 14:45:14 +01:00
Tim Neutkens 6542750e12
Fix edge case where file had module.export in the content (#5823)
We ran into this eg on hyper-site, which has `module.exports` in the content.
2018-12-05 14:37:26 +01:00
Hirofumi Wakasugi e463c2a1bb Remove outdated note from with-jest example (#5820) 2018-12-05 11:34:40 +01:00
tylim 81cfea7d90 improve Unstated example so that it can shares state when switching pages (#5822)
* add new example

* update gitignore

* fix lint

* fix linting

* fix linting again

* update unstated example

* remove unsued var

* update readme
2018-12-05 11:32:45 +01:00
Tim Neutkens 84223d39e7 v7.0.2-canary.38 2018-12-04 20:10:53 +01:00
Tim Neutkens 2d5b56a181 Disable usage of esmodules when commonjs is enabled on the preset 2018-12-04 20:10:22 +01:00
Tim Neutkens 29ed67b020
Add test for generateBuildId (#5816)
* Add docs for returning `null` from generateBuildId

* Add test for setting custom buildid

* Fix linting
2018-12-04 16:42:25 +01:00
nodegin cdd5129ef3 Simplify with-absolute-imports example (#5812)
* Delete .babelrc

* Update package.json

* Create next.config.js

* Update next.config.js
2018-12-04 16:38:39 +01:00
Tim Neutkens dada692bd6 v7.0.2-canary.37 2018-12-04 15:28:36 +01:00
Tim Neutkens bd2ad412d3
Bring back module.exports because of backwards compat (#5815) 2018-12-04 15:26:20 +01:00
陈雨童 7ffcb0bf86 Update polyfills (#5814)
#5521
2018-12-04 14:53:24 +01:00
M 38db893a33 fix typo (#5813) 2018-12-04 12:48:15 +01:00
Jeroen Knoops fcae74c49d Removes some quotes in with-emotion example (#5802)
There were some strange quotes and misaligned html on the page in the `with-emotion` example.
2018-12-04 11:55:33 +01:00
Tim Neutkens dd3b5bf81d v7.0.2-canary.36 2018-12-04 11:04:21 +01:00
Tim Neutkens d11a3aa34e
Add tests for isomorphic-unfetch bundling issue (#5805)
* Add tests for isomorphic-unfetch bundling issue

* Remove unneeded extra option

* Remove isomorphic-fetch
2018-12-04 10:59:12 +01:00
Peter Halasz 01b34bb784 Format no-document-title description (#5803) 2018-12-03 23:04:18 +01:00
Matheus Fernandes 977bf8d9eb Zeit -> ZEIT (#5804) 2018-12-03 23:01:23 +01:00
Tim Neutkens 082db2877d v7.0.2-canary.35 2018-12-03 19:50:59 +01:00
Tim Neutkens 2d31404d07 Add license to the root directory 2018-12-03 19:49:18 +01:00
Jess Telford 2f3b0c4de6 MDX example app (#5796)
Example deployment on now v2: https://nextjswith-mdxexample-r8b1vzjbn.now.sh
2018-12-03 19:41:12 +01:00
Tim Neutkens f79230db33
Change module resolution extensions (#5801)
Same as https://github.com/zeit/ncc/pull/80
2018-12-03 19:36:24 +01:00
Matthew Lilley cefbb84230 Fix for locale.split is not a function. (#5794)
* Fix for locale.split is not a function.

Following from https://github.com/zeit/next.js/pull/5488

- Renamed languages to supportedLanguages
- Firstly, accept languages based on supportedLanguages
- And finally, accept a single language, if it returns false, the default of 'en' is used.

I looked at the navigator library, which is used by 'accept', this should be a more solid solution, since we can now know that `const locale` is always a string.

// Before (Sometimes returns an array as `const local`)
const locale = accept.language(languages) || 'en' 

// After (Always returns a string)
const locale = accept.language(accept.languages(supportedLanguages)) || 'en';

* Update server.js

Update variable name.
2018-12-03 09:10:31 -08:00
Tim Neutkens 9890e06907
Dedupe only items with unique key (#5800)
Fixes #3705
Fixes #4656

- No longer automatically dedupe certain tags. Only the ones we know are *never* going to be duplicate like charSet, title etc.
- Fix `key=""` behavior, making sure that if a unique key is provided tags are deduped based on that.

For example:

```jsx
<meta property='fb:pages' content='one'>
<meta property='fb:pages' content='two'>
```

Would currently cause

```jsx
<meta property='fb:pages' content='two'>
```

### After this change:

```jsx
<meta property='fb:pages' content='one'>
<meta property='fb:pages' content='two'>
```

Then if you use next/head multiple times / want to be able to override:

```jsx
<meta property='fb:pages' content='one' key="not-unique-key">
<meta property='fb:pages' content='two' key="not-unique-key">
```

Would cause:

```jsx
<meta property='fb:pages' content='two'>
```

As `key` gets deduped correctly after this PR, similar to how React itself works.
2018-12-03 17:28:42 +01:00
Tim Neutkens 58f5dd297a
Add Typescript types for builds functions (#5791) 2018-12-03 14:18:52 +01:00
Tim Neutkens a9cf735f50
Convert babel plugins to typescript (#5789)
Slowly moving files over 💯
2018-12-02 18:30:00 +01:00
Luc e43d21fdf0 remove occurence of deprecated url prop in readme (#5786) 2018-12-01 21:11:06 +01:00