* 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.
Fixes#3705Fixes#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.
- Replaces taskr-babel with taskr-typescript for the `next` package
- Makes sure Node 8+ is used, no unneeded transpilation
- Compile Next.js client side files through babel the same way pages are
- Compile Next.js client side files to esmodules, not commonjs, so that tree shaking works.
- Move error-debug.js out of next-server as it's only used/require in development
- Drop ansi-html as dependency from next-server
- Make next/link esmodule (for tree-shaking)
- Make next/router esmodule (for tree-shaking)
- add typescript compilation to next-server
- Remove last remains of Flow
- Move hoist-non-react-statics to next, out of next-server
- Move htmlescape to next, out of next-server
- Remove runtime-corejs2 from next-server
In this example, we can:
- `QueryRenderer` SSR
- caching the data
- use the feature of `react-relay-network-modern` which is the powerful tool for `relay-modern`
I copy the example `with-relay-modern`, but I just modified the code. Some detail are not modified.
If you think this example is needed, I will fix those. Otherwise, close this **PR** to let me know this example is not needed.
- The with-firebase-auth example won't run unless a database with proper rules is created first.
- Add a small error callback to addDbListener to help with debugging if someone's database connection doesn't work.
**What's this PR?**
Based on the feedback on [this PR](https://github.com/zeit/next.js/pull/5722) @timneutkens asked me to create a test for `ssr: true`
**What's it do?**
- adds a test for setting `ssr: true` - /basic
- adds a test for setting `ssr: true` - /production
* Remove flow-typed
* Remove flow types
* Remove the last types
* Bring back taskr dependency
* Revert "Bring back taskr dependency"
This reverts commit 38cb95d7274d63fe63c6ac3c95ca358a28c17895.
* Bring back preset-flow as it’s used for tests
* Revert "Revert "Bring back taskr dependency""
This reverts commit b4c933ef133f4039f544fb10bf31d5c95d3b27a2.
On the server `props.initialMobxState` received by the `constructor` is a fully functioning mobx store that was instantiated by `getInitialProps()` only a few ticks earlier.
Thus, creating a new instance is unneccessary.
In the browser, however, `props.initialMobxState` is a hydrated plain object and thus the store needs to be initialized.